[issue44102] mock_open does not support the use of 'seek()'

2021-05-10 Thread Niko
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

[issue29780] Interpreter hang on self._epoll.poll(timeout, max_ev)

2018-01-31 Thread Niko Fink
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

[issue27837] Logging Cookbook Improvement

2016-08-23 Thread Niko Yasui
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

[issue27837] Logging Cookbook Improvement

2016-08-23 Thread Niko Yasui
Changes by Niko Yasui : Removed file: http://bugs.python.org/file44198/multi_log_cookbook.py ___ Python tracker <http://bugs.python.org/issue27837> ___ ___ Python-bug

[issue27837] Logging Cookbook Improvement

2016-08-23 Thread Niko Yasui
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

[issue27837] Logging Cookbook Improvement

2016-08-23 Thread Niko Yasui
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

[issue12657] Cannot override JSON encoding of basic type subclasses

2011-08-19 Thread Niko Wilbert
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

[issue11307] re engine exhaustively explores more than necessary

2011-02-24 Thread Niko Matsakis
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