Title: Outdated info about encoding in "datetime" · Issue #99032 · python/cpython · GitHub
Open Graph Title: Outdated info about encoding in "datetime" · Issue #99032 · python/cpython
X Title: Outdated info about encoding in "datetime" · Issue #99032 · python/cpython
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 c...
Open Graph 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. s...
X 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....
Opengraph URL: https://github.com/python/cpython/issues/99032
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Outdated info about encoding in \"datetime\"","articleBody":"In the `datetime` docs, there's a [Technical Detail](https://docs.python.org/3/library/datetime.html#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`).\r\n\r\n\u003e 1. 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 of `eucJP`, `SJIS`, or `utf-8`; use `locale.getlocale()` to determine the current locale’s encoding).\r\n\r\n---\r\n\r\n(I jumped the gun by submitting a PR for this (#93365) before an issue.)\n\n\u003c!-- gh-pr-number: gh-93365 --\u003e\n* PR: gh-93365\n\u003c!-- /gh-pr-number --\u003e\n\n\n\u003c!-- gh-pr-number: gh-103788 --\u003e\n* PR: gh-103788\n\u003c!-- /gh-pr-number --\u003e\n","author":{"url":"https://github.com/wjandrea","@type":"Person","name":"wjandrea"},"datePublished":"2022-11-02T23:53:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/99032/cpython/issues/99032"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a67f9ea7-0d86-adeb-1636-0c4193b6de0f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E944:31CE75:263734:32083A:6969795F |
| html-safe-nonce | 84e19a358296ce4a308971281c33a96ebb8803f3809748c6677371e09bebedf0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTQ0OjMxQ0U3NToyNjM3MzQ6MzIwODNBOjY5Njk3OTVGIiwidmlzaXRvcl9pZCI6IjUwMjI0MDU2MzgxMDkxMDAzODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e0635c9c1ae2ae69a70c12ad648aea1e07607852a602445deb65dc4f2aa2b384 |
| hovercard-subject-tag | issue:1433927887 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/99032/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f18be42ec20357d56d87eac6ca6ffb243aefa62b9c8a4db1a320d71aa6890d57/python/cpython/issues/99032 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f18be42ec20357d56d87eac6ca6ffb243aefa62b9c8a4db1a320d71aa6890d57/python/cpython/issues/99032 |
| og:image:alt | 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. s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wjandrea |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 212e3e3d3298bf5b313830edfd2399e869f7ea76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width