Re: Python 3.3 and .pyo files

2012-09-26 Thread Steven D'Aprano
On Fri, 21 Sep 2012 11:10:07 +0200, Marco wrote: > I was trying to import a pyo module in Python 3.3, but Python does not > find it: [...] Marco, this bug is apparently now fixed: http://bugs.python.org/issue16046 Please download the latest version of Python 3.3 and try again. (Folks, this is

Re: Python 3.3 and .pyo files

2012-09-22 Thread Terry Reedy
On 9/22/2012 9:21 AM, Steven D'Aprano wrote: On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote: On 9/21/2012 5:10 AM, Marco wrote: I was trying to import a pyo module in Python 3.3, but Python does not find it: You appear to be trying to *run*, not *import* a .pyo module. Marco is usin

Re: Python 3.3 and .pyo files

2012-09-22 Thread Ramchandra Apte
On Saturday, 22 September 2012 18:51:01 UTC+5:30, Steven D'Aprano wrote: > On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote: > > > > > On 9/21/2012 5:10 AM, Marco wrote: > > >> I was trying to import a pyo module in Python 3.3, but Python does not > > >> find it: > > > > > > You appea

Re: Python 3.3 and .pyo files

2012-09-22 Thread Steven D'Aprano
On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote: > On 9/21/2012 5:10 AM, Marco wrote: >> I was trying to import a pyo module in Python 3.3, but Python does not >> find it: > > You appear to be trying to *run*, not *import* a .pyo module. Marco is using the standard mechanism for finding, i

Re: Python 3.3 and .pyo files

2012-09-21 Thread Terry Reedy
On 9/21/2012 5:10 AM, Marco wrote: I was trying to import a pyo module in Python 3.3, but Python does not find it: You appear to be trying to *run*, not *import* a .pyo module. $ echo "print(__file__)" > foo.py $ python3.3 -O -m foo Since foo.py is in the current directory, I am not sure wh

Re: Python 3.3 and .pyo files

2012-09-21 Thread Marco
On 09/21/2012 02:55 PM, Steven D'Aprano wrote: $ ls >foo.pyo ># The following works in Python3.2, but not in 3.3 >$ python3.3 -O -m foo >/usr/local/bin/python3.3: No module named foo I can confirm that (1) it works using Python 3.2; (2) it doesn't work using Python 3.3; and (3) it does work in

Re: Python 3.3 and .pyo files

2012-09-21 Thread Steven D'Aprano
On Fri, 21 Sep 2012 11:10:07 +0200, Marco wrote: > I was trying to import a pyo module in Python 3.3, but Python does not > find it: > > $ echo "print(__file__)" > foo.py > $ python3.3 -O -m foo > /home/marco/temp/foo.py > $ ls > foo.py __pycache__ > $ rm foo.py > $ mv __pycache__/foo.cpython-33