Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-613

Cannot save files when tags cause filename longer than Windows max

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 1.3
    • 1.3
    • File Move & Rename
    • None
    • Windows 8.1 pro

      I have a number of flac files with long tags which would result in file addresses too long for Windows to support. When trying to save the tags Picard is trying to rename the files. The rename action is failing, resulting in the following debug logs:

      D: 11:27:02 Saving file u'M:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore & Trial by Jury (Glyndebourne Festival Chorus\\1-06 H.M.S. Pinafore; Act I. \u201cThe nightingale sighed for the moon\u2019s bright.flac'
      D: 11:27:04 Moving file u'M:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore & Trial by Jury (Glyndebourne Festival Chorus\\1-06 H.M.S. Pinafore; Act I. \u201cThe nightingale sighed for the moon\u2019s bright.flac' => u'C:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore _ Trial by Jury (Glyndebourne Festival Chorus, Pro Arte Orchestra feat. conductor_ Sir Malcolm Sargent)\\1-06 H.M.S. P. \u201cThe nightingale sighed for the moon\u2019s bright ray\u201d (Ralph, Sailors, Buttercup).flac'
      E: 11:27:04 Traceback (most recent call last):
        File "picard\util\thread.pyo", line 46, in run
        File "picard\file.pyo", line 180, in _save_and_rename
        File "picard\file.pyo", line 322, in _rename
        File "shutil.pyo", line 301, in move
        File "shutil.pyo", line 130, in copy2
        File "shutil.pyo", line 83, in copyfile
      IOError: [Errno 2] No such file or directory: u'C:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore _ Trial by Jury (Glyndebourne Festival Chorus, Pro Arte Orchestra feat. conductor_ Sir Malcolm Sargent)\\1-06 H.M.S. P. \u201cThe nightingale sighed for the moon\u2019s bright ray\u201d (Ralph, Sailors, Buttercup).flac'
      

      If you look carefully in the destination path it says H.M.S. P. rather than H.M.S. Pinafore in the track name. I don't know if this is significant.

      The save works correctly for shorter named files and the track name doesn't appear to get corrupted:

      D: 11:30:27 Saving file u'M:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore & Trial by Jury (Glyndebourne Festival Chorus\\1-08 H.M.S. Pinafore; Act I. \u201cMy gallant crew, good morning\u201d (Captain Corcoran, Sailors).flac'
      D: 11:30:28 Moving file u'M:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore & Trial by Jury (Glyndebourne Festival Chorus\\1-08 H.M.S. Pinafore; Act I. \u201cMy gallant crew, good morning\u201d (Captain Corcoran, Sailors).flac' => u'C:\\__classical_musicbrainz\\Gilbert & Sullivan\\H.M.S. Pinafore _ Trial by Jury (Glyndebourne Festival Chorus, Pro Arte Orchestra feat. conductor_ Sir Malcolm Sargent)\\1-08 H.M.S. Pinafore_ Act I. \u201cMy gallant crew, good morning\u201d (Captain Corcoran, Sailors).flac'
      D: 11:30:29 Updating file <File u'1-08 H.M.S. Pinafore_ Act I. \u201cMy gallant crew, good morning\u201d (Captain Corcoran, Sailors).flac'>
      

      My "Name files like this" setting is as follows:

      $if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2)$if(%compilation%, %artist% -,) %title%
      

      Track metadata:
      Title: H.M.S. Pinafore: Act I. "The nightingale sighed for the moon's bright ray" (Ralph, Sailors, Buttercup)
      Artist: Gilbert & Sullivan
      Track: H.M.S. Pinafore / Trial by Jury (Glyndebourne Festival Chorus, Pro Arte Orchestra feat. conductor: Sir Malcolm Sargent)
      Disc Number: 1
      Track Number 6

      I have reproduced this issue using the nightly from here: http://build.oxygene.sk/job/package-picard-win-daily/lastSuccessfulBuild/artifact/installer/picard-setup-1.3.0dev4_win_20140615095934.exe

            xlotlu Ionuț Ciocîrlan
            uniquereplica Steve Read
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                1.3