deanishe / deanishe/alfred-repos

Malformed repos settings json means you can't open the settings file with the workflow anymore

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
313
Forks
22
PR merge metrics
No merged PRs in 30d

Description

First of all, thank you for all the great work you've done with your Alfred workflows. Your python library was a huge help to me in the workflows that I've made.

---

Like https://github.com/deanishe/alfred-repos/issues/11 I had accidentally saved the repos settings file with malformed JSON. When I tried to use the `reposettings` command it no longer worked. Debugging the flow I get this error:

```
22:58:17 workflow.py:2061 DEBUG ---------- Git Repos (3.1.2) ----------
22:58:17 workflow.py:1468 DEBUG reading settings from /Users/matthew/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred-git-repos/settings.json
22:58:17 workflow.py:2080 ERROR Expecting , delimiter: line 17 column 5 (char 337)
Traceback (most recent call last):
File "/Users/matthew/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3B7A56B2-4D42-407F-98AA-B2AB1A245577/workflow/workflow.py", line 2070, in run
self.check_update()
File "/Users/matthew/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3B7A56B2-4D42-407F-98AA-B2AB1A245577/workflow/workflow.py", line 2316, in check_update
if not force and not self.settings.get('__workflow_autoupdate', True):
File "/Users/matthew/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3B7A56B2-4D42-407F-98AA-B2AB1A245577/workflow/workflow.py", line 1470, in settings
self._default_settings)
File "/Users/matthew/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3B7A56B2-4D42-407F-98AA-B2AB1A245577/workflow/workflow.py", line 827, in __init__
self._load()
File "/Users/matthew/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3B7A56B2-4D42-407F-98AA-B2AB1A245577/workflow/workflow.py", line 838, in _load
data.update(json.load(fp))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 17 column 5 (char 337)
22:58:17 workflow.py:2082 INFO for assistance, see: https://github.com/deanishe/alfred-repos/issues
22:58:17 workflow.py:2103 DEBUG ---------- finished in 0.002s ----------
```

Does the settings file actually need to be parsed to open it, or could it be separated from it?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.