python/cpython
Documented errors, page 4 of 5. Back to python/cpython
| Code / Message | Type | Severity | Tags |
|---|---|---|---|
| hour must be in 0..23, not | exception | error | datetime, valueerror, validation, time |
| time data %r does not match format %r | exception | error | strptime, datetime, parsing, format-mismatch, cpython |
| host/port and sock can not be specified at the same time | exception | error | asyncio, network, sockets, validation |
| invalid buffering: %r | exception | error | io, open, buffering, typeerror |
| invalid encoding: %r | exception | error | io, open, encoding, typeerror, text-io |
| cannot open ' ' for writing | console | error | cpython, build, freeze-module, permissions, output-path |
| error when writing to | console | error | cpython, build, freeze-module, disk-full, io-error |
| seek on closed file | exception | error | io, bytesio, seek, lifecycle, valueerror |
| cannot round a NaN | exception | error | decimal, rounding, round, nan, valueerror |
| invalid whence value | exception | error | python, io, buffered-reader, seek, valueerror, argument-order |
| utcoffset() argument must be a datetime instance or None | exception | error | python, datetime, timezone, type-error, api-protocol |
| cannot compare naive and aware datetimes | exception | error | python, datetime, timezone, type-error, comparison |
| Limit cannot be <= 0 | exception | error | asyncio, streams, validation, config |
| negative file descriptor | validation | error | python, io, file-io, file-descriptor, valueerror |
| object is already initialized | exception | error | asyncio, future, subclassing |
| unexpected %r char in declaration | exception | error | markup, html-parser, parsing, malformed-html |
| Cannot hash a signaling NaN value. | exception | error | decimal, hash, snan, nan, typeerror, set |
| day must be in range 1.. for month in year | exception | error | datetime, valueerror, validation, date, leap-year |
| flush on closed file | exception | error | io, flush, lifecycle, valueerror |
| Invalid weekday: (range is [1, 7]) | exception | error | datetime, isocalendar, fromisocalendar, weekday, valueerror, stdlib |
| BoundedSemaphore released too many times | validation | error | asyncio, semaphore, synchronization, resource-leak |
| TaskGroup has already been entered | exception | error | asyncio, taskgroup, api-misuse, structured-concurrency |
| cannot convert Infinity to integer ratio | exception | error | decimal, as-integer-ratio, infinity, overflow, fraction |
| Cannot convert signaling NaN to float | exception | error | decimal, float-conversion, snan, nan, valueerror |
| cannot notify on un-acquired lock | exception | error | asyncio, condition-variable, synchronization |
| Future object is not initialized. | exception | error | asyncio, future, initialization |
| Task does not support set_result operation | exception | error | asyncio, tasks, futures, api-misuse |
| can't have text and binary mode at once | exception | error | io, open, mode, valueerror, text-io, binary-io |
| getvalue on closed file | exception | error | io, bytesio, getvalue, lifecycle, valueerror |
| Invalid isoformat string | exception | error | datetime, fromisoformat, isoformat, valueerror, stdlib |
| ssl_handshake_timeout is only meaningful with ssl | exception | error | asyncio, tls, ssl, timeout, validation |
| month must be in 1..12, not | exception | error | datetime, valueerror, validation, date |
| name must be a string | exception | error | python, datetime, timezone, type-error |
| ssl_shutdown_timeout is only meaningful with ssl | exception | error | asyncio, tls, ssl, timeout, validation |
| loop must be an instance of AbstractEventLoop or None, not | exception | error | asyncio, event-loop, typeerror |
| minute must be in 0..59, not | exception | error | datetime, valueerror, validation, time |
| unexpected address family | exception | error | asyncio, udp, datagram, address-family |
| Task does not support set_exception operation | exception | error | asyncio, tasks, futures, api-misuse |
| fold must be either 0 or 1, not | exception | error | datetime, valueerror, validation, dst, pep-495 |
| read too short: got %ld instead of %ld bytes | console | error | cpython, build, freeze-module, file-race, short-read |
| second must be in 0..59, not | exception | error | datetime, valueerror, validation, time, leap-second |
| an integer is required | validation | error | python, io, file-io, seek, typeerror |
| doubled \M- (char of ) | validation | error | python, pyrepl, keymap, parsing, repl |
| "raw" argument must be writable. | exception | error | python, io, buffered-writer, oserror, constructor, pipe |
| TaskGroup is finished | exception | error | asyncio, taskgroup, lifecycle, structured-concurrency |
| tzname() argument must be a datetime instance or None | exception | error | python, datetime, timezone, type-error, api-protocol |
| 2-tuple is expected | exception | error | asyncio, udp, datagram, type-error |
| host and port was not specified and no sock specified | exception | error | asyncio, network, validation, configuration |
| Invalid week | exception | error | datetime, isocalendar, fromisocalendar, iso-week, valueerror, stdlib |
| invalid number of bytes to read | exception | error | python, io, buffered-reader, valueerror, read, validation |
| could not allocate %ld bytes | console | error | cpython, build, freeze-module, out-of-memory |
| ssl argument must be an SSLContext or None | exception | error | asyncio, tls, server, api-misuse |
| dst() argument must be a datetime instance or None | exception | error | python, datetime, timezone, type-error, api-protocol |
| binary mode doesn't take a newline argument | exception | error | io, open, newline, binary-io, valueerror, csv |
| cannot convert NaN to integer ratio | exception | error | decimal, as-integer-ratio, nan, fraction, valueerror |
| Isoformat time too short | exception | error | datetime, fromisoformat, time-parsing, valueerror, stdlib |
| string is expected | exception | error | asyncio, unix-socket, datagram, type-error |
| Forward reference must be a string -- got | exception | error | annotations, typing, forwardref, typeerror, cpython |
| invalid buffer size | exception | error | python, io, buffered-reader, valueerror, configuration, buffer-size |
| ISO year directive '%G' must be used with the ISO week… | exception | error | strptime, iso-week, datetime, format-string, cpython |
| cannot fstat | console | error | cpython, build, freeze-module, fstat, filesystem |
| Semaphore initial value must be >= 0 | validation | error | asyncio, semaphore, validation, configuration |
| unconverted data remains | exception | error | strptime, datetime, parsing, trailing-data, cpython |
| microsecond must be in 0..999999, not | exception | error | datetime, valueerror, validation, time, nanoseconds |
| readexactly size can not be less than zero | exception | error | asyncio, streams, validation, protocol-parsing |
| tz argument must be an instance of tzinfo | exception | error | python, datetime, timezone, type-error |
| Cannot subclass ForwardRef | exception | error | annotations, typing, forwardref, subclassing, cpython |
| can't have read/write/append mode at once | exception | error | io, open, mode, valueerror |
| Invalid microsecond separator | exception | error | datetime, fromisoformat, fraction, separator, valueerror, stdlib |
| offset must be a timedelta | exception | error | python, datetime, timezone, type-error |
| binary mode doesn't take an errors argument | exception | error | io, open, errors, binary-io, valueerror |
| Set of Tasks/Futures is empty. | exception | error | asyncio, tasks, wait, validation |
| Cannot convert NaN to integer | exception | error | decimal, int-conversion, nan, truncation, valueerror |
| invalid mode | validation | error | python, io, file-io, mode, typeerror |
| Cannot convert infinity to integer | exception | error | decimal, int-conversion, infinity, overflow, overflowerror |
| fromisoformat: argument must be str | exception | error | datetime, time, typeerror, fromisoformat, bytes |
| must have exactly one of read/write/append mode | exception | error | io, open, mode, valueerror |
| binary mode doesn't take an encoding argument | exception | error | io, open, encoding, binary-io, valueerror |
| fromutc() argument must be a datetime instance or None | exception | error | python, datetime, timezone, type-error, utc |
| A datagram socket was expected, got | exception | error | asyncio, udp, datagram, socket |
| Neither host/port nor sock were specified | exception | error | asyncio, server, configuration, api-misuse |
| cannot round an infinity | exception | error | decimal, rounding, round, infinity, overflowerror |
| parties must be >= 1 | validation | error | asyncio, barrier, validation, configuration |
| Non-thread-safe operation invoked on an event loop other… | exception | error | |
| a callable object was expected by | exception | error | |
| server is already being awaited on serve_forever() | exception | error | |
| An asyncio.Future, a coroutine or an awaitable is required | validation | error | |
| File descriptor is used by transport | exception | error | |
| asyncio.run() cannot be called from a running event loop | exception | error | |
| Cannot run the event loop while another loop is running | exception | error | |
| Runner.run() cannot be called from a running event loop | exception | error | |
| data argument must be bytes-like object (%r) | validation | error | |
| executor must be ThreadPoolExecutor instance | exception | error | |
| count must be a positive integer | exception | error | |
| Event loop stopped before Future completed. | exception | error | |
| only SOCK_STREAM type sockets are supported | exception | error | |
| coroutines cannot be used with | exception | error | |
| task factory must be a callable or None | exception | error | |
| get_buffer() returned an empty buffer | exception | error | |
| file should be opened in binary mode | exception | error |