[issue26867] test_ssl test_options fails on ubuntu 16.04

2017-02-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 2.7 ___ Python tracker

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Vinay Sajip
Vinay Sajip added the comment: This is not a bug - logging is formatting the message as per the specified format string. It then prepends the priority and sends the result to the socket. What you are seeing is just how systemd/journald interpret the message that's sent. --

[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-28 Thread Wolfgang Maier
Wolfgang Maier added the comment: > [...] I prefere the chapter as it currently is, because IMHO it > introduces the concepts more gradually than your proposal. That's ok! It's your PR and I only wanted to show an alternative. I was hoping for a bit more people to provide feedback though. The

[issue26867] test_ssl test_options fails on ubuntu 16.04

2017-02-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +311 ___ Python tracker ___ ___ Python-bugs-list

[issue28598] RHS not consulted in `str % subclass_of_str` case.

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

[issue29682] Checks for null return value

2017-02-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Extension Modules keywords: +easy (C) nosy: +gregory.p.smith, serhiy.storchaka stage: -> needs patch type: -> crash ___ Python tracker

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Martin. This is not a bug. -- nosy: +serhiy.storchaka stage: -> resolved status: open -> closed ___ Python tracker

[issue29682] Checks for null return value

2017-02-28 Thread Alex CHEN
New submission from Alex CHEN: Hi, Our tool reported a position that doesn't check for returned value (from a function that might returns null). might need a look that is there any problem or I am missing something. in function PyUnknownEncodingHandler of file pyexpat.c, if

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: python-dev thread: https://mail.python.org/pipermail/python-dev/2017-March/147501.html In formulating my question for the list, it occurred to me that while asynccontextmanager doesn't need to depend on asyncio, the AsyncExitStack proposed in issue 29302

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Martin Panter
Martin Panter added the comment: It's not clear what you expected the behaviour to be. A function cannot both raise an exception and return a value. In any case, you are correct in saying "the next option, '-d', is taken as the argument." I do not think this is a bug. See

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: It's probably worth a python-dev discussion, but I personally draw the line at "Does this need to import 'asyncio'?". If it does, then that's a clear dependency inversion, and the functionality doesn't belong in a relatively low level module like contextlib.

[issue29302] add contextlib.AsyncExitStack

2017-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: I quite like the idea of enhancing the existing ExitStack to also handle asynchronous operations rather than having completely independent implementations. However, a separate object may end up being simpler in practice as it allows developers to more

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nick, do you think this belongs in contextlib to be side-by-side with @contextmanager or would it be better to group all async tools in their own module. It seems to me that people are going to ask for an async version of everything, effectively

[issue29302] add contextlib.AsyncExitStack

2017-02-28 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +giampaolo.rodola, gvanrossum, haypo, ncoghlan, yselivanov ___ Python tracker ___

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks, I'll address your PR comments. issue 29302 is asking for AsyncExitStack, but that can be an independent change. I haven't personally felt the need for AsyncExitStack. -- ___ Python tracker

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Nick Coghlan
Nick Coghlan added the comment: The general idea seems reasonable to me, and I've added some specific code level feedback on the PR. A related question to this one would be whether or not it may make sense to develop a more async-friendly variant of contextlib.ExitStack (I don't currently

[issue28598] RHS not consulted in `str % subclass_of_str` case.

2017-02-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +310 ___ Python tracker ___ ___ Python-bugs-list

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +giampaolo.rodola, gvanrossum, haypo, ncoghlan, yselivanov ___ Python tracker ___

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Demos and Tools stage: -> patch review ___ Python tracker ___

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Marshall Giguere
New submission from Marshall Giguere: Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux >>> from getopt import getopt >>> argv = [ '-a', '-b', '-c', '-d', 'foo'] >>> opts, args = getopt( argv, 'abc:d:') >>> opts [('-a', ''), ('-b', ''), ('-c', '-d')] >>> args ['foo'] Expected

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- pull_requests: +308, 309 ___ Python tracker ___

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- pull_requests: +308 ___ Python tracker ___

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +haypo ___ Python tracker ___ ___

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Printing the backtrace in gdb results in Python errors: (gdb) bt ... #6 0x77ba9745 in _PyEval_EvalCodeWithName (_co=, globals=Traceback (most recent call last): File "/home/a/.virtualenvs/3.6g/bin/python3.6-gdb.py", line 1358, in to_string

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : -- pull_requests: +307 ___ Python tracker ___ ___

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: An async equivalent of @contextmanager would be an obvious use case for async generators and the async with statement. In my own code, I have several async context objects that could have been written more concisely if @asynccontextmanager was available.

[issue28791] update sqlite to 3.17.0

2017-02-28 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks, Big Stone. Setting the version to 3.7. -- versions: -Python 3.6 ___ Python tracker ___

[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-28 Thread Marco Buttu
Marco Buttu added the comment: Wolfgang, thanks for your contribution. However, I prefere the chapter as it currently is, because IMHO it introduces the concepts more gradually than your proposal. In addition the modification of the title section from "for Statements" to "for Loops" IMHO

[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2017-02-28 Thread Aviv Palivoda
Aviv Palivoda added the comment: I opened a PR. This actually is a bugfix in addition to an enhancement as it solves issue 26187 as well. -- ___ Python tracker

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-28 Thread Aviv Palivoda
Aviv Palivoda added the comment: Just to make sure when you say "sequence protocol" you thin about the doing blob[4:6] = "ab"? I actually think this is a nice feature. The Blob and the mmap object has a lot in common so I think that making the same API will be best. I think that adding the

[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2017-02-28 Thread Aviv Palivoda
Changes by Aviv Palivoda : -- pull_requests: +306 ___ Python tracker ___ ___

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Small discussion is started at pull request [1]. There are doubts about the usefulness of incremental I/O API. SQLite is rarely used for storing blobs of the size of hundreds of megabytes. For smaller blobs it may be enough to read or write all data at

[issue29678] email.Message.get_params decodes only first one header value

2017-02-28 Thread Sergey
Changes by Sergey : -- type: behavior -> enhancement ___ Python tracker ___ ___

[issue27645] Supporting native backup facility of SQLite

2017-02-28 Thread Aviv Palivoda
Aviv Palivoda added the comment: I actually looked at the patch and have a few comments: 1. You need to put Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS before the sqlite3 calls (especially the sleep). 2. I think that the `pysqlite_connection_backup` function will look a lot better if you

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2017-02-28 Thread Douglas Greiman
Douglas Greiman added the comment: Bazel has been updated to no longer create symlinks to /dev/null https://github.com/bazelbuild/bazel/issues/1458 -- ___ Python tracker

[issue29666] Issue in enum documentation

2017-02-28 Thread Kartik
Kartik added the comment: Hi I've edited the documentation to correct this and submitted a PR. -- nosy: +exqu17 pull_requests: +305 ___ Python tracker

[issue29678] email.Message.get_params decodes only first one header value

2017-02-28 Thread Sergey
New submission from Sergey: email.Message class has method get_params() that can decode(unquote) header values in compliance with RFC2231 and RFC2047. But if in email message exists multiple headers with the same key it can't be used to decode other headers than first. In my application I

[issue27593] Deprecate sys._mercurial and create sys._git

2017-02-28 Thread Steve Dower
Steve Dower added the comment: Just updated my PR to remove the GITTAG variable, so we'll just go with GITBRANCH and GITVERSION. (Any value in trying to extract the URL of the remote? That's probably going to be a bit flimsy, but might help more clearly identify forks.) --

[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-28 Thread Wolfgang Maier
Wolfgang Maier added the comment: I studied the github PR and thought about it carefully, and that made me come to believe that the chapter deserves a larger rewrite not just of one section, but of several. I'm attaching my proposed change as a "classical" patch here for discussion. I hope

[issue28598] RHS not consulted in `str % subclass_of_str` case.

2017-02-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: fixed -> stage: resolved -> needs patch status: closed -> open versions: +Python 2.7 -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue28598] RHS not consulted in `str % subclass_of_str` case.

2017-02-28 Thread Martijn Pieters
Martijn Pieters added the comment: > Is 2.7 free from this bug? No, 2.7 is affected too: >>> class SubclassedStr(str): ... def __rmod__(self, other): ... return 'Success, self.__rmod__({!r}) was called'.format(other) ... >>> 'lhs %% %r' % SubclassedStr('rhs') "lhs % 'rhs'"

[issue29676] verbose output of test_cprofile

2017-02-28 Thread INADA Naoki
INADA Naoki added the comment: thanks. for summary, notable changes are: (print_callers) +{method 'append' of 'list' objects} <- 40.0000.000 profilee.py:73(helper1) Stats.print_callees output for Profile doesn't fit expectation! and (print_callees)

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Gerrit Holl
Changes by Gerrit Holl : -- pull_requests: +304 ___ Python tracker ___ ___

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, I think the initial description could be clarified. It currently reads: > Return the floating point value number rounded to ndigits digits after the > decimal point. ... which doesn't make it clear what happens for negative ndigits. There's a line in

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread ChrisRands
ChrisRands added the comment: Ah yes, you're both completely right of course. Perhaps the docs could still be clarified though. I managed to completely overlook this, and perhaps other non-expert Python users would too. -- ___ Python tracker

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Mark Dickinson
Mark Dickinson added the comment: Yep, it's (genuinely) a feature, not a bug, and being able to round to the nearest ten, hundred, thousand, etc. is useful. The docs could perhaps be improved to make it clearer that this is supported. -- assignee: -> docs@python components:

[issue27500] ProactorEventLoop cannot open connection to ::1

2017-02-28 Thread Sebastien Bourdeauducq
Sebastien Bourdeauducq added the comment: This is still a problem with Python 3.5.3 and 3.6.0. -- ___ Python tracker ___

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Gerrit Holl
Gerrit Holl added the comment: >>> round(21345, -2) 21300 Desired and useful to me. -- nosy: +Gerrit.Holl ___ Python tracker ___

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread ChrisRands
New submission from ChrisRands: With a negative integer for ndigits the output from 'round()', for example 'round(3, -2)', is always zero ('0' for 'int.__round__' and '0.0' or '-0.0' for 'float.__round__'). I think either it should raise an exception or the docs should be updated to reflect

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Gerrit Holl added the comment: To resolve this, the `catch_warnings` context manager upon exiting should not only reset `filters`, but also `_filters_version`, and perhaps an associated dictionary? Not sure if I'm understanding the code in `warnings.c` correctly, and whether, for this

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Changes by Gerrit Holl : -- title: `catch_warnings` context manager causes warnings to be reprinted -> `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

[issue27144] concurrent.futures.as_completed() memory inefficiency

2017-02-28 Thread Will Vousden
Will Vousden added the comment: Is there a reason this hasn't been merged yet? Fixing this bug locally (albeit just by setting Future._result = None when I've extracted the result) reduced the memory footprint of my program from 50 GB to 7 GB, so it seems worth it. --

[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-28 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27144] concurrent.futures.as_completed() memory inefficiency

2017-02-28 Thread willvousden
Changes by willvousden : -- nosy: +willvousden ___ Python tracker ___ ___

[issue29676] verbose output of test_cprofile

2017-02-28 Thread Xiang Zhang
New submission from Xiang Zhang: Recently when I run the test suite test_cprofile always produces some verbose info but won't fail. This is not the case before. I am not sure this is a bug or not. git bisect tells me

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2017-02-28 Thread Michał Górny
Michał Górny added the comment: Christian, since the code is now integrated in Python 3.6+ (with some bugfixes AFAICS), could you consider updating your bitbucket package to match it? It would be helpful as a backport package for older Python versions. -- nosy: +mgorny

[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-28 Thread INADA Naoki
INADA Naoki added the comment: OK, since Aifc_write is harder to test, and the exception is very unlikely happens, I fixed only Aifc_read. -- ___ Python tracker

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
Q added the comment: PS. I'm not sure if that is a systemd/journald issue, or indeed a Python bug. However, it would be nice to clear one possibility. For a StreamHandler, it all works as it should. -- ___ Python tracker

[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-28 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +303 ___ Python tracker ___ ___

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker ___ ___

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
Q added the comment: Attaching the other file mentioned. -- Added file: http://bugs.python.org/file46680/good.py ___ Python tracker ___

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
New submission from Q: On Ubuntu LTS 16.04, SysLogHandler with a custom formatter does not seem to expand loglevel/levelno fields properly, when there are square brackets ( see the attached examples ). Instead, it seems to replace '[%(loglevel)s]' with a '[pid]', and '%(loglevel)s' with

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2017-02-28 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks everyone involved! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29673] Some gdb macros are broken in 3.6

2017-02-28 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue29671] Add function to gc module to check if any reference cycles have been reclaimed.

2017-02-28 Thread Mark Dickinson
Mark Dickinson added the comment: > In a normal program, a class wouldn't generally ever become garbage, Right; it's only really a problem with dynamically-created classes. Some parts of the standard library (like ctypes), generate such classes. Okay to close this as rejected? --

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

2017-02-28 Thread STINNER Victor
New submission from STINNER Victor: GCC allows to get "size" parameters of functions allocating memory to emit better warning. For example, GCC 7 will detect implicit cast from signed to unsigned integer and emit a warning. https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html