kovidgoyal/kitty

Tests failure with python-3.13.0b1

ionenwks opened this issue · 0 comments

Describe the bug
Still in beta and so is by no means urgent, but came across two test failures while testing with python-3.13.0b1 in Gentoo:

test_transfer_send (kitty_tests.file_transmission.TestFileTransmission.test_transfer_send) .. Traceback <snip>
test_rsync_roundtrip (kitty_tests.file_transmission.TestFileTransmission.test_rsync_roundtrip) ... ERROR
click here to see full tests output w/ kitty-0.34.1 (current master 1307c23 failed as well)
Running under CI: False
Go packages being tested: tools/tui/loop tools/rsync tools/tui/sgr tools/tui/subseq tools/utils/shm kittens/hyperlinked_grep tools/tui/shell_integration tools/tui/graphics tools/utils/shlex tools/tui/readline tools/utils kittens/ssh tools/unicode_names kittens/hints tools/cli tools/config tools/cmd/at tools/simdstring tools/utils/base85 kittens/transfer tools/wcswidth tools/utils/humanize kittens/diff tools/utils/style tools/themes tools/tui
test_all_kitten_names (kitty_tests.check_build.TestBuild.test_all_kitten_names) ... ok
test_ca_certificates (kitty_tests.check_build.TestBuild.test_ca_certificates) ... skipped 'CA certificates are only tested on frozen builds'
test_docs_url (kitty_tests.check_build.TestBuild.test_docs_url) ... ok
test_exe (kitty_tests.check_build.TestBuild.test_exe) ... ok
test_filesystem_locations (kitty_tests.check_build.TestBuild.test_filesystem_locations) ... ok
test_glfw_modules (kitty_tests.check_build.TestBuild.test_glfw_modules) ... ok
test_launcher_ensures_stdio (kitty_tests.check_build.TestBuild.test_launcher_ensures_stdio) ... ok
test_loading_extensions (kitty_tests.check_build.TestBuild.test_loading_extensions) ... ok
test_loading_shaders (kitty_tests.check_build.TestBuild.test_loading_shaders) ... ok
test_clipboard_write_request (kitty_tests.clipboard.TestClipboard.test_clipboard_write_request) ... ok
test_completion (kitty_tests.completion.TestCompletion.test_completion) ... ok
test_elliptic_curve_data_exchange (kitty_tests.crypto.TestCrypto.test_elliptic_curve_data_exchange) ... skipped 'RLIMIT_MEMLOCK is too low'
test_ansi_repr (kitty_tests.datatypes.TestDataTypes.test_ansi_repr) ... ok
test_bracketed_paste_sanitizer (kitty_tests.datatypes.TestDataTypes.test_bracketed_paste_sanitizer) ... ok
test_color_profile (kitty_tests.datatypes.TestDataTypes.test_color_profile) ... ok
test_expand_ansi_c_escapes (kitty_tests.datatypes.TestDataTypes.test_expand_ansi_c_escapes) ... ok
test_historybuf (kitty_tests.datatypes.TestDataTypes.test_historybuf) ... ok
test_line (kitty_tests.datatypes.TestDataTypes.test_line) ... ok
test_linebuf (kitty_tests.datatypes.TestDataTypes.test_linebuf) ... ok
test_notify_identifier_sanitization (kitty_tests.datatypes.TestDataTypes.test_notify_identifier_sanitization) ... ok
test_replace_c0_codes (kitty_tests.datatypes.TestDataTypes.test_replace_c0_codes) ... ok
test_rewrap_narrower (kitty_tests.datatypes.TestDataTypes.test_rewrap_narrower) ... ok
test_rewrap_simple (kitty_tests.datatypes.TestDataTypes.test_rewrap_simple) ... ok
test_rewrap_wider (kitty_tests.datatypes.TestDataTypes.test_rewrap_wider) ... ok
test_shlex_split (kitty_tests.datatypes.TestDataTypes.test_shlex_split) ... ok
test_single_key (kitty_tests.datatypes.TestDataTypes.test_single_key) ... ok
test_strip_csi (kitty_tests.datatypes.TestDataTypes.test_strip_csi) ... ok
test_to_color (kitty_tests.datatypes.TestDataTypes.test_to_color) ... ok
test_url_at (kitty_tests.datatypes.TestDataTypes.test_url_at) ... ok
test_utils (kitty_tests.datatypes.TestDataTypes.test_utils) ... ok
test_file_get (kitty_tests.file_transmission.TestFileTransmission.test_file_get) ... ok
test_parse_ftc (kitty_tests.file_transmission.TestFileTransmission.test_parse_ftc) ... ok
test_rsync_hashers (kitty_tests.file_transmission.TestFileTransmission.test_rsync_hashers) ... ok
test_rsync_roundtrip (kitty_tests.file_transmission.TestFileTransmission.test_rsync_roundtrip) ... ERROR
test_transfer_receive (kitty_tests.file_transmission.TestFileTransmission.test_transfer_receive) ... ok
test_transfer_send (kitty_tests.file_transmission.TestFileTransmission.test_transfer_send) ... Traceback (most recent call last):
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/__init__.py", line 149, in file_transmission
    self.ftc.handle_serialized_command(data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty/file_transmission.py", line 877, in handle_serialized_command
    self.handle_receive_cmd(cmd)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty/file_transmission.py", line 1038, in handle_receive_cmd
    self.callback_after(partial(self.transmit_rsync_signature, ar.id))
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty/file_transmission.py", line 1247, in callback_after
    callback(None)
    ~~~~~~~~^^^^^^
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty/file_transmission.py", line 1100, in transmit_rsync_signature
    n = fs.next_signature_block(buf[pos:])
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty/file_transmission.py", line 431, in next_signature_block
    return self.patcher.signature_header(buf)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
SystemError: Objects/abstract.c:430: bad argument to internal function
FAIL
test_box_drawing (kitty_tests.fonts.Rendering.test_box_drawing) ... ok
test_coalesce_symbol_maps (kitty_tests.fonts.Rendering.test_coalesce_symbol_maps) ... ok
test_emoji_presentation (kitty_tests.fonts.Rendering.test_emoji_presentation) ... ok
test_fallback_font_not_last_resort (kitty_tests.fonts.Rendering.test_fallback_font_not_last_resort) ... skipped 'Only macOS has a Last Resort font'
test_font_rendering (kitty_tests.fonts.Rendering.test_font_rendering) ... ok
test_shaping (kitty_tests.fonts.Rendering.test_shaping) ... ok
test_sprite_map (kitty_tests.fonts.Rendering.test_sprite_map) ... ok
test_os_window_size_calculation (kitty_tests.glfw.TestGLFW.test_os_window_size_calculation) ... ok
test_utf_8_strndup (kitty_tests.glfw.TestGLFW.test_utf_8_strndup) ... ok
test_animation_frame_loading (kitty_tests.graphics.TestGraphics.test_animation_frame_loading) ... ok
test_disk_cache (kitty_tests.graphics.TestGraphics.test_disk_cache) ... ok
test_gr_delete (kitty_tests.graphics.TestGraphics.test_gr_delete) ... ok
test_gr_operations_with_numbers (kitty_tests.graphics.TestGraphics.test_gr_operations_with_numbers) ... ok
test_gr_reset (kitty_tests.graphics.TestGraphics.test_gr_reset) ... ok
test_gr_scroll (kitty_tests.graphics.TestGraphics.test_gr_scroll) ... ok
test_graphics_quota_enforcement (kitty_tests.graphics.TestGraphics.test_graphics_quota_enforcement) ... ok
test_image_layer_grouping (kitty_tests.graphics.TestGraphics.test_image_layer_grouping) ... ok
test_image_parents (kitty_tests.graphics.TestGraphics.test_image_parents) ... ok
test_image_put (kitty_tests.graphics.TestGraphics.test_image_put) ... ok
test_load_images (kitty_tests.graphics.TestGraphics.test_load_images) ... ok
test_load_png (kitty_tests.graphics.TestGraphics.test_load_png) ... ok
test_load_png_simple (kitty_tests.graphics.TestGraphics.test_load_png_simple) ... ok
test_suppressing_gr_command_responses (kitty_tests.graphics.TestGraphics.test_suppressing_gr_command_responses) ... ok
test_unicode_placeholders (kitty_tests.graphics.TestGraphics.test_unicode_placeholders) ... ok
test_unicode_placeholders_3rd_combining_char (kitty_tests.graphics.TestGraphics.test_unicode_placeholders_3rd_combining_char) ... ok
test_unicode_placeholders_multiple_placements (kitty_tests.graphics.TestGraphics.test_unicode_placeholders_multiple_placements) ... ok
test_unicode_placeholders_scroll (kitty_tests.graphics.TestGraphics.test_unicode_placeholders_scroll) ... ok
test_xor_data (kitty_tests.graphics.TestGraphics.test_xor_data) ... ok
test_encode_key_event (kitty_tests.keys.TestKeys.test_encode_key_event) ... ok
test_encode_mouse_event (kitty_tests.keys.TestKeys.test_encode_mouse_event) ... ok
test_mapping (kitty_tests.keys.TestKeys.test_mapping) ... ok
test_layout_operations (kitty_tests.layout.TestLayout.test_layout_operations) ... ok
test_overlay_layout_operations (kitty_tests.layout.TestLayout.test_overlay_layout_operations) ... ok
test_splits (kitty_tests.layout.TestLayout.test_splits) ... ok
test_mouse_selection (kitty_tests.mouse.TestMouse.test_mouse_selection) ... ok
test_parsing_of_open_actions (kitty_tests.open_actions.TestOpenActions.test_parsing_of_open_actions) ... ok
test_conf_parsing (kitty_tests.options.TestConfParsing.test_conf_parsing) ... ok
test_base64 (kitty_tests.parser.TestParser.test_base64) ... ok
test_charsets (kitty_tests.parser.TestParser.test_charsets) ... ok
test_csi_code_rep (kitty_tests.parser.TestParser.test_csi_code_rep) ... ok
test_csi_codes (kitty_tests.parser.TestParser.test_csi_codes) ... ok
test_dcs_codes (kitty_tests.parser.TestParser.test_dcs_codes) ... ok
test_deccara (kitty_tests.parser.TestParser.test_deccara) ... ok
test_desktop_notify (kitty_tests.parser.TestParser.test_desktop_notify) ... ok
test_esc_codes (kitty_tests.parser.TestParser.test_esc_codes) ... ok
test_find_either_of_two_bytes (kitty_tests.parser.TestParser.test_find_either_of_two_bytes) ... ok
test_graphics_command (kitty_tests.parser.TestParser.test_graphics_command) ... ok
test_osc_codes (kitty_tests.parser.TestParser.test_osc_codes) ... ok
test_oth_codes (kitty_tests.parser.TestParser.test_oth_codes) ... ok
test_parser_threading (kitty_tests.parser.TestParser.test_parser_threading) ... ok
test_simple_parsing (kitty_tests.parser.TestParser.test_simple_parsing) ... ok
test_utf8_parsing (kitty_tests.parser.TestParser.test_utf8_parsing) ... ok
test_utf8_simd_decode (kitty_tests.parser.TestParser.test_utf8_simd_decode) ... ok
test_backspace_wide_characters (kitty_tests.screen.TestScreen.test_backspace_wide_characters) ... ok
test_bottom_margin (kitty_tests.screen.TestScreen.test_bottom_margin) ... ok
test_char_manipulation (kitty_tests.screen.TestScreen.test_char_manipulation) ... ok
test_color_stack (kitty_tests.screen.TestScreen.test_color_stack) ... ok
test_cursor_after_resize (kitty_tests.screen.TestScreen.test_cursor_after_resize) ... ok
test_cursor_hidden (kitty_tests.screen.TestScreen.test_cursor_hidden) ... ok
test_cursor_movement (kitty_tests.screen.TestScreen.test_cursor_movement) ... ok
test_detect_url (kitty_tests.screen.TestScreen.test_detect_url) ... ok
test_dirty_lines (kitty_tests.screen.TestScreen.test_dirty_lines) ... ok
test_draw_char (kitty_tests.screen.TestScreen.test_draw_char) ... ok
test_draw_fast (kitty_tests.screen.TestScreen.test_draw_fast) ... ok
test_emoji_skin_tone_modifiers (kitty_tests.screen.TestScreen.test_emoji_skin_tone_modifiers) ... ok
test_erase_in_screen (kitty_tests.screen.TestScreen.test_erase_in_screen) ... ok
test_hyperlinks (kitty_tests.screen.TestScreen.test_hyperlinks) ... ok
test_key_encoding_flags_stack (kitty_tests.screen.TestScreen.test_key_encoding_flags_stack) ... ok
test_margins (kitty_tests.screen.TestScreen.test_margins) ... ok
test_osc_52 (kitty_tests.screen.TestScreen.test_osc_52) ... ok
test_pagerhist (kitty_tests.screen.TestScreen.test_pagerhist) ... ok
test_pointer_shapes (kitty_tests.screen.TestScreen.test_pointer_shapes) ... ok
test_prompt_marking (kitty_tests.screen.TestScreen.test_prompt_marking) ... ok
test_regional_indicators (kitty_tests.screen.TestScreen.test_regional_indicators) ... ok
test_rep (kitty_tests.screen.TestScreen.test_rep) ... ok
test_resize (kitty_tests.screen.TestScreen.test_resize) ... ok
test_scrollback_fill_after_resize (kitty_tests.screen.TestScreen.test_scrollback_fill_after_resize) ... ok
test_selection_as_text (kitty_tests.screen.TestScreen.test_selection_as_text) ... ok
test_serialize (kitty_tests.screen.TestScreen.test_serialize) ... ok
test_sgr (kitty_tests.screen.TestScreen.test_sgr) ... ok
test_soft_hyphen (kitty_tests.screen.TestScreen.test_soft_hyphen) ... ok
test_tab_stops (kitty_tests.screen.TestScreen.test_tab_stops) ... ok
test_top_and_bottom_margin (kitty_tests.screen.TestScreen.test_top_and_bottom_margin) ... ok
test_top_margin (kitty_tests.screen.TestScreen.test_top_margin) ... ok
test_user_marking (kitty_tests.screen.TestScreen.test_user_marking) ... ok
test_variation_selectors (kitty_tests.screen.TestScreen.test_variation_selectors) ... ok
test_wrapping_serialization (kitty_tests.screen.TestScreen.test_wrapping_serialization) ... ok
test_writing_with_cursor_on_trailer_of_wide_character (kitty_tests.screen.TestScreen.test_writing_with_cursor_on_trailer_of_wide_character) ... ok
test_zwj (kitty_tests.screen.TestScreen.test_zwj) ... ok
test_search_query_parser (kitty_tests.search_query_parser.TestSQP.test_search_query_parser) ... ok
test_shm_with_kitten (kitty_tests.shm.SHMTest.test_shm_with_kitten) ... ok
test_line_edit (kitty_tests.tui.TestTUI.test_line_edit) ... ok
test_multiprocessing_spawn (kitty_tests.tui.TestTUI.test_multiprocessing_spawn) ... ok

======================================================================
ERROR: test_rsync_roundtrip (kitty_tests.file_transmission.TestFileTransmission.test_rsync_roundtrip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 226, in test_rsync_roundtrip
    test_rsync_roundtrip(self)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_rsync_roundtrip>
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 145, in test_rsync_roundtrip
    run_roundtrip_test(self, src_data, src_data[block_size:], 1, block_size)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    block_size = 16
    changed = b'0__patch1_______patch2__________2_______________3_______________4_______________5_______________6_______________7_______________8_ptch3_________9_______________10______________patch4__________12______________13____________XXYY______________15______________'
    num_of_patches = 5
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_rsync_roundtrip>
    src_data = b'0_______________1_______________2_______________3_______________4_______________5_______________6_______________7_______________8_______________9_______________10______________11______________12______________13______________14______________15______________'
    total_patch_size = 27
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 82, in run_roundtrip_test
    n = p.signature_header(buf)
    buf = <memory at 0x7ffff58e4ac0>
    changed = b'1_______________2_______________3_______________4_______________5_______________6_______________7_______________8_______________9_______________10______________11______________12______________13______________14______________15______________'
    num_of_patches = 1
    p = <rsync.Patcher object at 0x7ffff5947730>
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_rsync_roundtrip>
    signature = bytearray(b'')
    src_data = b'0_______________1_______________2_______________3_______________4_______________5_______________6_______________7_______________8_______________9_______________10______________11______________12______________13______________14______________15______________'
    total_patch_size = 16
SystemError: Objects/abstract.c:430: bad argument to internal function

======================================================================
FAIL: test_transfer_send (kitty_tests.file_transmission.TestFileTransmission.test_transfer_send)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 507, in test_transfer_send
    self.basic_transfer_tests()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_transfer_send>
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 363, in basic_transfer_tests
    single_file('--transmit-deltas')
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
    dest = '/tmp/portage/x11-terms/kitty-0.34.1/temp/tmpkchvrl5n/dest'
    pty = <kitty_tests.file_transmission.TransferPTY object at 0x7ffff4a8c890>
    s = <_io.BufferedWriter name='/tmp/portage/x11-terms/kitty-0.34.1/temp/tmpkchvrl5n/src'>
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_transfer_send>
    single_file = <function TestFileTransmission.basic_transfer_tests.<locals>.single_file at 0x7ffff4ab4b80>
    src = '/tmp/portage/x11-terms/kitty-0.34.1/temp/tmpkchvrl5n/src'
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/file_transmission.py", line 357, in single_file
    pty.wait_till_child_exits(require_exit_code=0)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
    cmd = ('--transmit-deltas',)
    dest = '/tmp/portage/x11-terms/kitty-0.34.1/temp/tmpkchvrl5n/dest'
    pty = <kitty_tests.file_transmission.TransferPTY object at 0x7ffff4a8c5d0>
    self = <kitty_tests.file_transmission.TestFileTransmission testMethod=test_transfer_send>
    src = '/tmp/portage/x11-terms/kitty-0.34.1/temp/tmpkchvrl5n/src'
  File "/tmp/portage/x11-terms/kitty-0.34.1/work/kitty-0.34.1/kitty/launcher/../../kitty_tests/__init__.py", line 383, in wait_till_child_exits
    raise AssertionError(f'Child did not exit in {timeout} seconds. Screen contents:\n{self.screen_contents()}')
    end_time = 9217.490635284
    require_exit_code = 0
    self = <kitty_tests.file_transmission.TransferPTY object at 0x7ffff4a8c5d0>
    si_pid = 0
    status = 0
    timeout = 10
AssertionError: Child did not exit in 10 seconds. Screen contents:
Scanning files…
Found 1 files and directories, requesting transfer permission…
Permission granted for this transfer

----------------------------------------------------------------------
Ran 129 tests in 12.907s

FAILED (failures=1, errors=1, skipped=3)
All Go tests succeeded, ran in 42.8 seconds
Error: Some tests failed!

Both are throwing SystemError: Objects/abstract.c:430: bad argument to internal function seemingly due to this being added PyObject_GetBuffer:

   if (flags != PyBUF_SIMPLE) {  /* fast path */
        if (flags == PyBUF_READ || flags == PyBUF_WRITE) {
            PyErr_BadInternalCall();
            return -1;
        }
    }

python/cpython@b7688ef71
python/cpython#114707

And I assume comes from the two PyObject_GetBuffer(a2, &dest, PyBUF_WRITE) in kittens/transfer/algorithm.c.

To Reproduce
Steps to reproduce the behavior:

  1. use python 3.13
  2. run tests