[issue18122] RuntimeError: not holding the import lock

2020-11-17 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as this is a python-2 only issue.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> 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



[issue18122] RuntimeError: not holding the import lock

2013-06-20 Thread Richard Oudkerk

Richard Oudkerk added the comment:

See also #9573 and #15914.

--

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-03 Thread Armin Rigo

Armin Rigo added the comment:

Indeed, no clue: it seems I don't get the error only on my system-installed 
2.7.3 on Linux 32.  I do get it on any other Python I tried, like 2.6.x, or the 
system-installed 2.7.1 on Linux 64.  So it's not actually a new bug.

--

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-03 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Forking as a side effect of importing a module is evil.  I think raising a 
RuntimeError is preferable to trying to make it Just Work.

But maybe one could do

void
_PyImport_ReInitLock(void)
{
if (import_lock != NULL) {
import_lock = PyThread_allocate_lock();
PyThread_acquire_lock(import_lock, WAIT_LOCK);
}
import_lock_thread = PyThread_get_thread_ident();
_PyImport_ReleaseLock();
}

--
nosy: +sbt

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-03 Thread Dmi Baranov

Dmi Baranov added the comment:

My system python-2.7.3 affected too:

python -c 'import sys;print(sys.version);import x'
2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3]
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError: not holding the import lock

$ uname -a
Linux d9frog9n-desktop 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 
2012 i686 i686 i386 GNU/Linux

Armin, at which system/architecture you passing that case on 2.7.3?

--

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> 2.7.3 passes, 2.7 trunk fails

Python 2.7.0, 2.7.2 and 2.6.8 all fail here.
Dmi is right: it starts failing at 4afc50d15544.
(note that Python 3 isn't affected)

--

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-03 Thread Armin Rigo

Armin Rigo added the comment:

The bug is different, because it doesn't depend on details of the platform.

--

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Dmi Baranov

Dmi Baranov added the comment:

Looks like old history from issue 7242

--
nosy: +dmi.baranov, gregory.p.smith

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
nosy: +pitrou

___
Python tracker 

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



[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Armin Rigo

New submission from Armin Rigo:

A new bug, introduced in recent Python 2.7 (2.7.3 passes, 2.7 trunk fails):

With the attached x.py, running "python -c 'import x'" fails with RuntimeError: 
not holding the import lock.

It occurs when doing a fork() while holding the import lock, if the child 
process imports more things (here distutils, could be anything) before finally 
trying to release the import lock (here by returning from the original 'import 
x').

--
files: x.py
messages: 190498
nosy: arigo
priority: normal
severity: normal
status: open
title: RuntimeError: not holding the import lock
versions: Python 2.7
Added file: http://bugs.python.org/file30450/x.py

___
Python tracker 

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