This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: test_email failed
Type: Stage:
Components: Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, christian.heimes, loewis, pterk, xyb
Priority: normal Keywords: rfe

Created on 2007-09-02 12:14 by xyb, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
msg_15.txt pterk, 2007-09-02 13:34
Messages (4)
msg55583 - (view) Author: xyb (xyb) * Date: 2007-09-02 12:14
test test_email failed -- Traceback (most recent call last):
  File "/home/xyb/Python-3.0a1/Lib/email/test/", line 1445,
in test_same_boundary_inner_outer
    msg = self._msgobj('msg_15.txt')
  File "/home/xyb/Python-3.0a1/Lib/email/test/", line 67,
in _msgobj
    return email.message_from_file(fp)
  File "/home/xyb/Python-3.0a1/Lib/email/", line 46, in
    return Parser(*args, **kws).parse(fp)
  File "/home/xyb/Python-3.0a1/Lib/email/", line 68, in parse
    data =
  File "/home/xyb/Python-3.0a1/Lib/", line 1231, in read
    readahead, pending = self._read_chunk()
  File "/home/xyb/Python-3.0a1/Lib/", line 1127, in _read_chunk
    pending = self._decoder.decode(readahead, not readahead)
  File "/home/xyb/Python-3.0a1/Lib/", line 291, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbe in position 86:
unexpected code byte
msg55584 - (view) Author: Peter van Kampen (pterk) Date: 2007-09-02 13:34
Attached is msg_15.txt encoded in utf-8.
>>> f ='Lib/email/test/data/msg_15.txt', 'r',
>>> s =
>>> f.close()
>>> f = open('Lib/email/test/data/msg_15.txt','w')
>>> f.write(s)
>>> f.close()

$ ./python Lib/test/ test_email
1 test OK.
msg55592 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-09-02 20:16
I don't think recoding the message is the right thing to do. Instead,
the email package should be fixed to not treat the bytes before the
first part of a multipart message as text, or else assume that it is
Latin-1 encoded (it's certainly not *meant* to be text to be shown to
the user - it's a fallback for MUAs which don't support MIME (whether it
then is a smart thing to Danish with Latin-1 is a different question))
msg57248 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-08 14:08
Fixed about two weeks ago
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45427
2007-11-08 14:08:18christian.heimessetstatus: open -> closed
nosy: + christian.heimes
resolution: fixed
messages: + msg57248
keywords: + rfe
2007-09-17 07:53:59jafosetpriority: normal
2007-09-02 20:16:46loewissetassignee: barry
messages: + msg55592
nosy: + barry, loewis
2007-09-02 13:34:08pterksetfiles: + msg_15.txt
nosy: + pterk
messages: + msg55584
2007-09-02 12:14:29xybcreate