[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Actually, testing your code fragment, it seems you do get a doc string when the f-string has no substitutions in curly brackets, otherwise you don’t get any doc string. Maybe this is due to how different forms of string are compiled. >>> class Foo: ...f'spa

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Having an unassigned f-string as the first statement is still valid syntax, so could at most be a warning, not a SyntaxError. -- ___ Python tracker

[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-18 Thread Julien Palard
Julien Palard added the comment: By moving: ``` /* else set the right exception and return NULL */ PyErr_SetString(pysqlite_ProgrammingError, "can't adapt"); ``` from `pysqlite_microprotocols_adapt` to `pysqlite_adapt` (to avoid changing the semantics from the outside) make the `pysqlite_micro

[issue10049] Add a "no-op" (null) context manager to contextlib

2016-11-18 Thread Martin Blais
Martin Blais added the comment: I've been looking for this today; I would have used it. Instead of an obvious (and explicit) null context manager, I had to read through this entire thread to eventually find out that I can use something called ExitStack(), which is designed for another use case

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-18 Thread STINNER Victor
STINNER Victor added the comment: New approach: patch 5 now compares indexgroup, groupindex and code instead of comparing pattern, to handle correctly two equal pattern strings compiled with the re.LOCALE flag and two different locales. The patch also converts indexgroup list to a tuple to be

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-18 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file45542/immortal-filters.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Here is another way to remember that the filter list has already been initialized. I made a new immortal _warnings.filters_initialized flag at the C level. It is actually a list so that it can be mutated and remembered across module reloads, but it is either em

[issue10049] Add a "no-op" (null) context manager to contextlib

2016-11-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: ExitStack() already covers the "null ctx mgr" use case described in the first message. Original example: with transaction or contextlib.null(): ... By using ExitStack: with transaction or ExitStack(): ... You can push this further and do this,

[issue28732] spawnl crash on windows7

2016-11-18 Thread Steve Dower
Steve Dower added the comment: Looks like a few functions in os module need this. os_execve_impl also doesn't release the GIL at any point, but I don't see why it shouldn't. I'll try and get to this over the weekend if nobody else comes up with a patch first. -- _

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Eric V. Smith
Eric V. Smith added the comment: It's Ned's call, but I wouldn't recommend changing this in 3.6, at least not 3.6.0. As Martin points out, the reason f'foo' is a "normal" string has to do with how strings and f-strings are assembled and concatenated. Similarly: 'foo' f'bar' 'baz' is a normal

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
New submission from Peter Eckersley: When argparse lists the default values for cli flags and arguments, it shows argparse's view of the internal Pythonic default, not the default behaviour of the program as a whole. This can be wrong in many cases, as documented at https://bugs.python.org/iss

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
Peter Eckersley added the comment: One thing I noticed when testing my patch by vendorizing it into the Certbot tree was that if a developer had somehow inherited from a version of argparse.Action that *doesn't* have this patch applied to it, and then passes in instances of those inheriting cl

[issue28743] test_choices_algorithms() in test_random uses lots of memory

2016-11-18 Thread Martin Panter
New submission from Martin Panter: Revision 32bfc8b6 added test.test_random.MersenneTwister_TestBasicOps.test_choices_algorithms(), which runs the following code: n = 13132817 # 13 million self.gen.choices(range(n), [1]*n, k=1) When I build Python with the “--with-pydebug” configure

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: Might I point out the precedent of b-strings? Those also don't contribute to __doc__. -- ___ Python tracker ___ __

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch implementing Eryk’s suggestion, for both from_buffer() and from_buffer_copy() methods. This is exactly how it is already handled for Array.from_address(). The two buffer methods were added more recently than from_address(). -- keywords:

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Ned Deily
Ned Deily added the comment: Since this was previously discussed and rejected (in Issue25179), I don't think we should revisit this now for 3.6, other than potentially a documentation tweak. -- nosy: +ned.deily versions: -Python 3.6 ___ Python trac

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
Peter Eckersley added the comment: Patch is now against the latest Python development tree, and includes test cases: https://gist.github.com/pde/daec08cadc21bca0d62852020887ee13 -- ___ Python tracker

[issue28548] http.server parse_request() bug and error reporting

2016-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7c98768368cb by Martin Panter in branch 'default': Issue #28548: Parse HTTP request version even if too many words received https://hg.python.org/cpython/rev/7c98768368cb -- nosy: +python-dev ___ Python t

[issue28744] Basic precision calc error

2016-11-18 Thread Renner
New submission from Renner: Simple code: print('%.55f' %(1.1 + 2.2 - 3.3)) print('%.55f' %(1.1 + 2.2)) is supposed to produce 0.000 3.300 But when I run it, Actually it produces 0.000

[issue28744] Basic precision calc error

2016-11-18 Thread Zachary Ware
Zachary Ware added the comment: https://docs.python.org/3/tutorial/floatingpoint.html -- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Thanks Mariatta. Some people like to use the warn(stacklevel=2) parameter, then the warning message is potentially more useful. Also, I think it would be good to write a brief test case for the warning. There are probably lots of examples in the test suite, e.g

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-18 Thread Martin Panter
Changes by Martin Panter : -- stage: -> patch review versions: +Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list ma

[issue28548] http.server parse_request() bug and error reporting

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Okay committed to 3.7 for the moment. I think that is all we can reasonably do unless we drop the pseudo-HTTP-0.9 support. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tra

[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-18 Thread Nick Coghlan
Nick Coghlan added the comment: The problem Martin is referring to is the SEO one, which is that the top link when searching for either "null context manager python" or "no-op context manager python" is this thread, rather than the "Use ExitStack for that" recipe in the docs: https://docs.pyt

[issue10656] "Out of tree" build fails on AIX

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Okay I will assume that $(srcdir) reference was just due to a mistake or bad cargo-culting then. Will commit this soon unless anyone has a good idea to avoid embedding @abs_srcdir@. -- stage: patch review -> commit review _

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-18 Thread Patrick Lehmann
Patrick Lehmann added the comment: Hello, I used this regexp on all files: -- match pattern: `([A-Za-z0-9_]+)' replace pattern ``\1`` -- I assumed that only identifiers where quoted in such way. I think my editor found arou

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-18 Thread Patrick Lehmann
Patrick Lehmann added the comment: I signed the CLA. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue28681] About function renaming in the tutorial

2016-11-18 Thread Vedran Čačić
Vedran Čačić added the comment: Obligatory link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ :-P Yes, Python objects are simpler than people, but still not completely trivial. The core issue is "who does the calling". Even one's native language might subtl

[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

2016-11-18 Thread Martin Blais
Martin Blais added the comment: Adding nullcontext = ExitStack in the source file would solve this problem in a single line of code. -- nosy: +blais ___ Python tracker ___ _

[issue28743] test_choices_algorithms() in test_random uses lots of memory

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a problem to me too. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-lis

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread woo yoo
New submission from woo yoo: I've experiment with the statement,however the result did not match the official description. I created a namespace package named l007, within which submodule named l009 was placed.I typed "from l007 import l009" in the interpreter, the execution was ok, while in

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please don't post screen shots of text. Copy and paste the text into the bug report. Some people (those who are blind, visually impaired or using a screen-reader for some other reason) cannot see the screen shot, and even those who can prefer to deal with tex

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you're quoting from the docs, its a good idea to give the URL to *which* documentation you are reading, not just a copy of the text. -- ___ Python tracker

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread woo yoo
woo yoo added the comment: The link associated with the documentation is https://docs.python.org/3/reference/simple_stmts.html#import. My package layout is : --l007 --l009.py My code is : >from l007 import l009 The excution was ok, which was not the case i had expected. -- ___

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: Why is this unexpected? Per the docs, the process is: find the module specified in the from clause, loading and initializing it if necessary; for each of the identifiers specified in the import clauses: check if the imported module has an attrib

[issue28740] Add sys.getandroidapilevel()

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: > I proposed to add a new function to the sys module: sys.getandroidapilevel() This would also help fixing the long standing issue 16255, and possibly also issue 16353. -- ___ Python tracker

[issue28745] Python 3.5.2 "from ... import" statement is different from official documentation

2016-11-18 Thread woo yoo
woo yoo added the comment: Thanks for your advice. -- nosy: -docs@python, steven.daprano ___ Python tracker ___ ___ Python-bugs-list

[issue26865] Meta-issue: support of the android platform

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: issue #28740: Add sys.getandroidapilevel() -- dependencies: +Add sys.getandroidapilevel() ___ Python tracker ___ ___

[issue28740] Add sys.getandroidapilevel()

2016-11-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: Patch tested with success on the android-24 emulator. -- ___ Python tracker ___ ___ Python-bugs-list

<    1   2