MCPcopy Index your code
hub / github.com/python/cpython / _decode_string

Method _decode_string

Lib/pickle.py:1461–1468  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

1459 dispatch[BINFLOAT[0]] = load_binfloat
1460
1461 def _decode_string(self, value):
1462 # Used to allow strings from Python 2 to be decoded either as
1463 # bytes or Unicode strings. This should be used only with the
1464 # STRING, BINSTRING and SHORT_BINSTRING opcodes.
1465 if self.encoding == "bytes":
1466 return value
1467 else:
1468 return value.decode(self.encoding, self.errors)
1469
1470 def load_string(self):
1471 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