[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > That's why I just propose to switch it to time.time(), which surely is > available on each and every Python version and implementation. It's not the same clock. time.clock() measures the process time, which is different from the wall clock time. Compare tim

[issue20435] Discrepancy between io.StringIO and _pyio.StringIO with univeral newlines

2014-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Current results for newline != '\n' looks meanless to me. They don't look meaningless to me, e.g.: >>> io.StringIO("a\r\nc\rd", newline=None).getvalue() 'a\nc\nd' >>> sio = io.StringIO(newline=None); sio.write("a\r\nc\rd"); sio.getvalue() 6 'a\nc\nd' There m

[issue20435] Discrepancy between io.StringIO and _pyio.StringIO with univeral newlines

2014-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 99168e7d4a3d by Antoine Pitrou in branch '3.3': Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline translation settings. http://hg.python.org/cpython/rev/99168e7d4a3d New changeset aadcc71a4967 by Antoine Pitrou in branch 'def

[issue20435] Discrepancy between io.StringIO and _pyio.StringIO with univeral newlines

2014-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3e61d8e06ef7 by Antoine Pitrou in branch '2.7': Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline translation settings. http://hg.python.org/cpython/rev/3e61d8e06ef7 -- ___ Python

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Yes, and my note about "scientificity" above. Also compare with your own account of time.perf_counter() above ("Usually time.perf_counter() is the expected function.") Also, I didn't want to start discussion on how to do benchmarking right, just to point out

[issue20435] Discrepancy between io.StringIO and _pyio.StringIO with univeral newlines

2014-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've fixed the reported bug. If other problems need fixing, better open a new issue :-) -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue20426] Compiling a regex with re.DEBUG should force a recompile

2014-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: A simple workaround is to bypass the cache when DEBUG is passed. See attached patch. (not sure this applies as a bug fix, but DEBUG probably isn't used in production anyway: the potential for breakage is low) -- keywords: +patch stage: test needed -> p

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Nick Coghlan
Nick Coghlan added the comment: >From a "principle of least surprise" point of view, non-specialists would likely be puzzled by a trailing dot and wonder why it was there. By contrast, specialists that know the trailing dot is technically *supposed* to be there are already going to be accustomed

[issue20486] msilib: can't close opened database

2014-02-02 Thread Ned Deily
Changes by Ned Deily : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue15216] Support setting the encoding on a text stream after creation

2014-02-02 Thread Nick Coghlan
Nick Coghlan added the comment: It's a blunt instrument to be sure, but a necessary one, I think - otherwise we end with a scattering of API specific solutions rather than a single consistent approach. Here's a thought, though: what if we went with Serhiy's "reconfigure" idea, limited that to s

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-02 Thread Larry Hastings
Larry Hastings added the comment: > That's likely true for CPython itself, at least currently. > I don't think it's generally a safe assumption in the CPython > ecosystem, which includes things like Cython, Numba, Nuitka and others, While I'm happy to accommodate these other projects if it's eas

[issue20472] test_write_pty() of test_asyncio fails on "x86 Tiger 3.x" buildbot

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: Oh, Ned told me that tests using the PollSelector are still failing. I forgot that poll() is also supported on OS X. Please try this new patch. -- Added file: http://bugs.python.org/file33878/asyncio_pty_osx-2.patch ___

[issue20472] test_write_pty() of test_asyncio fails on "x86 Tiger 3.x" buildbot

2014-02-02 Thread Ned Deily
Ned Deily added the comment: With asyncio_pty_osx-2.patch, test_asyncio now passes on OS X 10.4.11 and 10.5.8. -- ___ Python tracker ___

[issue20472] test_write_pty() of test_asyncio fails on "x86 Tiger 3.x" buildbot

2014-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 21a4ebf5a170 by Victor Stinner in branch 'default': Issue #20472: test_asyncio: skip PTY tests on Mac OS X older than 10.6 http://hg.python.org/cpython/rev/21a4ebf5a170 New changeset 0a71d29b970a by Victor Stinner in branch 'default': Issue #20472:

[issue20472] test_write_pty() of test_asyncio fails on "x86 Tiger 3.x" buildbot

2014-02-02 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If pystone uses a different clock in Python 3.4, you may not be able > to compare compare results with older Python versions. This sounds a bit silly. Typical pystone runs last a couple seconds at most, there won't be a significant clock drift in such a shor

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Paul: > well, pystone has limits to its "scientificity", it's more like quick- > run-anywhere, there's pybench for "real" testing (it's maintained and > supported I hope) pybench is so synthetic it's almost a nano-benchmark. I would suggest using the benchmar

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > Besides, if time.clock() is deprecated, pystone will *have* to be modified > one day, anyway. If something is changed, I would prefer to simply drop this old tool. It is not reliable and so may give you wrong results. -- ___

[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > So, to sum up: > - you write a fragile and unelegant patch without a good reason > - you commit it without review > - you're asked several times to provide an example of the problems your patch > is supposed to solve, but don't give any > - you don't take into

[issue20485] Enable 'import .pyd'

2014-02-02 Thread Suzumizaki
Suzumizaki added the comment: Thank you for reply. The hack msg209998 is interesting, but how to name submodule with non latin like languages, especially keeping native reable? X( The reason I don't use like "name.encode('unicode-escape').replace(b'\\', b'_')" is the length limits of the ide

[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: neologix, you are getting dangerously close to attacking the person instead of the issue. Can you live with the current state of the code? If so, let us know (or be silent if you prefer). If you cannot live with it, please show example code that fails or is

[issue20493] asyncio: OverflowError('timeout is too large')

2014-02-02 Thread STINNER Victor
New submission from STINNER Victor: In asyncio, if the next event is in 2^40 seconds, epoll.poll() raises an OverflowError because epoll_wait() maximum value for the timeout is INT_MAX seconds. Test timeout_overflow.py to reproduce the issue. -- files: timeout_overflow.py messages: 21

[issue20493] asyncio: OverflowError('timeout is too large')

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: Attached patch fixes the issue, but it has no unit test :-( On Windows, it looks like IocpProactor can also raise an error if the timeout is too large: # GetQueuedCompletionStatus() has a resolution of 1 millisecond, # round away from z

[issue20494] Backport of http://bugs.python.org/issue11849 to Python 2.7 (Make it more likely for the system allocator to release free()d memory arenas on glibc-based systems).

2014-02-02 Thread Benjamin Yolken
New submission from Benjamin Yolken: We have found that http://bugs.python.org/issue11849 affects a number of our Python 2.7 systems in production. I took the changes in http://hg.python.org/cpython/rev/f8a697bc3ca8 and backported them to the head of the python 2.7 cpython hg branch. I have ve

[issue20485] Enable 'import .pyd'

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: The PyInit_NAME symbol is not the only place where NAME is used. The NAME is also present in the PyModuleDef structure. It looks lie Python expects UTF-8 here. You encode it to UTF-8 and use "\xHH\xHH\xHH..." syntax to keep ASCII encoding for the C file? The N

[issue12187] subprocess.wait() with a timeout uses polling on POSIX

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: Ok, the new asyncio.subprocess module has been merged. Use asyncio.create_subprocess_exec/shell to create a subprocess and then use asyncio.wait_for(proc.wait(), timeout) to wait for the exit of the process with a timeout. The wait is asynchronous thanks to as

[issue20428] _Py_open does not work with O_CREAT

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > In file included from ./Modules/_localemodule.c:404:0, I don't see where _Py_open() is used in _localemodule.c. I didn't find a call to _Py_open() using O_CREAT. In fact, O_CREAT is not used in the C code of Python. (Except dbmopen in the dbm module, but it

[issue20350] Replace tkapp.split() to tkapp.splitlist()

2014-02-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: I know split has been troublesome and I am generally in favor of removing semi-duplication. Here are my questions. What system are you developing and testing on? Should I try the patch on Windows? Have you used coveragepy to see if the patched areas are covered

[issue20414] Python 3.4 has two Overlapped types

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: Sorry Martin, I'm not sure that I understood your proposition. Here is a new patch. -- Added file: http://bugs.python.org/file33882/overlapped_dealloc-2.patch ___ Python tracker _

[issue20493] asyncio: OverflowError('timeout is too large')

2014-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: Shouldn't this be fixed in the C implementation of the select module or in selectors.py? It seems likely that the exact range might be different for each syscall and possibly per OS or even OS version. -- ___ Pyth

[issue20405] Add io.BinaryTransformWrapper and a "transform" parameter to open()

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > Ever used "recode" ? No, what is it? I once used iconv for short tests, but I never required iconv to convert a real document. > E.g. the example at the end of codecs.py allows using Latin-1 within > the application, while talking to the console using UTF-8.

[issue20494] Backport of http://bugs.python.org/issue11849 to Python 2.7 (Make it more likely for the system allocator to release free()d memory arenas on glibc-based systems).

2014-02-02 Thread Benjamin Yolken
Benjamin Yolken added the comment: Attaching an updated version of the patch generated with autoconf 2.69 instead of 2.68. -- Added file: http://bugs.python.org/file33883/memory_fix_updated.patch ___ Python tracker

[issue20495] test_read_pty_output() hangs on FreeBSD 7.2 buildbot

2014-02-02 Thread STINNER Victor
New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20FreeBSD%207.2%203.x/builds/4969/steps/test/logs/stdio --- [298/389/1] test_asyncio Timeout (1:00:00)! Current thread 0x28401040 (most recent call first): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Li

[issue19334] test_asyncio hanging for 1 hour (non-AIX version)

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: > It was hanging on FreeBSD 7.2 recently: > http://buildbot.python.org/all/builders/x86%20FreeBSD%207.2%203.x/builds/4917/steps/test/logs/stdio Oh, it still hangs on the latest version of the code. I opened #20495 to track this bug. -- resolution: ->

[issue20318] subprocess.Popen can hang in threaded applications in Python 2

2014-02-02 Thread STINNER Victor
Changes by STINNER Victor : -- title: subprocess.Popen can hang in threaded applications -> subprocess.Popen can hang in threaded applications in Python 2 ___ Python tracker ___

[issue20495] test_read_pty_output() hangs on FreeBSD 7.2 buildbot

2014-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: I guess this is not a total surprise given that OS X derives in some way from BSD... I wonder if we just need to make a matrix of which OS versions and which syscalls can handle PTYs correctly, and either put it in the docs or perhaps even refuse to accept

[issue20368] Tkinter: handle the null character

2014-02-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: The core of the patch is a wrapper that traps UnicodeDecodeErrors, corrects the strings, and re-decodes. A Python version might look like def unicodeFromTclStringAndSize(s, size): try: return except UnicodeDecodeError: if b'\xc0\x80' in s: s.

[issue20485] Enable 'import .pyd'

2014-02-02 Thread Suzumizaki
Suzumizaki added the comment: Thank you for reply, STINNER. > You encode it to UTF-8 and use "\xHH\xHH\xHH..." syntax to keep ASCII > encoding for the C file? The NAME may also be mentionned in docstrings, > C comments, type names, etc. The main purpose of this issue is "I want use Cython like

[issue20496] function definition tutorial encourages bad practice

2014-02-02 Thread Alan Isaac
New submission from Alan Isaac: Section 4.6 of the tutorial introduces function definition: http://docs.python.org/3/tutorial/controlflow.html#defining-functions The first example defines a function that *prints* a Fibonacci series. A basic mistake made by students new to programming is to use

[issue20497] Unclear word in socket document.

2014-02-02 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/socket.html#socket.getaddrinfo > Changed in version 3.2: parameters can now be passed as single keyword > arguments. What *single* means? I can use multiple keyword arguments: In [3]: socket.getaddrinfo('www.python.org', 80,

[issue20435] Discrepancy between io.StringIO and _pyio.StringIO with univeral newlines

2014-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for fixing this bug. Maybe I reported it too hastily. -- ___ Python tracker ___ ___ Pyth

[issue20498] Update StringIO newline tests

2014-02-02 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patches adds several new checks and test cases to StringIO newline tests. It also fixes test_newline_lf which didn't use the newline argument. -- components: IO, Tests messages: 210080 nosy: benjamin.peterson, hynek, pitrou, serhiy.storchak

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-02 Thread Stefan Behnel
Stefan Behnel added the comment: > Also, PEP 8 forbids using annotations in the CPython library, which > includes all of CPython's builtins. So using annotations in any way > for this was off the table. Interesting, wasn't aware of that. Then let's wait what will happen when users start manuall

[issue20485] Enable 'import .pyd'

2014-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > The hack msg209998 is interesting, but how to name submodule with non latin > like languages, especially keeping native reable? X( It is left to your discretion. You can use idna, punycode, utf-7, szm62 or romaji. --

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Pystone should has an option to specify a timer (as timeit). -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-02 Thread Stefan Behnel
Stefan Behnel added the comment: >> inspect.isbuiltin() returns False > Are you absolutely sure about this? Yes. The "inheritance" of Cython's function type from PyCFunction is a pure implementation detail of the object struct layout that is not otherwise visible in any way. Specifically, there

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: > This change is redundant since BuiltinFunctionType (which isbuiltin() tests > for) is already in _NonUserDefinedCallables, which is tested for right > afterwards. The code is more understandable, though. Anyways, I'm glad that the issue is now resolved. Also,

[issue20350] Replace tkapp.split() to tkapp.splitlist()

2014-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I use Linux. Unfortunately these methods (as most methods in Tkinter) are not tested. IDLE doesn't use any of these methods. -- ___ Python tracker __

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset c19f5e4fdbe0 by Yury Selivanov in branch 'default': inspect.signature: Add (restore) support for builtin classes #20473 http://hg.python.org/cpython/rev/c19f5e4fdbe0 -- nosy: +python-dev ___ Python tracke

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: Committed. We'll likely need to modify the code again in 3.5, once we settle the exact semantics of __text_signature__. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Larry Hastings
Larry Hastings added the comment: What semantics are unsettled? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: For instance if __text_signature__ and __signature__ are present simultaneously which one should be used, or the use of '($' to specify bound-methods first parameters etc. -- ___ Python tracker

<    1   2