[New-bugs-announce] [issue3933] presence of .pythonstartup.py causes __main__.__file__ to be set incorrectly

Jean-Paul Calderone report at bugs.python.org
Mon Sep 22 14:43:58 CEST 2008


New submission from Jean-Paul Calderone <exarkun at divmod.com>:

exarkun at charm:~$ ls  .pythonstartup.py
.pythonstartup.py
exarkun at charm:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> __file__
'/home/exarkun/.pythonstartup.py'
>>> 
exarkun at charm:~$ mv .pythonstartup.py .not-pythonstartup.py
exarkun at charm:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> __file__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '__file__' is not defined
>>>

----------
components: Library (Lib)
messages: 73572
nosy: exarkun
severity: normal
status: open
title: presence of .pythonstartup.py causes __main__.__file__ to be set incorrectly
type: behavior
versions: Python 2.4, Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3933>
_______________________________________


More information about the New-bugs-announce mailing list