Outdated info about encoding in "datetime" #99032
Copy link
Copy link
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
In the datetime docs, there's a Technical Detail note that seems to say that strftime() will return an encoded string (i.e. bytes), but actually it returns a Unicode string as of Python 3.0 (i.e. str).
- Because the format depends on the current locale, care should be taken when making assumptions about the output value. Field orderings will vary (for example, “month/day/year” versus “day/month/year”), and the output may contain Unicode characters encoded using the locale’s default encoding (for example, if the current locale is
ja_JP, the default encoding could be any one ofeucJP,SJIS, orutf-8; uselocale.getlocale()to determine the current locale’s encoding).
(I jumped the gun by submitting a PR for this (#93365) before an issue.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
- StatusShow more project fieldsDone
Activity
gh-99032: datetime docs: Encoding is no longer relevant (#93365)
pythongh-99032: datetime docs: Encoding is no longer relevant (python…
Merge branch 'main' into superopt
Merge branch 'superopt' into superopt_spec
[3.11] gh-99032: datetime docs: Encoding is no longer relevant (GH-93365
JelleZijlstra commentedon Apr 29, 2023
All PRs merged, thank you!