[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Yes, I think this is a good idea. I was hesitant to make this change while #22798 was open because I thought we may end up exposing changes to tzname caused by localtime and friends. I also believe we can classify this as a bug-fix because side-effects

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten
Ed Schouten added the comment: Hi Alexander, I'm absolutely no expert when it comes to the Python codebase, so I've got a question. If we're going to movein this to Include/pytime.h, we should likely introduce full wrappers that have a name starting with _PyTime_, right? This header seem to b

[issue16384] import.c doesn't handle EOFError from PyMarshal_Read*

2016-09-14 Thread Sye van der Veen
Sye van der Veen added the comment: I would also agree that failing to load the main codec should be an abort. This bug was specifically the race condition in writing the .pyc file. Thanks for all your help! -- ___ Python tracker

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > we should likely introduce full wrappers that have a name starting with > _PyTime_, right? Yes, and I would like to give some thought to what the best API would be. The two choices are to emulate localtime_r on Windows or emulate localtime_s on POSIX

[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2016-09-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: +belopolsky stage: -> needs patch type: -> behavior ___ Python tracker ___ _

[issue22799] wrong time.timezone

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Closing. See #22798 for the reasons why synchronizing C variables with the time module constants is not a solution. -- resolution: -> wont fix status: open -> closed ___ Python tracker

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: I confirmed and investigated it. Thanks! I'll post patch including more test in 24 hours. -- ___ Python tracker ___ __

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2016-09-14 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: The time module defines timezone, altzone, tzname and daylight constants that store information about system timezone. This information is derived from the timezone rules that are in effect at the module loading time, but may be incorrect for the tim

[issue22799] wrong time.timezone

2016-09-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- superseder: -> Document time module constants (timezone, tzname, etc.) as deprecated. ___ Python tracker ___ __

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten
Ed Schouten added the comment: As a person who keeps a close eye on the Austin Group mailing lists (i.e., 'the POSIX working group'), my guess is that it's very unlikely that POSIX will ever add those *_s() extensions. Here's a discussion on Reddit that actually captures all of the arguments p

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Maybe we can just pick a prototype that's as Pythonesque as possible that > also fixes these shortcomings. Any thoughts? Yes, and just call it _PyTime_localtime without the ugly suffix. -- ___ Python tracker

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Xiang Zhang
Xiang Zhang added the comment: > I confirmed and investigated it. Thanks! I'll post patch including more test in 24 hours. Please wait a second. The cause of this problem is that attribute setting causes a combined table to be splitted (the code path is [0]->[1]->[2]->[3]). So every time you

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Xiang Zhang
Xiang Zhang added the comment: > popitem() before does the same thing and should never cause a problem. Ahh, this seems not true. Test it in py3.5 also crash. -- ___ Python tracker

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44665/fix-28147.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: This issue is caused by dictresize() and _PyObjectDict_SetItem() 1. a.__dict__.pop('a') convert the dict to combined table which has double keysize. 2. a.a = 1 converts the dict to split table again if there are no instances sharing key with class. As I wrote b

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44666/fix-28147.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten
Ed Schouten added the comment: Does this patch look all right to you? -- Added file: http://bugs.python.org/file44667/patch-pytime-localtime-gmtime ___ Python tracker ___ ___

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Yury Selivanov
New submission from Yury Selivanov: The attached patch implements an opcode cache for LOAD_GLOBAL opcode, making it 2x faster. The idea is to use the new co_extra field of code objects & PEP 509 to attach a cache structure pointing directly to the resolved global name. When globals or builti

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-14 Thread Clint Olsen
Clint Olsen added the comment: I'm not sure if this is applicable to this bug, but one feature missing from argparse is the ability to snarf arbitrary options up to a terminating '--'. The purpose of this is to collect arguments for potential children you may spawn. An example: --subscript_ar

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Very nice. I'll give it a week or two for the others to chime in and commit if I don't hear any objections. -- keywords: +patch stage: patch review -> commit review versions: +Python 3.7 ___ Python tracker

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I see that you picked localtime_s-like order of arguments. While I have no personal preference, I wonder why you prefer output to follow input. The usual UNIX/C convention is the opposite. Interfaces like sprintf, strcat, strftime and many other have

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten
Ed Schouten added the comment: I've been brainwashed by https://google.github.io/styleguide/cppguide.html#Function_Parameter_Ordering over the last couple of years, which is why I thought `localtime()/localtime_r()`'s way of ordering the arguments made most sense here. ;-) -- __

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I thought `[...]localtime_r()`'s way of ordering the arguments made most > sense here. Right. I keep forgetting which one is localtime_r and which is localtime_s. I don't think there is any preference in the Python codebase. (PEP 8 is silent on this p

[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue25478] Consider adding a normalize() method to collections.Counter()

2016-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The pitfall I imagine here is that if you continue adding elements after normalize() is called, the results will be nonsensical. -- nosy: +pitrou ___ Python tracker __

[issue28159] Deprecate isdst argument in email.utils.localtime

2016-09-14 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: With the implementation of PEP 495, email.utils.localtime() does not need the isdst argument to disambiguate naive time. In fact the utility method itself is redundant given that astimezone() now works for naive instances. -- components: Libra

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2016-09-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: belopolsky -> priority: high -> versions: +Python 3.7 -Python 3.6 ___ Python tracker ___ __

[issue28130] Document that time.tzset updates time module globals

2016-09-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- title: Document that time.tzset updates time module constants -> Document that time.tzset updates time module globals ___ Python tracker ___

[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: I had to rewrite the patch to make sure it reports correct position and covers all cases where using async/await should trigger a warning. Brett, could you please take a look at the patch? -- Added file: http://bugs.python.org/file44669/issue_26182.pat

[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: INADA, would you be able to address my last review comments? Also, I'm wondering what if we could implement __del__ and __repr__ in C too, so that we could drop BaseFuture class? -- ___ Python tracker

[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread STINNER Victor
STINNER Victor added the comment: Christian Heimes added the comment: > The main reason for two different hash algorithms was missing support for 64bit integer types. Python 3.4 was targeting platforms that had no 64bit integer support at all (IIRC SPARC). Nowaday Python requires 64bit ints to co

[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Yaron Goland
New submission from Yaron Goland: When running python -V or --version the output goes to stderr instead of stdout. Unless python thinks its version is an err shouldn't the result go to stdout? -- components: Macintosh messages: 276496 nosy: Yaron Goland, ned.deily, ronaldoussoren prior

[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Yaron Goland
Yaron Goland added the comment: To be fair it turns out that Java also outputs its version to stderr. Still seems wrong. It's not an error! -- ___ Python tracker ___ ___

[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, we didn't get to this. @Yury, do you think you could get to this before b1 goes out? It's a pure optimization (and a good one!). -- ___ Python tracker ___

[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: > @Yury, do you think you could get to this before b1 goes out? It's a pure > optimization (and a good one!). LGTM. Will commit tomorrow. -- assignee: -> yselivanov ___ Python tracker

[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. This was already done in Python 3.4. See https://docs.python.org/dev/whatsnew/3.4.html#changes-in-python-command-behavior and issue 18338 for details. Backporting this to 2.7 would break backwards compatibility so that means we can't chan

[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: (Of course I meant b2.) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: xiang is right. Python 3.5 has same issue when using popitem(). I'll make patch for 3.5. But it will be bit differ from patch for 3.6 and they will conflict. -- ___ Python tracker _

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-14 Thread paul j3
paul j3 added the comment: Clint, 'nargs=argparser.REMAINDER' ('...') may do what you want p=argparse.ArgumentParser() p.add_argument('--subscipt_args', nargs='...') p.add_argument('pos',nargs='*') p.parse_args('--subscipt_args --foo --bar --baz -- other args'.split()) produces

[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: I'm working on fixing points you commented. Wait a minute. Implementing __del__ and __repr__ in C is bit hard task to me. I can't do it in this week. (maybe I can't do it in this month too.) On Thu, Sep 15, 2016 at 7:37 AM, Yury Selivanov wrote: > > Yury Selivan

[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: > Implementing __del__ and __repr__ in C is bit hard task to me. > I can't do it in this week. (maybe I can't do it in this month too.) NP. I'll take a look myself after you upload the next iteration of the patch... --

[issue28161] Opening CON for write access fails

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: When opening the CON device the underlying CreateFile call needs to use either GENERIC_READ or GENERIC_WRITE access, but not both. Currently opening for writing fails as follows: >>> open('CON', 'wb', buffering=0) Traceback (most recent call last): Fil

[issue28140] Attempt to give better errors for pip commands typed into the REPL

2016-09-14 Thread Nick Coghlan
Nick Coghlan added the comment: Paul Moore pointed out on distutils-sig that since this is mainly desired for the REPL, we can put the logic in the default excepthook rather than into the SyntaxError constructor the way we had to for "print" and "exec": def excepthook(typ, value, traceback

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: For a console readall(), if the first line starts with '\x1a' (i.e. Ctrl+Z), it breaks out of its read loop before incrementing len. Thus the input isn't handled properly as EOF, for which the check requires len > 0. Instead it ends up calling WideCharToMultiByte

[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: WindowsConsoleIO fileno() gets a file descriptor on demand by calling _open_osfhandle. As a low I/O function this expects _open flags, but currently the code is passing 'rb' (int 0x7262) and 'wb' (int 0x7762). It should use _O_RDONLY | _O_BINARY and _O_WRONLY | _O

[issue28140] Attempt to give better errors for pip commands typed into the REPL

2016-09-14 Thread Nick Coghlan
Nick Coghlan added the comment: Given that this can be done with just an excepthook change, I'm going to suggest we make the change for 3.5 and 2.7 as well. -- versions: +Python 2.7, Python 3.5 ___ Python tracker

[issue21337] Add tests for Tix

2016-09-14 Thread Zachary Ware
Zachary Ware added the comment: Tix is now deprecated, extra tests are unnecessary. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker __

[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Ned Deily
Changes by Ned Deily : -- priority: normal -> high stage: needs patch -> patch review versions: +Python 3.7 ___ Python tracker ___ ___

[issue28164] _PyIO_get_console_type fails for various paths

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: _PyIO_get_console_type currently hard codes the names "CON", "CONIN$", and "CONOUT$" and doesn't use a case-insensitive comparison. For example, opening "conin$" doesn't get directed to WindowsConsoleIO: >>> open('conin$', 'rb', buffering=0) <_io.FileIO na

[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: This is the patch. And git branch is here https://github.com/methane/cpython/pull/5 -- Added file: http://bugs.python.org/file44670/fastfuture.patch ___ Python tracker ___

[issue28099] Drop Mac OS X Tiger support in Python 3.6

2016-09-14 Thread Ned Deily
Changes by Ned Deily : -- assignee: -> ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Xavion
New submission from Xavion: Each time I run a shell command via the 'subprocess' module, I notice that the memory footprint of my program increases by roughly 4 KiB. I've tested the problem with two different slices of code; the result is the same in either case (long after the function finish

[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Antti Haapala
Antti Haapala added the comment: 3.5.1+ ubuntu; I run the Popen case in while True, and watch `top` - not a single digit changes in the memory usage (the last digit being the kilobytes). That the memory footprint increases *once* by 4KiB is nothing; please run this in a loop. -- nosy:

[issue28150] Error CERTIFICATE_VERIFY_FAILED in macOS

2016-09-14 Thread Ned Deily
Ned Deily added the comment: Sorry, the information about this feature is currently only documented in the OS X installer ReadMe. As you noted, it's displayed to the user during installation when using the OS X installer app. A copy of the ReadMe is also installed for later reference in the

[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Xavion
Xavion added the comment: I wouldn't have reported this if it was only happening *once*. I already have it in a loop; a new shell command is fired every second. The memory footprint increases by roughly 4 KiB *each* time. I monitor it via the following Bash script: while true; do

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-14 Thread Sohaib Ahmad
Sohaib Ahmad added the comment: Thank you for pointing me towards hg bisect. I got some time to look into it and was able to find the commit that broke this functionality. A fix from Python 3 was backported in issue "urllib hangs when closing connection" which removed a call to ftp.voidresp().

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Antti Haapala
Antti Haapala added the comment: I just noticed that you're actually testing a builtin instead of something in just module globals. How is the performance with module globals? -- nosy: +ztane ___ Python tracker __

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-14 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue27806] 2.7 32-bit builds fail on future releases of OS X due to dependency on deleted header file

2016-09-14 Thread Tim Smith
Changes by Tim Smith : -- nosy: +tdsmith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does this prolongate the lifetime of cached global objects? -- nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.6 ___ Python tracker __

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: > Does this prolongate the lifetime of cached global objects? No. I store borrowed references. The idea is that if the state of globals/builtins dict has changed, we invalidate the cache. -- ___ Python tracker

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: Serhiy, feel free to review the patch. Guido and Ned okayed it to be committed before 3.6b2. Currently the patch only optimizes one opcode -- LOAD_GLOBAL, but cveal_cache.h file provides the infrastructure to easily implement more opcode caches. I can simpl

<    1   2