[issue9992] Command line arguments are not correctly decodedif locale and fileystem encodings aredifferent

2010-09-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: A system where the filesystem encoding doesn't match the locale encoding is hard to get right. Mmmh. The problem is maybe that the new PYTHONFSENCODING environment variable (added by #8622) introduced an horrible inconstency

[issue9992] Command line arguments are not correctly decoded if locale and fileystem encodings are different

2010-09-29 Thread STINNER Victor
two possible encodings to encode and decode command line arguments (with surrogateescape error handler): (a) filesystem encoding (b) locale encoding Decode Python command line arguments is one of the first operation executed when running Python, in the main() function. We don't have import

[issue9992] Command line arguments are not correctly decoded if locale and fileystem encodings are different

2010-09-29 Thread Philip Jenvey
Changes by Philip Jenvey pjen...@underboss.org: -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9992 ___ ___ Python-bugs-list

[issue9992] Command line arguments are not correctly decoded if locale and fileystem encodings are different

2010-09-29 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: [cmdline_encoding-2.patch] Patch to use locale encoding to decode and encode command line arguments. Remarks about the patch: - failing to get the locale encoding (very unlikely) is a fatal error - TODO: in initfsencoding

[issue5680] Command-line arguments when running in IDLE

2010-07-28 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Putting tjr and tal on nosy list cos it's IDLE. Apologies if I've got it wrong. -- nosy: +BreamoreBoy, taleinat, tjreedy versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-07-24 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: This issue only seems to be relevant for OSX, and then only for OSX releases before 10.5, because in that release Apple made sure that the LANG variable and simular LC_* ones specify a UTF-8 encoding and we're back at the common case

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-07-24 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It seems that everybody now agrees to close this issue as won't fix. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8775

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-07-06 Thread Daniele Varrazzo
Changes by Daniele Varrazzo p...@develer.com: -- nosy: +piro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8775 ___ ___ Python-bugs-list mailing

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-06-18 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- title: Use locale encoding to decode sys.argv, not the file system encoding - Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.) ___ Python tracker rep

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-06-18 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I'm still -1, failing to see the problem that is solved. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8775 ___

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-06-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm still -1, failing to see the problem that is solved. I know (and I agree), but I don't want to loose the patch :-) -- ___ Python tracker rep...@bugs.python.org

Re: plac, the easiest command line arguments parser in the world

2010-06-04 Thread Kenny Meyer
. With blatant immodesty, plac claims to be the easiest to use command line arguments parser module in the Python world. Its goal is to reduce the learning curve of argparse from hours to minutes. It does so by removing the need to build a command line arguments parser by hand: actually

Re: plac, the easiest command line arguments parser in the world

2010-06-03 Thread Michele Simionato
On Jun 2, 6:37 am, Michele Simionato michele.simion...@gmail.com wrote: I would like to announce to the world the first public release of plac:  http://pypi.python.org/pypi/plac The second release is out. I have added the recognition of keyword arguments, improved the formatting of the help

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Tim Golden
On 02/06/2010 05:37, Michele Simionato wrote: I would like to announce to the world the first public release of plac: http://pypi.python.org/pypi/plac Plac is a wrapper over argparse and works in all versions of Python starting from Python 2.3 up to Python 3.1. I like it. I'm a constant

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Paul Rubin
Tim Golden m...@timgolden.me.uk writes: pattern, which provides a minimally semi-self-documenting approach for positional args, but I've always found the existing offerings just a little too much work to bother with. I'll give plac a run and see how it behaves. After using optparse a couple

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 10:43 am, Paul Rubin no.em...@nospam.invalid wrote: Tim Golden m...@timgolden.me.uk writes: pattern, which provides a minimally semi-self-documenting approach for positional args, but I've always found the existing offerings just a little too much work to bother with. I'll give

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Jean-Michel Pichavant
to be the easiest to use command line arguments parser module in the Python world. Its goal is to reduce the learning curve of argparse from hours to minutes. It does so by removing the need to build a command line arguments parser by hand: actually it is smart enough to infer the parser from function annotations

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Stefan Behnel
Paul Rubin, 02.06.2010 10:43: Tim Golden writes: pattern, which provides a minimally semi-self-documenting approach for positional args, but I've always found the existing offerings just a little too much work to bother with. I'll give plac a run and see how it behaves. After using optparse a

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 11:01 am, Stefan Behnel stefan...@behnel.de wrote: I managed to talk a Java-drilled collegue of mine into writing a Python script for a little command line utility, but he needed a way to organise his argument extraction code when the number of arguments started to grow beyond two. I

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 6:37 am, Michele Simionato michele.simion...@gmail.com wrote: With blatant immodesty, plac claims to be the easiest to use command line arguments parser module in the Python world It seems I have to take that claim back. A few hours after the announce I was pointed out to http

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread alex23
Michele Simionato michele.simion...@gmail.com wrote: It seems I have to take that claim back. A few hours after the announce I was pointed out tohttp://pypi.python.org/pypi/CLIArgs which, I must concede, is even easier to use than plac. It seems everybody has written its own command line

plac, the easiest command line arguments parser in the world

2010-06-01 Thread Michele Simionato
arguments parser module in the Python world. Its goal is to reduce the learning curve of argparse from hours to minutes. It does so by removing the need to build a command line arguments parser by hand: actually it is smart enough to infer the parser from function annotations. Here is a simple example

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-05-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Fix the title: sys.argv is already decoded using the locale encoding on Unix, the problem is that it uses a (possibly) different encoding to encode command line arguments: file system encoding. -- title: Use locale

[issue8775] Use locale encoding to encode command line arguments (subprocess, os.exec*(), etc.)

2010-05-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8775 ___

Re: passing command line arguments to executable

2010-04-06 Thread Bror Johansson
On 2010-04-03 18:09, mcanjo wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter

Re: passing command line arguments to executable

2010-04-05 Thread mcanjo
On Apr 4, 6:32 am, Simon Brunning si...@brunningonline.net wrote: On 3 April 2010 18:20, mcanjo mca...@gmail.com wrote: I tried doing the following code: from subprocess import Popen from subprocess import PIPE, STDOUT exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr =

Re: passing command line arguments to executable

2010-04-05 Thread Patrick Maupin
On Apr 5, 11:22 am, mcanjo mca...@gmail.com wrote: On Apr 4, 6:32 am, Simon Brunning si...@brunningonline.net wrote: On 3 April 2010 18:20, mcanjo mca...@gmail.com wrote: I tried doing the following code: from subprocess import Popen from subprocess import PIPE, STDOUT exefile

Re: passing command line arguments to executable

2010-04-04 Thread Francesco Bochicchio
On 3 Apr, 19:20, mcanjo mca...@gmail.com wrote: On Apr 3, 11:15 am, Patrick Maupin pmau...@gmail.com wrote: On Apr 3, 11:09 am, mcanjo mca...@gmail.com wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a

Re: passing command line arguments to executable

2010-04-04 Thread Simon Brunning
On 3 April 2010 18:20, mcanjo mca...@gmail.com wrote: I tried doing the following code: from subprocess import Popen from subprocess import PIPE, STDOUT exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr = STDOUT) exefile.communicate('MarchScreen.pmm\nMarchScreen.out')[0] and

Re: passing command line arguments to executable

2010-04-04 Thread Gabriel Genellina
not accept command line arguments? Many do, and switch to interactive mode when no argument is provided. I'd try with -h /h --help /help -? /? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: passing command line arguments to executable

2010-04-04 Thread Joshua
On 4/3/10 12:09 PM, mcanjo wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter

passing command line arguments to executable

2010-04-03 Thread mcanjo
I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter a second time and it goes off and

Re: passing command line arguments to executable

