base64 - python program seems to run another (local) program automatically without being requested to -
(if you're opposed mixing programming , humor skip directly question in last paragraph)
we've encountered near x-files experience when python program started printing output in base64 encoding, without being asked to. actually, not output content of stdin got. in fact, program tried read stdin got empty string, yet stdin mysteriously read , passed stdout base64-encoded.
when reached state of complete bewilderment, noticed directory contains program named base64.py
. when deleted behavior went normal.
i hear expected behavior may related textwrap
python feature. spare think of such "feature", can't find reference , curious. not textwrap phenomena of using programs found in neighborhood without being asked.
so if cares explain and/or provide references i'd grateful.
(python 2.6 on rhel 5.7)
edit:
can't show code real code proprietary, , example tried put didn't show behavior.
question this:
under circumstances python program may run program named base64.py
found in same directory , pass standard input it?
edit2:
edited subject reflect solution better
textwrap
above "red herring"
base64
name of a standard library module. mention there program named base64.py
. program got executed when part of program tried import standard module (or module in turn depends on base64
).
see section 6.1.2. module search path in tutorial:
the directory containing script being run placed @ beginning of search path, ahead of standard library path. means scripts in directory loaded instead of modules of same name in library directory.
Comments
Post a Comment