[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2020-06-23 Thread SilentGhost


Change by SilentGhost :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2020-06-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2 is EOL, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2018-03-27 Thread Bob Hossley

Bob Hossley  added the comment:

Mike,

Thank you.

I moved to Python 3 some time ago.  I confirm that Python 3 does not
have the problem.  But I can't conveniently verify your workaround for
Python 2.

Regards,
Bob
bhoss...@ieee.org

On 2018-03-27 11:30 AM, Mike Edmunds wrote:
> 
> Mike Edmunds  added the comment:
> 
> Here's a workaround for Python 2.7:
> 
> ```
> class HeaderBugWorkaround(email.header.Header):
> def encode(self, splitchars=' ', **kwargs):  # only split on spaces, 
> rather than splitchars=';, '
> return email.header.Header.encode(self, splitchars, **kwargs)
> 
> # and then...
> 
> msg['Subject'] = HeaderBugWorkaround(subject, 'utf-8', header_name='Subject')
> 
> ```
> 
> (If you have the option, you're almost certainly better off moving to Python 
> 3 for anything email related. But if you're maintaining code that has to be 
> Python 2.7 compatible, this might help.)
> 
> --
> nosy: +medmunds
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2018-03-27 Thread Mike Edmunds

Mike Edmunds  added the comment:

Here's a workaround for Python 2.7:

```
class HeaderBugWorkaround(email.header.Header):
def encode(self, splitchars=' ', **kwargs):  # only split on spaces, rather 
than splitchars=';, '
return email.header.Header.encode(self, splitchars, **kwargs)

# and then...

msg['Subject'] = HeaderBugWorkaround(subject, 'utf-8', header_name='Subject')

```

(If you have the option, you're almost certainly better off moving to Python 3 
for anything email related. But if you're maintaining code that has to be 
Python 2.7 compatible, this might help.)

--
nosy: +medmunds

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2016-09-09 Thread R. David Murray

R. David Murray added the comment:

No, that is python3 code, it doesn't work on python2.  There's no workaround 
other than to back port the fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2016-09-09 Thread Matthew Jacobi

Matthew Jacobi added the comment:

Is there a workaround for this for people on python2? 
Would installing https://pypi.python.org/pypi/email/6.0.0a1 fix it?

> testing release of email6

> This is a standalone version of the version of email package that will ship 
> with Python 3.3. This version can be installed and run under Python3.2. It is 
> intended as a platform for testing the new code, but its final release should 
> also be useable to get the features of the new package under Python 3.2.

--
nosy: +Matthew Jacobi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2015-09-28 Thread R. David Murray

R. David Murray added the comment:

This is fixed in Python3.  The fix was part of a large change to the header 
folding algorithm, and I'm not sure it is appropriate to backport it.  I'm 
guessing we would, though, if someone wants to do the work for the backport.  
The relevant issue is issue 11492.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2015-09-28 Thread Bob Hossley

New submission from Bob Hossley:

In my function makeMsg(), there is:

msg = email.mime.nonmultipart.MIMENonMultipart('text',
'plain', charset='utf-8')
msg['Subject'] = email.header.Header(subject, 'utf-8')

subject has no space after the thousands comma:

u'1,010 words - "The Blackmail Caucus, a.k.a. the Republican Party" By Paul 
Krugman'


But

msg['Subject'].__str__()

'1, 010 words - "The Blackmail Caucus,\n a.k.a. the Republican Party" By Paul 
Krugman'

has a space after the thousands comma and the email message later generated has 
a space after the thousands comma.

This is objectionable.

Note that the email library also inserts a newline after the comma that is 
followed by a space.  Since I see no effect of this newline on the email 
generated, I have no objection to the newline.

--
components: email
messages: 251782
nosy: SegundoBob, barry, r.david.murray
priority: normal
severity: normal
status: open
title: In subject line email library inserts unwanted space after a thousands 
comma in a number
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2015-09-28 Thread Bob Hossley

Bob Hossley added the comment:

Thank you R. David Murray.

I look forward to being able to move my application to Python 3.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com