mfuentesg / SyncSettings

Sync Settings - The cross-platform solution to keep Sublime Text configuration synchronized
https://mfuentesg.dev/SyncSettings
MIT License
288 stars 38 forks source link

Sync Setting: Download error no json object could be decoded #121

Closed bfrontend closed 5 years ago

bfrontend commented 5 years ago

Traceback (most recent call last): File "C:\Users\17625\AppData\Roaming\Sublime Text 3\Installed Packages\Sync Settings.sublime-package\sync_settings/commands/download.py", line 50, in download manager.get_content(path.join(self.temp_folder, path.encode('Package Control.sublime-settings'))) File "./python3.3/json/init.py", line 316, in loads File "./python3.3/json/decoder.py", line 351, in decode File "./python3.3/json/decoder.py", line 369, in raw_decode ValueError: No JSON object could be decoded

earhax commented 5 years ago

I'm also seeing this issue, on Windows 10 Enterprise. Hope to see a fix soon!

mfuentesg commented 5 years ago

i was able to reproduce the issue, deleting Package Control.sublime-settings file from my personal gist.

i am not sure why you are ignoring that file, because the idea is synchronize your installed packages between multiple machines.

dialex commented 3 years ago

I still have this issue.

Steps:

  1. Mac: Install Sublime Text and Sync Settings plugin
  2. Mac: Customise it
  3. Mac: Save settings to gist using plugin
  4. Win: Install Sublime Text and Sync Settings plugin
  5. Win: Configure Sync Settings
  6. Win: Download settings

And that's when I get an error

image

And this is the gist created by the plugin: https://gist.github.com/dialex/06912984f5d0269351a0fb65f7d94015

mfuentesg commented 3 years ago

@dialex i tried with your gist, but i didn't faced the issue, are you sure that you have the latest version of SyncSettings?

Latest version v3.2.0

image

dialex commented 3 years ago

Yup, that's the version I have. I'm not sure what else I can do differently :/ Does it help to share the logs?

ERROR:Sync Settings.sync_settings.libs.logger:No JSON object could be decoded
Traceback (most recent call last):
  File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\diale\AppData\Roaming\Sublime Text 3\Installed Packages\Sync Settings.sublime-package\sync_settings/commands/download.py", line 52, in download
    package_settings = file.encode_json('{}' if file_content == '' else file_content)
  File "C:\Users\diale\AppData\Roaming\Sublime Text 3\Installed Packages\Sync Settings.sublime-package\sync_settings/libs/file.py", line 16, in encode_json
    return json.loads(re.sub(re.compile(r"(?:(?:^\s*)|\s+)//.*$", re.MULTILINE), "", decoded))
  File "./python3.3/json/__init__.py", line 316, in loads
  File "./python3.3/json/decoder.py", line 351, in decode
  File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
ERROR:Sync Settings.sync_settings.libs.logger:No JSON object could be decoded
Traceback (most recent call last):
  File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\diale\AppData\Roaming\Sublime Text 3\Installed Packages\Sync Settings.sublime-package\sync_settings/commands/download.py", line 52, in download
    package_settings = file.encode_json('{}' if file_content == '' else file_content)
  File "C:\Users\diale\AppData\Roaming\Sublime Text 3\Installed Packages\Sync Settings.sublime-package\sync_settings/libs/file.py", line 16, in encode_json
    return json.loads(re.sub(re.compile(r"(?:(?:^\s*)|\s+)//.*$", re.MULTILINE), "", decoded))
  File "./python3.3/json/__init__.py", line 316, in loads
  File "./python3.3/json/decoder.py", line 351, in decode
  File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
ERROR:Sync Settings.sync_settings.libs.logger:No JSON object could be decoded
Traceback (most recent call last):
  File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration
mfuentesg commented 3 years ago

@dialex Please try reinstalling Sync Settings, checking the error log, it is complaining about the line 16 with the following content return json.loads(re.sub(re.compile(r"(?:(?:^\s*)|\s+)//.*$", re.MULTILINE), "", decoded)) But, checking the code that line has another code, so please, reinstall Sync Settings and let me know if you are still facing the same issue.

https://github.com/mfuentesg/SyncSettings/blob/a7dbf97870354c5e7c8f8a35643a9ea673defdf0/sync_settings/libs/file.py#L15-L24

dialex commented 3 years ago

Reinstalling Sync Settings solved the issue. Thank you for your help :)

mfuentesg commented 3 years ago

@dialex Nice to read it. Enjoy SyncSettings