[issue29521] Minor warning messages when compiling documentation

2017-03-14 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +553 ___ Python tracker ___ ___

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

2017-03-14 Thread David Mertz
David Mertz added the comment: Raymond wrote: > The idea is that the method would return a new counter instance > and leave the existing instance untouched. Your own first example suggested: c /= sum(c.values()) That would suggest an inplace modification. But even if it's not that, but

[issue29813] PyTuple_GetSlice does not always return a new tuple

2017-03-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think the docs are fine as-is. Whether an identical tuple is new or not is an implementation detail. IMO, the docs would create more confusion by trying to over-explain, "slicing of tuples always returns a new tuple when the result tuple is distinct

[issue29813] PyTuple_GetSlice does not always return a new tuple

2017-03-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue29813] PyTuple_GetSlice does not always return a new tuple

2017-03-14 Thread Michael Seifert
Michael Seifert added the comment: > What leads to your headache? That depending on the arguments to "PyTuple_GetSlice" I get "SystemError: ..\Objects\tupleobject.c:156: bad argument to internal function" when using PyTuple_SetItem on the (supposedly) new tuple. Maybe I just misunderstood

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

2017-03-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: The idea is that the method would return a new counter instance and leave the existing instance untouched. -- ___ Python tracker

[issue29813] PyTuple_GetSlice does not always return a new tuple

2017-03-14 Thread Xiang Zhang
Xiang Zhang added the comment: I think the description is fine. :-( What leads to your headache? -- nosy: +xiang.zhang ___ Python tracker ___

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Марк Коренберг
Марк Коренберг added the comment: Syslog, listening on local machine via UNIX socket. -- ___ Python tracker ___

[issue29339] Interactive: Move to same indentation level as previousline

2017-03-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am inclined to close this. Any objection? -- ___ Python tracker ___ ___

[issue29676] C method is not profiled by lsprof

2017-03-14 Thread Xiang Zhang
Xiang Zhang added the comment: Actually the current test produces some noises, but it doesn't fail. -- ___ Python tracker ___

[issue29813] PyTuple_GetSlice does not always return a new tuple

2017-03-14 Thread Michael Seifert
Changes by Michael Seifert : -- title: PyTuple_GetSlice documentation incorrect -> PyTuple_GetSlice does not always return a new tuple ___ Python tracker

[issue29813] PyTuple_GetSlice documentation incorrect

2017-03-14 Thread Michael Seifert
New submission from Michael Seifert: The PyTuple_GetSlice documentation says it "Take a slice of the tuple pointed to by p from low to high and return it as a new tuple." [0] However in case the start is <= 0 and the stop is >= tuplesize it doesn't return the promised "new tuple", it just

[issue29674] Use GCC __attribute__((alloc_size(x, y))) on PyMem_Malloc() functions

2017-03-14 Thread svelankar
Changes by svelankar : -- pull_requests: +552 ___ Python tracker ___ ___

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Martin Panter
Martin Panter added the comment: FWIW I tend to use cStringIO.StringIO as a Python 2 replacement for io.StringIO to avoid this str vs unicode problem. But that only accepts ASCII, so won't help you if you really need the UTF-8 encoding step. -- nosy: +martin.panter

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-14 Thread Eric V. Smith
Eric V. Smith added the comment: I agree this needs to be different from replace(), due to not being atomic. That makes it an enhancement, so I'm removing 3.5. I'm +1 on Path supporting something like shutil.move(). -- nosy: +eric.smith type: -> enhancement versions: -Python 3.5

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-14 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +551 ___ Python tracker ___ ___ Python-bugs-list

[issue29339] Interactive: Move to same indentation level as previousline

2017-03-14 Thread 12345 67890
Changes by 12345 67890 : -- nosy: -12345 67890 ___ Python tracker ___ ___ Python-bugs-list

[issue29339] Interactive: Move to same indentation level as previousline

2017-03-14 Thread 12345 67890
12345 67890 added the comment: Folks, I have decided that I no longer have the time to resolve this issue. -- ___ Python tracker ___

[issue29812] test for token.py, and consistency tests for tokenize.py

2017-03-14 Thread R. David Murray
New submission from R. David Murray: http://bugs.python.org/issue24622 made reminded me that a while back we added tests for the keyword module that includes a test that if you run it, you get the result that is checked in. The same thing could be done for the token.py module. And then we

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Vinay Sajip
Vinay Sajip added the comment: > Nothing special. Just try to create SysLogHandler when syslog server is down. Which specific syslog configuration? UDP listener, Unix socket listener, or both? -- ___ Python tracker

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Jason R. Coombs
Jason R. Coombs added the comment: As a workaround, I wrapped BytesIO thus and it works for our needs. class LenientIO(io.BytesIO): """ A version of BytesIO that can accept unicode or bytes. See http://bugs.python.org/issue29809 """ def write(self, value): if

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Jason R. Coombs
Jason R. Coombs added the comment: > How you got a Unicode source line in SyntaxError? Good question. Took me a while to replicate the exact conditions, but here's an example: #coding: utf-8 from __future__ import unicode_literals import tokenize import io code = """ // // """ buf =

[issue29779] New environment variable PYTHONHISTORY

2017-03-14 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Mar 12, 2017, at 11:42 AM, Chi Hsuan Yen wrote: >That's a great feature! Here's a question: what should be CPython's behavior >when PYTHONHISTORY is explicitly set to empty? Currently there's an error: > >$ PYTHONHISTORY= ./python >Python 3.7.0a0

[issue29811] Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs()

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: callmethod3.patch of #29507 implements proposed optimization, but only when there is no positional argument. The patch doesn't apply cleanly since the code evolved, including a major refactoring: new Objects/call.c file. --

[issue29026] time.time() documentation should mention UTC timezone

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: Mariatta: "Hi, does this need backport to 2.7? I'm getting a lot of conflicts while trying to do that... Not sure how to proceed." I think it's ok to leave Python 2.7 doc unchanged. It's only a minor doc enhancement, the 2.7 doc is still correct. I close the

[issue29811] Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs()

2017-03-14 Thread STINNER Victor
Changes by STINNER Victor : -- title: Use FASTCALL in call.c callmethod() to avoid temporary tuple -> Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs() ___ Python tracker

[issue29507] Use FASTCALL in typeobject.c call_method() to avoid temporary tuple

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: call_method() of typeobject.c has been optimized by the commit 516b98161a0e88fde85145ead571e13394215f8c. I consider that the initial issue is now fixed. I created the issue #29811 to discuss optimizing callmethod() of call.c which is more complex.

[issue29811] Use FASTCALL in call.c callmethod() to avoid temporary tuple

2017-03-14 Thread STINNER Victor
New submission from STINNER Victor: call_method() of typeobject.c has been optimized to avoid temporary method object and to avoid temporary tuple in the issue #29507. Optimizing callmethod() of call.c was already discussed on issue #29507 but no decision was taken. Since call.c code is more

[issue29507] Use FASTCALL in typeobject.c call_method() to avoid temporary tuple

2017-03-14 Thread STINNER Victor
Changes by STINNER Victor : -- title: Use FASTCALL in call_method() to avoid temporary tuple -> Use FASTCALL in typeobject.c call_method() to avoid temporary tuple ___ Python tracker

[issue29676] C method is not profiled by lsprof

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: Oh wow, I didn't expect this issue with tracing when the commit 5566bbb8d563646d83e8172410fa0c085e8233b1 was merged: test_sys_settrace and test_lsprof passed. Would it be possible to add an unit test? -- nosy: +haypo

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks, Martin, and thanks Jim for the ping. I'll backport the change to 2.7 later today, and then this issue can be closed :) -- assignee: docs@python -> Mariatta ___ Python tracker

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The “tabnanny” script was removed from Tools/scripts/ in 2.0: . So the 2.7 FAQ also has the wrong location. -- ___ Python tracker

[issue29339] Interactive: Move to same indentation level as previousline

2017-03-14 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: -Jim Fasarakis-Hilliard ___ Python tracker ___

[issue29674] Use GCC __attribute__((alloc_size(x, y))) on PyMem_Malloc() functions

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: Yeah, as for each GCC release, I expect new warnings. I noticed the implicit fall through in GCC 7. I know that it's used on purpose in CPython. -- title: Use GCC __attribute__((alloc_size(x,y))) on PyMem_Malloc() functions -> Use GCC

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
Changes by Stefan Krah : -- status: open -> closed ___ Python tracker ___ ___

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
Stefan Krah added the comment: Thanks for the PR! -- Merged. -- assignee: -> skrah components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved versions: +Python 3.7 ___ Python tracker

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- pull_requests: +550 ___ Python tracker ___ ___

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Just a question, does this need backport to 2.7? It's only been backported to 3.5 and 3.6. -- nosy: +Mariatta ___ Python tracker

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
Stefan Krah added the comment: Not right now, but if anyone makes a PR I can click the merge button. :) -- ___ Python tracker ___

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-03-14 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue12458] Tracebacks should contain the first line of continuation lines

2017-03-14 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue29674] Use GCC __attribute__((alloc_size(x, y))) on PyMem_Malloc() functions

2017-03-14 Thread svelankar
svelankar added the comment: Ok. As a side note, while compiling python source using gcc 7 [gcc (GCC) 7.0.1 20170314 (experimental)], few places in the code with case fallthrough (must be intentional) triggered this warning - -Wimplicit-fallthrough=. We can either disable this warning

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Марк Коренберг
Марк Коренберг added the comment: Nothing special. Just try to create SysLogHandler when syslog server is down. Exception will be raised. -- ___ Python tracker

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Stefan, do you have time to make a PR for this? -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Vinay Sajip
Vinay Sajip added the comment: Can you provide a short script which demonstrates exactly the problem you're trying to solve? -- nosy: +vinay.sajip ___ Python tracker

[issue29540] Add compact=True flag to json.dump/dumps

2017-03-14 Thread Ben Hoyt
Ben Hoyt added the comment: Agreed. Seems much the same as other argument constants, like pickle.HIGHEST_PROTOCOL for the "protocol" argument. These are not changing the API, just adding a helper constant to avoid the magic values. -Ben On Tue, Mar 14, 2017 at 12:24 PM, Brett Cannon

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Alex Gaynor
Alex Gaynor added the comment: Sounds good to me! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Christian Heimes
Christian Heimes added the comment: Yes, I'm planning a PEP to make the SSL module a bit more sane: 1) deprecate all protocols except for PROTOCOL_TLS_CLIENT / PROTOCOL_TLS_SERVER 2) deprecate purpose in favor of PROTOCOL_TLS_* 3) PROTOCOL_TLS_CLIENT defaults to CERT_REQUIRED,

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Alex Gaynor
Alex Gaynor added the comment: Ah, so instead of PROTOCOL_SSLv23 using PROTOCOL_TLS_CLIENT and deprecating the Purpose bits entirely? That sounds good to me! -- ___ Python tracker

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Christian Heimes
Christian Heimes added the comment: For 3.7 I'm planning to move to protocols instead of purpose oids (PROTOCOL_TLS_CLIENT, PROTOCOL_TLS_SERVER). -- ___ Python tracker

[issue29540] Add compact=True flag to json.dump/dumps

2017-03-14 Thread Brett Cannon
Brett Cannon added the comment: I agree with David that I don't see how adding a constant to the module is really a complication of an API. -- ___ Python tracker

[issue29787] Internal importlib frames visible when module imported by import_module throws exception

2017-03-14 Thread Brett Cannon
Brett Cannon added the comment: Yep, I agree it isn't as nice as syntactic import, but that can happen when you're not getting to use dedicated bytecode like syntactic import does. If you can come up with a patch that adds hardly any more C code -- say about 10 or 20 lines? -- I would

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +christian.heimes, dstufft, janssen ___ Python tracker ___

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

2017-03-14 Thread David Mertz
David Mertz added the comment: I definitely wouldn't want a mutator that "normalized" counts for the reason Antoine mentions. It would be a common error to normalize then continue meaningless counting. One could write a `Frequency` subclass easily enough. The essential feature in my mind

[issue29810] Rename ssl.Purpose.{CLIENT,SERVER}_AUTH

2017-03-14 Thread Alex Gaynor
New submission from Alex Gaynor: The names are super misleading. First, they're written in a way that's the opposite of how people think about these things (CLIENT_AUTH -> server socket; SERVER_AUTH -> client socket). Second, they're misleading, you can have TLS which is *mutually*