2010-04-03 Thread Patrick Maupin
On Apr 3, 11:09 am, mcanjo mca...@gmail.com wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output

Re: passing command line arguments to executable

2010-04-03 Thread Simon Brunning
On 3 April 2010 17:09, mcanjo mca...@gmail.com wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output

Re: passing command line arguments to executable

2010-04-03 Thread mcanjo
On Apr 3, 11:15 am, Patrick Maupin pmau...@gmail.com wrote: On Apr 3, 11:09 am, mcanjo mca...@gmail.com wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the

Re: passing command line arguments to executable

2010-04-03 Thread Patrick Maupin
On Apr 3, 12:20 pm, mcanjo mca...@gmail.com wrote: On Apr 3, 11:15 am, Patrick Maupin pmau...@gmail.com wrote: On Apr 3, 11:09 am, mcanjo mca...@gmail.com wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a

[issue5680] Command-line arguments when running in IDLE

2010-02-04 Thread Gabriel Genellina
Redesign this interface (yet again) as follows: - Present a dialog box for ``Run Module'' - Allow specify command line arguments in the dialog box -- nosy: +gagenellina Added file: http://bugs.python.org/file16139/issue5680-patch2.diff ___ Python

How to pass Chinese characters as command-line arguments?

2010-01-31 Thread kj
I want to pass Chinese characters as command-line arguments to a Python script. My terminal has no problem displaying these characters, and passing them to the script, but I can't get Python to understand them properly. E.g. if I pass one such character to the simple script import sys print

Re: How to pass Chinese characters as command-line arguments?

2010-01-31 Thread Diez B. Roggisch
Am 31.01.10 16:52, schrieb kj: I want to pass Chinese characters as command-line arguments to a Python script. My terminal has no problem displaying these characters, and passing them to the script, but I can't get Python to understand them properly. E.g. if I pass one such character

Re: How to pass Chinese characters as command-line arguments?

2010-01-31 Thread kj
In 7slr5ife6...@mid.uni-berlin.de Diez B. Roggisch de...@nospam.web.de writes: Am 31.01.10 16:52, schrieb kj: I want to pass Chinese characters as command-line arguments to a Python script. My terminal has no problem displaying these characters, and passing them to the script, but I can't

Re: Command line arguments??

2009-11-18 Thread Nobody
On Tue, 17 Nov 2009 23:57:55 +, Rhodri James wrote: Quote the filenames or escape the spaces: C:\Python26\Python.exe C:\echo.py C:\New Folder\text.txt We've been living with this pain ever since windowed GUIs encouraged users to put spaces in their file names (Apple, I'm looking at

Re: Command line arguments??

2009-11-17 Thread Nobody
On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: Quote the filenames or escape the spaces: C:\Python26\Python.exe C:\echo.py C:\New Folder\text.txt We've been living with this pain ever since windowed GUIs encouraged users to put spaces in their file names (Apple, I'm looking at

Re: Command line arguments??

2009-11-17 Thread Gerry
On Nov 17, 2:26 pm, Nobody nob...@nowhere.com wrote: On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: Quote the filenames or escape the spaces: C:\Python26\Python.exe C:\echo.py C:\New Folder\text.txt We've been living with this pain ever since windowed GUIs encouraged users   to

Re: Command line arguments??

2009-11-17 Thread Nobody
On Tue, 17 Nov 2009 11:47:46 -0800, Gerry wrote: How about this: lastarg = .join(sys.argv[2:]) What about it? IOW, why would you want to do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line arguments??

2009-11-17 Thread Rhodri James
On Tue, 17 Nov 2009 19:26:46 -, Nobody nob...@nowhere.com wrote: On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: Quote the filenames or escape the spaces: C:\Python26\Python.exe C:\echo.py C:\New Folder\text.txt We've been living with this pain ever since windowed GUIs

Re: Command line arguments??

