Third party pytz always chosen
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Graphite |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Near the top of /opt/graphite/
try: # See if there is a system installation of pytz first
import pytz
except ImportError: # Otherwise we fall back to Graphite's bundled version
from graphite.thirdparty import pytz
However inside the default settings.py the thirdparty directory is inserted *before* other entries in sys.path:
sys.path.insert(0, THIRDPARTY_DIR)
Hence it will always use the third party one that is included with graphite (which is out of date and doesn't work on my system for some reason). This should be simple enough to fix by changing that insert to an append, but I'm not sure is there is some legitimate reason for the insert.
Also, if thirdparty is in the path anyways there's no need for the try/except around the pytz import.
I don't mind a patch for this, if my fix sounds good please let me know.
Changed in graphite: | |
status: | Fix Committed → Fix Released |
You're quite correct, the thirdparty dir doesnt need to be in sys.path at all since it's contained within the main webapp dir and the imports are relative to that path.