You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
qgis2to3 failed with a FileNotFound exception when I tried to use it with my plugin. Looking at the code, it was because the path to the temp directory was hard-coded, and assumed a *nix OS. I fixed it for myself using import tempfile and f = open(f"{tempfile.gettempdir()}/missing", "a+") (patch file: 0001-fix-temp-directory-not-found-on-windows.zip).
Traceback (most recent call last):
File "qgis2to3", line 9, in
sys.exit(main('qgis_fixes'))
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\main.py", line 259, in main
options.processes)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 703, in refactor
items, write, doctests_only)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 296, in refactor
self.refactor_dir(dir_or_file, write, doctests_only)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 316, in refactor_dir
self.refactor_file(fullname, write, doctests_only)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 744, in refactor_file
*args, **kwargs)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 351, in refactor_file
tree = self.refactor_string(input, filename)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 383, in refactor_string
self.refactor_tree(tree, name)
File "C:\OSGeo4W64\apps\Python36\lib\lib2to3\refactor.py", line 457, in refactor_tree
new = fixer.transform(node, results)
File "C:\OSGeo4W64\apps\Python36\lib\site-packages\qgis2to3\codeporting\qgis_fixes\fix_pyqt.py", line 585, in transform
self.transform_member(node, results)
File "C:\OSGeo4W64\apps\Python36\lib\site-packages\qgis2to3\codeporting\qgis_fixes\fix_pyqt.py", line 519, in transform_member
f = open("/tmp/missing", "a+")
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/missing'
The text was updated successfully, but these errors were encountered:
NathanW2
added a commit
to NathanW2/qgis2to3
that referenced
this issue
Oct 2, 2018
qgis2to3 failed with a FileNotFound exception when I tried to use it with my plugin. Looking at the code, it was because the path to the temp directory was hard-coded, and assumed a *nix OS. I fixed it for myself using
import tempfile
andf = open(f"{tempfile.gettempdir()}/missing", "a+")
(patch file: 0001-fix-temp-directory-not-found-on-windows.zip).The text was updated successfully, but these errors were encountered: