Skip to content

Commit 58b63ca

Browse files
Add minimal Unicode crash reproduction test
1 parent bed5025 commit 58b63ca

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Debug Unicode Crash
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
debug-unicode:
8+
runs-on: windows-latest
9+
strategy:
10+
matrix:
11+
python: ["3.14"]
12+
architecture: [x86, x64]
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: ${{ matrix.python }}
19+
architecture: ${{ matrix.architecture }}
20+
21+
- name: Run minimal Unicode test
22+
run: python debug_unicode.py
23+
24+
- name: Run with pytest
25+
run: |
26+
pip install pytest
27+
pytest debug_unicode.py -v

debug_unicode.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
"""Minimal reproduction for Windows x86 Unicode crash"""
3+
4+
import warnings
5+
import sys
6+
7+
def test_unicode_warning():
8+
"""Test that triggers Unicode in warnings system"""
9+
unicode_string = "\U00010002abc--abc\u79d8\u5bc6\u4ee3\u7801-\u79d8\u5bc6\u4ee3\u7801"
10+
11+
print(f"Python version: {sys.version}")
12+
print(f"Platform: {sys.platform}")
13+
print(f"Architecture: {sys.maxsize > 2**32}")
14+
print(f"Unicode string: {repr(unicode_string)}")
15+
16+
# Trigger a warning with Unicode content
17+
warnings.warn(f"Test warning with Unicode: {unicode_string}")
18+
19+
print("Test completed successfully")
20+
21+
if __name__ == "__main__":
22+
test_unicode_warning()

0 commit comments

Comments
 (0)