Skip to content

Commit 7acadcb

Browse files
authored
Handle the file argument properly
The argument is a file *path* but is called *file* and yet it's treated as a string. If passed an actual File or a Pathname it will be properly handled.
1 parent 6fc5073 commit 7acadcb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/sqlite3/database.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def quote( string )
6565
def initialize file, options = {}, zvfs = nil
6666
mode = Constants::Open::READWRITE | Constants::Open::CREATE
6767

68+
file = file.to_path if file.respond_to? :to_path
6869
if file.encoding == ::Encoding::UTF_16LE || file.encoding == ::Encoding::UTF_16BE || options[:utf16]
6970
open16 file
7071
else

0 commit comments

Comments
 (0)