45 Commits

Author SHA1 Message Date
Jeong, YunWon
d3272e752b Align codegen metadata with CPython (#7952) 2026-05-23 20:16:03 +09:00
Huy Vũ (Josh)
e6bcd64066 Validate SyntaxError details tuple shape (#7533) 2026-03-29 22:37:08 +09:00
Jeong, YunWon
6b870d62ad Fix traceback, syntax errors, and exception handling (#7015)
* Update codeop from v3.14.3

* Fix traceback, syntax errors, and exception handling

- Improve unclosed bracket detection with "'(' was never closed" message
- Fix IndentationError location to point to end of line
- Implement frame.clear() with proper checks for executing/suspended frames
- Fix exception context chaining for propagated exceptions
- Add traceback.__dir__() and prevent tb_next deletion
- Fix subscript operation source range restoration in compiler
- Change "duplicate parameter" to "duplicate argument" error message
- Refactor duplicate code in asyncgenerator.rs and frame.rs

---------

Co-authored-by: CPython Developers <>
2026-02-07 13:41:45 +09:00
Jeong, YunWon
c045593e4e impl more nt (#6984)
* mpl new features

* windows encodings

* impl nt functions

* revert

* codecs

* fix codecs
2026-02-04 09:53:02 +09:00
CPython Developers
8265279411 Update test_exceptions from v3.14.2 2026-01-31 00:59:29 +09:00
Jeong, YunWon
7eceb145b1 more optimization (#6860) 2026-01-25 10:18:47 +02:00
Jeong, YunWon
eee360822c Rework compiler about exception handling (#6638)
* asyncgen

* fix coroutine

* rewrite compiler

* tests

* set pyc magic number
2026-01-04 09:15:38 +09:00
Jeong YunWon
4a352344b6 mark failing test_ctypes 2025-12-24 00:13:30 +09:00
Jiseok CHOI
9ce85862ce Add BaseException.add_note() and __notes__ attribute support (#6252) 2025-11-14 10:31:47 +09:00
ShaharNaveh
68e7310d22 reapply patch 2025-10-22 11:02:36 +03:00
ShaharNaveh
e18354b990 fix test markers in test_exceptions.py 2025-10-22 10:57:47 +03:00
ShaharNaveh
19b6241ef9 Update changed files from 3.13.7 -> 3.13.8 2025-10-22 10:57:47 +03:00
ShaharNaveh
f6d755b4ff mark failing tests 2025-07-16 13:37:18 +03:00
ShaharNaveh
0fbe6ce268 Update test_exceptions from 3.13.5 2025-07-16 13:37:18 +03:00
Jeong, YunWon
3734f32e42 Exception.set_traceback_typed (#5832) 2025-06-24 18:56:10 +09:00
Jeong, YunWon
9c2a4695c1 Fix excepthook (#5830) 2025-06-24 16:58:27 +09:00
Jeong YunWon
e4c8f2bb43 Fix ImportError 2025-06-20 16:12:30 +09:00
Jeong YunWon
44d66dcdac Fix SyntaxError 2025-06-20 16:12:30 +09:00
Jeong YunWon
a186a5a9f5 Impl PyAttributeError args 2025-06-18 15:53:17 +09:00
Stefan Lukas
a6b4ef7f5d Replace Python parser with ruff parser (#5494)
* stage1

* compiler pass build

* introduce rustpython-compiler-source

* stage2

* fixup

* pass compile

* Fix hello world compiler test

* Fix code generation for if-elif-else statement

* Fix code generation for lambda expression

* Fix code generation for integers

* Fix code generation for fstrings

* Fix code generation for if statement

* Fix code generation for if statement

* Fix code generation for if statement

* Fix code generation for fstring

* Fix code generation for class definition

* Replace feature flags

* Initialize frozen core modules

* Allow __future__ import after module doc comment

* Disable ast module

* Commit remaining fixes for compile errors in examples

* Fix some warnings

* Update ast stdlib module

* Update ast stdlib module

* Update ast stdlib module

* Update ast stdlib module

* Update ast stdlib module

* Split ast stdlib module into files

* Fix codegen for positional arguments with defaults

* Update ast stdlib module

* Update ast stdlib module

* Extract string and constant handling from expression.rs

* Always add required fields to AST nodes

* Compile doc strings correctly again

* Enable "ast" Cargo feature by default

* Refactor compilation of big integer literal

* Update ast stdlib module

* Update ast stdlib module

* Update ast stdlib module

* Reset barebones example

* Fix some left-over warnings

* Undo accidential change

* Adapt shell to ruff parser

* Pin parser to v0.4.10

* fix clippy

* Add TODO about interactive mode

* Fix compilation of complex number expression

* Remove moved code

* Update test case to ruff v0.4.10

* Apply suggestion

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>

* Apply suggestion

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>

* Fix compilation of fstring expression

* Fix compilation of fstring expression

* Fix wasm compile errors

* Attach correct source locations to ast objects

* Fix some more wasm compile errors

* Consider compile mode and enable AST stdlib module again

* Fix incorrect AST source location end column

* Fix compile error if "compiler" feature is not enabled

* Fix regrtests

* Fix some test_ast tests

* Add source range to type ignore

* Fix incompatibility with Rust 2024 edition

* Fix todos by implementing missing ast conversions and deleting unused code

* Appease clippy

* Fix remaining ast tests

* Fix remaining ast tests

* Mark/fix remaining tests

* Fix more

* Hacky windows fix

---------

Co-authored-by: Kangzhi Shi <shikangzhi@gmail.com>
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
Co-authored-by: Noa <coolreader18@gmail.com>
2025-03-19 21:06:03 -05:00
Ankit Goel
7623668256 Raise TypeError if BaseException receives Keyword arguments 2024-09-24 11:57:37 +09:00
Jonathan Rotter
1034477f1e unit test fix - only allow catching exceptions - test_catch_non_BaseException (#5249)
* test_baseexception.test_catch_non_BaseException

* enabling test_except_star_invalid_exception_type
2024-04-21 01:30:20 +09:00
Andrey Maltsev
302149e02d Update test_exceptions.py from Cpython v3.11.2 2023-04-02 14:35:18 +00:00
Riley Sutton
83880893d5 Enable previously failing tests 2022-12-27 18:06:56 +11:00
Jeong YunWon
15aad7cb94 Fix with-statement location 2022-08-11 07:14:20 +09:00
Jeong YunWon
a363b05340 PySetterValue for descr_set and setattro 2022-08-08 04:31:14 +09:00
43824e393b Change Lib/test/test_exceptions.py runable 2022-07-13 16:47:31 +09:00
4030ad12d9 Update test_exceptions.py from CPython 3.10.5 2022-07-13 16:47:31 +09:00
Padraic Fanning
2815f3d037 Unmark passing test 2022-04-27 20:40:06 -04:00
Dean Li
29c953d9a6 test: update test.support and test_io to 3.10
Initially this is only meant to be a small update for `test_io.py`.
But it turns out that `test.support` need a lot of cleanup especially
for `test.support.warnings_helper`.
2022-04-18 22:50:55 +08:00
Dean Li
6f98288e84 test: use import_helper 2021-11-29 21:03:02 +08:00
Dean Li
5ee4fb899b test: use os_helper 2021-11-28 20:51:32 +08:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Dean Li
49a5805d11 test: use os_helper 2021-11-13 02:18:33 +00:00
snowapril
1bff6a38d1 add decorators on failed tests
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-20 10:19:42 +09:00
snowapril
8d0cefeb64 update test_exceptions.py from cpython 3.10 for suggestion feature
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-20 10:19:42 +09:00
Noah
0ab451c519 Rework the vm exception stack to handle errors better 2021-02-15 17:44:48 -06:00
Noah
99a8d68933 Fix test_exceptions.testRaising 2020-12-19 15:09:20 -06:00
Jeong YunWon
2970af237a unskip test_exceptions.py 2020-11-12 11:30:33 +09:00
Basix
9868f63f50 Skip CPython-specific test on Windows
Check its comments for details
2020-08-10 02:36:29 +09:00
Basix
e5178574f0 Skip rescursion tests on Windows
See #2050
2020-08-10 02:36:29 +09:00
Aviv Palivoda
77b83ea4f8 Separate coro exception stack 2020-03-06 12:04:40 +02:00
Aviv Palivoda
83386fda25 Set errno on os.listdir 2020-03-06 10:46:29 +02:00
Aviv Palivoda
92d0f05242 Mark unsupported tests 2020-03-06 10:46:29 +02:00
Aviv Palivoda
78565d1ab0 Add test_exceptions from CPython 3.8 2020-03-06 10:46:29 +02:00