I've run into a threading error in some code when I run it on MacOS that works
flawlessly on a *BSD system running the same version of python. I'm running
the python 2.7.6 for MacOS distribution from python.org's downloads page.
I have tried to reproduce the error with a simple example, but so
On Friday, 25 April 2014 10:05:03 UTC-4, Chris Angelico wrote:
> 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.
I liked the theory, but I've run some tests and can't reproduce the error that
w
On Friday, 25 April 2014 14:58:56 UTC-4, Ned Deily wrote:
> FWIW, the Python 2 version of subprocess is known to be thread-unsafe.
> There is a Py2 backport available on PyPI of the improved Python 3
> subprocess module:
Since that't the only thread that calls anything in subprocess, and I'm o
On Sunday, 27 April 2014 10:33:38 UTC-4, Chris Angelico wrote:
> In most contexts, "thread unsafe" simply means that you can't use the
> same facilities simultaneously from two threads (eg a lot of database
> connection libraries are thread unsafe with regard to a single
> connection, as they'll
I'm wondering if there's a way in python to cause __init__ to return a class
other than the one initially specified. My use case is that I'd like to have a
superclass that's capable of generating an instance of a random subclass.
I've tried both returning the subclass (as I would when overloa
On Sep 15, 1:35 am, Chris Rebert wrote:
> Override __new__() instead:
> http://docs.python.org/reference/datamodel.html#object.__new__
Aha.. thanks! The reference book I'm working from neglects to mention
__new__, so I'd assumed __init__ was the constructor. It hadn't
occurred to me that python
On Sep 15, 1:54 am, Ryan Kelly wrote:
> The above will do exactly what you want, but it's generally bad style
> unless you have a very specific use-case. Is there a particular reason
> you need to "magically" return a subclass, rather than making this
> explicit in the code?
>
> To be friendlier
On Sep 15, 1:54 am, Ryan Kelly wrote:
> To be friendlier to others reading your code, I would consider using a
> classmethod to create an alternative constructor:
I finally got back to looking at this today. As it turns out, un-
overriding __new__ in the child class is more complicated than I fi
I'm trying to figure out a couple of things with the logging module,
and I'm hoping someone can provide some pointers. I've read through
the module docs on python.org, the basic and advanced tutorials, and
the cookbook post, but a couple of things still elude me.
First, I'd like to be able to per
On Jan 11, 9:34 pm, Roy Smith wrote:
> What I would do is log to syslog (logging.handlers.SysLogHandler) and
> let syslog worry about rotating log files. Why reinvent the wheel?
Syslog is fine for an application run by an administrator, but isn't
an option for a user.
--
http://mail.python.org/
On Jan 12, 8:03 pm, K Richard Pixley wrote:
> Here's the confusion. Each log named __name__ is under the root logger.
> If you want them all, then catch them all with the root logger.
Thanks! I knew I was missing something obvious. Between you and Jean-
Michael Pichavant I've figured out wha
11 matches
Mail list logo