summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-10-30 02:17:38 +0100
committerVictor Stinner <victor.stinner@gmail.com>2012-10-30 02:17:38 +0100
commit292c835548df618983043b9698d0dc8c34adea12 (patch)
tree11ae17b994b6eaaaf5625d05839ad16af03443f9 /Doc
parent76df43de30f40b5cc1de9d36a5a083dd8bd8cb27 (diff)
downloadcpython-git-292c835548df618983043b9698d0dc8c34adea12.tar.gz
Issue #15478: Raising an OSError doesn't decode or encode the filename anymore
Pass the original filename argument to OSError constructor, instead of trying to encode it to or decode it from the filesystem encoding. This change avoids an additionnal UnicodeDecodeError on Windows if the filename cannot be decoded from the filesystem encoding (ANSI code page).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/exceptions.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 053ba562f8..ccc600537e 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -246,6 +246,12 @@ The following exceptions are the exceptions that are usually raised.
:exc:`VMSError`, :exc:`socket.error`, :exc:`select.error` and
:exc:`mmap.error` have been merged into :exc:`OSError`.
+ .. versionchanged:: 3.4
+
+ The :attr:`filename` attribute is now the original file name passed to
+ the function, instead of the name encoded to or decoded from the
+ filesystem encoding.
+
.. exception:: OverflowError