Support both Python 2 and 3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
Fix Released
|
Undecided
|
Tomi Hukkalainen |
Bug Description
Hi, it's really confusing that python-dateutil drops support for Python 2 in its new version. What happens is pip install python-dateutil from most old 2.x projects will get the new version automatically and things fail in confusing ways like this:
>>> from dateutil.parser import parse
>>> parse('
Traceback (most recent call last):
...
File "/Users/
return list(cls(s))
TypeError: iter() returned non-iterator of type '_timelex'
This is a feature request: please try supporting Python 2 using the 3to2 conversion tool in your setup.py file (or by building a Python 2 egg at deploy time for PyPI).
http://
http://
I don't know how well 3to2 it works but it's worth a try. You can add Python 2 to your test suite with tox http://
If 3to2 doesn't work it's probably not so hard to make a single source module. Mock was able to do this with a few hacks: http://
Finally, if all else fails, 2to3 is an awesome tool and works very well.
I really feel strongly that you're doing a huge disservice to the community by dropping Python 2 right now; it's too soon. Dateutil is an *essential* library so I praise your efforts on this wonderful tool. I consider it to be one of the missing standard library modules. The reality is that Python 3 adoption is going to be very gradual and I think it's the responsibility of essential module developers to support both versions. Even those who want to port to Python 3 are going to be held back by their dependencies.
thanks, Kumar
Related branches
Changed in dateutil: | |
status: | Invalid → In Progress |
Changed in dateutil: | |
status: | In Progress → Fix Committed |
Changed in dateutil: | |
status: | Fix Committed → Fix Released |
I should add that since I do feel strongly enough about this, I can help work on Python 2 support! I will try to find time for this if no one beats me to it...