From 9f6d250f9f9a3655e5f69bd654c2d6fba920173b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 29 Apr 2009 20:06:29 +0000 Subject: [PATCH] Fix code example. Specify that the error handler is used on all relevant APIs. --- pep-0383.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pep-0383.txt b/pep-0383.txt index 5fe77cd5e..e7bf8c7f9 100644 --- a/pep-0383.txt +++ b/pep-0383.txt @@ -74,7 +74,8 @@ lone half surrogate codes U+DCxx. To convert non-decodable bytes, a new error handler "python-escape" is introduced, which produces these half surrogates. On encoding, the error handler converts the half surrogate back to the corresponding -byte. +byte. This error handler used used in any API that receives or produces +file names, command line arguments, or environment variables. The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning @@ -119,7 +120,7 @@ for accepting and returning bytes, would be written as:: dirname = dirname.decode(fse, "python-escape") for fn in os.listdir(dirname): # fn is now a str object - yield fn.encode(fse, "python-escape" + yield fn.encode(fse, "python-escape") Copyright =========