Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--caption is broken with python 3.12 #249

Open
narutojawad opened this issue Feb 27, 2024 · 0 comments
Open

--caption is broken with python 3.12 #249

narutojawad opened this issue Feb 27, 2024 · 0 comments

Comments

@narutojawad
Copy link

  • telegram-upload version:0.7.1
  • Python version:3.12
  • Operating System: Windows 10

Description

the tool works fine but when "--caption" is used it Crashes.

What I Did

Any command with (--caption) in it will crash.
telegram-upload --caption {file.name} --to "********" --force-file "File.ext "File2.ext"

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\sd\AppData\Roaming\Python\Python312\Scripts\telegram-upload.exe\__main__.py", line 7, in <module> File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\exceptions.py", line 68, in wrap return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\management.py", line 191, in upload client.send_files(to, files, delete_on_success, print_file_id, forward) File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\client\telegram_upload_client.py", line 126, in send_files message = self.send_one_file(entity, file, send_as_media, thumb=thumb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\client\telegram_upload_client.py", line 103, in send_one_file message = self._send_file_message(entity, file, thumb, progress) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\client\telegram_upload_client.py", line 58, in _send_file_message caption=file.file_caption, force_document=file.force_file, ^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\upload_files.py", line 177, in file_caption caption = formatter.format(self._caption, file=FilePath(self.path), now=datetime.datetime.now()) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\sd\AppData\Roaming\Python\Python312\site-packages\telegram_upload\caption_formatter.py", line 303, in __new__ self = cls._from_parts(args) ^^^^^^^^^^^^^^^ AttributeError: type object 'WindowsFilePath' has no attribute '_from_parts'. Did you mean: '_load_parts'?

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

No branches or pull requests

1 participant