unittest and threading

2012-01-24 Thread Ross Boylan
find anything definitive. If it matters, I'm using CPython 2.7. Thanks. If you're using email, I'd appreciate a cc. Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest and threading

2012-01-25 Thread Ross Boylan
On Tue, 2012-01-24 at 13:54 -0800, Ross Boylan wrote: > Is it safe to use unittest with threads? > > In particular, if a unit test fails in some thread other than the one > that launched the test, will that information be captured properly? > > A search of the net shows a s

Condition.wait() behavior with timeout

2012-01-30 Thread Ross Boylan
rs waiting on the condition, not one with notify() and a single thread waiting (which is what I'm thinking about). The thread does say there is no return value; it seems to me it would be useful to document that if it's still true (or True :). Can anyone help me understand w

#line in python

2012-02-18 Thread Ross Boylan
s and methods that could do the conversion on the fly? I don't know if there's a way to go from the function (or class) object the decorator receives to the AST. Comments? Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: #line in python (dirty tricks)

2012-02-20 Thread Ross Boylan
Duncan Booth wrote > Ross Boylan wrote: > > > As an extension or alternate, could there be a decorator like > > @source_line(lineno, filename) > > for classes and methods that could do the c

inserting \ in regular expressions

2011-10-26 Thread Ross Boylan
sub(r"([\\\"])", "\1", 'Silly " quote') 'Silly \\\x01 quote' >>> re.sub(r"([\\\"])", "\\1", 'Silly " quote') 'Silly \\" quote' Or perhaps I'm confused about what the displayed results mean. If a string has a literal \, does it get shown as \\? I'd appreciate it if you cc me on the reply. Thanks. Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: inserting \ in regular expressions [solved]

2011-11-05 Thread Ross Boylan
On Wed, 2011-10-26 at 12:48 -0700, Ross Boylan wrote: > I want to replace every \ and " (the two characters for backslash and > double quotes) with a \ and the same character, i.e., > \ -> \\ > " -> \" I'd like to thank Ian, Dave, MRAB, and John for their he

logging module and threading

2007-05-11 Thread Ross Boylan
parent would get each logged event right away. However, logging.getLogger("a").error("test") produces only a single log message indicating an associated object of "a". The docs lead me to expect that I'd see one message from "a" and another from root.

question about subprocess and shells

2009-12-04 Thread Ross Boylan
cs of the pipes for the processes standard file handles. Do they need to be closed (judging from the examples, no)? When reads/writes to them return, and what state is the stream in at the time? Thanks for any wisdom you can offer. Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list