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

Trello Card Name sanitisation not working properly on Windows #29

Open
FabianWildgrube opened this issue Sep 23, 2019 · 1 comment
Open

Comments

@FabianWildgrube
Copy link

Card names that contain the character " are not sanitised, which causes an error when calling mkdir on windows. (Windows 10 in my case, running the script installed via pip)

A simple fix would be to add " in the regex in line 46 in backup.py like so:

return re.sub(r'[<>:\/\|\?\*\'"]', '_', name)[:FILE_NAME_MAX_LENGTH]

Test run on my system worked fine with this fix.

Cheers

@eyaler
Copy link

eyaler commented Dec 29, 2019

need to add also \\

return re.sub(r'[<>:\/\|\?\*\'"\\]', '_', name)[:FILE_NAME_MAX_LENGTH]

otherwise i get eg.:

Traceback (most recent call last):
File "c:\anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\anaconda3\scripts\trello-full-backup.exe_main
.py", line 7, in
File "c:\anaconda3\lib\site-packages\trello_full_backup_init
.py", line 5, in main
cli()
File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 318, in cli
backup_board(board, args)
File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 175, in backup_board
backup_card(id_card, c, args.attachment_size, tokenize)
File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 111, in backup_card
mkdir(card_name)
File "c:\anaconda3\lib\site-packages\trello_full_backup\backup.py", line 28, in mkdir
os.mkdir(name)
FileNotFoundError: [WinError 3] The system cannot find the path specified: '1_לבדוק_BCA - להציע סדנאות \ קורס'

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

2 participants