Commit be21d98c authored by Guido van Rossum's avatar Guido van Rossum

Use repr() on the filename in EnvironmentError.__str__(). This

displays funny characters, like spaces or control characters, more
clearly (one of my pet peeves in error messages).  Also only suppress
the filename if it is None; display it if it is '', since that would
be a genuine (illegal) filename passed in!
parent ee9306b6
......@@ -104,9 +104,9 @@ class EnvironmentError(StandardError):
self.errno, self.strerror = args
def __str__(self):
if self.filename:
if self.filename is not None:
return '[Errno %s] %s: %s' % (self.errno, self.strerror,
self.filename)
repr(self.filename))
elif self.errno and self.strerror:
return '[Errno %s] %s' % (self.errno, self.strerror)
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment