[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2008-06-22 Thread Andi Albrecht

Andi Albrecht <[EMAIL PROTECTED]> added the comment:

For me this issue seems to be a duplicate of issue1645148.

In my opinion the test case that checks if headers created by strings or
Header instances are equal is incorrect. It shouldn't set the
continuation whitespace explicitly when creating a Headers instance. I
would expect that

  A) msg['aheader'] = 'a long string that breaks, but shortened here'

and

  B) msg['aheader'] = Header('a long string that breaks, but shortened
here')

result in the same output. But for A) a Header instance is initialized
in Generator._write_headers() with continuation_ws set to `\t` and for
B) the default ' ' is used (see http://bugs.python.org/msg31102).

I'm uploading a patch that modifies test_string_headerinst_eq() to what
I think it should look like with this message. Of course, this test will
fail at the moment, but maybe you agree that the Header instance in this
test should be initialized without explicitly setting continuation_ws.

--
keywords: +patch
nosy: +aalbrecht
Added file: http://bugs.python.org/file10700/py_issue1974.diff

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1974>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2008-06-23 Thread Andi Albrecht

Andi Albrecht <[EMAIL PROTECTED]> added the comment:

IMO, the best way to resolve this is to use the default continuation
whitespace when a Header class is created from a string. But I'm pretty
unsure about the default whitespace character. After having a look at a
random set of mails in my inbox it seems that in most cases a tab is
used for all headers except for the subject (excluding mails sent from
Python scripts of course...). I would prefer '\t'; it's allowed and
results in a cleaner output - but it won't solve the problem with some
email clients which was the starting point for this issue (a short note
in the docs should resolve this anyway... ;-)

But I wonder if for some reason setting headers from strings
intentionally differs from using the Header class? There are some tests
that explicitly test both cases and expect different output. In
TestLongHeaders it's

 test_long_unbreakable_lines_with_continuation()
 test_long_lines_with_different_header(self)
 test_long_received_header() [continuation_ws set to tab here]

So, what I would do is
 * remove continuation_ws keyword from Generator._write_headers()
 * make '\t' the default cont. whitespace for headers (Header class)
 * update test cases and the documentation accordingly

Do you think that this is the right way to go? Or would it break too
much code outside stdlib if the default ws changes?

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1974>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2008-06-23 Thread Andi Albrecht

Andi Albrecht <[EMAIL PROTECTED]> added the comment:

FWIW, I've uploaded a patch to codereview: 

http://codereview.appspot.com/2407

It uses a space character as Chris suggested.

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1974>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4908] adding a get_metadata in distutils

2009-01-12 Thread Andi Albrecht

Andi Albrecht  added the comment:

Is it intended that when reading PKG-INFO files the PEP 314 attributes
(provides, requires, obsoletes) are only set if version is exactly "1.1"? 

I'd expected that those attributes are available regardless of the
metadata version of the parsed file (with None as default for PKG-INFO
files < 1.1).

--
nosy: +aalbrecht

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



[issue14102] argparse: add ability to create a man page

2012-02-25 Thread Andi Albrecht

Changes by Andi Albrecht :


--
nosy: +andialbrecht

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