Skip to content

Fix _ftp_parse._parse_time for Python ≥ 3.15 - #606

Open
markmentovai wants to merge 1 commit into
PyFilesystem:masterfrom
markmentovai:py315_ftp_parse_time
Open

markmentovai wants to merge 1 commit into
PyFilesystem:masterfrom
markmentovai:py315_ftp_parse_time

Conversation

@markmentovai

Copy link
Copy Markdown

Type of changes

  • Bug fix

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

time.strptime processing of formats that contain %d but not %Y was deprecated in Python 3.13, and removed from Python 3.15 (python/cpython#70647). Deal with this by adding %Y and having it parse the current year, in line with prior semantics.

This fixes these tests/test_ftp_parse.py TestFTPParse tests by restoring the ability to parse the '%b %d %H:%M' time format.

  • test_decode_linux
  • test_decode_linux_sticky
  • test_decode_linux_suid
  • test_parse_time

time.strptime processing of formats that contain %d but not %Y was
deprecated in Python 3.13, and removed from Python 3.15
(python/cpython#70647). Deal with this by
adding %Y and having it parse the current year, in line with prior
semantics.

This fixes these tests/test_ftp_parse.py TestFTPParse tests by restoring
the ability to parse the '%b %d %H:%M' time format.
 - test_decode_linux
 - test_decode_linux_sticky
 - test_decode_linux_suid
 - test_parse_time

This branch has not been deployed

No deployments
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.

1 participant