Skip to content

Test failures on Python 3.13 due to read-only Gzip(NG)File #44

Closed
@musicinmybrain

Description

@musicinmybrain

With tox -e py312, all tests pass, but there is a warning:

tests/test_gzip_compliance.py::TestGzip::test_fileobj_mode
  /home/ben/src/forks/python-zlib-ng/.tox/py312/lib64/python3.12/site-packages/zlib_ng/gzip_ng.py:139: FutureWarning: GzipFile was opened for writing, but this will change in future Python releases.  Specify the mode argument for opening it for writing.
    super().__init__(filename, mode, compresslevel, fileobj, mtime)

With tox -e py313 (using Python 3.13.0b1 from updates-testing on Fedora 39), this warning appears to come to fruition:

========================================================================================== short test summary info ==========================================================================================
FAILED tests/test_gzip_compliance.py::TestGzip::test_append - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_buffered_reader - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_bytes_filename - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_compresslevel_metadata - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_decompress - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_exclusive_write - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_fileobj_mode - AssertionError: 'rb' != 1
FAILED tests/test_gzip_compliance.py::TestGzip::test_io_on_closed_object - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_issue44439 - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_many_append - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_metadata - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_metadata_ascii_name - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_mode - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_mtime - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_non_seekable_file - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_paddedfile_getattr - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_peek - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_read - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_read1 - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_readline - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_readlines - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_seek_read - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_seek_whence - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_seek_write - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_textio_readlines - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_with_open - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write_array - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write_bytearray - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write_incompatible_type - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write_memoryview - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_write_read_with_pathlike_file - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestGzip::test_zero_padded_file - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_binary_modes - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_encoding - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_encoding_error_handler - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_implicit_binary_modes - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_newline - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_pathlike_file - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestOpen::test_text_modes - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestCommandLine::test_compress_infile_outfile - AssertionError: Process return code is 1
FAILED tests/test_gzip_compliance.py::TestCommandLine::test_compress_infile_outfile_default - AssertionError: Process return code is 1
FAILED tests/test_gzip_compliance.py::TestCommandLine::test_compress_stdin_outfile - AssertionError: b'Traceback (most recent call last):\n  Fil[689 chars]ct\n' != b''
FAILED tests/test_gzip_compliance.py::TestCommandLine::test_decompress_infile_outfile - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_compliance.py::TestCommandLine::test_decompress_stdin_stdout - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[1] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[2] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[3] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[4] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[5] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[6] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[7] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[8] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_stdin_stdout[9] - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_outfile - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_stdout - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_out_file - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_out_file_force - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_out_file_inmplicit_name_prompt_accept - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_compress_infile_out_file_no_name - OSError: [Errno 9] write() on read-only GzipNGFile object
FAILED tests/test_gzip_ng.py::test_decompress_on_long_input - OSError: [Errno 9] write() on read-only GzipNGFile object
========================================================================== 61 failed, 14484 passed, 2 skipped in 71.46s (0:01:11) ===========================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions