Skip to content
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

sys.argv only works with python exe #36380

Closed
thehaas mannequin opened this issue Apr 4, 2002 · 4 comments
Closed

sys.argv only works with python exe #36380

thehaas mannequin opened this issue Apr 4, 2002 · 4 comments
Assignees

Comments

@thehaas
Copy link
Mannequin

thehaas mannequin commented Apr 4, 2002

BPO 539319
Nosy @theller

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:

assignee = 'https://github.com/theller'
closed_at = <Date 2002-04-04.18:00:38.000>
created_at = <Date 2002-04-04.16:38:27.000>
labels = ['OS-windows']
title = 'sys.argv only works with python exe'
updated_at = <Date 2002-04-04.18:00:38.000>
user = 'https://bugs.python.org/thehaas'

bugs.python.org fields:

activity = <Date 2002-04-04.18:00:38.000>
actor = 'theller'
assignee = 'theller'
closed = True
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2002-04-04.16:38:27.000>
creator = 'thehaas'
dependencies = []
files = []
hgrepos = []
issue_num = 539319
keywords = []
message_count = 4.0
messages = ['10160', '10161', '10162', '10163']
nosy_count = 2.0
nosy_names = ['theller', 'thehaas']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue539319'
versions = []

@thehaas
Copy link
Mannequin Author

thehaas mannequin commented Apr 4, 2002

This is a weird one, and I've know it works on other
Win2000 installations, but it doesn't work on mine.

sys.argv only works when I put "python" in front of it
in the cmd command line. However, the script does run
if I just type in it's name, but it ignores all command
line arguments.

Version: 2.2
Platform: Win2000

Example:

C:\stuff>type test.py
import sys
print sys.argv

C:\stuff>test.py arg1 arg2
['C:\\stuff\\test.py']

C:\stuff>python test.py arg1 arg2
['test.py', 'arg1', 'arg2']

Is this something with my setup, or something else??

@thehaas thehaas mannequin closed this as completed Apr 4, 2002
@thehaas thehaas mannequin assigned theller Apr 4, 2002
@thehaas thehaas mannequin added the OS-windows label Apr 4, 2002
@thehaas thehaas mannequin closed this as completed Apr 4, 2002
@thehaas thehaas mannequin assigned theller Apr 4, 2002
@thehaas thehaas mannequin added the OS-windows label Apr 4, 2002
@theller
Copy link

theller commented Apr 4, 2002

Logged In: YES
user_id=11105

I can reproduce this behaviour if I change the association
for Python files from the default entry
'C:\python22\python.exe "%1" %*'
into
'C:\python22\python.exe "%1"'.
You can find this entry from Windows Explorer,
Tools->Folder Options->File Types.
Select the 'PY Python File' entry, press advanced, select
the 'open' entry, press edit, and look at the "Appplication
used to perform action" entry.

Probably something wrong with your setup.

@thehaas
Copy link
Mannequin Author

thehaas mannequin commented Apr 4, 2002

Logged In: YES
user_id=116274

I went into that, I had got the PY option, but instead it
sais "PY File". And instead of an advanced button, it had
"Change", with the text beside it saying "Change to Default
'Python File"" I hit that button, which than turned to
"Advanced" and the PY option turned into "Python File".
When I hit "Advanced" the option was 'C:\python22\python.exe
"%1" %*', it it now works from the command line:

C:\stuff>test.py arg1
['C:\\stuff\\test.py', 'arg1']

I'm not sure what caused it to change (perhaps Vim??) but it
works now.

Closing it myself. Thanks for the help

@theller
Copy link

theller commented Apr 4, 2002

Logged In: YES
user_id=11105

Fine. Assigning the bug to myself, and changing the
resolution to 'works for me'.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant