Re: Python under PowerShell adds characters

2017-03-30 Thread Steve D'Aprano
On Thu, 30 Mar 2017 04:43 pm, Marko Rauhamaa wrote: > Steven D'Aprano : > >> On Thu, 30 Mar 2017 07:29:48 +0300, Marko Rauhamaa wrote: >>> I'd expect not having to deal with Unicode decoding exceptions with >>> arbitrary input. >> >> That's just silly. If you have

Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-30 Thread Pavol Lisy
On 3/29/17, Jan Gosmann wrote: > On 28 Mar 2017, at 14:21, INADA Naoki wrote: > >> On Wed, Mar 29, 2017 at 12:29 AM, Jan Gosmann >> wrote: >> >> I suppose smaller and faster benchmark is better to others looking for >> it. >> I already stopped the azure

Re: pandas dataframe, find duplicates and add suffix

2017-03-30 Thread Pavol Lisy
On 3/28/17, zljubi...@gmail.com wrote: > In dataframe > > import pandas as pd > > data = {'model': ['first', 'first', 'second', 'second', 'second', 'third', > 'third'], > 'dtime': ['2017-01-01_112233', '2017-01-01_112234', > '2017-01-01_112234', '2017-01-01_112234',

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
New submission from Dominic Mayers: I am just curious to know if someone considered the idea of passing a factory instance that returns RequestHandlerClass instances instead of directly passing the class? It may affect existing handlers that read non local variables, but there should be a way

[issue29944] Argumentless super() calls do not work in classes constructed with type()

2017-03-30 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +ncoghlan, xiang.zhang ___ Python tracker ___ ___

[issue29945] decode string:u"\ufffd" UnicodeEncodeError

2017-03-30 Thread Eryk Sun
Eryk Sun added the comment: > windows version run success! Trying to decode a non-ASCII unicode string should raise an exception on any platform: Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, modifying these mature APIs is a really bad idea. They are worked well as-is of over a decade. Seeing people use None for these arguments makes the code less readable. Python has a number of APIs where the number of arguments controls the

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-30 Thread Charalampos Stratakis
Changes by Charalampos Stratakis : -- nosy: +cstratak ___ Python tracker ___ ___

[issue29946] compiler warning "sqrtpi defined but not used"

2017-03-30 Thread Louie Lu
Louie Lu added the comment: I can reproduce on ArchLinux 4.10.1-1, GCC 6.3.1: /home/louielu/Python/cpython/Modules/mathmodule.c:74:21: warning: ‘sqrtpi’ defined but not used [-Wunused-const-variable=] static const double sqrtpi = 1.772453850905516027298167483341145182798; Is used by

Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-30 Thread INADA Naoki
> > Running further trials indicate that the problem actually is related to > swapping. If I reduce the model size in the benchmark slightly so that > everything fits into the main memory, the problem disappears. Only when the > memory usage exceeds the 32GB that I have, Python 3.6 will acquire

[issue29946] compiler warning "sqrtpi defined but not used"

2017-03-30 Thread Xiang Zhang
New submission from Xiang Zhang: Ubuntu 16.10, GCC 6.2.0 /home/angwer/repos/cpython/Modules/mathmodule.c:74:21: warning: ‘sqrtpi’ defined but not used [-Wunused-const-variable=] static const double sqrtpi = 1.772453850905516027298167483341145182798; -- components: Build messages:

[issue29945] decode string:u"\ufffd" UnicodeEncodeError

2017-03-30 Thread STINNER Victor
STINNER Victor added the comment: Decoding Unicode doesn't make any sense. You should take a look at http://unicodebook.readthedocs.io/ to understand what you are doing :-) (On Python 3, Unicode strings, the str type, has no mode .decode() type.) I suggest to close the issue has NOT A BUG.

[issue29945] decode string:u"\ufffd" UnicodeEncodeError

2017-03-30 Thread webber
Changes by webber : Added file: http://bugs.python.org/file46767/windows.jpg ___ Python tracker ___ ___

[issue29945] decode string:u"\ufffd" UnicodeEncodeError

2017-03-30 Thread webber
New submission from webber: I use python on linux, version is 2.7.13: [root@localhost bin]# ./python2.7 Python 2.7.13 (default, Mar 30 2017, 00:54:08) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a=u"\ufffd" >>>

[issue29533] urllib2 works slowly with proxy on windows

2017-03-30 Thread Paul Moore
Paul Moore added the comment: The behaviour you're describing for IE sounds like a bug to me. If you specify a host that should bypass the proxy, then that's what should happen - it shouldn't matter if you specify the host by IP address or by name. I'm -1 on Python trying to match IE bugs.

[issue29887] test_normalization doesn't work

2017-03-30 Thread STINNER Victor
STINNER Victor added the comment: Benjamin: "We should change the tests to fail if they get a 404." Good idea. Currently, the test is explicitly skipped on this case. Since "-u urlfetch" option must be explicitly passed on the command line, it makes sense to fail on that case. I proposed

[issue29887] test_normalization doesn't work

2017-03-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +805 ___ Python tracker ___ ___

[issue29942] Stack overflow in itertools.chain.from_iterable.

2017-03-30 Thread Mark Dickinson
Mark Dickinson added the comment: > I would have guessed that the C compiler would have automatically removed the > tail recursion I think it probably does, unless optimisation is turned off: I'm unable to reproduce except in debug builds of Python. -- nosy: +mark.dickinson

[issue29913] ipadress compare_networks does not work according to documentation

2017-03-30 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue29913] ipadress compare_networks does not work according to documentation

2017-03-30 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 16f852345bcdec1bbb15e5363fad6b33bf960912 by Xiang Zhang (s-sanjay) in branch 'master': bpo-29913: deprecate compare_networks() in documentation (GH-865) https://github.com/python/cpython/commit/16f852345bcdec1bbb15e5363fad6b33bf960912 --

[issue29942] Stack overflow in itertools.chain.from_iterable.

2017-03-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks fine. Feel free to apply and to backport this to earlier versions. I would have guessed that the C compiler would have automatically removed the tail recursion, but your experience would indicate otherwise. -- assignee: -> twouters

[issue27863] multiple issues in _elementtree module

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c90ff1b78cb79bc3762184e03fa81f11984aaa45 by Serhiy Storchaka in branch '3.5': bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#904) https://github.com/python/cpython/commit/c90ff1b78cb79bc3762184e03fa81f11984aaa45 --

[issue27863] multiple issues in _elementtree module

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +804 ___ Python tracker ___ ___

[issue29918] Missed "const" modifiers in C API documentation

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29918] Missed "const" modifiers in C API documentation

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 84b8e92e463bd6a5174bd3e5a6543580f6319c57 by Serhiy Storchaka in branch 'master': bpo-29918: Add missed "const" modifiers in C API documentation. (#846) https://github.com/python/cpython/commit/84b8e92e463bd6a5174bd3e5a6543580f6319c57

[issue29816] Get rid of C limitation for shift count in right shift

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Mark. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27863] multiple issues in _elementtree module

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +803 ___ Python tracker ___ ___

[issue29816] Get rid of C limitation for shift count in right shift

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 918403cfc3304d27e80fb792357f40bb3ba69c4e by Serhiy Storchaka in branch 'master': bpo-29816: Shift operation now has less opportunity to raise OverflowError. (#680)

[issue27863] multiple issues in _elementtree module

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 576def096ec7b64814e038f03290031f172886c3 by Serhiy Storchaka in branch 'master': bpo-27863: Fixed multiple crashes in ElementTree. (#765) https://github.com/python/cpython/commit/576def096ec7b64814e038f03290031f172886c3 --

[issue29944] Argumentless super() calls do not work in classes constructed with type()

2017-03-30 Thread assume_away
New submission from assume_away: The simplest example: def mydec(cls): return type(cls.__name__, cls.__bases__, dict(cls.__dict__)) @mydec class MyList(list): def extend(self, item): super(MyList, self).extend(item) def insert(self, index, object):

[issue29939] Compiler warning in _ctypes_test.c

2017-03-30 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- pull_requests: +802 ___ Python tracker ___ ___

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I agree with George that supporting None here is the better option. This problem also applies to collections.deque. tuple, list, and deque all have very similar index implementations, and it would be nice to merge their argument parsing boilerplate.

[issue25996] Add support of file descriptor in os.scandir()

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24821] The optimization of string search can cause pessimization

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29878] Add global instances of int 0 and 1

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29852] Argument Clinic: add common converter to Py_ssize_t that accepts None

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29852] Argument Clinic: add common converter to Py_ssize_t that accepts None

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 762bf40438a572a398e500c74e38f9894ea20a45 by Serhiy Storchaka in branch 'master': bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716) https://github.com/python/cpython/commit/762bf40438a572a398e500c74e38f9894ea20a45

[issue25996] Add support of file descriptor in os.scandir()

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ea720fe7e99d68924deab38de955fe97f87e2b29 by Serhiy Storchaka in branch 'master': bpo-25996: Added support of file descriptors in os.scandir() on Unix. (#502) https://github.com/python/cpython/commit/ea720fe7e99d68924deab38de955fe97f87e2b29

[issue24821] The optimization of string search can cause pessimization

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0a58f72762353768c7d26412e627ff196aac6c4e by Serhiy Storchaka in branch 'master': bpo-24821: Fixed the slowing down to 25 times in the searching of some (#505) https://github.com/python/cpython/commit/0a58f72762353768c7d26412e627ff196aac6c4e

[issue29878] Add global instances of int 0 and 1

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb by Serhiy Storchaka in branch 'master': bpo-29878: Add global instances of int for 0 and 1. (#852) https://github.com/python/cpython/commit/ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb --

[issue22392] Clarify documentation of __getinitargs__

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +alexandre.vassalotti ___ Python tracker ___

[issue22392] Clarify documentation of __getinitargs__

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See more detailed description in PEP 307. -- nosy: +serhiy.storchaka stage: needs patch -> patch review ___ Python tracker

Re: Python under PowerShell adds characters

2017-03-30 Thread Chris Angelico
On Thu, Mar 30, 2017 at 4:57 PM, Marko Rauhamaa wrote: > What I'm saying is that every program must behave in a minimally > controlled manner regardless of its inputs (which are not in its > control). With UTF-8, it is dangerously easy to write programs that > explode

Re: Python under PowerShell adds characters

2017-03-30 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Mar 30, 2017 at 4:43 PM, Marko Rauhamaa wrote: >> The input is not in my control, and bailing out may not be an option: >> >>$ echo >> aa\n\xdd\naa' | grep aa >>aa >>aa >>$ echo \xdd' | python2 -c 'import sys;

[issue29887] test_normalization doesn't work

2017-03-30 Thread Benjamin Peterson
Benjamin Peterson added the comment: We should change the tests to fail if they get a 404. -- ___ Python tracker ___

<    1   2