-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2to3 call for file in current directory yields error #75764
Comments
2to3 doesn't work if called for file in current directory with --add-suffix option. $ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W --add-suffix=3 test2to3.py --some changes-- Traceback (most recent call last):
File "D:/repos/cpython/Tools/scripts/2to3", line 5, in <module>
sys.exit(main("lib2to3.fixes"))
File "D:\repos\cpython\lib\lib2to3\main.py", line 259, in main
options.processes)
File "D:\repos\cpython\lib\lib2to3\refactor.py", line 687, in refactor
items, write, doctests_only)
File "D:\repos\cpython\lib\lib2to3\refactor.py", line 282, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
File "D:\repos\cpython\lib\lib2to3\refactor.py", line 728, in refactor_file
*args, **kwargs)
File "D:\repos\cpython\lib\lib2to3\refactor.py", line 339, in refactor_file
write=write, encoding=encoding)
File "D:\repos\cpython\lib\lib2to3\refactor.py", line 505, in processed_file
self.write_file(new_text, filename, old_text, encoding)
File "D:\repos\cpython\lib\lib2to3\main.py", line 84, in write_file
os.makedirs(output_dir)
File "D:\repos\cpython\\lib\os.py", line 221, in makedirs
mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: '' It works well if I use absolute path for target file or set -o: $ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W --add-suffix=3 /d/MyPythonScripts/test2to3.py
$ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W --add-suffix=3 -o . test2to3.py |
Issue also effects 3.5 |
3.5 is in security-fix-only mode, and we use versions to indicate which versions we plan to fix the bug in. |
Gotcha, sorry about that. Active uses 3.5, so I guess I would take it up On Oct 3, 2017 2:27 PM, "R. David Murray" <report@bugs.python.org> wrote:
|
Yes, redistributors sometimes backport non-security fixes if they consider them important enough. Note that I haven't evaluated the merits of this issue, and there is a related issue about how 2to3 finds its fixers that this may overlap with. |
Inserting (with 12 spaces) if not output_dir:
output_dir = "./" at lines 83 and 84 works as a temporary workaround. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: