[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-12 Thread Brett Cannon
Brett Cannon added the comment: Thanks for catching the warning and the fix, Karthikeyan! -- ___ Python tracker ___ ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- pull_requests: +15628 pull_request: https://github.com/python/cpython/pull/16003 ___ Python tracker ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The test is same as below and given that __spec__ an __name__ are passed as None where ImportWarning is raised in Lib/importlib/_bootstrap.py 1074 . can we just use self.assertWarns(ImportWarning) in the test? >>> __import__('', {'__package__':

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The test added seems to have created an ImportWarning in test_builtin.BuiltinTest.test_import . ./python.exe -Wall -m unittest -v test.test_builtin.BuiltinTest.test_import test_import (test.test_builtin.BuiltinTest) ...

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread miss-islington
miss-islington added the comment: New changeset f3480ad08823a9bc7df490bb5b54593d9483be70 by Miss Islington (bot) in branch '3.7': [3.8] bpo-37409: fix relative import with no parent (GH-14956) (GH-15913) https://github.com/python/cpython/commit/f3480ad08823a9bc7df490bb5b54593d9483be70

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +15565 pull_request: https://github.com/python/cpython/pull/15925 ___ Python tracker ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Brett Cannon
Brett Cannon added the comment: New changeset 0a6693a469cfb1dd5c8048d8cb4231a7b5883251 by Brett Cannon in branch '3.8': [3.8] bpo-37409: fix relative import with no parent (GH-14956) (GH-15913) https://github.com/python/cpython/commit/0a6693a469cfb1dd5c8048d8cb4231a7b5883251 --

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Brett Cannon
Change by Brett Cannon : -- pull_requests: +15554 pull_request: https://github.com/python/cpython/pull/15913 ___ Python tracker ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Brett Cannon
Brett Cannon added the comment: New changeset 92420b3e679959a7d0ce875875601a4cee45231e by Brett Cannon (Ben Lewis) in branch 'master': bpo-37409: fix relative import with no parent (#14956) https://github.com/python/cpython/commit/92420b3e679959a7d0ce875875601a4cee45231e --

[issue37409] relative import without parent succeeds with builtins.__import__

2019-08-02 Thread Brett Cannon
Change by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37409] relative import without parent succeeds with builtins.__import__

2019-07-26 Thread Ben Lewis
Change by Ben Lewis : -- pull_requests: +14724 pull_request: https://github.com/python/cpython/pull/14956 ___ Python tracker ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-06-29 Thread Ben Lewis
Change by Ben Lewis : -- keywords: +patch pull_requests: +14282 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/14465 ___ Python tracker

[issue37409] relative import without parent succeeds with builtins.__import__

2019-06-28 Thread Ben Lewis
Ben Lewis added the comment: I'll look into this further and open a PR initially for the regression tests. -- ___ Python tracker ___

[issue37409] relative import without parent succeeds with builtins.__import__

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: If you run with `-Xdev`/warnings turned on you get an idea of what's happening: >>> builtins.__import__('', globals(), locals(), ('foo',), 1) :1: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ The

[issue37409] relative import without parent succeeds with builtins.__import__

2019-06-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37409] relative import without parent succeeds with builtins.__import__

2019-06-28 Thread Brett Cannon
Change by Brett Cannon : -- title: relative import without parent -> relative import without parent succeeds with builtins.__import__ ___ Python tracker ___

[issue37409] relative import without parent

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: The code doing the sanity check for importlib can be found at https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Lib/importlib/_bootstrap.py#L943-L948 . -- ___ Python tracker

[issue37409] relative import without parent

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: I opened bpo-37444 for the relative import beyond top-level package issue. -- ___ Python tracker ___

[issue37409] relative import without parent

2019-06-28 Thread Brett Cannon
Change by Brett Cannon : -- versions: +Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37409] relative import without parent

2019-06-27 Thread Brett Cannon
Brett Cannon added the comment: Please open a separate issue for the relative import issue. -- stage: resolved -> test needed ___ Python tracker ___

[issue37409] relative import without parent

2019-06-26 Thread Ben Lewis
Ben Lewis added the comment: >>> foo = 'oops' >>> from . import foo as fubar # should raise ImportError >>> fubar 'oops' After further investigation, the problem is that builtins.__import__ (the c port version) does not replicate the behaviour of importlib.__import__ (the python reference