Geoffrey Bache gjb1...@users.sourceforge.net added the comment:
Thanks for the tips, looks like we have the basis for a solid workaround here.
Perhaps that could be encapsulated and added as sys.raw_argv or something in
future?
--
___
Python
Tim Golden m...@timgolden.me.uk added the comment:
Suggest you raise a separate feature-request issue for that, Geoff, perhaps
offering the two implementations described. Perhaps raise it it on python-ideas
first to gauge reactions. I'm +0 myself since it's so easy to do anyway and I
don't
Matthew Woodcraft matt...@woodcraft.me.uk added the comment:
open(/proc/self/cmdline).read() should work on linux (note that the arguments
are separated by NULs).
--
nosy: +mattheww
___
Python tracker rep...@bugs.python.org
Geoffrey Bache gjb1...@users.sourceforge.net added the comment:
I also just ran into this. Is it likely that an enhancement request to provide
access to the raw command line, as requested by the previous commenter, would
be accepted? It's sometimes useful to have some idea about what kind of
Tim Golden m...@timgolden.me.uk added the comment:
Merely from a Windows point-of-view, you could get the full
command line fairly easily:
code
import ctypes
pstring = ctypes.windll.kernel32.GetCommandLineW ()
print (ctypes.c_wchar_p (pstring).value)
/code
TJG
--
nosy: +tim.golden
Geoffrey Bache gjb1...@users.sourceforge.net added the comment:
Interesting. Any idea if something similar is possible on Linux?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2972
___
Tim Golden m...@timgolden.me.uk added the comment:
I'm afraid I don't know; might be worth asking that on the main python mailing
list.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2972
Hari Krishna Dara harid...@gmail.com added the comment:
I hit exactly this same problem today trying to customize sys.path. We
conventionally use .pth file under site-packages to add our custom
library paths, but this is not convenient in development while switching
between branches/checkout
Brett Cannon br...@python.org added the comment:
This cannot change as sys.argv needs to be set after Python initializes
to strip out what arguments were meant for the interpreter and not the
script being run. All of this also needs to happen with site executing
first, so this cannot be changed.
Changes by Brett Cannon br...@python.org:
--
priority: - normal
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2972
___
___
Python-bugs-list
Changes by Daniel Diniz aja...@gmail.com:
--
assignee: - brett.cannon
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2972
___
11 matches
Mail list logo