L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
122 stars 22 forks source link

Json decode Error: quotes are not escaped. #82

Closed raumen837 closed 3 years ago

raumen837 commented 4 years ago

While rendering a new Version of my map i getting this error:

Exception in thread Thread-5: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "auto.py", line 662, in refZoom ref(outFolder, timestamp, surface, daytime, args.basepath, args) File "/home/linuxadmin/code/make/factorio/mods/L0laapk3_FactorioMaps_4.1.0/ref.py", line 120, in ref data = json.load(f) File "/usr/lib/python3.8/json/__init__.py", line 293, in load return loads(fp.read(), File "/usr/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 76485 (char 76484)

So after some checking i found the problem. part of mapinfo.json:

{"nauvis":{"spawn":{"y":0,"x":0},"zoom":{"min":14,"max":21},"tags":[{"iconType":"virtual","iconName":"signal-info","iconPath":"Images/labels/virtual/signal-info.png","position":{"y":-55.90625,"x":-129.65234375},"text":"deadlock! Cause of "No path" as trains can't go back.","last_user":"removed","force":"player"}],"hidden":false,"captured":true,"links":[],"playerPosition":{"y":-38.26953125,"x":17.90625},"day":true}}}],"defaultSurface":"nauvis"}

there is no escape for the quots in "text":"deadlock! Cause of "No path" as trains can't go back."