Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matthewmcgarvey opened this issue Jun 12, 2021 · 0 comments

Comments

@matthewmcgarvey
Copy link

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 #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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant