Locale-dependent text IO: tasklist probe and browser launch diagnostics crash under UTF-8 mode; Common Crawl URL cache fails on non-ASCII URLs
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by reading browser_profiler.py, browser_manager.py, and async_url_seeder.py, focusing on the subprocess output decoding and the Common Crawl JSONL cache reads and writes described in the issue. Add tests for non-ASCII output and URLs under UTF-8 mode, then run the relevant tests. Done means all three paths handle the specified encoding cases without crashes or corrupted cache data.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Three independent spots decode or write text using the platform default codec. On Windows with a non-UTF-8 ANSI codepage (cp1252/cp936) — and, more broadly, under UTF-8 mode, which becomes the default in Python 3.15 (PEP 686) — they raise UnicodeDecodeError / UnicodeEncodeError or silently corrupt data.
1. BrowserProfiler._is_browser_running (browser_profiler.py)
process = subprocess.run(["tasklist", "/FI", f"PID eq {pid}"],
capture_output=True, text=True)
return str(pid) in process.stdout
tasklist writes ANSI/OEM-encoded text (e.g. GBK on CJK Windows). Under UTF-8 mode the strict decode fails (observed live on a cp936 machine: 'utf-8' codec can't decode byte 0xcf in position 4). UnicodeDecodeError is a ValueError, so it escapes the except (ProcessLookupError, PermissionError, OSError) tuple. Every caller — get_builtin_browser_info(), the launch-time liveness check, and the kill loop — then treats a live builtin browser as dead, so kill/cleanup logic silently degrades and browser processes leak.
2. Chromium stdout/stderr diagnostics (browser_manager.py)
Five bytes.decode() calls decode Chromium's launch diagnostics with the strict default codec. Chromium emits ANSI/OEM-encoded messages on Windows (localized error text is common), so diagnosing an early exit can itself raise UnicodeDecodeError — converting a diagnosable launch failure into an opaque Failed to start browser: ....
3. Common Crawl URL cache (async_url_seeder.py)
_from_cc streams Common Crawl index results into a .jsonl cache and reads it back via aiofiles.open(path, "w" / "r") with no encoding. Real-world CC URLs contain raw non-ASCII characters; under cp1252/cp936 the write raises UnicodeEncodeError mid-generator (it is not caught by the httpx exception handlers), aborting the whole seeding run. A cache written under one locale also mojibakes when read back under another.
Suggested fix
Pin encoding="utf-8" at these spots (plus errors="replace" where console/subprocess output is only searched, not parsed). ASCII-only content is unaffected in all three cases. Patch and tests incoming as a PR.
- Ngôn ngữ chính
- Python
- Star
- 87.2k
- Fork
- 9.1k
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của unclecode/crawl4ai
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackCó thể đã có người làm @HhH666-ux đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Hardened docker-compose (read_only) keeps full Chromium from starting: crashpad needs a writable ~/.configCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở🐞 Bug 📌 Root caused
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
unclecode/crawl4ai#2494 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Crawl4aiDockerClient has no public option for the API token the 0.9 server requiresĐang mở⚙ Done ✨ Enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
⚙ Done 🐞 Bug 📌 Root caused
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: PDF images saved with save_images_locally=True come back with an empty src in result.mediaĐang mở⚙ Done 🐞 Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unclecode/crawl4ai#2469 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của unclecode/crawl4ai
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Install the skills as a Claude Code pluginCó thể đã có người làm @ruban-24 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Make the usage of time-zone aware UTC timestamps the norm across the pynxtools NOMAD ecosystemĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FAIRmat-NFDI/pynxtools#874 ·
-
Eval: PublicationĐang mởdata
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100