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

Function nts

tools/python-3.11.9-amd64/Lib/tarfile.py:168–174  ·  view source on GitHub ↗

Convert a null-terminated bytes object to a string.

(s, encoding, errors)

Source from the content-addressed store, hash-verified

166 return s[:length] + (length - len(s)) * NUL
167
168def nts(s, encoding, errors):
169 """Convert a null-terminated bytes object to a string.
170 """
171 p = s.find(b"\0")
172 if p != -1:
173 s = s[:p]
174 return s.decode(encoding, errors)
175
176def nti(s):
177 """Convert a number field to a python number.

Callers 3

ntiFunction · 0.85
frombufMethod · 0.85
_proc_gnulongMethod · 0.85

Calls 2

findMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected