Skip to content

Import profile: support multiple skip_dir/skip_file entries #65

@mjbogusz

Description

@mjbogusz

As per the onedrive usage docs, the skip_dir and skip_file entries can be specified multiple times.

Right now OneDriveGUI fails to parse such a config with no GUI-visible error, only with a traceback on the console:

Traceback (most recent call last):
  File "/tmp/.mount_OneDriuGuN24//usr/src/OneDriveGUI.py", line 783, in import_profile
    _new_od_config = read_config(config_path)
  File "/tmp/.mount_OneDriuGuN24//usr/src/OneDriveGUI.py", line 2774, in read_config
    config.read_string(config_string)
  File "/tmp/.mount_OneDriuGuN24/usr/lib/python3.8/configparser.py", line 723, in read_string
    self.read_file(sfile, source)
  File "/tmp/.mount_OneDriuGuN24/usr/lib/python3.8/configparser.py", line 718, in read_file
    self._read(f, source)
  File "/tmp/.mount_OneDriuGuN24/usr/lib/python3.8/configparser.py", line 1093, in _read
    raise DuplicateOptionError(sectname, optname,
configparser.DuplicateOptionError: While reading from '<string>' [line 12]: option 'skip_dir' in section 'onedrive' already exists

A simple workaround is to merge the multiple lines with a pipe (|) as per the docs linked above - this allows the profile to be imported successfully.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions