[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor! -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-b

[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset e5063a82f490 by Serhiy Storchaka in branch 'default': Issue #27352: Fixed an error message in a test. https://hg.python.org/cpython/rev/e5063a82f490 -- ___ Python tracker

[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread STINNER Victor
STINNER Victor added the comment: You broke Python! Example: http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/4853/steps/test/logs/stdio == FAIL: test_importfrom (test.test_ast.ASTValidatorTests) --

[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Brett. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset e3164c9edb0b by Serhiy Storchaka in branch 'default': Issue #27352: Correct the validation of the ImportFrom AST node and simplify https://hg.python.org/cpython/rev/e3164c9edb0b -- nosy: +python-dev ___ P

[issue27352] Bug in IMPORT_NAME

2016-06-27 Thread Brett Cannon
Brett Cannon added the comment: LGTM -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27352] Bug in IMPORT_NAME

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I was wrong. The level argument is always non-negative integer (if a bytecode is not corrupted). The second branch can be just removed. Following patch also fixes the validation of the ImportFrom AST node. -- nosy: +benjamin.peterson, georg.br

[issue27352] Bug in IMPORT_NAME

2016-06-20 Thread Brett Cannon
Brett Cannon added the comment: Then I say go ahead and commit it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue27352] Bug in IMPORT_NAME

2016-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thak you for the explanation Brett. Since current "import" without "from" is not broken, I suppose that the raised exception is cleared somewhere later. The patch doesn't have visible effect (unless may be using nonstandard loaders or __import__, don't know)

[issue27352] Bug in IMPORT_NAME

2016-06-20 Thread Brett Cannon
Brett Cannon added the comment: My suspicion is the -1 aspect is a hold-over from that being the default level value in Python 2.7 that no one removed. The patch LGTM. Do we need a test for this for some reason? -- assignee: -> serhiy.storchaka stage: patch review -> commit review __

[issue27352] Bug in IMPORT_NAME

2016-06-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Seems there is a bug in the implementation of the IMPORT_NAME opcode in ceval.c. If the level argument is -1, it is not passed to __import__ (should never happen, but looks correct). If it is an integer != -1 in C long range, it is passed to __import__ (th