Python: importing pytz triggers warning

Bug #281991 reported by Tessa Lau
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This problem occurs on a fresh update of Ibex. It did not occur in Hardy.

Importing the pytz module after the vobject module triggers the following warning:

>>> import vobject, pytz
/usr/lib/python2.5/site-packages/pytz/__init__.py:29: UserWarning: Module dateutil was already imported from /var/lib/python-support/python2.5/dateutil/__init__.py, but /var/lib/python-support/python2.5 is being added to sys.path
  from pkg_resources import resource_stream
/usr/lib/python2.5/site-packages/pytz/__init__.py:29: UserWarning: Module vobject was already imported from /var/lib/python-support/python2.5/vobject/__init__.py, but /var/lib/python-support/python2.5 is being added to sys.path
  from pkg_resources import resource_stream

Importing the modules in the opposite order does not print a warning. Perhaps there is a problem in the pytz module that it does not check for modules that have already been imported?

Revision history for this message
Wade Tattersall (wade-tattersall) wrote :

I can confirm that this happens in Intrepid Ibex, and does not occur in Hardy Heron. This issue is encountered when importing matplotlib, as it apparently loads those two modules in that order.

Revision history for this message
Toon Verstraelen (toon-verstraelen) wrote :

I have the same problem. It happens both on fresh installations of Intrepid Ibex, as on systems that were upgraded from Hardy Heron.

Revision history for this message
michael, liao (michael-hliao) wrote :

look this thread https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/299381/comments/5, this issue has workaround or temporary fixing method.

Revision history for this message
dewey hylton (dewey.hylton) wrote :

please confirm whether you are still seeing this issue. i cannot reproduce the error on intrepid:

$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vobject, pytz
>>>

Revision history for this message
Toon Verstraelen (toon-verstraelen) wrote :

After applying the workaround suggested by michael, I didn't notice it anymore.

Revision history for this message
Matthias Klose (doko) wrote :

this is only a problem with a custom install of matplotlib. the Ubuntu packages has proper dependencies on pytz and dateutil.

Changed in python-defaults:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.