[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Here's an updated patch.

--
nosy: +berker.peksag
stage:  - patch review
type: behavior - enhancement
versions: +Python 3.5 -Python 3.2
Added file: http://bugs.python.org/file36737/issue16324_v2.diff

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



[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread R. David Murray

R. David Murray added the comment:

The updated patch looks good to me.  Go ahead and commit it.

--

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



[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d43d4d4ebf2c by Berker Peksag in branch 'default':
Issue #16324: _charset parameter of MIMEText now also accepts 
email.charset.Charset instances.
https://hg.python.org/cpython/rev/d43d4d4ebf2c

--
nosy: +python-dev

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



[issue16324] MIMEText __init__ does not support Charset instance

2014-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Claude and thanks for the review, David!

--
assignee:  - berker.peksag
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-26 Thread Claude Paroz

Changes by Claude Paroz cla...@2xlibre.net:


--
keywords: +patch
Added file: http://bugs.python.org/file27726/issue16324-1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread Claude Paroz

New submission from Claude Paroz:

When initializing a MIMEText instance, it might be desirable to set the 
_charset parameter to a real Charset instance, not only a charset identifier 
(for example to pass a Charset with customized body_encoding). Unfortunately, 
this is failing:

  File .../django/core/mail/message.py, line 128, in __init__
MIMEText.__init__(self, text, subtype, charset)
  File /usr/lib/python3.2/email/mime/text.py, line 29, in __init__
**{'charset': _charset})
  File /usr/lib/python3.2/email/mime/base.py, line 25, in __init__
self.add_header('Content-Type', ctype, **_params)
  File /usr/lib/python3.2/email/message.py, line 475, in add_header
parts.append(_formatparam(k.replace('_', '-'), v))
  File /usr/lib/python3.2/email/message.py, line 67, in _formatparam
if value is not None and len(value)  0:
TypeError: object of type 'Charset' has no len()

It is possible to later call set_charset, but the payload is already encoded 
(and 'Content-Transfer-Encoding' is set).
Did I miss anything?

--
components: email
messages: 173764
nosy: barry, claudep, r.david.murray
priority: normal
severity: normal
status: open
title: MIMEText __init__ does not support Charset instance
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread R. David Murray

R. David Murray added the comment:

I don't think you missed anything.  It doesn't look like this has ever worked, 
but you'd certainly think it would.  The documentation doesn't claim anything 
about it one way or another.  That probably means we should treat it as an 
enhancement rather than a bug fix, but I'm open to argument on that.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread Claude Paroz

Claude Paroz added the comment:

It's fine for me to consider it as an enhancement. The fix might be as simple 
as replacing **{'charset': _charset} by **{'charset': str(_charset)} in 
MIMEText __init__.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16324
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com