
Using:Python 2.7.0+ (r27:82500, Sep 15 2010, 18:14:55) [GCC 4.4.5] on linux2(Ubuntu 10.10) Method to reproduce error: 1. Defining a module which is later imported by another: --------------------------------------------------------------------- class SomeThing: def __init__(self): self.variable = 'Where is my bytecode?' def deliver(self): return self.variable
if __name__ == '__main__': obj = SomeThing() print obj.deliver() --------------------------------------------------------------------- 2. Run this module:Output of the Python Shell: Where is my bytecode? >>> 3. Defining the importing module: --------------------------------------------------------------------- class UseSomeThing: def __init__(self, something): self.anything = something def giveanything(self): return self.anything
if __name__ == '__main__': anything = UseSomeThing(SomeThing.SomeThing().deliver()).giveanything() print anything --------------------------------------------------------------------- 4. Run this module:Output of the Python Shell: Where is my bytecode >>>(One can find SomeThing.pyc on the disc.) 5. Changing the imported module: ---------------------------------------------------------------------class SomeThing: def __init__(self): self.variable = 'What the hell is this? It could not be Python!' def deliver(self): return self.variableif __name__ == '__main__': obj = SomeThing() print obj.deliver()--------------------------------------------------------------------- 6. Run the changed module:Output of the Python Shell: What the hell is this? It could not be Python! >>> 7. Run the importing module again:Output of the Python Shell: Where is my bytecode? >>>8. Deleting the bytecode of the imported module makes no effect! Remark: I think that I have observed yesterday late night a similar effect on Windows XPwith Python 2.7.1 and Python 3.1.3. But when I have tried it out today in the morning theerror hasn't appeared. So it may be that the Python interpreter isn't working correctly onlyon Ubuntu 10.10.

On Mon, Jan 24, 2011 at 04:39:54PM +0000, Stefan Spoettl wrote:
So it may be that the Python interpreter isn't working correctly onlyon Ubuntu 10.10
Than you should report the problem to the Ubuntu developers, right? And it would be nice if you investigate deeper and send a proper mail - with a subject, with a properly formatted text, not html.
http://www.catb.org/~esr/faqs/smart-questions.html
Oleg.

Bug reports should be filed at bugs.python.org
On Mon, Jan 24, 2011 at 08:39, Stefan Spoettl spoettl@hotmail.com wrote:
Using: Python 2.7.0+ (r27:82500, Sep 15 2010, 18:14:55) [GCC 4.4.5] on linux2 (Ubuntu 10.10) Method to reproduce error:
- Defining a module which is later imported by another:
class SomeThing: def __init__(self): self.variable = 'Where is my bytecode?' def deliver(self): return self.variable
if __name__ == '__main__': obj = SomeThing() print obj.deliver()
- Run this module:
Output of the Python Shell: Where is my bytecode? >>> 3. Defining the importing module:
class UseSomeThing: def __init__(self, something): self.anything = something def giveanything(self): return self.anything
if __name__ == '__main__': anything = UseSomeThing(SomeThing.SomeThing().deliver()).giveanything() print anything
- Run this module:
Output of the Python Shell: Where is my bytecode >>> (One can find SomeThing.pyc on the disc.) 5. Changing the imported module:
class SomeThing: def __init__(self): self.variable = 'What the hell is this? It could not be Python!' def deliver(self): return self.variable
if __name__ == '__main__': obj = SomeThing() print obj.deliver()
- Run the changed module:
Output of the Python Shell: What the hell is this? It could not be Python! >>> 7. Run the importing module again: Output of the Python Shell: Where is my bytecode? >>> 8. Deleting the bytecode of the imported module makes no effect! Remark: I think that I have observed yesterday late night a similar effect on Windows XP with Python 2.7.1 and Python 3.1.3. But when I have tried it out today in the morning the error hasn't appeared. So it may be that the Python interpreter isn't working correctly only on Ubuntu 10.10. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/brett%40python.org
participants (3)
-
Brett Cannon
-
Oleg Broytman
-
Stefan Spoettl