Copying the value of "length" tag crashes if multiple files are selected

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 3.0.0a1, 2.14
    • Affects Version/s: None
    • Component/s: Tags & Metadata
    • None
    • Environment:
      Windows

      When running code off Master:

      1. Add two files of different length
      2. Select both files
      3. Select the vale of the length tab in the table view:
      4. Copy with ctrl-c

       

      Crash:

      Traceback (most recent call last):
        File "D:\projects\picard\picard\ui\metadatabox_init_.py", line 261, in keyPressEvent
          self._copy_value()
        File "D:\projects\picard\picard\ui\metadatabox_init_.py", line 283, in _copy_value
          value = [format_time(value or 0), ]
                   ^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\projects\picard\picard\util_init_.py", line 305, in format_time
          ms = float(ms)
               ^^^^^^^^^
      TypeError: float() argument must be a string or a real number, not 'list'

       

      Specifically, when copying the value from ~length with multiple selection, the value is [''], because the tag_diff contains multiple values, so 
      self.tag_diff.new['~length'] = ['']
       

            Assignee:
            StevilKnevil
            Reporter:
            StevilKnevil
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                3.0.0a1
                2.14