[issue12238] Readline module loading in interactive mode

2020-03-06 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon status: pending -> open ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12238] Readline module loading in interactive mode

2016-09-24 Thread Christian Heimes
Christian Heimes added the comment: Steve took care of the readline import for isolated mode in #28192. We can't change the default behavior. If you want to prevent Python from important files from either cwd, user packages or env vars, you have to use isolated mode. System scripts should use

[issue12238] Readline module loading in interactive mode

2015-10-01 Thread R. David Murray
R. David Murray added the comment: This issue was reported again in issue 25288. To summarize: the cwd should only be used for imports *after* the command prompt is displayed, and readline is imported *before* the prompt is displayed but currently is imported from the cwd. This should be

[issue12238] Readline module loading in interactive mode

2015-10-01 Thread R. David Murray
Changes by R. David Murray : -- stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue12238] Readline module loading in interactive mode

2015-10-01 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___

[issue12238] Readline module loading in interactive mode

2013-04-24 Thread yaccz
Changes by yaccz yac@gmail.com: -- nosy: +yaccz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12238 ___ ___ Python-bugs-list mailing list

[issue12238] Readline module loading in interactive mode

2013-04-22 Thread STINNER Victor
STINNER Victor added the comment: We may add a command line option and/or an environment variable to not add the current directory to sys.path. Changing the current behaviour may break many applications / use cases. -- ___ Python tracker

[issue12238] Readline module loading in interactive mode

2013-04-22 Thread STINNER Victor
STINNER Victor added the comment: We may add a command line option and/or an environment variable to not add the current directory to sys.path. Oh, this is exactly what the issue #16499 proposes. -- ___ Python tracker rep...@bugs.python.org

[issue12238] Readline module loading in interactive mode

2012-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue was fixed in 3.3, but not in 2.7 or 3.2. $ strace ./python -i /dev/null 21 | grep readline stat64(/home/serhiy/py/cpython3.3/build/lib.linux-i686-3.3/readline.cpython-33m.so, {st_mode=S_IFREG|0755, st_size=52511, ...}) = 0

[issue12238] Readline module loading in interactive mode

2012-10-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: Serhiy, I don't think it's fixed in 3.3, or perhaps I'm misunderstanding what you mean by fixed. If you create readline.cpython-33m.so in your cwd and then run python, the fake readline will still be loaded instead of the real one. For example (here with

[issue12238] Readline module loading in interactive mode

2012-10-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: Regardless, I'm not sure what we should do about this issue. Loading readline is obviously provided as a convenience to make the interpreter prompt easier to use. Several of us would probably like to go a bit further and also add tab-completion (see

[issue12238] Readline module loading in interactive mode

2012-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I understand what happens. Python 3.3+ uses getdents(), not stat() for module search. Therefore stat() is not called for non-existed files. It stands that while the -S and -E option allow to disable any customization a user might have done (which is

[issue12238] Readline module loading in interactive mode

2011-06-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't think readline is special-cased: $ echo 1/0 logging.py $ cpython/default/python Python 3.3a0 (default:d8502fee4638+, Jun 6 2011, 19:13:58) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. import

[issue12238] Readline module loading in interactive mode

2011-06-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Python 3.3a0 (default:7323a865457a+, Jun 5 2011, 19:22:38) [GCC 4.5.2] on linux2 Type help, copyright, credits or license for more information. import sys sys.modules['logging'] Traceback (most recent call last): File stdin, line 1,

[issue12238] Readline module loading in interactive mode

2011-06-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The difference is that logging is not imported at startup. So, however os (and friends, there are a lot of modules in sys.modules at startup) is imported, it is different from how readline.so is imported. For the record, os is imported by the

[issue12238] Readline module loading in interactive mode

2011-06-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Yeah, that would be my guess. And readline.so is imported in main at a point where it has decided we are going into interactive mode, which is presumably after all other initialization has taken place, including the path munging. Thus

[issue12238] Readline module loading in interactive mode

2011-06-06 Thread Niels Heinen
Niels Heinen ni...@heinen.ws added the comment: Hi Eric, David, This means that you cannot type python and press enter in any shared directory without the risk of a malicious readlinemodule.so being imported and executed. I think this is different from a scenario where someone explicitly

[issue12238] Readline module loading in interactive mode

2011-06-06 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I've done a little poking around, and it looks like you are correct and I'm wrong. It appears that readline.so is or should be a special case. I've added some people to nosy to see what they think. Specifically, it appears that if I

[issue12238] Readline module loading in interactive mode

2011-06-03 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: +1 to what David said. See also #5753. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12238 ___

[issue12238] Readline module loading in interactive mode

2011-06-02 Thread Niels Heinen
New submission from Niels Heinen ni...@heinen.ws: Running the python binary without a script or using the -i flag will start the process in interactive mode. The interactive mode requires an external module to be loaded: readline. Per default behavior, Python also tries to load this module from

[issue12238] Readline module loading in interactive mode

2011-06-02 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: This is a general principle of how Python runs in interactive mode and is not confined to loading readline. The same would be true for any module loaded during startup, and there are quite a few that are so loaded. Since loading

[issue12238] Readline module loading in interactive mode

2011-06-02 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12238 ___ ___ Python-bugs-list mailing list