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: Remove sys.setdefaultencoding()
Type: behavior Stage: resolved
Components: Interpreter Core, Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, eric.araujo, ezio.melotti, lemburg, pitrou, vstinner
Priority: low Keywords:

Created on 2010-08-09 19:50 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg113461 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-08-09 19:50
The use of sys.setdefaultencoding() has always been discouraged, and it has become a no-op in py3k (the encoding is hard-wired to utf-8 and changing it raises an error). It is time to remove this function entirely.

The state of PyUnicode_SetDefaultEncoding() should be also considered, since it has become useless for the same reasons.
msg113468 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-08-09 20:39
Antoine Pitrou wrote:
> 
> New submission from Antoine Pitrou <pitrou@free.fr>:
> 
> The use of sys.setdefaultencoding() has always been discouraged, and it has become a no-op in py3k (the encoding is hard-wired to utf-8 and changing it raises an error). It is time to remove this function entirely.
> 
> The state of PyUnicode_SetDefaultEncoding() should be also considered, since it has become useless for the same reasons.

+1 on removing both.
msg113528 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-10 12:21
Is it possible to add a deprecation warning in 2.7 too? If not, at least a recommendation not to use it in the 2.7 docs? I am willing to write one or two paragraphs to explain why it’s a terrible idea.
msg115318 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-09-01 16:30
Ok to remove it from Python 3.2. I don't think that it is necessary to update Python 2.7 code/doc.
msg115324 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-01 18:56
Done in r84397.
History
Date User Action Args
2022-04-11 14:57:05adminsetgithub: 53758
2010-09-01 18:56:18pitrousetstatus: open -> closed
versions: - Python 3.3
messages: + msg115324

resolution: fixed
stage: needs patch -> resolved
2010-09-01 17:33:27Arfreversetnosy: + Arfrever
2010-09-01 16:30:58vstinnersetmessages: + msg115318
2010-09-01 14:40:21pitrousetnosy: + vstinner
2010-08-10 12:21:37eric.araujosetnosy: + eric.araujo
messages: + msg113528
2010-08-09 20:39:41lemburgsetnosy: + lemburg
messages: + msg113468
2010-08-09 19:51:54ezio.melottisetnosy: + ezio.melotti
2010-08-09 19:50:51pitroucreate