[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Irit Katriel  added the comment:

@uniocto - thank you for the tests.

--
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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset c05d8a6b67785450b1fec0d30fe26d5478bc4f0b by Irit Katriel in 
branch '3.9':
bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26211)
https://github.com/python/cpython/commit/c05d8a6b67785450b1fec0d30fe26d5478bc4f0b


--

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 373741a97c9f6ffee427c2b4eaccb74347af228a by Irit Katriel in 
branch '3.10':
[3.10] bpo-25872: Add unit tests for linecache and threading (GH-25913) 
(GH-26212)
https://github.com/python/cpython/commit/373741a97c9f6ffee427c2b4eaccb74347af228a


--

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib) -Interpreter Core

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +24829
pull_request: https://github.com/python/cpython/pull/26212

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +24828
pull_request: https://github.com/python/cpython/pull/26211

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24825
pull_request: https://github.com/python/cpython/pull/26208

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-07 Thread So Ukiyama


So Ukiyama  added the comment:

I apologize if this is rude, as I am not familiar with this method.
I created a following PR to add unit tests about this issue.

https://github.com/python/cpython/pull/25913

I would be happy to receive feedback on the PR.

--
components: +Interpreter Core -Library (Lib)
nosy: +uniocto

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2021-05-05 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 8.0 -> 9.0
pull_requests: +24582
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/25913

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-11-19 Thread Irit Katriel


Irit Katriel  added the comment:

The issue was fixed but a unit test for this still needs to be added.

--
keywords: +easy -patch
nosy: +iritkatriel
stage: patch review -> test needed

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 852e8a7ed4d3d48e5c1c8120cfc932eb6a84bb8e by Miss Islington (bot) 
in branch '3.7':
[3.8] bpo-25872: Fix KeyError in linecache when multithreaded (GH-18007) 
(GH-20092)
https://github.com/python/cpython/commit/852e8a7ed4d3d48e5c1c8120cfc932eb6a84bb8e


--

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset b86636bff4b29ce23c886df079715dd951f13a07 by Andrew Kuchling in 
branch '3.8':
[3.8] bpo-25872: Fix KeyError in linecache when multithreaded (GH-18007) 
(GH-20092)
https://github.com/python/cpython/commit/b86636bff4b29ce23c886df079715dd951f13a07


--

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19755
pull_request: https://github.com/python/cpython/pull/20511

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-18 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-14 Thread A.M. Kuchling


Change by A.M. Kuchling :


--
nosy: +akuchling
nosy_count: 5.0 -> 6.0
pull_requests: +19398
pull_request: https://github.com/python/cpython/pull/20092

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-05-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +19394
pull_request: https://github.com/python/cpython/pull/20079

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-01-14 Thread Michael Graczyk


Change by Michael Graczyk :


--
pull_requests: +17408
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18007

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-01-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Michael, reopening. I was wrong while trying the reproducer since map is 
lazy in Python 3 and threads were not executed.

--
resolution: wont fix -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.9 -Python 2.7

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-01-05 Thread Michael Graczyk


Michael Graczyk  added the comment:

This issue still exists in Python 3. The repro just needs to be changed so that 
the threads are actually started.

- map(lambda t: t.start(), threads)
- map(lambda t: t.join(), threads)
+ [t.start() for t in threads]
+ [t.join() for t in threads]

My fix is linked.

--
nosy: +Michael Graczyk

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-01-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

As @xtreak said, this looks like it was fixed for Python 3 and was only an 
issue for 2.7, so I'm closing the issue.

--
nosy: +cheryl.sabella
resolution:  -> wont fix
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



[issue25872] multithreading traceback KeyError when modifying file

2019-11-22 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +16845
pull_request: https://github.com/python/cpython/pull/17360

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2019-02-26 Thread Christopher Unkel


Change by Christopher Unkel :


--
keywords: +patch
pull_requests: +12085
stage:  -> patch review

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2018-08-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It seems there was a major refactor in traceback module with 
6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39 where this was fixed in Python 3. 
Ignoring the KeyError seems reasonable to me.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2015-12-15 Thread Michael Allen

New submission from Michael Allen:

Modifying a file while getting a stacktrace across multiple threads causes 
linecache's cache to bust and del to be called on the global cache variable. 
This is not thread safe and raises a KeyError.

Reproducible with,

import threading
import traceback

def main():
with open(__file__, 'a') as fp:
fp.write(' ')
traceback.format_stack()

threads = [
threading.Thread(target=main)
for i in range(100)
]
map(lambda t: t.start(), threads)
map(lambda t: t.join(), threads)

I see the following error,

Exception in thread Thread-56:
Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 810, 
in __bootstrap_inner
self.run()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 763, 
in run
self.__target(*self.__args, **self.__kwargs)
  File "test.py", line 7, in main
traceback.format_stack()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 279, 
in format_stack
return format_list(extract_stack(f, limit))
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 305, 
in extract_stack
linecache.checkcache(filename)
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/linecache.py", line 69, 
in checkcache
del cache[filename]
KeyError: 'test.py'

Possible solution is to ignore KeyError on del cache[filename].

--
components: Library (Lib)
messages: 256469
nosy: Michael Allen
priority: normal
severity: normal
status: open
title: multithreading traceback KeyError when modifying file
type: crash
versions: Python 2.7

___
Python tracker 

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