KBNLresearch / iromlab

Loader software for automated imaging of optical media with Nimbie disc robot
Apache License 2.0
31 stars 5 forks source link

Illegal filename characters in volumeIdentifier cause hang while trying to rename ISO image #99

Closed bitsgalore closed 4 years ago

bitsgalore commented 4 years ago

For one CD:

<volumeIdentifier>20/20</volumeIdentifier>

Result:

  File "f:\johan\pythonCode\iromlab\iromlab\isobuster.py", line 118, in extractData
    os.rename(isoFileTemp, isoFile)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'e:\\nimbieTest\\kb-13962c50-e5f4-11e9-911c-7446a0b42b9a\\1a749e82-e5f4-11e9-8c88-744
6a0b42b9a\\disc.iso' -> 'e:\\nimbieTest\\kb-13962c50-e5f4-11e9-911c-7446a0b42b9a
\\1a749e82-e5f4-11e9-8c88-7446a0b42b9a\\20/20.iso'

This is caused by the /character which is not allowed in a (Windows) file name.

bitsgalore commented 4 years ago

Fixed by adding exception handler (effect: file is not renamed):

https://github.com/KBNLresearch/iromlab/commit/bce4be52c91e62dc4b910357058636cc3b350008

Maybe the catch-all exception is a bit too crude here; also it would be possible to filter/replace illegal chars.