MacOS 10.9.2: threading error using python.org 2.7.6 distribution

Chris Angelico rosuav at gmail.com
Fri Apr 25 10:05:03 EDT 2014


On Fri, Apr 25, 2014 at 11:43 PM, Matthew Pounsett
<matt.pounsett at gmail.com> wrote:
> If I insert that object into the test code and run it instead of MyThread(), I get the error.  I can't see anything in there that should cause problems for the threading module though... especially since this runs fine on another system with the same version of python.
>
> Any thoughts on what's going on here?

First culprit I'd look at is the mixing of subprocess and threading.
It's entirely possible that something goes messy when you fork from a
thread.

Separately: You're attempting a very messy charset decode there. You
attempt to decode as UTF-8, errors ignored, and if that fails, you log
an error... and continue on with the original bytes. You're risking
shooting yourself in the foot there; I would recommend you have an
explicit fall-back (maybe re-decode as Latin-1??), so the next code is
guaranteed to be working with Unicode. Currently, it might get a
unicode or a str.

ChrisA



More information about the Python-list mailing list