Issue2056

classification
Title: sys.argv doesn't see !
Type: behaviour Severity: normal
Components: Any Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, rjkimble, santa4nt, zyasoft
Priority: Keywords:

Created on 2013-05-22.15:52:08 by rjkimble, last changed 2015-03-02.01:15:39 by zyasoft.

Messages
msg8025 (view) Author: Bob Kimble (rjkimble) Date: 2013-05-22.15:54:13
When parsing the command line args, exclamation points/bangs/!'s are ignored.
msg8026 (view) Author: Santoso Wijaya (santa4nt) Date: 2013-05-22.17:52:10
What platform? Works as expected on Ubuntu with Jython 2.7b1 for me:

$ cat /tmp/bang.py 
#!/usr/bin/env python

import sys

def main(args):
    print repr(args)
    return 0


if __name__ == '__main__':
    sys.exit(main(sys.argv))

$ ./dist/bin/jython --version
Jython 2.7b1+
$ ./dist/bin/jython /tmp/bang.py ! hello
['/tmp/bang.py', '!', 'hello']
msg8027 (view) Author: Bob Kimble (rjkimble) Date: 2013-05-22.18:27:41
Thanks for responding. The problem happens on 64-bit Windows 7. Running bang.py under jython and then python:

C:\temp>jython --version
Jython 2.7b1

C:\temp>jython bang.py ! hello
['bang.py', 'hello']

C:\temp>python bang.py ! hello
['bang.py', '!', 'hello']
msg8028 (view) Author: Bob Kimble (rjkimble) Date: 2013-05-22.18:30:22
BTW, I'm running Java 7 -- is that a problem?

C:temp>java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
msg8030 (view) Author: Jeff Allen (jeff.allen) Date: 2013-05-23.20:52:23
Nope, nothing to do with Java 7. It's a problem in the batch file related to use of ! as a variable substitution marker when setdelayedexpansion is in force. Any batch file wizards out there? (I've never mastered the things.)

http://stackoverflow.com/questions/5226793/using-setdelayedexpansion-in-batch-files-handling-dirs-filenames-containing
msg9367 (view) Author: Jim Baker (zyasoft) Date: 2015-01-09.03:41:58
We should simply solve with #1491 (native launcher for Windows), so I'm going to mark as a duplicate
msg9538 (view) Author: Jim Baker (zyasoft) Date: 2015-02-22.06:22:32
#1491 is now fixed
History
Date User Action Args
2015-03-02 01:15:39zyasoftsetstatus: pending -> closed
2015-02-22 06:22:32zyasoftsetstatus: open -> pending
messages: + msg9538
2015-01-09 03:41:59zyasoftsetresolution: duplicate
messages: + msg9367
nosy: + zyasoft
2013-05-23 20:52:24jeff.allensetnosy: + jeff.allen
messages: + msg8030
2013-05-22 18:30:22rjkimblesetmessages: + msg8028
2013-05-22 18:27:41rjkimblesetmessages: + msg8027
2013-05-22 17:52:11santa4ntsetnosy: + santa4nt
messages: + msg8026
2013-05-22 15:54:13rjkimblesetmessages: + msg8025
2013-05-22 15:52:08rjkimblecreate