Skip to content

Drop legacy Python 2 bytes support from strftime#183

Merged
slashmili merged 1 commit into
slashmili:mainfrom
5j9:type-hint
Jul 13, 2026
Merged

Drop legacy Python 2 bytes support from strftime#183
slashmili merged 1 commit into
slashmili:mainfrom
5j9:type-hint

Conversation

@5j9

@5j9 5j9 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Removes the Python 2 compatibility layer that decoded byte strings in date.strftime(). Because the library now targets Python 3.9+, standard string formatting applies, and passing bytes format specifiers is no longer supported.

  • Remove redundant .decode('utf-8') try/except block in date.strftime()
  • Remove test_strftime_unicode which passed bytes (b'...') to strftime

Removes the Python 2 compatibility layer that decoded byte strings in
`date.strftime()`. Because the library now targets Python 3.9+, standard
string formatting applies, and passing bytes format specifiers is no
longer supported.

- Remove redundant `.decode('utf-8')` try/except block in
  `date.strftime()`
- Remove `test_strftime_unicode` which passed bytes (`b'...'`) to
  `strftime`
@slashmili
slashmili merged commit 1eb517f into slashmili:main Jul 13, 2026
13 checks passed
@slashmili

Copy link
Copy Markdown
Owner

Thanks!

@slashmili

Copy link
Copy Markdown
Owner

Published as 6.0.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants