Can anyone think of a simple way work around this issue by overriding
__builtins__.input() with a function that calls input() and then returns
an rstrip()ped version of the input string? I though of setting a
PYTHONSTARTUP environment variable, but that only affects interactive
interpreter instances.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
Maybe you could put something in site.py?
--
Greg
In my opinion that's a python bug (because it should be able to remove
the \r\n and not only \n).
Anyway, Pydev also had that problem and it was fixed by having a
custom sitecustomize.py:
See: http://github.com/aptana/Pydev/tree/master/plugins/org.python.pydev/PySrc/pydev_sitecustomize/
It just has to added to the pythonpath before the run (and it'll
remove itself and call the default later on) -- the only catch is that
it has to be on a folder called "pydev_sitecustomize" -- you can
probably change the code if you don't want to follow that.
It'll fix input(), raw_input() and will also fix encoding problems
when writing non ASCII to the console (you may set a
'PYDEV_CONSOLE_ENCODING' in the environment or let it try to find a
default on) -- should be compatible with python 2 or 3.
Cheers,
Fabio
I just noted that you said they are already using pydev -- maybe it's
an old version? Or maybe you're doing a custom launcher that overrides
the usual pythonpath and for some reason is not passing the
pydev_sitecustomize folder?
Cheers,
Fabio