diff options
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r-- | coverage/sqldata.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py index c120d82e..91508586 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -414,7 +414,11 @@ class Sqlite(SimpleRepr): self.nest = 0 def connect(self): - self.con = sqlite3.connect(self.filename) + # SQLite on Windows on py2 won't open a file if the filename argument + # has non-ascii characters in it. Opening a relative file name avoids + # a problem if the current directory has non-ascii. + filename = os.path.relpath(self.filename) + self.con = sqlite3.connect(filename) # This pragma makes writing faster. It disables rollbacks, but we never need them. # PyPy needs the .close() calls here, or sqlite gets twisted up: |