2009-11-17 Thread Dave Angel
Nobody wrote: On Tue, 17 Nov 2009 11:47:46 -0800, Gerry wrote: How about this: lastarg = .join(sys.argv[2:]) What about it? IOW, why would you want to do that? Like many tricks, it'd work if several conditions applied: 1) there's exactly two arguments expected on the

Re: Command line arguments??

2009-11-17 Thread greg
Rhodri James wrote: We've been living with this pain ever since windowed GUIs encouraged users to put spaces in their file names (Apple, I'm looking at you!). It's not really Apple's fault. There was no problem with spaces in filenames in the classic MacOS environment, because there was no

Command line arguments??

2009-11-16 Thread rantingrick
I am currently having fun with command line arguments in a windows environment. If i get a path that has spaces anywhere in it my script gets the wrong arguments from sys.argv. You guy's probably know what i am talking about. Heres and example. 'C:\\Python26\\Python.exe C:\\echo.py C:\\New Folder

Re: Command line arguments??

2009-11-16 Thread Benjamin Kaplan
On Mon, Nov 16, 2009 at 6:18 PM, rantingrick rantingr...@gmail.com wrote: I am currently having fun with command line arguments in a windows environment. If i get a path that has spaces anywhere in it my script gets the wrong arguments from sys.argv. You guy's probably know what i am talking

Re: Command line arguments??

2009-11-16 Thread Rhodri James
On Mon, 16 Nov 2009 23:18:23 -, rantingrick rantingr...@gmail.com wrote: I am currently having fun with command line arguments in a windows environment. If i get a path that has spaces anywhere in it my script gets the wrong arguments from sys.argv. You guy's probably know what i am

Re: Command line arguments??

2009-11-16 Thread rantingrick
On Nov 16, 5:30 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: We've been living with this pain ever since windowed GUIs encouraged users   to put spaces in their file names (Apple, I'm looking at you!).   Fundamentally, if people want the pretty they have to live with the  

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-05-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I believe the title problem is solved by PEP 383 in py3k trunk. -- nosy: +r.david.murray resolution: - fixed stage: - committed/rejected status: open - pending ___ Python tracker

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-05-18 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3023 ___ ___

[issue5680] Command-line arguments when running in IDLE

2009-04-26 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- nosy: +gpolo priority: - normal stage: - patch review versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5680 ___

Raw command line arguments

2009-04-24 Thread Enchanter
How to pass the raw command line arguments to the python? Such as: mypython.py txt -c Test Only {Help} The arguments I hope to get is: txt -c Test Only {Help} -- Keep the quotation marks in the arguments. -- http://mail.python.org/mailman/listinfo/python

Re: Raw command line arguments

2009-04-24 Thread Chris Rebert
On Fri, Apr 24, 2009 at 2:40 AM, Enchanter ensoul.magaz...@gmail.com wrote: How to pass the raw command line arguments to the python? Such as:     mypython.py  txt -c Test Only {Help} The arguments I hope to get is:              txt -c Test Only {Help}               -- Keep

Re: Raw command line arguments

2009-04-24 Thread Dave Angel
Enchanter wrote: How to pass the raw command line arguments to the python? Such as: mypython.py txt -c Test Only {Help} The arguments I hope to get is: txt -c Test Only {Help} -- Keep the quotation marks in the arguments. As Chris has said, the shell

Re: Raw command line arguments

2009-04-24 Thread Gabriel Genellina
En Fri, 24 Apr 2009 06:40:23 -0300, Enchanter ensoul.magaz...@gmail.com escribió: How to pass the raw command line arguments to the python? That depends on the OS or the shell you're using. Such as: mypython.py txt -c Test Only {Help} The arguments I hope to get

[issue5680] Command-line arguments when running in IDLE

