Parse failures raise ValidationError with an empty message; the ANTLR diagnostic is lost
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
The empty message comes from the ValidationError raised when pyqasm.loads() catches a parse failure; openqasm3/parser.py:107 re-raises QASM3ParsingError with no text, and the ANTLR diagnostic only reaches stderr. Read how the error listener is attached before changing anything. Linked PR #452 is already open against this, so check its status first. Done means str(exc) includes the line, column and ANTLR message.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When pyqasm.loads() fails to parse, the ValidationError message is "Failed to parse OpenQASM string: " with nothing after the colon. The ANTLR diagnostic that says what is wrong (line 3:10 no viable alternative at input 'rx(pi/2q') goes to stderr only, so a service that surfaces str(exc) to a user gives them an empty reason.
Repro (pyqasm 1.2.1, openqasm3 1.0.1)
import pyqasm
try:
pyqasm.loads("OPENQASM 3.0;\nqubit q;\nrx(pi / 2 q;\n")
except Exception as exc:
print(repr(str(exc)))
# prints: 'Failed to parse OpenQASM string: '
# stderr: line 3:10 no viable alternative at input 'rx(pi/2q'
openqasm3.parser.QASM3ParsingError is raised with no message (raise QASM3ParsingError() from exc in openqasm3/parser.py:107), so {err} formats as empty.
Suggestion
Capture the ANTLR error listener output (line, column, message) and put it in the ValidationError message, e.g. Failed to parse OpenQASM string: line 3:10 no viable alternative at input 'rx(pi/2q'. Line and column would also let callers point at the offending statement.
- Ngôn ngữ chính
- Python
- Star
- 29
- Fork
- 33
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay 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 qBraid/pyqasm
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement error-handling program-validation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Move the QASM 2 printer and its branch pre-processing out of qasm2.pyCó thể đã có người làm @danielgaskins đã nhận 7 ngày trước. Đang mởenhancement qasm2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
qBraid/pyqasm#447 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] dumps() emits extern calls without a semicolon, producing unparsable QASMCó thể đã có người làm @Jah-yee đã nhận 15 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
qBraid/pyqasm#438 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`extern port` / `extern frame` in `cal` blocks fail to parse, blocking nearly every spec OpenPulse exampleCó thể đã có người làm @Riiocodee đã nhận 2 ngày trước. Đang mởbug llm-assisted qasm3 qasm3-coverage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
qBraid/pyqasm#401 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của qBraid/pyqasm
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
521xueweihan/HelloGitHub#4063 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Vanilla-OS/apx-gui#112 ·
-
Devstral and Voxtral: section 5 fails in us-east-1 with 400 "Model does not support audio modality"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws-samples/sample-per-model-bedrock#409 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DuckDB 2.0 breaks to_pyarrow_batchesCó thể đã có người làm @DG47 đã 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
ibis-project/ibis#12196 ·
Maintainer thường phản hồi trong vòng 1 ngày