Closed Arfrever closed 12 years ago
Some modules firstly try to import simplejson, while others json. This can result in importing both json and simplejson:
$ python2.7 Python 2.7.2+ (2.7:f1ee3bb6ba64+, Jan 29 2012, 20:33:23) [GCC 4.5.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> import mwlib.siteinfo.fetch_siteinfo >>> sys.modules["json"] <module 'json' from '/usr/lib64/python2.7/json/__init__.pyc'> >>> sys.modules["simplejson"] <module 'simplejson' from '/usr/lib64/python2.7/site-packages/simplejson/__init__.pyc'> >>>
I suggest that all modules firstly try to import simplejson before json.
Do you care enough to provide a patch?
http://people.apache.org/~Arfrever/mwlib-json.patch
Some modules firstly try to import simplejson, while others json. This can result in importing both json and simplejson:
I suggest that all modules firstly try to import simplejson before json.