2009-04-03 Thread Matthew Barnett
New submission from Matthew Barnett pyt...@mrabarnett.plus.com: Patch idle-args.diff adds a dialog for entering command-line arguments for a script from within IDLE itself. -- components: IDLE files: idle-args.diff keywords: patch messages: 85341 nosy: mrabarnett severity: normal status

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread David Watson
David Watson bai...@users.sourceforge.net added the comment: @ Victor Stinner: Yes, the behaviour of those functions is as you describe - it's been changed since I filed this issue. I do consider it an improvement. By the password database, I mean /etc/passwd or replacements that are

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: By the password database, I mean /etc/passwd or replacements that are accessible via getpwnam() and friends. Please only discuss one issue at the time in the bug tracker. This issue is about invalidly-encoded command-line arguments

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: By the password database, I mean /etc/passwd or replacements that are accessible via getpwnam() and friends. Users are often allowed to change things like the GECOS field, and can generally stick any old junk in there,

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-12-31 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3023 ___ ___

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-12-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Hmm, yes, I see that the open() builtin doesn't accept bytes filenames, though os.open() still does. What? open() builtin, io.open() and os.open() accept bytes filename. So what *is* os.listdir() supposed to do when it finds an

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-12-30 Thread Dan Dever
, command-line arguments, etc. Since Python 3 strings must be text, they cannot generally be used to represent Unix strings. David's right, this is going to cause real problems. It has to be solved somehow, but the more obvious solutions are in some way ugly and introduce platform-to-platform

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-12-29 Thread dedded
Changes by dedded ded...@verizon.net: -- nosy: +dedded ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3023 ___ ___ Python-bugs-list mailing list

Taking command line arguments from another program

2008-07-27 Thread aditya shukla
Hello folks ,I have a program in which a text file is generated as an output eg C:\prog\ prog -x test.txt Right now whenever i have to read the test file i have to put its name manually in my code. eg f=open(c:\\prog\\test.txt,r) How ever i want to add the name of the test file dynamically to my

Angle brackets in command-line arguments?

2008-07-16 Thread Keith Hughitt
Hi all, I am using someone else's script which expects input in the form of: ./script.py arg1 arg2 I was wondering if the angle-brackets here have a special meaning? It seems like they specify an input and output stream to use in place of the console. I could not find anything in the

Re: Angle brackets in command-line arguments?

2008-07-16 Thread Marc 'BlackJack' Rintsch
On Wed, 16 Jul 2008 07:53:56 -0700, Keith Hughitt wrote: I am using someone else's script which expects input in the form of: ./script.py arg1 arg2 I was wondering if the angle-brackets here have a special meaning? It seems like they specify an input and output stream to use in place

Re: Angle brackets in command-line arguments?

2008-07-16 Thread Fredrik Lundh
Keith Hughitt wrote: I am using someone else's script which expects input in the form of: ./script.py arg1 arg2 arg is a common notation for replace with argument value, so it could be that they're just expecting you to type: ./script.py arg1 arg2 Alternatively, they meant

Re: Angle brackets in command-line arguments?

2008-07-16 Thread Gary Herron
, they are *not* seen by the script as command line arguments. (And they are *not* brackets, and do not need to be matched. ) For any command, cmd file redirects the contents of file to cmd's standard input, which in Python is accessed by reading from sys.stdin (use input or raw_input or sys.stdin.read

Re: Angle brackets in command-line arguments?

2008-07-16 Thread Keith Hughitt
* specify input and output streams as you surmise.  However, they are *not* seen by the script  as command line arguments.  (And they are *not* brackets, and do not need to be matched. ) For any command,   cmd file redirects the contents of file to cmd's standard input, which in Python

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-06-02 Thread David Watson
David Watson [EMAIL PROTECTED] added the comment: Hmm, yes, I see that the open() builtin doesn't accept bytes filenames, though os.open() still does. When I saw that you could pass bytes filenames transparently from os.listdir() to os.open(), I assumed that this was intentional! So what *is*

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-06-02 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: The issue with unrepresentable file names hasn't been decided yet. One option is to include the bytes object in that case, instead, noting that this can only occur on selected platforms. Another option is indeed to raise an exception, or

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-06-01 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: That os.listdir still uses bytes should be changed as well. Both file names and command line arguments are strings, from the viewpoint of Python. Nothing else is supported. -- nosy: +loewis

