mherrmann / mherrmann/fman

DirectoryPaneListener 'RememberSortSettings' raised error.

Open
#755 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

1 vote bug
Dominant language
Python
Stars
275
Forks
16
PR merge metrics
No merged PRs in 30d

Description

After Windows has crashed, each time I change directory, I get the following exception:

DirectoryPaneListener 'RememberSortSettings' raised error.

Traceback (most recent call last):
  File "fman\impl\plugins\plugin.py", line 301, in before_location_change
  File "C:\Users\*\AppData\Local\fman\Versions\1.7.3\Plugins\Core\core\commands\__init__.py", line 1795, in before_location_change
    self._remember_curr_sort_column()
  File "C:\Users\*\AppData\Local\fman\Versions\1.7.3\Plugins\Core\core\commands\__init__.py", line 1816, in _remember_curr_sort_column
    settings = load_json('Sort Settings.json', default={})
  File "fman\__init__.py", line 213, in load_json
  File "fman\impl\plugins\__init__.py", line 37, in load_json
  File "fman\impl\plugins\config.py", line 27, in load_json
  File "fman\impl\plugins\config.py", line 91, in load_json
  File "json\__init__.py", line 299, in load
  File "json\__init__.py", line 354, in loads
  File "json\decoder.py", line 339, in decode
  File "json\decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It was caused by Sort Settings (Windows).json file's content being only \0\0. The issue disappeared after the file was removed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/commands/init.py at _remember_curr_sort_column and the fman config load_json path shown in the traceback. Reproduce loading Sort Settings (Windows).json when its content is invalid, then determine the expected handling for that corrupted file. Done means changing directories no longer raises the reported exception after the settings file is malformed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.