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.

classification
Title: [doc] open() function errors='surrogateescape' has inaccurate information
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bupjae2, docs@python, lukasz.langa, meowmeowmeowcat, miss-islington
Priority: normal Keywords: patch

Created on 2021-06-28 13:06 by bupjae2, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27650 merged meowmeowmeowcat, 2021-08-07 07:39
PR 27681 merged miss-islington, 2021-08-09 14:15
PR 27682 merged miss-islington, 2021-08-09 14:15
Messages (8)
msg396632 - (view) Author: Bupjae Lee (bupjae2) Date: 2021-06-28 13:06
https://docs.python.org/3/library/functions.html#open

error parameter of open() function says this:

'surrogateescape' will represent any incorrect bytes as code points in the Unicode Private Use Area ranging from U+DC80 to U+DCFF.


However, U+DC80 to U+DCFF doesn't belong to "Unicode Private Use Area"; it belongs to "Low Surrogate Area".



Suggested fix:

'surrogateescape' will represent any incorrect bytes as (unpaired) low surrogate code units ranging from U+DC80 to U+DCFF.
msg399170 - (view) Author: meowmeowcat (meowmeowmeowcat) * Date: 2021-08-07 06:51
Thanks!

Confirmed by: https://docs.python.org/3/library/codecs.html#error-handlers

I'll open a PR for this.
msg399245 - (view) Author: Bupjae Lee (bupjae2) Date: 2021-08-08 23:07
I just noticed that very next sentence, "These private code points will then be turned back...", also needs to be fixed.

Suggested fix:

"These surrogate code units will then be turned back..."
msg399250 - (view) Author: meowmeowcat (meowmeowmeowcat) * Date: 2021-08-09 07:45
Oh, I missed this too. I'll fix it.
msg399268 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-09 14:15
New changeset b05e9b63fcfcd4bd7a6434fa9f9a7028d12f91c4 by meowmeowmeowcat in branch 'main':
bpo-44522: Fix inaccurate information in open() function (GH-27650)
https://github.com/python/cpython/commit/b05e9b63fcfcd4bd7a6434fa9f9a7028d12f91c4
msg399270 - (view) Author: miss-islington (miss-islington) Date: 2021-08-09 14:35
New changeset c79aa427c0b0c8a09e5c22a5420baf837054f509 by Miss Islington (bot) in branch '3.10':
bpo-44522: Fix inaccurate information in open() function (GH-27650)
https://github.com/python/cpython/commit/c79aa427c0b0c8a09e5c22a5420baf837054f509
msg399271 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-09 14:39
New changeset 037ef8d6d9cc8225d6db0305cee2d8d0ee5bee74 by Miss Islington (bot) in branch '3.9':
bpo-44522: Fix inaccurate information in open() function (GH-27650) (GH-27682)
https://github.com/python/cpython/commit/037ef8d6d9cc8225d6db0305cee2d8d0ee5bee74
msg399272 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-09 14:40
Thanks, meowmeowcat! ✨ 🍰 ✨
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88688
2021-08-09 14:40:25lukasz.langasetstatus: open -> closed
versions: - Python 3.6, Python 3.7, Python 3.8
messages: + msg399272

resolution: fixed
stage: patch review -> resolved
2021-08-09 14:39:39lukasz.langasetmessages: + msg399271
2021-08-09 14:35:14miss-islingtonsetmessages: + msg399270
2021-08-09 14:15:12miss-islingtonsetpull_requests: + pull_request26167
2021-08-09 14:15:04miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26166
2021-08-09 14:15:02lukasz.langasetnosy: + lukasz.langa
messages: + msg399268
2021-08-09 07:45:49meowmeowmeowcatsetmessages: + msg399250
2021-08-08 23:07:54bupjae2setmessages: + msg399245
2021-08-07 07:39:13meowmeowmeowcatsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26144
2021-08-07 06:51:20meowmeowmeowcatsetnosy: + meowmeowmeowcat
messages: + msg399170
2021-06-28 13:06:46bupjae2create