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
Python 3 doesn't register script arguments #53230
Comments
Python 3.1.2 hasn't any arguments except the file name in sys.argv[0]. For example: build.py test |
It's not entirely clear to me what issue you're reporting here: could you provide a short example script that exhibits the problem, and list the exact steps necessary to reproduce, along with actual and expected results? |
Examplescript test.py: import sys
print(sys.argv[1]) Call this script now with an argument, for exmaple: test.py 1234 |
Can’t reproduce here: |
Hmm. I don't see any difference between the two here (OS X 10.6). What platform are you on, and where did your copy of Python 3.1.2 come from? newton:~ dickinsm$ cat test.py
import sys
print(sys.argv[1])
newton:~ dickinsm$ python3.1 test.py 1234
1234
newton:~ dickinsm$ python2.6 test.py 1234
1234
newton:~ dickinsm$ python3.1
Python 3.1.2 (r312:79147, May 18 2010, 17:21:15)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
newton:~ dickinsm$ python2.6
Python 2.6.5 (r265:79063, May 18 2010, 17:12:15)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> |
I'm using Windows XP Professional SP3. I downloaded Python 3.1.2 from this site. Even Python 3.0.1 hasn't worked. |
3.0 should not be used and does not get fixes. Can you try downloading Python again and testing? P.S. please do not change the component; Lib means “Python files under Lib/ in the source checkout”, but sys is a module built by the interpreter core. |
I have already installed Python 3.1.2 a second time. I have selected during the installation that the files shall be compiled into bytecode. |
I'm failing to reproduce this on Windows 7, too. It sounds as though you're starting the python script without an explict 'python'. What are your filetype associations for python scripts? i.e., what's the result of typing 'assoc py' at a console prompt? Just for reference, I get:
|
assoc .py I tried this now with Ubuntu and Python 3.1.2 and all works fine. But under Windows XP it doesn't work. |
Okay, thanks. What does ftype Python.File give? |
ftype Python.File |
I've just found issue bpo-7936, which looks like the same problem. I'm going to close this issue as a duplicate of that one; further discussion should be moved there. |
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: