Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2049

Skip malformed local configuration files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 4.4.2
    • Component/s: Configuration
    • Tags:
    • Sprint:
      nxDrive 11.1.29
    • Story Points:
      1

      Description

      Error

      Command line arguments:

      uninstall
      

      Exception:

      Traceback (most recent call last):
        File "nxdrive\__main__.py", line 117, in main
        File "nxdrive\commandline.py", line 481, in handle
        File "nxdrive\commandline.py", line 392, in parse_cli
        File "nxdrive\commandline.py", line 433, in load_config
        File "configparser.py", line 696, in read
        File "configparser.py", line 1079, in _read
      configparser.MissingSectionHeaderError: File contains no section headers.
      file: 'C:\\Users\\Windows10\\.nuxeo-drive\\config.ini', line: 1
      '[DEFAULT]\n'
      

      Analysis

      ▶ file config.ini 
      config.ini: UTF-8 Unicode (with BOM) text, with CRLF line terminators
      

      Fix

      This is a 2 steps fix:

      1. The config file should be opened with a specified encoding (UTF-8, always) (see https://stackoverflow.com/a/1648865/1117028).
      2. We should skip any errors and print a warning with the stacktrace.

        Attachments

        1. fix.patch
          1 kB
        2. config.ini
          0.1 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m