MCPcopy Index your code
hub / github.com/RustPython/RustPython / nts

Function nts

Lib/tarfile.py:165–171  ·  view source on GitHub ↗

Convert a null-terminated bytes object to a string.

(s, encoding, errors)

Source from the content-addressed store, hash-verified

163 return s[:length] + (length - len(s)) * NUL
164
165def nts(s, encoding, errors):
166 """Convert a null-terminated bytes object to a string.
167 """
168 p = s.find(b"\0")
169 if p != -1:
170 s = s[:p]
171 return s.decode(encoding, errors)
172
173def nti(s):
174 """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