Lines Matching defs:bytes

1867     /* maxchar exceeds 16 bit, wee need 4 bytes for unicode characters */
1870 /* in case the native representation is 2-bytes, we need to allocate a
3456 /* Decoding bytes objects is the most common case and should be fast */
3475 /* Retrieve a bytes buffer view through the PEP 3118 buffer interface */
3478 "decoding to str: need a bytes-like object, %.80s found",
3710 "use PyUnicode_AsEncodedString() to encode from str to bytes "
3773 PyObject *bytes = PyBytes_FromString(str);
3775 return bytes;
3890 /* If the codec returns a buffer, raise a warning and convert to bytes */
3896 "encoder %s returned bytearray instead of bytes; "
3911 "'%.400s' encoder returned '%.400s' instead of 'bytes'; "
4077 else { // PyOS_FSPath() guarantees its returned value is bytes or str.
4130 "path should be string, bytes, or os.PathLike, not %.200s",
4149 "path should be string, bytes, or os.PathLike, not %.200s",
4432 /* Copy back the bytes variables, which might have been modified by the
4546 /* Copy back the bytes variables, which might have been modified by the
5430 char *bytes;
5432 bytes = PyMem_RawMalloc((len + 1) * max_char_size);
5435 bytes = PyMem_Malloc((len + 1) * max_char_size);
5437 if (bytes == NULL) {
5441 char *p = bytes;
5477 PyMem_RawFree(bytes);
5480 PyMem_Free(bytes);
5502 size_t final_size = (p - bytes);
5505 bytes2 = PyMem_RawRealloc(bytes, final_size);
5508 bytes2 = PyMem_Realloc(bytes, final_size);
5515 PyMem_RawFree(bytes);
5518 PyMem_Free(bytes);
5527 /* Primary internal function which creates utf8 encoded bytes objects.
5531 maximum possible needed (4 result bytes per Unicode character), and return
5760 /* remaining bytes at the end? (size should be divisible by 4) */
5839 /* output buffer is 4-bytes aligned */
5907 /* four bytes are reserved for each surrogate */
6173 /* output buffer is 2-bytes aligned */
6246 /* two bytes are reserved for each surrogate */
6603 For UCS1 strings it's '\xxx', 4 bytes per source character.
6604 For UCS2 strings it's '\uxxxx', 6 bytes per source character.
6605 For UCS4 strings it's '\U00xxxxxx', 10 bytes per source character.
6623 /* 4 byte characters can take up 10 bytes, 2 byte characters can take up 6
6624 bytes, and 1 byte characters 4. */
6879 /* 4 byte characters can take up 10 bytes, 2 byte characters can take up 6
6880 bytes, and 1 byte characters 4. */
6997 static const char *argparse = "On;encoding error handler must return (str/bytes, int) tuple";
7122 /* subtract preallocated bytes */
7132 /* subtract preallocated bytes */
7172 /* subtract preallocated bytes */
7179 /* Directly copy bytes result to output. */
7239 bytes object directly. */
7364 /* Fast path: if it is an ASCII-only string, construct bytes object
8377 Return the size (in bytes) of this object.
8583 "character mapping must return integer, bytes or None, not %.400s",
8606 various state variables. Resize the output bytes object if not enough
8770 /* Directly copy bytes result to output. */
8776 /* Make room for all additional bytes. */
14117 Return the size of the string in memory, in bytes.