Skip to content

Fix FilePath creation on Python 3.12#288

Draft
Mirochill wants to merge 1 commit into
Nekmo:masterfrom
Mirochill:fix-249-filepath-python312
Draft

Fix FilePath creation on Python 3.12#288
Mirochill wants to merge 1 commit into
Nekmo:masterfrom
Mirochill:fix-249-filepath-python312

Conversation

@Mirochill

Copy link
Copy Markdown

Fixes #249.

Summary

  • replace the private Path._from_parts() call in FilePath.__new__
  • delegate FilePath construction to Path.__new__, which works with pathlib internals on Python 3.12+
  • keep the existing FilePath dispatch to WindowsFilePath / PosixFilePath

Validation

  • Not run locally.
  • git diff --check
  • git show --check HEAD
  • rg -n "_from_parts|_flavour|Path\.__new__|class FilePath" telegram_upload\caption_formatter.py tests\test_caption_formatter.py

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.

--caption is broken with python 3.12

1 participant