keep-to-markdown icon indicating copy to clipboard operation
keep-to-markdown copied to clipboard

Error if title contains path separator

Open paolopan83 opened this issue 1 year ago • 1 comments

Under windows, If note title contains / it will result in an error. BTW I suppose also : and + are forbidden character for Windows filenames

Example of offending file

{
    "color": "DEFAULT",
    "isTrashed": false,
    "isPinned": false,
    "isArchived": false,
    "textContent": "toto pipo",
    "title": "1: 12/3/24 ",
    "userEditedTimestampUsec": 1548706696486000,
    "createdTimestampUsec": 1548706676397000
}

Error

Traceback (most recent call last):
  File "/c/MyData/temp/keep to md/keep-to-markdown.py", line 194, in <module>
    read_write_notes(args)
  File "/c/MyData/temp/keep to md/keep-to-markdown.py", line 143, in read_write_notes
    with open(f'{notespath}{filename}.md', 'w', encoding='utf-8') as mdfile:
FileNotFoundError: [Errno 2] No such file or directory: 'notes/1: 12/3/24 .md'

paolopan83 avatar Sep 19 '23 16:09 paolopan83

Othewise thanks for this nice ans simple tool thtat just saved me many hours ❤️

paolopan83 avatar Sep 19 '23 16:09 paolopan83