carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
436 stars 46 forks source link

Failed to export with WinError 123 #107

Closed androbey closed 3 months ago

androbey commented 4 months ago

Desktop (please complete the following information):

Describe the bug After doing lots of work the export fails with

 C:\Python312\Lib\shutil.py:448 in copy2                                                           │
│                                                                                                  │
│    445 │   │   if not follow_symlinks:                                                           │
│    446 │   │   │   flags |= _winapi.COPY_FILE_COPY_SYMLINK                                       │
│    447 │   │   try:                                                                              │
│ >  448 │   │   │   _winapi.CopyFile2(src_, dst_, flags)                                          │
│    449 │   │   │   return dst                                                                    │
│    450 │   │   except OSError as exc:                                                            │
│    451 │   │   │   if (exc.winerror == _winapi.ERROR_PRIVILEGE_NOT_HELD

│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │             dst = WindowsPath('C:/Users/muser/signal-chats/mychat/media/2023-11-04T13-41…    │ │
│ │            dst_ = 'C:\\Users\\muser\\signal-chats\\mychat\\media\\2023-11-04T13-41-08.87…    │ │
│ │           flags = 8                                                                          │ │
│ │ follow_symlinks = True                                                                       │ │
│ │             src = WindowsPath('C:/Users/muser/AppData/Roaming/Signal/attachments.noindex/62… │ │
│ │            src_ = 'C:\\Users\\muser\\AppData\\Roaming\\Signal\\attachments.noindex\\62\\62c… │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect

To reproduce Steps to reproduce the behavior. Please include the exact commands tried.

I tried to export all chats (first time) without any special arguments: sigexport ~/signal-chats

It seems to be related to how attachments are named when sent, so as I don't know which file causes the above error, I don't know how to provide further steps to reproduce. When using a sample chat with only images, the export works fine.

Is there any way I can fix this?

carderne commented 3 months ago

Added a bit of code here to skip these errors (you'll get a warning message), will release this shortly. b04bc46

Please re-install with pip install --upgrade signal-export and try again. Re-open the issue if the problem persists.