Ticket #4570 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

Windows: Error when adding PDF where metadata contains illegal path components

Reported by: emeraldtears Owned by: john
Priority: major Milestone:
Component: PDF Input Version: trunk
Keywords: ntfs filename path space metadata Cc:

Description

Encountered when adding a PDF with existing metadata:

ERROR: ERROR: Unhandled exception: <b>WindowsError</b>:[Error 3] The system cannot find the path specified: u'X:\\Calibre Library\\mariana .\\Zaha_Hadid (274)'

Traceback (most recent call last):
  File "site-packages\calibre\gui2\library.py", line 671, in setData
  File "site-packages\calibre\library\database2.py", line 1117, in set
  File "site-packages\calibre\library\database2.py", line 1221, in set_title
  File "site-packages\calibre\library\database2.py", line 757, in set_path
  File "os.py", line 157, in makedirs
WindowsError: [Error 3] The system cannot find the path specified: u'X:\\Calibre Library\\mariana .\\Zaha_Hadid (274)'

Cause: metadata contains "author" string that is used in the automatic creation of file path, however the string is not legal to use in the filesystem.

Detail: "author" string in metadata is "mariana ." - using NTFS under Windows Vista 32-bit, the string is automatically and silently truncated to "mariana"; the string created in the filesystem is now different from what Calibre has in the database, causing errors when working with the object. Similarly, one could create this scenario by changing metadata for an object already in the Calibre database, requiring manual intervention to fix.

Workaround: when this is encountered, the user must manually alter file metadata before inserting the object into Calibre.

Recommendation: check, on add and on change, for illegal strings present in any metadata string that will be used as a part of the file path before committing the change.

Using Calibre 0.6.33 on Windows Vista 32-bit SP2.

Change History

comment:1 Changed 8 months ago by kovidgoyal

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in branch trunk. The fix will be in the next release.

Note: See TracTickets for help on using tickets.