[issue24981] Add a test which uses the ast module to compile the stdlib

2021-08-31 Thread Irit Katriel
Irit Katriel added the comment: I think there is something like this here: https://github.com/python/cpython/blob/22fe0eb13c3441b71b60aaea0e7fe289a29783da/Lib/test/test_ast.py#L1498 -- nosy: +iritkatriel ___ Python tracker

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: The distutils error is a ValueError, which was printed as such before I added 'Exception' to the except statement. I did not initially catch SyntaxError separately because some are caught during the compile phase. Revised file corrects 'pass' to 'continue' and

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-04 Thread Brett Cannon
Brett Cannon added the comment: Two things about the UTF-8 decode issue. One is you don't need to decode the source for it to be compiled; ast.parse()/compile() will work from bytes objects and thus handle the decoded for you. Two, if you want to decode source files into text, use importlib.ut

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ran with installed 3.5.0rc1. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Forgot to mention: runtime 4 seconds. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: The attached recurses one level deep in Lib. Catching UnicodeDecodeError on file read is needed at least for "test/test_source_encoding.py 'utf-8' codec can't decode byte 0xf0 in position 267: invalid continuation byte". Catching "badxxx.py" is needed for sev

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 This is a great idea. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Brett Cannon
New submission from Brett Cannon: Issue #24975 shows that we can easily end up with holes in support from the ast module. We should probably make sure we have a test that goes through the entire stdlib, Does an ast.parse(), and then passes the result to compile() to verify no exceptions are ra