File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -979,7 +979,14 @@ def _connect(self):
979
979
# SQLite on Windows on py2 won't open a file if the filename argument
980
980
# has non-ascii characters in it. Opening a relative file name avoids
981
981
# a problem if the current directory has non-ascii.
982
- filename = os .path .relpath (self .filename )
982
+ try :
983
+ filename = os .path .relpath (self .filename )
984
+ except ValueError :
985
+ # ValueError can be raised under Windows when os.getcwd() returns a
986
+ # folder from a different drive than the drive of self.filename in
987
+ # which case we keep the original value of self.filename unchanged,
988
+ # hoping that we won't face the non-ascii directory problem.
989
+ filename = self .filename
983
990
# It can happen that Python switches threads while the tracer writes
984
991
# data. The second thread will also try to write to the data,
985
992
# effectively causing a nested context. However, given the idempotent
You can’t perform that action at this time.
0 commit comments