canonicalwebteam.store-api 7.2.0__py3-none-any.whl → 7.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of canonicalwebteam.store-api might be problematic. Click here for more details.

@@ -14,11 +14,19 @@ password = os.getenv("REDIS_DB_PASSWORD", None)
14
14
 
15
15
  class SafeJSONEncoder(json.JSONEncoder):
16
16
  def default(self, obj):
17
- if isinstance(obj, bytes):
17
+ if isinstance(obj, (bytes, bytearray)):
18
18
  try:
19
- return obj.decode("utf-8")
19
+ return bytes(obj).decode("utf-8")
20
20
  except UnicodeDecodeError:
21
- return f"<<non-decodable-bytes ({len(obj)} bytes)>>"
21
+ return f"non-decodable-bytes ({len(obj)} bytes)"
22
+
23
+ if isinstance(obj, set):
24
+ try:
25
+ return sorted(obj)
26
+ except Exception:
27
+ return list(obj)
28
+ if isinstance(obj, tuple):
29
+ return list(obj)
22
30
  return super().default(obj)
23
31
 
24
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: canonicalwebteam.store-api
3
- Version: 7.2.0
3
+ Version: 7.3.0
4
4
  Summary:
5
5
  License: LGPL-3.0
6
6
  Author: Canonical Web Team
@@ -7,8 +7,8 @@ canonicalwebteam/store_api/dashboard.py,sha256=M5JLjTTahN-bfiVz9SuP6ahLjqEvOalwm
7
7
  canonicalwebteam/store_api/devicegw.py,sha256=i42fnc29-CF3vM_tm7mwoOjQraDhu41EDkxILle1pQ4,10627
8
8
  canonicalwebteam/store_api/publishergw.py,sha256=u2D2Y76xC8ms16XTZcUe_KmRdcyzqOV2g0aN9HYZBrQ,29702
9
9
  canonicalwebteam/stores_web_redis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- canonicalwebteam/stores_web_redis/utility.py,sha256=dsHn8Zasn3Wsq4M29igv2gLA1vmXMDo8PQduf5cF_ns,3677
11
- canonicalwebteam_store_api-7.2.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
12
- canonicalwebteam_store_api-7.2.0.dist-info/METADATA,sha256=50eC9ov7cIBDajLYmhtdPDgj_Q8LlWp4qPCFtOgD9SI,2284
13
- canonicalwebteam_store_api-7.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
14
- canonicalwebteam_store_api-7.2.0.dist-info/RECORD,,
10
+ canonicalwebteam/stores_web_redis/utility.py,sha256=W7tFZlPcuwnR8c9Jow2YTm4bwJmWf-iuOJEA0MyVT_4,3906
11
+ canonicalwebteam_store_api-7.3.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
12
+ canonicalwebteam_store_api-7.3.0.dist-info/METADATA,sha256=Mr0N90yQziuvlkIsYh6WAZ_jxjOkSUcaMgbxgts37cU,2284
13
+ canonicalwebteam_store_api-7.3.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
14
+ canonicalwebteam_store_api-7.3.0.dist-info/RECORD,,