[python-committers] [RELEASED] Python 3.2 rc 1

Mark Summerfield list at qtrac.plus.com
Mon Jan 17 03:33:42 EST 2011


Hi Georg,
I can't be sure it is a bug, but there is a definite difference of
behavior between 3.0/3.1 and 3.2rc1.
Given this directory layout:
$ ls -R Graphics/
Graphics/:
__init__.py Vector Xpm.py
Graphics/Vector:
__init__.py Svg.py
And these files:
$ cat Graphics/__init__.py 
__all__ = ["Xpm"]
$ cat Graphics/Xpm.py 
#!/usr/bin/env python3
XPM = 0
$ cat Graphics/Vector/__init__.py 
__all__ = ["Svg"]
$ cat Graphics/Vector/Svg.py 
#!/usr/bin/env python3
from ..Graphics import Xpm
SVG = 1
I can do the relative import with Python 3.0 and 3.1 but not with
3.2rc1:
$ python30
Python 3.0.1 (r301:69556, Jul 15 2010, 10:31:51) 
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Graphics.Vector import *
>>> Svg.SVG
1
$ python31
Python 3.1.2 (r312:79147, Jul 15 2010, 10:56:05) 
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Graphics.Vector import *
>>> Svg.SVG
1
$ ~/opt/python32rc1/bin/python3
Python 3.2rc1 (r32rc1:88035, Jan 16 2011, 08:32:59) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Graphics.Vector import *
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "Graphics/Vector/Svg.py", line 2, in <module>
 from ..Graphics import Xpm
ImportError: No module named Graphics
Should I report it as a bug or is this a planned change of behavior (or
was the original behavior wrong?).
-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
 C++, Python, Qt, PyQt - training and consultancy
 "Advanced Qt Programming" - ISBN 0321635906
 http://www.qtrac.eu/aqpbook.html


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /