MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _decode_string

Method _decode_string

tools/python-3.11.9-amd64/Lib/pickle.py:1322–1329  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

1320 dispatch[BINFLOAT[0]] = load_binfloat
1321
1322 def _decode_string(self, value):
1323 # Used to allow strings from Python 2 to be decoded either as
1324 # bytes or Unicode strings. This should be used only with the
1325 # STRING, BINSTRING and SHORT_BINSTRING opcodes.
1326 if self.encoding == "bytes":
1327 return value
1328 else:
1329 return value.decode(self.encoding, self.errors)
1330
1331 def load_string(self):
1332 data = self.readline()[:-1]

Callers 3

load_stringMethod · 0.95
load_binstringMethod · 0.95
load_short_binstringMethod · 0.95

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected