New submission from Niko :
Using 'mock_open' to unit test a code that uses the 'seek()' function for the
file object does not work. This would be a great addition for mock_open
functionality as this use case happens occasionally.
Test file contains:
def test_one(s
Niko Fink added the comment:
I recently had a similar issue, a MWE can be found here (and also attached):
https://gist.github.com/N-Coder/89b1be8e5cfb83b1b03ade8485676982
As soon as `loop.stop` in loop_stop_problem.py:44 is called in a non-threadsafe
way from another thread, i.e. without
Niko Yasui added the comment:
I see, I didn't realize that the simpler code would break under certain
conditions.
While there are definitely simpler examples in other documents, I haven't been
able to find any indication that there is a simpler way to do multiprocessing
and loggin
Changes by Niko Yasui :
Removed file: http://bugs.python.org/file44198/multi_log_cookbook.py
___
Python tracker
<http://bugs.python.org/issue27837>
___
___
Python-bug
Niko Yasui added the comment:
Thank you both for the helpful comments.
Vinay, since you want to illustrate a listener process in the multiprocessing
example, why not include a shorter, simpler example beforehand? This is my
first time using logging, and it took me multiple hours to figure out
New submission from Niko Yasui:
Removed the unnecessary listener function and changed the worker loggers from
root to children. Also replaced print statements with logging statements and a
stdout handler to illustrate the usefulness of handler levels. This version
also doesn't requ
Niko Wilbert added the comment:
This issue is also a real pain when using namedtuple. In many situations a
namedtuple should be serialized as a dict, but there is no reasonable way to
get this behavior.
Earlier solutions (e.g., see
http://stackoverflow.com/questions/5906831/serializing-a
New submission from Niko Matsakis :
Executing code like this:
>>> r = re.compile(r'(\w+)*=.*')
>>> r.match("abcdefghijklmnopqrstuvwxyz")
takes a long time (around 12 seconds, on my machine). Presumably this is
because it is enumerating all the various