[issue29592] abs_paths() in site.py is slow

2017-03-14 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: sys.stderr.write() accepts Unicode (encoded to sys.stderr.encoding), whereas io.BytesIO.write() requires bytes: >>> import sys; sys.stderr.write(u'\xe9\n') é >>> import io; io.BytesIO().write(u'\xe9\n') Traceback (most recent call last): File "", line 1, in

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: format_exception_only() produces a Unicode string for SyntaxError with Unicode source line. >>> traceback.format_exception_only(SyntaxError, SyntaxError('failed', >>> ('', 7, 2, u' // test'))) [' File "", line 7\n', u'// test\n', '^\n',

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Jason R. Coombs
Jason R. Coombs added the comment: A complimentary error will occur on Python 3 if a bytes member exists in the SyntaxError, though I suspect that would be an invalid usage. -- ___ Python tracker

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

2017-03-14 Thread Vedran Čačić
Vedran Čačić added the comment: That seems horribly arbitrary to me, not to mention inviting another intdiv fiasco (from sanity import division:). If only Counter was committed to only working with integer values from start, it might be acceptable, but since Counter implementation was always

[issue29804] test_ctypes test_pass_by_value fails on arm64 (aarch64) architecture

2017-03-14 Thread Vinay Sajip
Vinay Sajip added the comment: The test checks that a structure passed by value is indeed passed by value - something that is architecture-dependent, as calling conventions differ across architectures. If the test fails, this indicates that the structure isn't being passed by value - a

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: I measured that my patch (pull request) increases the stack usage of 64 bytes per partial_call() call. I consider that it's accepted for a speedup between 1.12x faster and 1.25x faster. Attached partial_stack_usage.py requires testcapi_stack_pointer.patch of

[issue25643] Python tokenizer rewriting

2017-03-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: -patch versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Shouldn't this issue get closed now that the PR was merged? -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Jason R. Coombs
New submission from Jason R. Coombs: I'm writing a routine that captures exceptions and logs them to a database. In doing so, I encountered a situation that when parsing a Unicode file that has an IndentationError (SyntaxError), print_exc will fail when it tries to render the unicode line.

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: That makes sense to me, I'll wait around until the dependency is resolved. -- ___ Python tracker ___

[issue25643] Python tokenizer rewriting

2017-03-14 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am working on the other issue (the recent patch is still not published). Sorry, but two issues modify the same code and are conflicting. Since I believe that this issue makes less semantic changes, I think it would be easier to rebase it after finishing

[issue29804] test_ctypes test_pass_by_value fails on arm64 (aarch64) architecture

2017-03-14 Thread Iryna
Iryna added the comment: Hi Vinay, I have added you to the nosy list as you are the author of the fix for bpo-29565, and would like to ask you for insights or ideas on why the test would fail only on one architecture (arm64)? -- ___ Python tracker

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

2017-03-14 Thread Wolfgang Maier
Wolfgang Maier added the comment: > >>> Counter(red=11, green=5, blue=4).normalize(100) # percentage > Counter(red=55, green=25, blue=20) I like this example, where the normalize method of a Counter returns a new Counter, but I think the new Counter should always only have integer counts.

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Thanks for linking the dependency, Serhiy :-) Is there anybody currently working on the other issue? Also, shouldn't both issues now get retagged to Python 3.7? -- ___ Python tracker

[issue22891] code removal from urllib.parse.urlsplit()

2017-03-14 Thread Tim Graham
Tim Graham added the comment: I sent a pull request for this issue's dependency (issue 27657) and added a second commit there with this patch. A test added in the first commit demonstrates that removing this code no longer results in the behavior change described in msg238254. --

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please hold this until finishing issue25643. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Python tokenizer rewriting ___ Python tracker ___

[issue3353] make built-in tokenizer available via Python C API

2017-03-14 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Okay, I'll take a look at it over the next days and try and submit a PR after fixing any issues that might be present. -- ___ Python tracker

[issue29600] Returning an exception object from a coroutine triggers implicit exception chaining?!?

2017-03-14 Thread Yury Selivanov
Yury Selivanov added the comment: > I am wondering how much of other uses of PyErr_SetObject() are affected by > similar bugs? Only when we use an exception to carry a return value. AFAIK StopIteration is the only such case. -- ___ Python tracker

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nice results. You made a great work for decreasing C stack consumption. It would be sad to lose it without good reasons. Could you please compare two variants, with and without small stack? -- ___ Python tracker

[issue29540] Add compact=True flag to json.dump/dumps

2017-03-14 Thread R. David Murray
R. David Murray added the comment: I don't see how adding a constant increases the complexity of the API. -- ___ Python tracker ___

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: > What about C stack consumption? Is not this increase it? Yes, my optimization consumes more C stack: small_stack allocates 80 bytes on the stack (for 5 positional arguments). Is it an issue? -- ___ Python tracker

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: bench_fastcall_partial.py: more complete microbenchmark. I rewrote my patch: * I added _PyObject_HasFastCall(callable): return 1 if callable supports FASTCALL calling convention for positional arguments * I splitted partial_call() into 2 subfunctions:

[issue29735] Optimize functools.partial() for positional arguments

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: > If the underlying function doesn't support fast call, and both args and > pto->args are not empty, patched partial_call() makes one unneeded copyings. The simple workaround is to revert changes using FASTCALL in partial_call(). But for best performances, it

[issue29600] Returning an exception object from a coroutine triggers implicit exception chaining?!?

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am wondering how much of other uses of PyErr_SetObject() are affected by similar bugs? -- nosy: +serhiy.storchaka ___ Python tracker

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +548 ___ Python tracker ___

[issue29807] ArgParse page in library reference rewrite

2017-03-14 Thread Martin Panter
Martin Panter added the comment: Also see Issue 26602 and Issue 11176, each with patches. Perhaps you could help review and combine them. -- nosy: +martin.panter ___ Python tracker

[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-03-14 Thread STINNER Victor
STINNER Victor added the comment: Can you write a short Python script producing the bug? -- ___ Python tracker ___

[issue29787] Internal importlib frames visible when module imported by import_module throws exception

2017-03-14 Thread Ulrich Petri
Ulrich Petri added the comment: Thanks for the fast response. However I disagree with the assertion that this is "working as expected". IMO the same arguments apply as in the original ticket (esp. Georg Brandls) http://bugs.python.org/issue15110#msg163258. It is unexpected, confusing (esp.

[issue29808] SyslogHandler: should not raise exception in constructor if connection fails

2017-03-14 Thread Марк Коренберг
New submission from Марк Коренберг: Syslog handler already able to ignore temporary errors while seding logs. So he knows that syslog server may be not reachable at the moment. But when we say about constructor, it fails with error. I have fixed that -- now it will ignore such errors, and try

[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-03-14 Thread INADA Naoki
Changes by INADA Naoki : -- dependencies: -Document PyEval_Call* functions resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue28810] Document bytecode changes in 3.6

2017-03-14 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- pull_requests: +547 ___ Python tracker ___ ___

[issue26602] argparse doc introduction is inappropriately targeted

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The patch looks unfinished. I left some narrow nit-picky review comments, but I haven’t really thought about the problem from a high level. -- nosy: +martin.panter stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-14 Thread Xiang Zhang
Xiang Zhang added the comment: I committed the suboptimal patch. I close this issue now and if there is any enhancement solution, let's make it another issue. Thank you all. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following example copies the entire buffer object while copying only smart part is needed: m = memoryview(b'x'*10**6) b'%.100b' % m I don't know whether this is important use case that is worth an optimization. The workaround is using slicing

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +546 ___ Python tracker ___ ___ Python-bugs-list

[issue29807] ArgParse page in library reference rewrite

2017-03-14 Thread Steve Carter
New submission from Steve Carter: Originally raise as https://github.com/python/pythondotorg/issues/1059 Although it's a reference page, it is clouded by too many examples and too little reference material. Moreover, the examples are not real-world applications of argument parsing. I propose

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Vedran Čačić
Vedran Čačić added the comment: We obviously missed this, at least for 3.5... any chance of having it for 3.7? -- nosy: +veky ___ Python tracker ___

[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the example worked on old versions of Python, perhaps this is a regression. Either WeakSet was pickleable or it was not used in that asyncio/multiprocessing use. If this is a regression in the stdlib it should be fixed. -- nosy: +fdrake,