need to revert email.generator._make_boundary() vs. mimetools.choose_boundary() #45

Closed
opened 2011-10-06 14:30:50 -07:00 by wescpy · 1 comment
wescpy commented 2011-10-06 14:30:50 -07:00 (Migrated from github.com)

noticed in 1.4.4 over 1.4.3 that you moved it from email.generator._make_boundary() to mimetools.choose_boundary()... unfortunately, we'll we need to revert this change as the latter is deprecated for 3.x:

$ python2.7 -3
Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetools
__main__:1: DeprecationWarning: in 3.x, mimetools has been removed in favor of the email package

And they really did carry-through with their threat (so the import of twython3k/twython.py fails):

$ python3
Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mimetools

why the change from email.generator._make_boundary()? it seems to work fine under both Python 2 & 3:

$ python2.7 -3
Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.generator
>>> email.generator._make_boundary()
'===============1929834788=='
>>> ^D
$ python3
Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.generator
>>> email.generator._make_boundary()
'===============0161796712942765287=='
noticed in 1.4.4 over 1.4.3 that you moved it from email.generator._make_boundary() to mimetools.choose_boundary()... unfortunately, we'll we need to revert this change as the latter is deprecated for 3.x: ``` $ python2.7 -3 Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import mimetools __main__:1: DeprecationWarning: in 3.x, mimetools has been removed in favor of the email package ``` And they really did carry-through with their threat (so the import of twython3k/twython.py fails): ``` $ python3 Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import mimetools Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mimetools ``` why the change from email.generator._make_boundary()? it seems to work fine under both Python 2 & 3: ``` $ python2.7 -3 Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import email.generator >>> email.generator._make_boundary() '===============1929834788==' >>> ^D $ python3 Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import email.generator >>> email.generator._make_boundary() '===============0161796712942765287==' ```
ryanmcgrath commented 2011-10-06 14:40:22 -07:00 (Migrated from github.com)

Mmmm, alright, the most recent two commits should fix this.

Mmmm, alright, the most recent two commits should fix this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#45
No description provided.