[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-06-01 Thread David Watson
)? Could sys.argv not provide bytes objects for those arguments, like os.listdir()? Or (better IMHO) have a separate sys.argv_bytes interface? -- components: Unicode messages: 67608 nosy: baikie severity: normal status: open title: Problem with invalidly-encoded command-line arguments (Unix

Re: Command line arguments in Windows

2008-03-04 Thread Chris
On Mar 4, 8:38 am, Mike Walker [EMAIL PROTECTED] wrote: If you run a python file, ie. just double clicking it the only argument you will have will be the filename of the script. If you create a shortcut to the script and in the target box add your arguments (if you have quotation marks

Re: Command line arguments in Windows

2008-03-04 Thread Steve Holden
Chris wrote: On Mar 4, 8:38 am, Mike Walker [EMAIL PROTECTED] wrote: If you run a python file, ie. just double clicking it the only argument you will have will be the filename of the script. If you create a shortcut to the script and in the target box add your arguments (if you have

Command line arguments in Windows

2008-03-03 Thread Mike Walker
I am having some problems with command line arguments in Windows. The same code under Linux works fine. In Windows I only get one argument no matter how many arguments are passed on the command line. I think there is some problem with the way the .py files are associated causing this. I'm just

Re: Command line arguments in Windows

2008-03-03 Thread Mike Walker
If you run a python file, ie. just double clicking it the only argument you will have will be the filename of the script. If you create a shortcut to the script and in the target box add your arguments (if you have quotation marks place them after not inside) you will see your arguments.

Re: Command line arguments in Windows

2008-03-03 Thread Chris
On Mar 4, 7:12 am, Mike Walker [EMAIL PROTECTED] wrote: I am having some problems with command line arguments in Windows. The same code under Linux works fine. In Windows I only get one argument no matter how many arguments are passed on the command line. I think there is some problem

Re: Command line arguments in Windows

2008-03-03 Thread Mark Tolonen
Mike Walker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you run a python file, ie. just double clicking it the only argument you will have will be the filename of the script. If you create a shortcut to the script and in the target box add your arguments (if you have

Re: Command line arguments in Windows

2008-03-03 Thread Mike Walker
Mark Tolonen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From the command line, the 'ftype' and 'assoc' commands can be used view how an extension is handled: C:\assoc .py .py=Python.File C:\ftype Python.File Python.File=C:\Python25\python.exe %1 %* My guess is

Re: command-line arguments in IDLE

2007-11-07 Thread Ginger
it does have one in activepython Thanks and Regards, Ginger - Original Message - From: Russ P. [EMAIL PROTECTED] To: python-list@python.org Sent: Wednesday, November 07, 2007 8:56 AM Subject: command-line arguments in IDLE Is it possible to pass command-line arguments when running

command-line arguments in IDLE

2007-11-07 Thread Russ P.
Is it possible to pass command-line arguments when running a program in IDLE? The Run menu does not seem to provide that option. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: command-line arguments in IDLE

2007-11-07 Thread [EMAIL PROTECTED]
On Nov 7, 6:27 am, Russ P. [EMAIL PROTECTED] wrote: Is it possible to pass command-line arguments when running a program in IDLE? The Run menu does not seem to provide that option. Thanks. Can't you just fake the command line args by setting sys.argv? This isn't too sophisticated

Re: command-line arguments in IDLE

2007-11-07 Thread Tal Einat
Russ P. wrote: Is it possible to pass command-line arguments when running a program in IDLE? The Run menu does not seem to provide that option. Thanks. thunderfoot's workaround should work well, but requires changing the script. If you want IDLE environment, but don't mind running IDLE from

command-line arguments in IDLE

2007-11-06 Thread Russ P.
Is it possible to pass command-line arguments when running a program in IDLE? The Run menu does not seem to provide that option. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

passing command line arguments

2007-09-07 Thread Brian McCann
Hi, when I run the script show_args2.py # ./show_args2.py 1 2 3 I get the following error Traceback (most recent call last): File ./show_args2.py, line 4, in ? print 'The arguments of %s are %s' %s \ NameError: name 's' is not defined #

RE: passing command line arguments

2007-09-07 Thread Brian McCann
Darren, Thanks From: [EMAIL PROTECTED] on behalf of darren kirby Sent: Fri 9/7/2007 1:58 PM To: python-list@python.org Subject: Re: passing command line arguments quoth the Brian McCann: Hi, when I run the script show_args2.py # ./show_args2.py 1 2 3

Re: passing command line arguments

2007-09-07 Thread Carsten Haese
On Fri, 2007-09-07 at 12:47 -0400, Brian McCann wrote: Hi, when I run the script show_args2.py # ./show_args2.py 1 2 3 I get the following error Traceback (most recent call last): File ./show_args2.py, line 4, in ? print 'The arguments of %s are %s' %s \ NameError:

Re: passing command line arguments

2007-09-07 Thread darren kirby
quoth the Brian McCann: Hi, when I run the script show_args2.py # ./show_args2.py 1 2 3 I get the following error Traceback (most recent call last): File ./show_args2.py, line 4, in ? print 'The arguments of %s are %s' %s \ NameError: name 's' is not defined

Re: command line arguments using subprocess

2007-03-15 Thread Gabriel Genellina
En Wed, 14 Mar 2007 16:51:04 -0300, Jim [EMAIL PROTECTED] escribió: I'm trying to use subprocess to drive a Perl script. I'm having some trouble getting it to spot the command line arguments. Basically, if I call subprocess(args).wait() where args has a second item, I can't convince

command line arguments using subprocess

2007-03-14 Thread Jim
Hello, I'm trying to use subprocess to drive a Perl script. I'm having some trouble getting it to spot the command line arguments. Basically, if I call subprocess(args).wait() where args has a second item, I can't convince the Perl script to see it. Below is a pretty small example. If someone

Re: Command line arguments on Vista

2007-01-16 Thread jmike
Thanks for the answers; that was the problem exactly. --JMike Duncan Booth wrote: It sounds like the registry entry for running Python files is messed up. Can you go to a command line and see what the command 'ftype Python.File' displays? (Assuming that command lines and ftype still work on

Re: Command line arguments on Vista

2007-01-13 Thread Gabriel Genellina
Duncan Booth [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] It sounds like the registry entry for running Python files is messed up. Can you go to a command line and see what the command 'ftype Python.File' displays? (Assuming that command lines and ftype still work on Vista)

Command line arguments on Vista

2007-01-12 Thread jmike
So I write this sript called printargs.py: -- #!/usr/local/bin/python import sys print 'there are %d args' % len(sys.argv) for arg in sys.argv: print 'arg: %s' % arg -- and make it executable. On pretty much every platform I can get my hands on, when I run printargs.py booga

Re: Command line arguments on Vista

2007-01-12 Thread jmike
By the way, note that if I say (on Vista) python printargs.py booga -a wooga I get the desired output: there are 4 args arg: printargs.py arg: booga arg: -a arg: wooga So the quesiton still stands, what's up with that? Thanks, --JMike --

Re: Command line arguments on Vista

2007-01-12 Thread jmike
Some further information: perl seems to do the same thing (losing arguments). We think it may have something to do with file association. Any ideas anyone? --JMike -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line arguments on Vista

2007-01-12 Thread Duncan Booth
[EMAIL PROTECTED] wrote: But on Windows Vista, when I run that command, I get there are 1 args arg: printargs.py What's up with that? It sounds like the registry entry for running Python files is messed up. Can you go to a command line and see what the command 'ftype

<    1   2   3   4   >