[issue11554] Port email module's test_email_codecs.py to Python 3

2011-03-15 Thread Michael Henry

New submission from Michael Henry :

test_email_codecs.py in the email module should be ported to Python 3.

The attached patch ports test_email_codecs.py and hooks it into the email test
suite.

--
components: Library (Lib)
files: port-test_email_codecs.py.patch
keywords: patch
messages: 130980
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: Port email module's test_email_codecs.py to Python 3
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21213/port-test_email_codecs.py.patch

___
Python tracker 
<http://bugs.python.org/issue11554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11555] email.Message.as_string no longer mangles "From " (doc fix)

2011-03-15 Thread Michael Henry

New submission from Michael Henry :

The function email.Message.as_string has an out-of-date comment:

"""
This is a convenience method and may not generate the message exactly
as you intend because by default it mangles lines that begin with
"From ".  For more flexibility, use the flatten() method of a
Generator instance.
"""

The functionality has changed such that "From " mangling is no longer done.

--
components: Library (Lib)
messages: 130981
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: email.Message.as_string no longer mangles "From " (doc fix)

___
Python tracker 
<http://bugs.python.org/issue11555>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11556] email.Message.get_payload can handle bytes payloads (minor doc fix)

2011-03-15 Thread Michael Henry

New submission from Michael Henry :

In email.Message.get_payload, there is the following out-of-date comment:

"""
# payload can be bytes here, (I wonder if that is actually a bug?)
"""

The code can actually handle bytes payloads.

--
components: Library (Lib)
messages: 130982
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: email.Message.get_payload can handle bytes payloads (minor doc fix)

___
Python tracker 
<http://bugs.python.org/issue11556>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11558] Raise a more helpful exception in email.message.Message.attach after set_payload("some string")

2011-03-15 Thread Michael Henry

New submission from Michael Henry :

The attached test program, test_email_attach_to_string.py, demonstrates the
desire for email.message.Message.attach to raise a more helpful exception when
the user incorrectly invokes attach() after setting the payload to a string.

--
components: Library (Lib)
files: test_email_attach_to_string.py
messages: 130984
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: Raise a more helpful exception in email.message.Message.attach after 
set_payload("some string")
Added file: http://bugs.python.org/file21214/test_email_attach_to_string.py

___
Python tracker 
<http://bugs.python.org/issue11558>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11578] Increase test coverage for timeit.py

2011-03-16 Thread Michael Henry

New submission from Michael Henry :

The timeit.py module has no specific tests.  The attached patch adds
Lib/test/test_timeit.py for unit testing, along with slight modifications
to timeit.py to support predictable unit testing.

--
components: Library (Lib)
files: timeit_unit_test.patch
keywords: patch
messages: 131171
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: Increase test coverage for timeit.py
Added file: http://bugs.python.org/file21251/timeit_unit_test.patch

___
Python tracker 
<http://bugs.python.org/issue11578>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5633] fix for timeit when the statment is a string and the setup is not (and tests)

2011-03-16 Thread Michael Henry

Michael Henry  added the comment:

Issue #11578 added unit tests for timeit.py.  Because of this bug, two tests
were omitted.  In the attached patch are the previously withheld  unit tests
and an alternate method of fixing the bug (developed before Tim's fix was
noticed).  It's not clear to me what timing-related issues influence the
strategy for fixing this bug.

--
keywords: +patch
nosy: +michael.henry, r.david.murray
versions: +Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21253/timeit_issue_5633.patch

___
Python tracker 
<http://bugs.python.org/issue5633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11578] Increase test coverage for timeit.py

2011-03-16 Thread Michael Henry

Michael Henry  added the comment:

Issue #5633 contains two additional unit tests that can't be added until
that ticket's bug is fixed.

--
nosy: +rhettinger
resolution: accepted -> 
status: closed -> open

___
Python tracker 
<http://bugs.python.org/issue11578>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11589] Unit test extensions for email module

2011-03-17 Thread Michael Henry

New submission from Michael Henry :

The attached patch includes additional unit tests for the email module,
and splits pre-existing test_header_encode() and test_decode() functions
into individual test functions.

--
components: Library (Lib)
files: test_email_additional_tests.patch
keywords: patch
messages: 131263
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: Unit test extensions for email module
Added file: http://bugs.python.org/file21269/test_email_additional_tests.patch

___
Python tracker 
<http://bugs.python.org/issue11589>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11590] email quoprimime.py patch for header_encode of empty string, decode with different eol

2011-03-17 Thread Michael Henry

New submission from Michael Henry :

The attached patch adds unit tests and some minor fixes for the email
module's quoprimime.py file.  The header_encode() function did not
properly return an empty string when given an empty string.  The
decode() function did not properly detect the input string's EOL
character.

This patch depends on application of the patch in issue #11589.

--
components: Library (Lib)
files: quoprimime_patch_header_encode_decode.patch
keywords: patch
messages: 131265
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: email quoprimime.py patch for header_encode of empty string, decode with 
different eol
Added file: 
http://bugs.python.org/file21270/quoprimime_patch_header_encode_decode.patch

___
Python tracker 
<http://bugs.python.org/issue11590>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11606] maxlinelen exceeded by email module's body_encode() function

2011-03-19 Thread Michael Henry

New submission from Michael Henry :

The email module's body_encode() function (found in
quoprimime.py) can generate oversized encoded lines that exceed
the maximum line length specified by the maxlinelen parameter.
The attached test case
'test_encode_trailing_space_at_maxlinelen' demonstrates the
problem.  When encoding the body 'abcd \n1234' with
maxlinelen=5, the erroneous output is 'abcd =\n\n1234', with 6
characters in the first output line.

The attached patch provides unit tests and a fix for
body_encode().  

Note: This patch depends on application of the patch in Issue
#11590.

--
components: Library (Lib)
files: quoprimime_patch_body_encode.patch
keywords: patch
messages: 131407
nosy: michael.henry, r.david.murray
priority: normal
severity: normal
status: open
title: maxlinelen exceeded by email module's body_encode() function
Added file: http://bugs.python.org/file21289/quoprimime_patch_body_encode.patch

___
Python tracker 
<http://bugs.python.org/issue11606>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11606] maxlinelen exceeded by email module's body_encode() function

2011-03-24 Thread Michael Henry

Michael Henry  added the comment:

David,

Your patch looks fine to me.  I like putting the logic is a
separate class as you've done.  I looked in itertools for
something to perform the job of the each_last() generator I'd
had in my patch, but I didn't see anything.  I like the idea of
encapsulating the test logic of (index + 1 == len(sequence)) in
some way, as each_last() does, rather than having the caller
calculate it.  If that capability exists somewhere in the Python
standard library, it would be my choice to use that.  If it has
to be built just for this test, though, perhaps it's not worth
the extra lines of code to define each_last().

Michael Henry

--

___
Python tracker 
<http://bugs.python.org/issue11606>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com