Lines Matching defs:bytes

182     /* codecs.encode, used for saving bytes in older protocols */
1264 /* If reading from a file, we need to only pull the bytes we need, since there
1269 bytes from the input stream/buffer.
1272 failure; on success, returns the number of bytes read from the file.
1359 /* Read `n` bytes from the unpickler's data source, storing the result in `buf`.
1408 "read() returned non-bytes object (%R)",
1448 /* Read `n` bytes from the unpickler's data source, storing the result in `*s`.
1456 should use this function's return value to know how many bytes you can
2150 /* How many bytes do we need? There are nbits >> 3 full
2151 * bytes of data, and nbits & 7 leftover bits. If there
2386 "serializing a bytes object larger than 4 GiB "
2406 /* Older pickle protocols do not have an opcode for pickling bytes
2408 the __reduce__ method) to permit bytes object unpickling.
2411 2 'bytes' is just an alias for 'str' (which has different
2412 parameters than the actual bytes object), we use codecs.encode
2414 Python 2 *and* the appropriate 'bytes' object when unpickled
4611 Returns size in memory, in bytes.
4712 bytes argument. It can thus be a file object opened for binary
5216 /* s contains x bytes of an unsigned little-endian integer. Return its value
5220 calc_binsize(char *bytes, int nbytes)
5222 unsigned char *s = (unsigned char *)bytes;
5246 /* s contains x bytes of a little-endian integer. Return its value as a
5252 calc_binint(char *bytes, int nbytes)
5254 unsigned char *s = (unsigned char *)bytes;
5263 * is signed, so on a box with longs bigger than 4 bytes we need
5348 /* 'size' bytes contain the # of bytes of little-endian 256's-complement
5374 /* Read the raw little-endian bytes and convert. */
5439 PyObject *bytes;
5463 bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL);
5464 if (bytes == NULL)
5467 /* Leave the Python 2.x strings as bytes if the *encoding* given to the
5468 Unpickler was 'bytes'. Otherwise, convert them to unicode. */
5469 if (strcmp(self->encoding, "bytes") == 0) {
5470 obj = bytes;
5473 obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
5474 Py_DECREF(bytes);
5498 "BINSTRING exceeds system's maximum size of %zd bytes",
5506 /* Convert Python 2.x strings to bytes if the *encoding* given to the
5507 Unpickler was 'bytes'. Otherwise, convert them to unicode. */
5508 if (strcmp(self->encoding, "bytes") == 0) {
5525 PyObject *bytes;
5535 "BINBYTES exceeds system's maximum size of %zd bytes",
5540 bytes = PyBytes_FromStringAndSize(NULL, size);
5541 if (bytes == NULL)
5543 if (_Unpickler_ReadInto(self, PyBytes_AS_STRING(bytes), size) < 0) {
5544 Py_DECREF(bytes);
5548 PDATA_PUSH(self->stack, bytes, -1);
5566 "BYTEARRAY8 exceeds system's maximum size of %zd bytes",
5667 "BINUNICODE exceeds system's maximum size of %zd bytes",
6266 * the number of bytes following the opcode, holding the index (code) value.
6271 char *codebytes; /* the nbytes bytes after the opcode */
6834 "FRAME length exceeds system's maximum of %zd bytes",
7118 Returns size in memory, in bytes.
7233 arguments. Both methods should return bytes. Thus *file* can be a
7243 respectively. The *encoding* can be 'bytes' to read these 8-bit
7244 string instances as bytes objects.
7661 bytes argument. It can thus be a file object opened for binary
7719 Return the pickled representation of the object as a bytes object.
7791 arguments. Both methods should return bytes. Thus *file* can be a
7801 respectively. The *encoding* can be 'bytes' to read these 8-bit
7802 string instances as bytes objects.
7861 respectively. The *encoding* can be 'bytes' to read these 8-bit
7862 string instances as bytes objects.