Skip to content

Commit c860319

Browse files
iabdalkaderdpgeorge
authored andcommitted
senml: Fix data record encoding to use binascii instead of base64.
1 parent 295a9e3 commit c860319

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

micropython/senml/senml/senml_record.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ def _build_rec_dict(self, naming_map, appendTo):
190190
if (
191191
naming_map["vd"] == "vd"
192192
): # neeed to make a distinction between json (needs base64) and cbor (needs binary)
193-
result[naming_map["vd"]] = base64.b64encode(self._value)
193+
result[naming_map["vd"]] = binascii.b2a_base64(self._value, newline=False).decode(
194+
"utf8"
195+
)
194196
else:
195197
result[naming_map["vd"]] = self._value
196198
else:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy