Skip to content

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

@wescpy

Description

@wescpy

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=='

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions