[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I also checked using 3.8 (built from commit 1f58f4fa6a0e3c60cee8df4a35c8dcf3903acde8), and it works there, so it looks as if 3.7 is the problem. > VENV38\Scripts\python.exe --version Python 3.8.0a2+ > VENV38\Scripts\python.exe mp_queue_example.p

[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Versions: > VENV\Scripts\python.exe --version Python 3.7.2 > VENV36\Scripts\python.exe --version Python 3.6.8 -- ___ Python tracker <https://bugs.python.org/i

[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I just checked using 3.6. The program does NOT hang when executed from a 3.6 virtualenv. So this is a possible regression (or something could be messed up on my system). D:\dev\eva_v_next>VENV36\Scripts\python.exe mp_queue_example.py main, pid=28

[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna : When executing mp_queue_example.py in the system interpreter: D:\dev\eva_v_next>d:\python372\python.exe mp_queue_example.py main, pid=892, executable=d:\python372\python.exe process_worker, pid=12848, executable=d:\python372\python.exe submitt

[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2019-03-08 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: See also: https://bugs.python.org/issue36227 PR: https://github.com/python/cpython/pull/12225 -- nosy: +Bernt.Røskar.Brenna ___ Python tracker <https://bugs.python.org/issue31

[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2019-03-08 Thread Bernt Røskar Brenna
Change by Bernt Røskar Brenna : -- keywords: +patch pull_requests: +12225 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31256> ___ _

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I pushed changes to the PR. I also added xml_declaration and default_namespace to the tostringlist() method. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I will add xml_declaration and push to the existing PR. -- ___ Python tracker <https://bugs.python.org/issue36227> ___ ___

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-07 Thread Bernt Røskar Brenna
Change by Bernt Røskar Brenna : -- keywords: +patch pull_requests: +12215 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36227> ___ _

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-07 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna : default_namespace is often used when serializing ET elements. tostring() is mainly a wrapper around ElementTree.write(), and it is therefore natural that it mirrors write's argument. tostring() already passes encoding, method and short_empty_elements

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: A question/comment: In this case (and there are probably other cases like it) - it seems to me that the docstring (in os.py) and the docs (in os.rst) are similar enough that the docstring from the code could be included in the docs (using Sphinx's

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Yet another patch, this time including changes to os.walk()'s docstring as well. Ignore the two other files. -- Added file: http://bugs.python.org/file40849/os_walk_doc.patch ___ Python tracker <

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-23 Thread Bernt Røskar Brenna
Changes by Bernt Røskar Brenna <bernt.bre...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file40846/os_walk_docs_change_unclear_language.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-23 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I agree your suggestion is better, I did not see it before submitting my first patch. I've added another patch. -- Added file: http://bugs.python.org/file40847/os_walk_docs_change_unclear_language_2.patch

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-22 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: OK, I'll submit a patch -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25461> ___ ___ Pyth

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-22 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna: At least for me (non-english speaker), the following is confusing: "Modifying dirnames when topdown is False is ineffective, because in bottom-up mode the directories in dirnames are generated before dirpath itself is generated." I suggest

[issue20529] Unittest displays ResourceWarning warnings when running tests, it probably should not

2014-02-06 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna: Given the following file test_reswarn.py: import unittest class TestResourceWarning(unittest.TestCase): def test_it(self): self.assertIn(TestResourceWarning, open(__file__).read()) Running the test: $ python -m unittest

[issue20529] Unittest displays ResourceWarning warnings when running tests, it probably should not

2014-02-06 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: OK I see. I'll just use: python -W ignore:ResourceWarning -m unittest -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20529

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I just tested on 3.4a0. Observed the following changes: - subprocess_devnull now NEVER fails. - subprocess_redirfile does not fail as often as before, but still fails. I changed the number of tasks to 20 and increased max_workers to 5 to get

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Increasing max_workers to 5 and running 20 tasks highlighs the 3.3-3.4 difference (code in attached file testscript4.py): Version: 3.4.0a4 (v3.4.0a4:e245b0d7209b, Oct 20 2013, 19:23:45) [MSC v.1600 32 b it (Intel)] Platform: Windows-XP-5.1.2600-SP3 Tasks

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Changes by Bernt Røskar Brenna bernt.bre...@gmail.com: -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19575 ___ ___ Python

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Changes by Bernt Røskar Brenna bernt.bre...@gmail.com: -- components: +IO ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19575 ___ ___ Python-bugs

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: I tested, and locking around the subprocess.Popen call indeed works on Python 3.4. Thanks! Do you have any tips on how to accomplish the same thing on Python 3.3 (locking around Popen did not make any difference on 3.3

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Never mind, I figured it: On Python 3.3, the combination of locking around Popen and opening the file that I redirect to using the code below works (code from scons): def open_noinherit(*args, **kwargs): fp = open(*args, **kwargs

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-18 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: And here's a function that does not require pywin32: def open_noinherit_ctypes(*args, **kwargs): HANDLE_FLAG_INHERIT = 1 import msvcrt from ctypes import windll, WinError fp = open(*args, **kwargs) if not windll.kernel32

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-14 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Another script, another test case. Four different tasks are run: subprocess_redirfile: Popen(stdout=file) subprocess_devnull: Popen(stdout=DEVNULL) subprocess_noredirect: Popen() nosubprocess: No Popen() call Judging from the output it looks

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-14 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Similar result on Windows Server 2008: Platform: Windows-2008ServerR2-6.1.7600 task_type #threads result subprocess_redirfile 2 9 errors subprocess_redirfile 1 OK subprocess_devnull2 9 errors

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-14 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: @neologix: How can it not have anything to do with threads? - It always works with max_workers == 1 - When max_workers == 2, shutil.rmtree sometimes fails -- ___ Python tracker rep...@bugs.python.org http

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-14 Thread Bernt Røskar Brenna
Changes by Bernt Røskar Brenna bernt.bre...@gmail.com: -- nosy: +astrand ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19575 ___ ___ Python-bugs

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-14 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: @neologix: But how do you explain this: subprocess_devnull2 9 errors subprocess_devnull1 OK subprocess_devnull creates a file, then starts a subprocess (that redirects to DEVNULL, does not use the file), then tries

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-13 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna: Running the following task using concurrent.futures.ThreadPoolExecutor works with max_workers == 1 and fails when max_workers 1 : def task(): dirname = tempfile.mkdtemp() f_w = open(os.path.join(dirname, stdout.txt), w) f_r = open

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-13 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Simpler task method that still reproduces the problem: def task(): dirname = tempfile.mkdtemp() f_w = open(os.path.join(dirname, stdout.txt), w) e_w = open(os.path.join(dirname, stderr.txt), w) with subprocess.Popen(dir, shell=True

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-13 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: No indexing and no virus scanner running. Note that it never fails if running in a single thread. IMO, this indicates that external processes interfering is not the problem. -- ___ Python tracker rep

[issue19575] subprocess.Popen with multiple threads: Redirected stdout/stderr files still open after process close

2013-11-13 Thread Bernt Røskar Brenna
Bernt Røskar Brenna added the comment: Here's an improved repro script. I believe it demonstrates that it is the combination of subprocess.Popen and threading that causes the problem. Here's the output from my Windows XP VM: *** c:\... c:\Python33\python.exe repro_improved.py Windows-XP

[issue7883] CallTips.py _find_constructor does not work

2011-12-22 Thread Bernt Røskar Brenna
Bernt Røskar Brenna bernt.bre...@gmail.com added the comment: Attached is Lib/test/test_idlelib.py, containing a unit test for the issue. -- Added file: http://bugs.python.org/file24075/test_idlelib.py ___ Python tracker rep...@bugs.python.org http

[issue7876] unittest docs use deprecated method in code example

2010-02-08 Thread Bernt Røskar Brenna
Bernt Røskar Brenna bernt.bre...@gmail.com added the comment: Sorry, forgot to check svn, I was looking at the 3.1.1 release tarball. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7876

[issue7883] CallTips.py _find_constructor does not work

2010-02-08 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna bernt.bre...@gmail.com: Test case: In IDLE python shell: from http.client import HTTPConnection c = HTTPConnection( Notice that the call tip is an empty parenthesis. This patch works for me: [/tmp/py3k/Lib/idlelib] $ svn diff Index: CallTips.py

[issue7884] IDLE 3.1.1 crashes with UnicodeDecodeError when I press Ctrl-Space

2010-02-08 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna bernt.bre...@gmail.com: Platform: Linux Python 3.1.1 built from source. Tk version 8.4, Tcl version 8.4. Idle 2.6.4 (also built from source), works correctly (executes force-open-completions). Test case: - Start idle3 - press Ctrl-Space in the IDLE

[issue7876] unittest docs use deprecated method in code example

2010-02-07 Thread Bernt Røskar Brenna
New submission from Bernt Røskar Brenna bernt.bre...@gmail.com: Suggest change the code example to use assertRaises instead of failUnlessRaises. The docs read: assertRaises(exception[, callable, ...])¶ failUnlessRaises(exception[, callable, ...])¶ with self.failUnlessRaises