[issue27419] Bugs in PyImport_ImportModuleLevelObject

2018-08-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it can. Thanks Berker for reminder.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2018-08-02 Thread Berker Peksag


Berker Peksag  added the comment:

The workaround was removed in 
https://github.com/berkerpeksag/cpython/commit/133138a284be1985ebd9ec9014f1306b9a425d98
 Can this issue be closed now?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added temporary workaround to make buildbots working. The bug is partially 
reappeared in __import__ in subinterpreter. I think this is better than 
reverting all patches.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4c07faa33915 by Serhiy Storchaka in branch '3.5':
Issue #27419: Added temporary workaround for subinterpreters.
https://hg.python.org/cpython/rev/4c07faa33915

New changeset 5540234ca517 by Serhiy Storchaka in branch 'default':
Issue #27419: Added temporary workaround for subinterpreters.
https://hg.python.org/cpython/rev/5540234ca517

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-17 Thread Berker Peksag

Berker Peksag added the comment:

I'm getting a segfault after d87f99e297d5 (SubinterpreterTest.test_subinterps).

$ ./python -m test test_capi
Run tests sequentially
0:00:00 [1/1] test_capi
Fatal Python error: Segmentation fault

Current thread 0x7fd5e401d700 (most recent call first):
  File "/home/berker/projects/cpython/default/Lib/test/support/__init__.py", 
line 2440 in run_in_subinterp
  File "/home/berker/projects/cpython/default/Lib/test/test_capi.py", line 337 
in test_subinterps
  File "/home/berker/projects/cpython/default/Lib/unittest/case.py", line 600 
in run
  File "/home/berker/projects/cpython/default/Lib/unittest/case.py", line 648 
in __call__
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 122 
in run
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 84 
in __call__
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 122 
in run
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 84 
in __call__
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 122 
in run
  File "/home/berker/projects/cpython/default/Lib/unittest/suite.py", line 84 
in __call__
  File "/home/berker/projects/cpython/default/Lib/test/support/__init__.py", 
line 1704 in run
  File "/home/berker/projects/cpython/default/Lib/test/support/__init__.py", 
line 1805 in _run_suite
  File "/home/berker/projects/cpython/default/Lib/test/support/__init__.py", 
line 1839 in run_unittest
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/runtest.py", 
line 179 in test_runner
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/runtest.py", 
line 180 in runtest_inner
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/runtest.py", 
line 144 in runtest
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/main.py", 
line 334 in run_tests_sequential
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/main.py", 
line 406 in run_tests
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/main.py", 
line 466 in _main
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/main.py", 
line 446 in main
  File "/home/berker/projects/cpython/default/Lib/test/libregrtest/main.py", 
line 508 in main
  File "/home/berker/projects/cpython/default/Lib/test/__main__.py", line 2 in 

  File "/home/berker/projects/cpython/default/Lib/runpy.py", line 85 in 
_run_code
  File "/home/berker/projects/cpython/default/Lib/runpy.py", line 184 in 
_run_module_as_main
Segmentation fault (core dumped)

See also 
http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/builds/1387/steps/test/logs/stdio
 for the same failure on buildbots.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c88ec1bb67d0 by Serhiy Storchaka in branch '3.5':
Issue #27419: Standard __import__() no longer look up "__import__" in globals
https://hg.python.org/cpython/rev/c88ec1bb67d0

New changeset d87f99e297d5 by Serhiy Storchaka in branch 'default':
Issue #27419: Standard __import__() no longer look up "__import__" in globals
https://hg.python.org/cpython/rev/d87f99e297d5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-04 Thread Brett Cannon

Brett Cannon added the comment:

The semantics for looking up __import__ is to only grab it from builtins and to 
ignore globals() and locals() (see issue #25500), so any fix/change should 
follow those semantics.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-07-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a reproducer for the second bug.

In Python 2.7 and Python 3.2 all works.

In Python 3.3+:

$ ./python import_bug_2.py 
Traceback (most recent call last):
  File "import_bug_2.py", line 6, in 
import os.path
  File "import_bug_2.py", line 4, in __import__
raise AssertionError
AssertionError

--
Added file: http://bugs.python.org/file43621/import_bug_2.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a reproducer for the first bug.

In Python 3.6:

$ ./python import_bug_1.py
1738
738
Fatal Python error: deallocating None

Current thread 0xb7552700 (most recent call first):
Aborted (core dumped)

In Python 3.5:

$ ./python import_bug_1.py
1709
Traceback (most recent call last):
  File "import_bug_1.py", line 10, in 
from .foo import bar
SystemError: Parent module '' not loaded, cannot perform relative import

--
type: behavior -> crash
Added file: http://bugs.python.org/file43586/import_bug_1.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27419] Bugs in PyImport_ImportModuleLevelObject

2016-06-30 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

1. If __package__ is None, and __spec__ is None or not set, and emitting 
ImportWarning raises an error, package is a borrowed reference to None, and it 
is decrefed. As result, the reference count of None is decremented.

2. __import__ is looked in globals or builtins and passed to _find_and_load(), 
_handle_fromlist() or called with highest package name. This doesn't match 
Python implementation. Python implementation uses _gcd_import which implements 
the original __import__, and isn't affected by overriding __import__ in globals 
or builtins.

--
components: Interpreter Core
files: fix-__import__.patch
keywords: patch
messages: 269564
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Bugs in PyImport_ImportModuleLevelObject
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43585/fix-__import__.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com