pytr icon indicating copy to clipboard operation
pytr copied to clipboard

Filenames - Windows compatible

Open dontobi opened this issue 2 years ago • 2 comments

Description of the bug I have been using pytr for a few days. I load the PDF's into a folder that is shared via SMB. Unfortunately I can't open some files under Windows, because they are named with characters that Windows doesn't support.

To Reproduce Steps to reproduce the behavior:

  1. Run the command pytr dl_docs <smb_dir>
  2. Open the SMB Share
  3. Try to open a file

Expected behavior The files should be saved Windows compliant.

Error log N/A

Environment

  • OS: RaspberryPiOS armv7
  • pytr version: 0.0.15

Additional context I access the SMB share with multiple Windows 10 (21H2) devices.

dontobi avatar May 17 '22 08:05 dontobi

pytr uses pathvalidate to sanitize the file path. It is currently set to auto, which means that the validation depends on the platform pytr is running on. I will make an option to use universal filepaths. The Windows/Universal characterset is pretty limited that's why I don't want to enforce it on Linux/MacOS users

marzzzello avatar May 17 '22 10:05 marzzzello

If there was a parameter, that would be great. So everyone could decide for himself what to use.

dontobi avatar May 17 '22 10:05 dontobi