[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 91909962d7f5 by Brett Cannon in branch 'default':
Issue #15778: Coerce ImportError.args to a string when it isn't
http://hg.python.org/cpython/rev/91909962d7f5

--
nosy: +python-dev

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brian.curtin

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

(patch added)

--
stage:  -> patch review

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Changes by Dave Malcolm :


--
keywords: +patch
Added file: http://bugs.python.org/file26988/fix-str-of-bogus-ImportError.patch

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

Sorry, it's 6825fd9b00ed

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> This appears to be due to commit 76272.

Could you give the changeset id? Revision numbers are not portable from one 
repository clone to another.

--
nosy: +pitrou

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

New submission from Dave Malcolm:

In Python 3.2 and earlier:
>>> str(ImportError(b'foo'))
"b'foo'"

In Python 3.3:
>>> str(ImportError(b'foo'))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __str__ returned non-string (type bytes)

This appears to be due to commit 76272.

I'm attaching a patch which fixes it, though perhaps ImportError should 
type-check the arguments

Motivation:
This leads to a failure of the test suite for "docutils" when run under Python 
3.3 betas, specifically:

==
ERROR: test_unicode (test_error_reporting.ErrorStringTests)
--
Traceback (most recent call last):
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/test3/test_error_reporting.py",
 line 154, in test_unicode
str(ErrorString(ImportError(self.bs
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 124, in __str__
super(ErrorString, self).__str__())
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 74, in __str__
return str(self.data)
TypeError: __str__ returned non-string (type bytes)

See 
http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/test/test_error_reporting.py?revision=7464&view=markup
 for the test code.  Arguably docutils could just pick a different exception 
subclass.

--
messages: 169042
nosy: brett.cannon, dmalcolm
priority: normal
severity: normal
status: open
title: str(ImportError(b'foo')) fails
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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