Bernt Røskar Brenna 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
<http://bugs.python.org/issue7
New submission from Bernt Røskar Brenna :
Suggest change the code example to use assertRaises instead of failUnlessRaises.
The docs read:
assertRaises(exception[, callable, ...])¶
failUnlessRaises(exception[, callable, ...])¶
with self.failUnlessRaises(some_error_class
Bernt Røskar Brenna added the comment:
Sorry, forgot to check svn, I was looking at the 3.1.1 release tarball.
--
___
Python tracker
<http://bugs.python.org/issue7
New submission from Bernt Røskar Brenna :
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
New submission from Bernt Røskar Brenna :
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 shell
- idle crashes, and
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_ele
Change by Bernt Røskar Brenna :
--
keywords: +patch
pull_requests: +12215
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36227>
___
_
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>
___
___
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
Change by Bernt Røskar Brenna :
--
keywords: +patch
pull_requests: +12225
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31256>
___
_
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
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
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
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
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
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"), "
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")
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
<h
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.
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 as if it is
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
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
<http://bugs.python.
Changes by Bernt Røskar Brenna :
--
nosy: +astrand
___
Python tracker
<http://bugs.python.org/issue19575>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 to
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
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
Changes by Bernt Røskar Brenna :
--
versions: +Python 3.4
___
Python tracker
<http://bugs.python.org/issue19575>
___
___
Python-bugs-list mailing list
Unsub
Changes by Bernt Røskar Brenna :
--
components: +IO
___
Python tracker
<http://bugs.python.org/issue19575>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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.ker
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 -
Bernt Røskar Brenna added the comment:
OK I see.
I'll just use:
python -W ignore:ResourceWarning -m unittest
--
___
Python tracker
<http://bugs.python.org/is
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
Bernt Røskar Brenna added the comment:
OK, I'll submit a patch
--
___
Python tracker
<http://bugs.python.org/issue25461>
___
___
Python-bugs-list m
Changes by Bernt Røskar Brenna :
--
keywords: +patch
Added file:
http://bugs.python.org/file40846/os_walk_docs_change_unclear_language.patch
___
Python tracker
<http://bugs.python.org/issue25
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.
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
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
39 matches
Mail list logo