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 not working #69031
Comments
when I try to use the 2to3 script on the command line on Windows x64, I get the response: C:\Program Files\Python34\Tools\scripts>2to3 C:\Users\brian\Downloads\puzzles.py When I ask for help I get: C:\Program Files\Python34\Tools\scripts>2to3 --help In fact this is always the response I obtain irrespective of what I enter after '2to3' on the command line. Python 3.5rc1 also behaves in the same way. |
I have now got it working using the command line: C:\Program Files\Python35\Tools\scripts>"C:\Program Files\Python34\python" 2to3.py --help I am not sure why the default Windows invocation of Python doesn't work with 2to3 as this works fine with other python scripts that I have tried. |
Your .py file association isn't configured to pass command-line arguments. Revert to using the "Python.File" type that was created by Python's installer. The associated command should be something like
depending on where py.exe is located. |
Thanks for the explanation. My apologies for this posting, which I will now close |
If this occurs in 3.5 then it needs to be fixed (though I thought I'd already fixed it once...). I'll take a look. |
Hi Steve, The behaviour I reported was the same on Python 3.4 and 3.5rc1. But eryksun was correct in suggesting that this was a problem in the way my file association for Python was set up. My py_auto_file association was set to: "C:\Program Files\Python34\python.exe" "%1" adding %* on the end fixed the problem. (by the way, thank you for your work on _msvccompiler.py). best regards,
|
Yes, I see. Thanks for clarifying, it seems all the installers are fine but Windows will generate associations that don't forward arguments. |
Oh, it's that auto filetype again. Steve, when you say you fixed this for 3.5, does that means there's a simple command or API to revert this automatic ProgId back to the Python.File type? This problem shows up repeatedly on Stack Overflow, so it would be nice to have a solution that works consistently from Windows 7 to 10. cmd.exe's built-in assoc and ftype commands only modify the local machine association and filetype. A per-user install doesn't use those, and sometimes Explorer instead uses a per-executable command defined in Software\Classes\Applications. Also, just modifying the command doesn't actually select what ShellExecuteEx will choose to run. I used to directly modify Explorer's FileExts\...\UserChoice for a given file extension, but that's actively discouraged by a deny ACL nowadays. Fine, but I've run into cases where Explorer's dialog doesn't let me choose a an existing ProgId. |
I'm afraid there's no easy way to revert it. I may get to invest the time for 3.6's launcher[1] to make it available in Default Programs, but I've always struggled to get that to work properly. Explorer should always use the per-user command if it's there, and it's basically the responsibility of users to not change it if they don't want it to change. [1] The launcher owns the shortcut, not the core Python installation - the separation is only important to users in that if you don't include the launcher you don't get the association, and if you install the launcher for all users then the shortcut is for all users. (Also cleared the Versions field, since Python 3.4 creates the correct association too. Preventing user customization on a user's machine is not something we're going to get into, but that's the only way to "solve" this problem.) |
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: