[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

If you have a pending overlapped operation then the associated buffer should 
not be deallocated until that operation is complete, or else you are liable to 
get a crash or memory corruption.

Unfortunately WinXP provides no reliable way to cancel a pending operation -- 
there is CancelIo() but that just cancels operations started by the *current 
thread* on a handle.  Vista introduced CancelIoEx() which allows cancellation 
of a specific overlapped op.

These warnings happen in the deallocator because the buffer has to be freed.

For Vista and later versions of Windows these warnings are presumably 
unnecessary since CancelIoEx() is used.

For WinXP the simplest thing may be to check if Py_Finalize is non-null and if 
so suppress the warning (possibly leaking the buffer since we are exiting 
anyway).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread ThurnerRupert

ThurnerRupert added the comment:

david, you mentioned working code. i am the opposite of an expert in the source 
code of python, but i thought i would be able to at least find where the code 
is for sys.stdout.write and sys.stderr.write, where i thought \ should be 
replaced by / when running in cygwin or msys/mingw. embarrassing for me, i did 
not find it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

For Vista and later versions of Windows these warnings are presumably 
unnecessary since CancelIoEx() is used.

As close() on regular files, I would prefer to call explicitly cancel() to 
control exactly when the overlapped operation is cancelled. Can't you fix 
multiprocessing and/or the unit test to ensure that all overlapped operations 
are completed or cancelled?

close() does flush buffers and so may fail. Is it the same for 
CancelIo/CancelIoEx? In the official documentation, only one error case is 
described: If this function cannot find a request to cancel, the return value 
is 0 (zero), and GetLastError returns ERROR_NOT_FOUND.

The warning is useful because it may be a real bug in the code. I also like 
ResourceWarning(unclosed file/socket ...) warnings.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 As close() on regular files, I would prefer to call explicitly cancel() 
 to control exactly when the overlapped operation is cancelled.

If you use daemon threads then you have no guarantee that the thread will ever 
get a chance to explicitly call cancel().

 Can't you fix multiprocessing and/or the unit test to ensure that all 
 overlapped operations are completed or cancelled?

On Vista and later, yes, this is done in the deallocator using CancelIoEx(), 
although there is still a warning.  On XP it is not possible because CancelIo() 
has to be called from the same thread which started the operation.

I think these warnings come from daemon threads used by manager processes.  
When the manager process exits some background threads may be blocked doing an 
overlapped read.

(It might be possible to wake up blocked threads by setting the event handle 
returned by _PyOS_SigintEvent().  That might allow the use of non-daemon 
threads.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

You certainly can't replace *all* occurrences of backslash characters with 
forward slashes when running in a cygwin or msys shell anyway. Backslashes have 
many uses besides being (annoyingly) Windows path separators.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

When bytearray_setslice_linear() is called to shrink the buffer with lo=0 and 
PyByteArray_Resize() fails because of a memory error, the bytearray is leaved 
in an inconsistent state: ob_start has been updated but not the size.

I found the issue using failmalloc: test_nonblock_pipe_write_smallbuf() of 
test_io does fail with an assertion error when testing the _pyio module which 
uses bytearray for the write buffer.

Attached patch restores the bytearray in its previous state if 
PyByteArray_Resize() failed.

I prefer to only fix the issue in Python 3.4 because it is unlikely and I 
prefer to not introduce regressions in previous Python versions.


I made a similar fix for list:

changeset:   84717:3f25a7dd8346
user:Victor Stinner victor.stin...@gmail.com
date:Fri Jul 19 23:06:21 2013 +0200
files:   Objects/listobject.c
description:
Issue #18408: Fix list_ass_slice(), handle list_resize() failure

I tested the patch manually by injecting a fault using gdb: list items are 
correctly restored on failure.

--
files: bytearray_setslice_mem_error.patch
keywords: patch
messages: 202736
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: bytearray_setslice_linear() leaves the bytearray in an inconsistent 
state on memory allocation failure
versions: Python 3.4
Added file: http://bugs.python.org/file32593/bytearray_setslice_mem_error.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19437] More failures found by pyfailmalloc

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e40d07d3cd2 by Victor Stinner in branch 'default':
Issue #19437: Fix PyImport_ImportModuleLevelObject(), handle
http://hg.python.org/cpython/rev/8e40d07d3cd2

New changeset a217ea1671a8 by Victor Stinner in branch 'default':
Issue #19437: Fix PyCData_GetContainer() of ctypes, handle PyDict_New() failure
http://hg.python.org/cpython/rev/a217ea1671a8

New changeset dc5ae99bc605 by Victor Stinner in branch 'default':
Issue #19437: Fix GetKeepedObjects() of ctypes, handle PyCData_GetContainer()
http://hg.python.org/cpython/rev/dc5ae99bc605

New changeset 13203ea0ac5b by Victor Stinner in branch 'default':
Issue #19437: Fix ctypes, handle PyCData_GetContainer() and GetKeepedObjects()
http://hg.python.org/cpython/rev/13203ea0ac5b

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19437
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Eric V. Smith

Eric V. Smith added the comment:

Agreed with Nick. I think it's clear than any change to the behavior will have 
to take place inside os.path. I just don't know what that change would be.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

Python C API evolves. For example, the Unicode type has been rewriten for 
scratch to use a more efficient design. Would it be possible to mark deprecated 
functions as deprecated, so users will be noticed that the API evolved and 
Python has better functions?

For example, PyUnicode_GET_SIZE() is deprecated and returns a different value 
than PyUnicode_GET_LENGTH() if wchar_t size is 16-bit (ex: Windows and AIX).

GCC has an nice __attribute__((deprecated)) to tag functions.

--
messages: 202740
nosy: haypo
priority: normal
severity: normal
status: open
title: Use __attribute__((deprecated)) to warn usage of deprecated functions 
and macros
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19569
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-11-13 Thread Sascha Peilicke

New submission from Sascha Peilicke:

Encountered an isssue with Unicode paths when invoking Sphinx' distutils 
command (i.e. 'setup.py build_sphinx'): 

$ python setup.py build_sphinx
running build_sphinx
error: 'source_dir' must be a directory name (got `doc/source`)

...
(Pdb) l
 96 for root, dirnames, filenames in os.walk(guess):
 97 if 'conf.py' in filenames:
 98 return root
 99 return None
100 
101  - def finalize_options(self):
102 if self.source_dir is None:
103 self.source_dir = self._guess_source_dir()
104 self.announce('Using source directory %s' % self.source_dir)
105 self.ensure_dirname('source_dir')
106 if self.source_dir is None:
(Pdb) n
 /usr/lib/python2.7/site-packages/sphinx/setup_command.py(102)finalize_options()
- if self.source_dir is None:
(Pdb) n
 /usr/lib/python2.7/site-packages/sphinx/setup_command.py(105)finalize_options()
- self.ensure_dirname('source_dir')
(Pdb) s
--Call--
 /usr/lib64/python2.7/distutils/cmd.py(266)ensure_dirname()
- def ensure_dirname(self, option):
(Pdb) s
...
--Call--
 /usr/lib64/python2.7/distutils/cmd.py(253)_ensure_tested_string()
- def _ensure_tested_string(self, option, tester,
(Pdb) 
 /usr/lib64/python2.7/distutils/cmd.py(255)_ensure_tested_string()
- val = self._ensure_stringlike(option, what, default)


Command.ensure_dirname (likewise ensure_filename) fails because 
_ensure_stringlike only tests for isistance(..., str) rather than 
isinstance(..., types.StringTypes).

--
components: Distutils
files: distutils-ensure_stringlike-unicode.patch
keywords: patch
messages: 202741
nosy: saschpe
priority: normal
severity: normal
status: open
title: distutils' Command.ensure_dirname fails on Unicode
type: behavior
versions: Python 2.7
Added file: 
http://bugs.python.org/file32594/distutils-ensure_stringlike-unicode.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19570
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

This is more a feature request than a bug. You should use an encoded path, or 
upgrade to Python 3 which handles Unicode correctly.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19570
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

I just commited a change to avoid PyUnicode_GET_SIZE(): this function doesn't 
handle errors very well, if PyUnicode_AsUnicode() fails, the result is zero. 
The caller is unable to know that an error occurred.

http://hg.python.org/cpython/rev/28f71af02b69

Don't use deprecated function PyUnicode_GET_SIZE()

Replace it with PyUnicode_GET_LENGTH() or PyUnicode_AsUnicodeAndSize()


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19569
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17828] More informative error handling when encoding and decoding

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

Patch for the final version that I'm about to commit.

- I realised the exception chaining would only trigger for the encode() and 
decode() methods, when it was equally applicable to the codecs.encode() and 
codecs.decode() functions, so I updated the test cases and moved it accordingly.

- reworded the What's New text to better clarify the historical confusion 
around the nature of the codecs module that these changes are intended to 
rectify (since the intent is clear from the existence of codecs.encode and 
codecs.decode and their coverage in the test suite since Python 2.4).

--
stage: needs patch - commit review
Added file: 
http://bugs.python.org/file32595/issue17828_improved_codec_errors_v7.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17828
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19343] Expose FreeBSD-specific APIs in resource module

2013-11-13 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. Here's a preliminary patch.

--
keywords: +patch
nosy: +Claudiu.Popa
Added file: http://bugs.python.org/file32596/resource.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19343
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I think the attached patch should fix it.  Note that with the patch the 
RuntimeError can probably only occur on Windows XP.

Shall I apply it?

--
keywords: +patch
Added file: http://bugs.python.org/file32597/dealloc-runtimeerror.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19567] mimetypes.init() raise unhandled excption in windows

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 9291.  Can you answer Victor's question over there 
for us?

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - mimetypes initialization fails on Windows because of non-Latin 
characters in registry

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19567
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2013-11-13 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +adamhj

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9291
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-11-13 Thread Sascha Peilicke

Sascha Peilicke added the comment:

Happens since Sphinx-1.2b3, here's some context: 
https://bitbucket.org/birkenfeld/sphinx/issue/1142

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19570
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17828] More informative error handling when encoding and decoding

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 854a2cea31b9 by Nick Coghlan in branch 'default':
Close #17828: better handling of codec errors
http://hg.python.org/cpython/rev/854a2cea31b9

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17828
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

As noted above, it's still not clear the change *can* be implemented at the 
standard library level - we don't have the context to determine if a Windows 
native path or a POSIX path is more appropriate when a Windows build is being 
used in a POSIX environment.

From the interpreter's point of view, the launch environment makes no 
difference, the only thing that matters is the target platform for the build. 
If they don't match, you're going to get weird glitches like this.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19571] urlparse.parse_qs with empty string

2013-11-13 Thread stutiredboy

New submission from stutiredboy:

 import urlparse
 urlparse.parse_qs('a=b=1')
{'b': ['1']}
 

why not:

{'a' : [''], 'b' : ['1']}

is this a bug?

--
components: Library (Lib)
messages: 202751
nosy: stutiredboy
priority: normal
severity: normal
status: open
title: urlparse.parse_qs with empty string
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19571
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17839] base64 module should use memoryview

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e53984133740 by Nick Coghlan in branch 'default':
Issue #17839: mention base64 change in What's New
http://hg.python.org/cpython/rev/e53984133740

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17839
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19571] urlparse.parse_qs with empty string

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

It is not a bug:

 parse_qs('a=b=1', keep_blank_values=True)
{'a': [''], 'b': ['1']}

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19571
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18861] Problems with recursive automatic exception chaining

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

So, I've been pondering the idea of traceback/frame annotations and exception 
trees a bit.

And what I'm wondering is if it may make sense to have the ability to annotate 
*frames* at runtime, and these annotations can be qualified by module names. 
So, for example, you might be able to write things like:

sys.annotate_frame(codecs, encoding, the_encoding)
sys.annotate_frame(codecs, decoding, the_encoding)
sys.annotate_frame(traceback, hide, True)
sys.annotate_frame(traceback, context, exc)

And then the traceback display machinery would be updated to do something 
useful with the annotations.

I'm not sure how ExitStack would cope with that (or other code that fakes 
tracebacks) but it's something to ponder.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18861
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2013-11-13 Thread Tim Golden

Tim Golden added the comment:

Only just been reminded of this one; it's possible that it's been superseded by 
Issue15207. At the least, that issue resulted in a code change in this area of 
mimetypes. I'll have a look later.

--
nosy: +tim.golden

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9291
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

Also reproduced on x86 Ubuntu Shared 3.x buildbot.

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/9012/steps/test/logs/stdio

==
ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)
--
Traceback (most recent call last):
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/unix_events.py, 
line 662, in _do_waitpid_all
callback, args = self._callbacks.pop(pid)
KeyError: 21303

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_unix_events.py,
 line 723, in setUp
self.watcher = self.create_watcher(self.loop)
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_unix_events.py,
 line 1466, in create_watcher
return unix_events.FastChildWatcher(loop)
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/unix_events.py, 
line 596, in __init__
super().__init__(loop)
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/unix_events.py, 
line 474, in __init__
self.set_loop(loop)
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/unix_events.py, 
line 498, in set_loop
self._do_waitpid_all()
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/unix_events.py, 
line 665, in _do_waitpid_all
with self._lock:
AttributeError: 'FastChildWatcher' object has no attribute '_lock'

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

Attached patch should fix this issue. BaseChildWatcher constructors calls 
set_loop() which calls _do_waitpid_all(). The problem is that _do_waitpid_all() 
is called before FastChildWatcher own attributes are set.

--
keywords: +patch
Added file: http://bugs.python.org/file32598/asyncio_fastchildwatcher.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

 Can't you fix multiprocessing and/or the unit test to ensure that all 
 overlapped operations are completed or cancelled?

 On Vista and later, yes, this is done in the deallocator using
 CancelIoEx(), although there is still a warning.

I don't understand. The warning is emitted because an operating is not done nor 
cancelled. Why not cancel explicitly active operations in manager.shutdown()? 
It is not possible?

 ... I think these warnings come from daemon threads used by manager
 processes.  When the manager process exits some background threads
 may be blocked doing an overlapped read.

I don't know overlapped operations. There are not asynchronous? What do you 
mean by blocked doing an overlapped read?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18861] Problems with recursive automatic exception chaining

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

Walter suggested annotating the exceptions directly might work: 
https://mail.python.org/pipermail/python-dev/2013-November/130155.html

However, that potentially runs into nesting problems (e.g. the idna codec 
invokes the ascii codec), although Walter suggested a simpler mechanism that 
just involved appending to a list.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18861
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Hmm...  That fix works, and if you're concerned about the buildbots, by all 
means check it in.

But I think the root cause is a poor API for initializing ChildWatchers.  This 
is currently done at the end of __init__() -- it calls self.set_loop() which is 
implemented by the subclass.

I think the right fix is to change the protocol to separate out the constructor 
from the set_loop() call (which also isn't a great name, since it does so much 
more -- maybe it can be called link_loop()?).   This is more cumbersome (esp. 
for the tests), but it really rubs me the wrong way that you have to to 
initialize the subclass before initializing the base class.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19565] test_multiprocessing_spawn: RuntimeError and assertion error on windows xp buildbot

2013-11-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

On 13/11/2013 3:07pm, STINNER Victor wrote:
 On Vista and later, yes, this is done in the deallocator using
 CancelIoEx(), although there is still a warning.

 I don't understand. The warning is emitted because an operating is not done 
 nor cancelled. Why not cancel explicitly active operations in 
 manager.shutdown()? It is not possible?

shutdown() will be run in a different thread to the ones which started 
the overlapped ops, so it cannot stop them using CancelIo().  And 
anyway, it would mean writing a separate implementation for Windows -- 
the current manager implementation contains no platform specific code.

Originally overlapped IO was not used on Windows.  But, to get rid of 
polling, Antoine opened the can of worms that is overlapped IO:-)

 ... I think these warnings come from daemon threads used by manager
 processes.  When the manager process exits some background threads
 may be blocked doing an overlapped read.

 I don't know overlapped operations. There are not asynchronous? What do you 
 mean by blocked doing an overlapped read?

They are asynchronous but the implementation uses a hidden thread pool. 
  If a pool thread tries to read from/write to a buffer that has been 
deallocated, then we can get a crash.

By blocked doing an overlapped read I mean that a daemon thread is 
waiting for a line like

 data = conn.recv()

to complete.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19565
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19462] Add remove_argument() method to argparse.ArgumentParser

2013-11-13 Thread Artem Ustinov

Artem Ustinov added the comment:

What is the way to 'hide' the argument from being parsed?

E.g. we have self.parser.add_argument('foo') in parent class,
how can we modify it in child class so that it would not to
appear in --help strings and not populated to child's Namespace?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19462
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19462] Add remove_argument() method to argparse.ArgumentParser

2013-11-13 Thread paul j3

paul j3 added the comment:

`argparse.SUPPRESS` should do the trick.  According to the documentation it can 
be used with `default` and `help` parameters.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19462
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19572] Report more silently skipped tests as skipped

2013-11-13 Thread Zachary Ware

New submission from Zachary Ware:

(Nosy list copied from #18702)

Grepping for ^\s+return$ and ^\s+pass$ in Lib/test turned up several more 
tests that are silently skipped (along with many legitimate uses of each).  The 
attached patch turns each into a skip in a few various ways, including 
splitting a test into two tests in a couple of cases.

I'll make a few comments on Rietveld myself to point out places where I would 
really like some extra scrutiny.

--
components: Tests
files: skiptest_not_return_or_pass.diff
keywords: patch
messages: 202762
nosy: ezio.melotti, haypo, michael.foord, ned.deily, pitrou, serhiy.storchaka, 
terry.reedy, vajrasky, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Report more silently skipped tests as skipped
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32599/skiptest_not_return_or_pass.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19572
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can't un-memmove because you already lost bytes between new_hi and hi.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Laurent Birtz

Laurent Birtz added the comment:

First, I apologize for my overly harsh tone. A dismissive comment above struck 
a nerve but that doesn't excuse it.


@Lawrence: from my perspective it is a bug: the Python interpreter doesn't 
handle paths correctly on MinGW as I'd expect.


As Nick said, the ideal scenario would be to come up with a solution that 
actually fixes the problem on MinGW. I realize that very few people use MinGW 
and are impacted by this, so it seems like much effort for little gain. 
Nevertheless, perhaps the issue could be left open until someone decides to 
bite the bullet and fix it properly? I'm the one complaining and it's fair that 
I spend the effort to fix it, but like everyone I have limited time on my 
hands, and I can't do this now.

FWIW I see three potential solutions. I'm not involved in Python development 
and I don't know how applicable they are.

1) Modifying os.sep as described above.

Pros: it behaves as expected from the user point-of-view. It makes sense that 
the separator in this variable is used internally by the module for 
manipulating the paths. It may be straightforward to implement by making this a 
property and propagating the change to the Python code and/or interpreter code 
whenever it is set.

Cons: AFAICT there aren't obvious reasons why someone would modify os.sep 
currently, so it *should* be fine for backward compatibility for most users, 
but there is no guarantee.

2) Adding the function os.set_sep(separator). 

Like 1), but it's less transparent to the user, who might set os.sep naively 
like I did and be surprised that it doesn't work. I think that eliminates all 
potential backward compatibility issues though.

3) Detect MinGW.

It's brittle but it makes Python behaves as expected for the user -- who might 
still want/depend on the current behavior however? I'm not a fan of this but 
it's doable. If the MinGW detection fails then the behavior falls back to the 
standard Windows behavior. The reverse (assuming MinGW incorrectly) is way more 
problematic, but I think that the odds of that happening are very low. So 
essentially if the detection fails then only the MinGW users are impacted.


Nick, correct me if I'm wrong but the target platform for MinGW is mostly 
Windows itself, aside of this particular issue? The rest of the standard 
library seems to be working fine on MinGW as it is.


Thank you.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Anthony Baire

Anthony Baire added the comment:

I confirm the fix.

It is clear that the separation between BaseChildWatcher and its subclasses is 
far from ideal. The first implementation was clean, but as the patch evolved 
interactions got complex to the point that BaseChildWatcher should not be 
considered as an API but rather as implementation details for the two other 
classes (eg. .add_child_handler() is implemented in subclasses whereas 
.remove_child_handler() is in the base class). At least it should be renamed as 
_BaseChildWatcher to make that clear.

For set_loop, another possible name is 'attach_loop' (like in the doc string 
actually)

--
nosy: +aba

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Guido van Rossum

Guido van Rossum added the comment:

TBH the test structure is also rather fragile.  I need to think about it more; 
the global state to hold the current test instance smells, as do the various 
class-level functions (waitpid(), WIFEXITED() etc.) that aren't methods but 
used as mock functions.  The huge piles of mock.patch decorators should have 
tipped me off during the review, but I was more focused on the implementation 
instead of on the tests. :-(

The smallest fix to prevent one breaking test from breaking all following tests 
is just to remove the assert.  The next smallest fix is to use addCleanup() 
instead of tearDown() to reset ChildWatcherTestsMixin.instance.  The next fix 
would be huge (refactor the tests completely) and I don't want to go there.

Anthony, can you come up with a fix along the lines you suggested?  You can 
submit this to the Tulip repo first (let me review it).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10734] test_ttk test_heading_callback fails with newer Tk 8.5

2013-11-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10734
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19572] Report more silently skipped tests as skipped

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue19492 and issue19493.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19572
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Guido van Rossum

Guido van Rossum added the comment:

I pushed Victor's temporary patch so the buildbots can have peace.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e0eeb4cc8fa by Guido van Rossum in branch 'default':
asyncio: Temporary fix by Victor Stinner for issue 19566.
http://hg.python.org/cpython/rev/8e0eeb4cc8fa

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Anthony Baire

Anthony Baire added the comment:

I put a cleaner patch here:

https://codereview.appspot.com/26220043/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19573] Fix the docstring of inspect.Parameter and the implementation of _ParameterKind

2013-11-13 Thread Antony Lee

New submission from Antony Lee:

The following patch corrects the docstring of `inspect.Parameter`, as the 
`default` and `annotation` attributes are in fact set to `empty` if no value is 
provided, and the `kind` attribute is in fact an `int` (more precisely, a 
`_ParameterKind`).  It also reimplements the `_ParameterKind` type as an 
`IntEnum`, as the previous implementation (which predates stdlib enums) was 
more or less a hand-rolled `IntEnum`.

--
assignee: docs@python
components: Documentation
files: inspect.py.diff
keywords: patch
messages: 202773
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Fix the docstring of inspect.Parameter and the implementation of 
_ParameterKind
type: enhancement
Added file: http://bugs.python.org/file32600/inspect.py.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19573
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-11-13 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19570
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19572] Report more silently skipped tests as skipped

2013-11-13 Thread Zachary Ware

Zachary Ware added the comment:

Starting a review of #19492, I realized my original regexs didn't take comments 
into account.  Grepping ^\s+return\s*(#.*)?$ instead turned up a couple more 
skips, including some in test_tempfile that said return  # ugh, can't use 
SkipTest, relics of the days before unittest.SkipTest.

--
Added file: http://bugs.python.org/file32601/skiptest_not_return_or_pass.v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19572
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19493] Report skipped ctypes tests as skipped

2013-11-13 Thread Zachary Ware

Zachary Ware added the comment:

Grepping with the same regexes I used for #19572 come up with some extra skips 
in the ctypes tests too; would you like me to create a new patch including them 
or would you like to do it, Serhiy?

--
nosy: +zach.ware

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19493
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19492] Report skipped distutils tests as skipped

2013-11-13 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19492
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

 Hmm...  That fix works, and if you're concerned about the buildbots, by all 
 means check it in.
 (...)
 I pushed Victor's temporary patch so the buildbots can have peace.

Yes, I'm concerned by buildbots, I would like to check if my last
changes did not introduce any regression. This week, there is a lot of
noise: many false positive related to networks and various other bugs.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

(So thanks for having applied my fix.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19574] Negative integer division error

2013-11-13 Thread Vatroslav Suton

New submission from Vatroslav Suton:

integer division obviously uses float division with math.floor, which produces 
invalid result when result is less than 0, simply try the following 5/2 versus 
-5/2. Please use math.ceil function for results less than 0.
btw is there any way to patch that in __builtins__ ?

--
components: Library (Lib)
messages: 202778
nosy: vatroslavsuton
priority: normal
severity: normal
status: open
title: Negative integer division error
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19574
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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(os.path.join(dirname, stdout.txt), r)
e_w =  open(os.path.join(dirname, stderr.txt), w)
e_r = open(os.path.join(dirname, stderr.txt), r)

with subprocess.Popen(dir, shell=True, stdout=f_w, stderr=e_w) as p:
pass

f_w.close()
f_r.close()
e_w.close()
e_r.close()

shutil.rmtree(dirname)

The exception is raised by shutil.rmtree when max_workers  1: The process 
cannot access the file because it is being used by another process

See also this Stack Overflow question about what seems to bee a similar 
problem: 
http://stackoverflow.com/questions/15966418/python-popen-on-windows-with-multithreading-cant-delete-stdout-stderr-logs
  The discussion on SO indicates that this might be an XP problem only.

The attached file reproduces the problem on my Windows XP VM.

--
components: Library (Lib), Windows
files: repro.py
messages: 202779
nosy: Bernt.Røskar.Brenna
priority: normal
severity: normal
status: open
title: subprocess.Popen with multiple threads: Redirected stdout/stderr files 
still open after process close
versions: Python 3.3
Added file: http://bugs.python.org/file32602/repro.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, stdout=f_w, stderr=e_w) as p:
pass

f_w.close()
e_w.close()

shutil.rmtree(dirname)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

 You can't un-memmove because you already lost bytes between new_hi and hi.

Oh, that's why I prefered a review. You're right, bytes are lost.

Here is a different approach which updates the size to ensure that the object 
is consistent on memory allocation failure.

--
Added file: 
http://bugs.python.org/file32603/bytearray_setslice_mem_error-2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19574] Negative integer division error

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

This is not an aspect of Python that can possibly change, I'm afraid, for 
backward compatibility reasons.

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Integer division for negative numbers

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19574
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19574] Negative integer division error

2013-11-13 Thread Mark Dickinson

Mark Dickinson added the comment:

See also http://docs.python.org/2/faq/programming.html#why-does-22-10-return-3

BTW, integer division does not use float division internally.  That would fail 
for integers too large to be exactly representable as floats.  The 
implementation can be seen in Objects/intobject.c and Objects/longobject.c if 
you're interested.

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19574
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

It doesn't look like you are waiting for the subprocess to complete (and 
therefore close the files) before doing the rmtree.  What happens if you do 
that?

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

Nevermind, I forgot that the context manager also does the wait.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-11-13 Thread R. David Murray

R. David Murray added the comment:

Most likely this is a case of a virus scanner or file indexer having the file 
open when rmtree runs.  See issue 7443, which was about solving this for our 
test suite.  My last message there asks about exposing the workaround in 
shutil, but no one appears to have taken me up on that suggestion yet.

Can you disable all virus scanners and indexers and try again?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

While working on a unit test for the issue #14432, I hit a bug. My C thread got 
the GIL with PyGILState_Ensure(), but it was strange because the main Python 
thread also had the GIL...

Then I saw that gil_created() returned false. The solution is to call 
PyEval_InitThreads() to create the GIL.

I was reading Non-Python created threads documentation, but this section 
doesn't mention PyEval_InitThreads().

I don't know if it's something new in Python 3.2 with the new GIL.

--
assignee: docs@python
components: Documentation
messages: 202787
nosy: christian.heimes, docs@python, haypo, pitrou
priority: normal
severity: normal
status: open
title: Non-Python created threads documentation doesn't mention 
PyEval_InitThreads()
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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-5.1.2600-SP3
Concurrency: 2
Task kind: subprocess_redirfile
3 errors of 10

Concurrency: 1
Task kind: subprocess_redirfile
0 errors of 10

Concurrency: 2
Task kind: subprocess_devnull
5 errors of 10

Concurrency: 1
Task kind: subprocess_devnull
0 errors of 10

Concurrency: 2
Task kind: nosubprocess
0 errors of 10

Concurrency: 1
Task kind: nosubprocess
0 errors of 10

***

Note that:
- even when subprocess redirects to DEVNULL there are errors
- when no subprocess.Popen is executed, no errors occur (the file is created as 
normal, but is not used by subprocess.Popen)

--
Added file: http://bugs.python.org/file32604/repro_improved.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19575
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19249] Enumeration.__eq__

2013-11-13 Thread Ethan Furman

Ethan Furman added the comment:

changeset ca909a3728d3

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19249
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

We can't change os.sep globally for the process because the Windows APIs
don't reliably accept forward slashes. Changing it when the Windows binary
is run through msys would thus mean potentially breaking currently working
applications.

Using the Cygwin Python instead is safer, since all the affected OS API
calls will be trapped by Cygwin's POSIX API implementation and translated
appropriately for Windows.

Terry's description when first closing this issue remains accurate: MS
created this mess through an atrociously poor choice of path separator
decades ago, and until *all* their APIs natively accept forward slashes as
path separators (which seems unlikely to ever happen), the only backwards
compatible answer currently appears to be to use a full POSIX interface
layer like Cygwin.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19493] Report skipped ctypes tests as skipped

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Grepping with the same regexes I used for #19572 come up with some extra
 skips in the ctypes tests too; would you like me to create a new patch
 including them or would you like to do it, Serhiy?

Please do this Zachary.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19493
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19572] Report more silently skipped tests as skipped

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I added some comments on Rietveld to the first patch. In general it LGTM. I 
will made a review for additional skips tomorrow.

I suggest extract importlib related changes in separated issue. Bratt Cannon 
should review them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19572
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

However, coming up with a way to detect that msys is in use, and publishing
that information for use by applications like Mercurial, or creating a
catalogue of which Windows APIs still don't accept forward slashes as path
separators could help the issue progress.

There's just no magic fix we can apply at the interpreter or standard
library level to make the problem go away - it's *precisely* the kind of
problem that exists in the space between the POSIX shell on Windows
provided by msys and the full POSIX API provided by Cygwin.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19572] Report more silently skipped tests as skipped

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I will made a review for additional skips tomorrow.

Additional skips LGTM.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19572
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14432] Bug in generator if the generator in created in a C thread

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch for Python 3.4:

- remove PyFrameObject.f_tstate attribute: the thread state can be easily 
retrieved, it is known where it is needed (see the patch). There is one 
function which doesn't know the thread state: _PyEval_CallTracing(), but this 
function was already calling PyEval_GetFrame() which calls PyThreadState_GET() 
internally, so...

- add an unit test for this issue (generator created in a temporary C thread)

It's really hard to reproduce the crash. I tried with my old tarball and I 
failed. I also tried with my unit test and I failed. I'm pretty sure that the 
crash can only be reproduced when Python is compiled is release mode.

I reproduced the crash once with the unit test on an unpatched Python 3.4.


For Python 2.7 and 3.3, what do you think of applying generator.patch? It looks 
simple and obvious. I don't know the impact on performances, but it should be 
very low.

--
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file32605/issue14432.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why the object with updated size is more consistent?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

This issue is tricky, I will try to explain it.

To understand the bug, I wrote the following function:

static int
_PyByteArray_CheckConsistency(PyByteArrayObject *obj)
{
assert(obj != NULL);
assert(PyByteArray_Check(obj));

assert(Py_SIZE(obj) = 0);
assert(obj-ob_bytes = obj-ob_start);
assert((obj-ob_start - obj-ob_bytes) = obj-ob_alloc);
assert((obj-ob_alloc - (obj-ob_start - obj-ob_bytes)) = Py_SIZE(obj));
return 1;
}


In this issue, I'm concerned by bytearray_setslice_linear() with growth  0. 
There are two cases:

(A) lo == 0
(B) lo != 0.


(A) It's trivial to rollback the change: restore previous value of ob_start. 
(Another option is to update the size, which should be the same if I understood 
correctly.) You retrieve the original object.

Expected result:

 b=bytearray(b'1234567890')
 del b[:6]
 b
bytearray(b'7890')

Current behaviour on MemoryError

 b=bytearray(b'1234567890')
 del b[:6]
 b
bytearray(b'7890\x00\xfb\xfb\xfb\xfb\xfb')

With the patch:

 b=bytearray(b'1234567890')
 del b[:6]
Traceback (most recent call last):
  File stdin, line 1, in module
MemoryError
 b
bytearray(b'1234567890')



(B) You cannot restore removed bytes. Currently, you get an inconsistent 
bytearray object because its content is updated but not its size.

No error:

 b=bytearray(b'1234567890')
 del b[3:6]
 b
bytearray(b'1237890')

Current behaviour on MemoryError:

 b=bytearray(b'1234567890')
 del b[3:6]
Traceback (most recent call last):
  File stdin, line 1, in module
MemoryError
 b
bytearray(b'1237890890')

With the patch:

 b=bytearray(b'1234567890')
 del b[3:6]
Traceback (most recent call last):
  File stdin, line 1, in module
MemoryError
 b
bytearray(b'1237890')

With the patch, the deletion succeeded even if you get a MemoryError. The 
bytearray object is consistent. It's just that its buffer could be smaller (it 
wastes memory).


Note: I used gdb to inject a MemoryError in PyByteArray_Resize().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-11-13 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


Added file: http://bugs.python.org/file32606/ac521cef665a.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19183
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19183] PEP 456 Secure and interchangeable hash algorithm

2013-11-13 Thread Christian Heimes

Christian Heimes added the comment:

Hi Nick,

I have updated the patch and the PEP text. The new version has small string 
hash optimization disabled. The other changes are mostly cleanup, reformatting 
and simplifications.

Can you please do a review so I can get the patch into 3.4 before beta1 is 
released?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19183
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-11-13 Thread Christian Heimes

Christian Heimes added the comment:

What's the status of this patch? I need a way to load CA certs from memory for 
another patch of mine.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16487
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb42adc53923 by Guido van Rossum in branch 'default':
asyncio: Fix from Anthony Baire for CPython issue 19566 (replaces earlier fix).
http://hg.python.org/cpython/rev/eb42adc53923

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9816] random.jumpahead and PRNG sequence independence

2013-11-13 Thread Craig McQueen

Craig McQueen added the comment:

I notice that the C++11 library has a discard() member function for its random 
generators, which is effectively a jumpahead operation. It seems that the C++11 
library has implemented discard() for the Mersene Twister generator. If 
jumpahead() is technically possible for MT, can it be added back into the 
Python library?

--
nosy: +cmcqueen1975

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9816] random.jumpahead and PRNG sequence independence

2013-11-13 Thread Craig McQueen

Craig McQueen added the comment:

C++11 Mersenne Twister discard() member function:
http://www.cplusplus.com/reference/random/mersenne_twister_engine/discard/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9816] random.jumpahead and PRNG sequence independence

2013-11-13 Thread Craig McQueen

Craig McQueen added the comment:

StackOverflow question about Mersenne Twister jumpahead:
http://stackoverflow.com/q/4184478/60075

which refers to this:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/JUMP/index.html

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Laurent Birtz

Laurent Birtz added the comment:

I agree with the no magic bullet point and that Microsoft is fully to blame 
for the situation.


About the catalogue of Windows APIs that accept slashes. I've read in various 
places that the only problematic case is the legacy shell API. The power shell 
seems to accept forward slashes.

http://stackoverflow.com/questions/18464038/is-it-possible-to-make-vim-use-forward-slashes-on-windows

http://stackoverflow.com/questions/10523708/why-does-the-cmd-exe-shell-on-windows-fail-with-paths-using-a-forward-slash


Is it reasonable to believe that most Python programs don't care about the 
legacy shell API? I assume that the Python library uses CreateProcess() under 
the hood without touching cmd.exe. Some odd Python programs may invoke cmd.exe 
explicitly but hopefully that is a rare case.

If those assumptions hold, then changing os.sep *from the user script* would 
not break backward compatibility and allow Python to work as expected on MinGW. 
Arguably it's a simpler solution than requiring Python projects like Mercurial 
to tackle that issue themselves. Even if it's not the perfect solution, it's a 
step-up from Non-Cygwin Python corrupts paths on MinGW and you can't make it 
stop.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19577] memoryview bind (the opposite of release)

2013-11-13 Thread mpb

New submission from mpb:

I'm writing Python code to parse binary (byte oriented) data.

I am (at least somewhat) aware of the performance implications of various 
approaches to doing the parsing.  With performance in mind, I would like to 
avoid unnecessary creation/destruction/copying of memory/objects.

An example:

Let's say I am parsing b'0123456789'.
I want to extract and return the substring b'234'.

Now let's say I do this with memoryviews, to avoid unnecessary creation and 
copying of memory.

m0 = memoryview (b'0123456789')
m1 = m0[2:5]# m1 == b'234'

Let's say I do this 1000 times.  Each time I use readinto to load the next data 
into m0.  So I can create m0 only once and reuse it.

But if the relative position of m1 inside m0 changes with each parse, then I 
need to create a new m1 for each parse.

In the context of the above example, I think it might be nice if I could rebind 
an existing memoryview to a new object.  For example:

m0 = memoryview (b'0123456789')
m1.bind (m0, 2, 5)# m1 == b'234'

Is this an idea worth considering?

(Possibly related: Issue 9789, 9757, 3506; PEP 3118)

--
messages: 202806
nosy: mpb
priority: normal
severity: normal
status: open
title: memoryview bind (the opposite of release)
type: enhancement
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19577
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17828] More informative error handling when encoding and decoding

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 99ba1772c469 by Christian Heimes in branch 'default':
Issue #17828: va_start() must be accompanied by va_end()
http://hg.python.org/cpython/rev/99ba1772c469

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17828
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19578] del list[a:b:c] doesn't handle correctly list_resize() failure

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

del list[start:stop:step] instruction doesn't handle list_resize() failure 
when step != 1.

Attached patch notifies the caller that list_resize() fails. On case of 
failure, the list is modified (items are deleted), it's just that list buffer 
could be smaller (it wastes memory).

See also issue #19568 which is similar for bytearray.

--
files: list_ass_subscript.patch
keywords: patch
messages: 202808
nosy: haypo
priority: normal
severity: normal
status: open
title: del list[a:b:c] doesn't handle correctly list_resize() failure
versions: Python 3.4
Added file: http://bugs.python.org/file32607/list_ass_subscript.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19578
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

2013-11-13 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #19578, similar issue in list.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19568
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19578] del list[a:b:c] doesn't handle correctly list_resize() failure

2013-11-13 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19578
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19437] More failures found by pyfailmalloc

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eea54395797c by Victor Stinner in branch 'default':
Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear
http://hg.python.org/cpython/rev/eea54395797c

New changeset 7d0323556c53 by Victor Stinner in branch 'default':
Issue #19437: Use an identifier for __name__ string in pickle to improve
http://hg.python.org/cpython/rev/7d0323556c53

New changeset 285d28c3620a by Victor Stinner in branch 'default':
Issue #19437: Fix array.buffer_info(), handle PyLong_FromVoidPtr() and
http://hg.python.org/cpython/rev/285d28c3620a

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19437
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17828] More informative error handling when encoding and decoding

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26121ae22016 by Christian Heimes in branch 'default':
Issue #17828: _PyObject_GetDictPtr() may return NULL instead of a PyObject**
http://hg.python.org/cpython/rev/26121ae22016

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17828
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17828] More informative error handling when encoding and decoding

2013-11-13 Thread Christian Heimes

Christian Heimes added the comment:

Coverity has found two issues in your patch. I have fixed them both.

--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17828
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19579] test_asyncio: test__run_once timings should be relaxed

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

On Windows, the monotonic timer has a resolution of 15 ms in the worst case. 
The timing should accept a greater error.

http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/9547/steps/test/logs/stdio

==
FAIL: test__run_once (test.test_asyncio.test_base_events.BaseEventLoopTests)
--
Traceback (most recent call last):
  File 
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_asyncio\test_base_events.py,
 line 184, in test__run_once
self.assertTrue(9.99  t  10.1, t)
AssertionError: False is not true : 9.9890687

--
messages: 202813
nosy: gvanrossum, haypo
priority: normal
severity: normal
status: open
title: test_asyncio: test__run_once timings should be relaxed
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19579
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6208] path separator output ignores shell's path separator: / instead of \

2013-11-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

subprocess has a 'shell=True' option, although its use is discouraged unless 
really necessary. To pursue this, I suggest running the test suite on Windows 
(including xp) with os.sep changed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6208
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-11-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Perhaps we can fix PyGILState to call PyEval_InitThreads automatically?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19577] memoryview bind (the opposite of release)

2013-11-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 In the context of the above example, I think it might be nice if I
 could rebind an existing memoryview to a new object.

It would be nice how so? Can you try to estimate the speed gain?

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19577
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19563] Changing barry's email to ba...@python.org

2013-11-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Do we want to cut a new release quickly in order to spread the fix?

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19563
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19371] timing test too tight

2013-11-13 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +gvanrossum

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19371
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19371] timing test too tight

2013-11-13 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
resolution:  - duplicate
superseder:  - test_asyncio: test__run_once timings should be relaxed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19371
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19579] test_asyncio: test__run_once timings should be relaxed

2013-11-13 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
nosy: +ezio.melotti, pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19579
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19291] Add docs for asyncio package (Tulip, PEP 3156)

2013-11-13 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19291
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19579] test_asyncio: test__run_once timings should be relaxed

2013-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f91550e7e2b7 by Guido van Rossum in branch 'default':
asyncio: Relax timing requirement. Fixes issue 19579.
http://hg.python.org/cpython/rev/f91550e7e2b7

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19579
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19577] memoryview bind (the opposite of release)

2013-11-13 Thread mpb

mpb added the comment:

It would be nice in terms of avoiding malloc()s and free()s.

I could estimate it in terms of memoryview creations per message parse.  I'll 
be creating 10-20 memoryviews to parse each ~100 byte message.

So... I guess I'd have to build a test to see how long a memoryview 
creation/free takes.  And then perhaps compare it with variable to variable 
assignment instead.

If Python pools and recycles unused object by type (the way Lisp recycles cons 
cells) without free()ing them back to the heap, then there would be minimal 
speed improvement from my suggestion.  I don't know how CPython works 
internally, however.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19577
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com