mgedmin/ghcloneall

subprocess.Popen() is not threadsafe on Python 2!

Closed this issue · 2 comments

I'm happily calling subprocess.Popen() from threads but apparently this can deadlock. Google has the details (a StackOverflow post with links to multiple Python bugs).

Wow I was in a rush when I filed this.

I think I was referring to this StackOverflow post: https://stackoverflow.com/questions/21194380/is-subprocess-popen-not-thread-safe

There's apparently a simple fix: use subprocess32 instead of subprocess on Python 2.

I'm not in a rush to apply workarounds for this, because support for Python 2 ends soon (January 1 2020), and nobody has complained about this problem.

I don't mind fixing this if there turn out to be actual users for whom this is a real problem.