[issue34859] python core in string substring search

2018-09-30 Thread pashkasan
New submission from pashkasan : find substring in string its correct behavior? sample code str = """ Content-Length: 3192 Connection: close Cookie: _secure_admin_session_id=2a5dc26329de17ca4eafe; -1477319126846 Content-Disposition: form-data;

[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-09-30 Thread Vinay Sajip
Vinay Sajip added the comment: > Checking fmt to match the style in the constructor of logging.Formatter This seems a reasonable change to want to make. You would need to parse the format string for fields using the appropriate style. This should probably be via a validate() method in each

[issue34804] Repetition of 'for example' in documentation

2018-09-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Though stylistically odd, the repeated text is correct. If Andrew feels like amending it, that would be nice; otherwise, I don't think it is worth the micro-edit. -- nosy: +rhettinger priority: normal -> low

[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2018-09-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: IIRC, there was an early decision to handle only exact types and their subclasses (plus tuples). For example, os.environ and instances of collections.ChainMap are not JSON serializable. I believe the reason was that it made encoding faster, more

[issue34370] Tkinter scroll issues on macOS

2018-09-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: I just installed 3.7.1rc on current High Sierra and observed same as Vlad. -- nosy: +terry.reedy ___ Python tracker ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Nathaniel Smith
Nathaniel Smith added the comment: Yeah, something like that. Or sys.enable_chaos_mode(), that pytest or whoever could call before running tests. -- ___ Python tracker ___

[issue34313] IDLE crashes with Tk-related error on macOS with ActiveTcl 8.6

2018-09-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since this was opened, I have opened files in the editor, without incident with both installed 3.7.0 and 3.7.1rc1 (64 bit). Should this still stay open? Does anyony have any problems with the current release candidates? --

[issue33065] IDLE debugger: failure stepping through module loading

2018-09-30 Thread ppperry
ppperry added the comment: Line 59 isn't actually executed; the error comes from the trace event that gets fired before line 59, which is the first `line` event in the frame containing the uninitialized _ModuleLock. -- nosy: +ppperry ___ Python

[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2018-09-30 Thread Michael Smith
New submission from Michael Smith : If a mappingproxy object is a read-only proxy to a mapping, would it make sense for them to JSON serialize just like the mapping they come from? Currently, json.dumps throws the "I don't know how to serialize this" error: $ python -c 'import json > import

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: If we were to ship a "chaos" mode in the CPython interpreter itself, I assume you envision an interpreter flag and/or env var? If it required someone compiling the interpreter a special way I don't think it would be widely adopted within continuous

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Nathaniel Smith
Nathaniel Smith added the comment: Would it make sense to implement a "chaos" mode (that e.g. testing tools could enable unconditionally), that disables the small integer and small string caches? -- nosy: +njs ___ Python tracker

[issue34751] Hash collisions for tuples

2018-09-30 Thread Tim Peters
Tim Peters added the comment: An "aha!" moment for me: I noted before that replacing the tuple hash loop with Py_uhash_t t = (Py_uhash_t)y; t ^= t << 1; x = (x * mult) + t; does OK (64-bit build): most tests had no collisions, but the original tuple test had 24 (a modest

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread miss-islington
miss-islington added the comment: New changeset cb0bec37dd8279555bc01fa03a259eaf7dbb6d5d by Miss Islington (bot) in branch '3.6': bpo-34850: Replace is with == in idlelib.iomenu (GH-9649) https://github.com/python/cpython/commit/cb0bec37dd8279555bc01fa03a259eaf7dbb6d5d --

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread miss-islington
miss-islington added the comment: New changeset 214c0b3d153c4bad14086888b9de0826a7abc083 by Miss Islington (bot) in branch '3.7': bpo-34850: Replace is with == in idlelib.iomenu (GH-9649) https://github.com/python/cpython/commit/214c0b3d153c4bad14086888b9de0826a7abc083 -- nosy:

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: To me, this issue is about unnecessary dependence on implementation details, with the particular example being 'is' versus '=='. Perhaps PEP8, Programming Recommendations, should have a new subsection 'Implementation Dependencies' to recommend against such

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread miss-islington
Change by miss-islington : -- pull_requests: +9042 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread miss-islington
Change by miss-islington : -- pull_requests: +9041 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 5fa247d60d4f3f2b8c8ae8cb57363aca234344c2 by Terry Jan Reedy in branch 'master': bpo-34850: Replace is with == in idlelib.iomenu (GH-9649) https://github.com/python/cpython/commit/5fa247d60d4f3f2b8c8ae8cb57363aca234344c2 --

[issue33533] Provide an async-generator version of as_completed

2018-09-30 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: If there is interest in this, I'd like to attempt a PR for a sync/async variant of as_completed. Note that the new docs are *much* clearer, so the first (documentation) problem from the description is now fixed. Although the documentation is still brief, it

[issue34856] Make the repr of lambda containing the signature and body expression.

2018-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: OTOH the current repr is bounded. Some people write very long lambdas. On Sun, Sep 30, 2018 at 11:31 AM Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > -- > keywords: +patch > pull_requests: +9039 > stage: -> patch review > >

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2018-09-30 Thread Dan Snider
Dan Snider added the comment: So I also just happened to notice that the "documentation is wrong" for list, tuple, and collections.deque. They use use _PyEval_SliceIndexNotNone whch causes this: >>> s = 'abcde' >>> s.index('d', 0, None) 3 >>> [*s].index('d', None) Traceback (most recent

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +9040 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34857] IDLE: SyntaxWarning not handled properly

2018-09-30 Thread Terry J. Reedy
New submission from Terry J. Reedy : In 3.6.6, """compile("assert (0, 'bad')", '', 'single')""" in Python or IDLE emits "SyntaxWarning: assertion is always true, perhaps remove parentheses?". In Python, >>> assert (0, 'bad') :1: SyntaxWarning: assertion is always true, perhaps remove

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: Yet, Greg’s point is that this only works if the developer tests their code with the new Python version. I’m not sure that his proposal is better though. I think static checkers are the better remedy. On Sun, Sep 30, 2018 at 10:02 AM Serhiy Storchaka

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: Should go to @ambv. On Sun, Sep 30, 2018 at 9:29 AM Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > -- > keywords: +patch > pull_requests: +9037 > stage: -> patch review > > ___ > Python tracker

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These bugs was found when working on issue34856. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue34856] Make the repr of lambda containing the signature and body expression.

2018-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +9039 stage: -> patch review ___ Python tracker ___ ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: This is a nice approach to the problem. I completely agree that we cannot change `is` semantics. I'm okay with leaving it to checkers to catch `== None`. -- ___ Python tracker

[issue34771] test_ctypes failing on Linux SPARC64

2018-09-30 Thread Frank Schaefer
Frank Schaefer added the comment: Well, after perusing the ctypes callproc.c code, I found the hacks referenced by martin.panter and tried activating them with some SPARC64 #ifdefs: --- python3.6-3.6.6.orig/Modules/_ctypes/callproc.c +++ python3.6-3.6.6/Modules/_ctypes/callproc.c @@ -1041,6

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread miss-islington
miss-islington added the comment: New changeset 0f161b307969f86b4f8f31baf38f53f5462a9874 by Miss Islington (bot) in branch '3.7': bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645) https://github.com/python/cpython/commit/0f161b307969f86b4f8f31baf38f53f5462a9874

[issue34856] Make the repr of lambda containing the signature and body expression.

2018-09-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> f = lambda x, y=1: x+y >>> f Currently it is less informative: " at 0x7f437cd27890>". -- components: Interpreter Core messages: 326738 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal status: open title: Make the repr of

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2a2940e5c3e6d92f4fac5e9d361a1e224bb2f12e by Serhiy Storchaka in branch 'master': bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645) https://github.com/python/cpython/commit/2a2940e5c3e6d92f4fac5e9d361a1e224bb2f12e

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread miss-islington
Change by miss-islington : -- pull_requests: +9038 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34835] Multiprocessing module update fails with pip3

2018-09-30 Thread Dr_Zaszus
Dr_Zaszus added the comment: Thank you! It's clear now. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34855] batch file variables

2018-09-30 Thread Eric Lindblad
New submission from Eric Lindblad : The development version code can set the variable EXTERNALS_DIR in two .bat files, but nowhere in a .bat file is set the variable EXTERNAL_DIR, the latter appearing in find_python.bat. I am not a Powershell user and so cannot interpret the content of the

[issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

2018-09-30 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a large difference with the DeprecationWarning in the md5 and sha modules. A SyntaxWarning is emitted when the compiler compiles Python sources to bytecode. Since bytecode is cached in pyc files, you will see it at most once at first run of the

[issue34851] re.error - for the search function in the re module

2018-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: Perhaps we could improve that error message. If Ronald hand't pointed out the actual problem, it would have taken me a while to figure it out, too. Maybe "bad character range +-* at position 2: starting character is after ending character"? Although I'll

[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2018-09-30 Thread Aymeric Augustin
Aymeric Augustin added the comment: For now I will use the following hack: server.close() await server.wait_closed() # Workaround for wait_closed() not quite doing # what I want. await asyncio.sleep(0) # I believe that all accepted connections have reached #

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +9037 stage: -> patch review ___ Python tracker ___ ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: The problem with a SyntaxWarning is that the wrong people will see it. It gets in the way of users of applications that happen to be written in Python. scenarios: (a) A Python interpreter gets upgraded, and suddenly the _users_ of an application start

[issue34854] Crash in string annotations in lambda with keyword-only argument without default value

2018-09-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Compiling a string annotation containing a lambda with keyword-only argument without default value causes a crash. from __future__ import annotations def f() -> (lambda *, x: x): pass The following PR fixes this crash. It also fixes other errors: *

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Xiang Zhang
Xiang Zhang added the comment: I have catched using `is` to do string equality check in our codebase by linters before. Not all my colleagues know what's not suitable here. The only common and suitable case I can think of is programmers are exploring CPython internals, like what

[issue34853] Python django cors

2018-09-30 Thread Ammar Askar
Ammar Askar added the comment: Hey Anel, this bug tracker is for issues with the Python language itself, not its libraries or usage. Try the flask-cors issue tracker or stackoverflow for more help-oriented questions: https://github.com/corydolphin/flask-cors https://stackoverflow.com/

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Now that I think about this a bit better, this may be actually a problem as: with (yield something) as x: is a more than valid use case that will be broken with the simple grammar rule :( -- ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: -9036 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34853] Python django cors

2018-09-30 Thread Anel Hodzic
New submission from Anel Hodzic : API call gives the desired response when trying through browser or postman. from rest_framework import generics from django.shortcuts import get_object_or_404 from .jsonserializer import GroupSerializer, SubgroupSerializer, ProductsSerializer from .models

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +9036 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2018-09-30 Thread Aymeric Augustin
New submission from Aymeric Augustin : **Summary** 1. Is it correct for `Server.wait_closed()` (as implemented in asyncio) to be a no-op after `Server.close()`? 2. How can I tell that all incoming connections have been received by `connection_made()` after `Server.close()`? **Details**

[issue33727] Server.wait_closed() doesn't always wait for its transports to fihish

2018-09-30 Thread Aymeric Augustin
Aymeric Augustin added the comment: I believe this is by design: the documentation says: > The sockets that represent existing incoming client connections are left open. `Server` doesn't keep track of active transports serving requests. (That said, I haven't figured out what _waiters is

[issue32808] subprocess.check_output opens an unwanted command line window after fall creator update

2018-09-30 Thread Cheryl Sabella
Cheryl Sabella added the comment: @Christian Heigele Any additional information re: msg312034? Thanks! -- nosy: +cheryl.sabella ___ Python tracker ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Suggestions about the wording of the warning message are welcome. -- ___ Python tracker ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: I like this solution of a syntax warning for `is ` and I agree that `== None` should not be a warning. (And for what its worth, I strongly disagree with making `is` a hybrid sometimes-check-identity-sometimes-check-equality operator.) -- nosy:

[issue32947] Support OpenSSL 1.1.1

2018-09-30 Thread Christian Heimes
Christian Heimes added the comment: The release candidates came out a couple of days ago. -- ___ Python tracker ___ ___

[issue32947] Support OpenSSL 1.1.1

2018-09-30 Thread Kurt Roeckx
Kurt Roeckx added the comment: Do you have any idea when the next release will be? I think python is currently our biggest blocker for getting OpenSSL 1.1.1 in Debian testing. -- ___ Python tracker

[issue34851] re.error - for the search function in the re module

2018-09-30 Thread Ronald Oussoren
Ronald Oussoren added the comment: This is not a bug. You are searching for the character range from "+" to "*", which is an invalid range because "+" > "*". -- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Agreed about the special case. Minor change suggestion: ``sleep()` always suspends the current task, allowing other tasks to run. That is, replace "switches execution to another [task]" because there might not be other tasks or they might not be

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +9035 stage: -> patch review ___ Python tracker ___ ___

[issue34851] re.error - for the search function in the re module

2018-09-30 Thread Bnaya
New submission from Bnaya : I was writing the following: re.search('([+-*])', "54 * 83") And I got the following runtime error: Traceback (most recent call last): File "", line 1, in File "C:\Users\bnaya\AppData\Local\Programs\Python\Python37-32\lib\re.py", line 183, in search

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It also fixes an incorrect use of "is" with an empty string in IDLE. -- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy ___ Python tracker

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +9034 stage: -> patch review ___ Python tracker ___ ___

[issue34850] Emit a syntax warning for "is" with a literal

2018-09-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Gregory have noticed that the "is" and "is not" operator sometimes is used with string and numerical literals. This code "works" on CPython by accident, because of caching on different levels (small integers and strings caches, interned strings,

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Adding "`asyncio.sleep()` always pauses the current task and switches execution to another one" sounds totally reasonable to me (without mentioning zero `delay` special case). Would you make a pull request? --

[issue32892] Remove specific constant AST types in favor of ast.Constant

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yesterday I submitted a PR that should fix astroid in Python 3.8: https://github.com/PyCQA/astroid/issues/616 -- ___ Python tracker ___

[issue30672] PEP 538: Unexpected locale behaviour on *BSD (including Mac OS X)

2018-09-30 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +9033 stage: test needed -> patch review ___ Python tracker ___ ___

[issue32892] Remove specific constant AST types in favor of ast.Constant

2018-09-30 Thread Nathaniel Smith
Nathaniel Smith added the comment: As a point of information, this did in fact break pylint/astroid: https://github.com/PyCQA/astroid/issues/617 -- nosy: +njs ___ Python tracker

[issue30672] PEP 538: Unexpected locale behaviour on *BSD (including Mac OS X)

2018-09-30 Thread Nick Coghlan
Nick Coghlan added the comment: Putting back to normal, as the difference between the C locale and the POSIX locale is that you never get the latter by default - you have to explicitly request it. The underlying fix for this is in the PR for bpo-34589. -- dependencies:

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: The issue is because the current documentation *doesn't* say that "`asyncio.sleep()` always pauses the current task and switches execution to another one", it just says that it "blocks for _delay_ seconds". With that description a perfectly valid

[issue13280] argparse should use the new Formatter class

2018-09-30 Thread paul j3
paul j3 added the comment: Thinking about https://bugs.python.org/issue34744, I realized that the new style formatting could provide some added flexibility to the help lines. I think new style formatting could be added in parallel with the existing style, as an alternative, not as a

[issue34744] New %(flag)s format specifier for argparse.add_argument help string

2018-09-30 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue13280, argparse should use the new Formatter class Raymond Hettinger argued against making such a switch. However there may be some value in allowing its use in parallel with the '%' style of formatting. That is, if the 'help' string

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: `asyncio.sleep()` always pauses the current task and switches execution to another one. `asyncio.sleep(0)` has no special meaning (but it has internal optimization for the case). Basically the same as `time.sleep(0)` for multithreaded program. I doubt if

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-09-30 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue28742 argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable is asking for something similar - the ability to override the automatic `%(default)s` in certain

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2018-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Dan. It is easy to fix a docstring. Related issues are issue28197 and issue31942. -- components: -Argument Clinic keywords: +easy (C) nosy: +rhettinger, serhiy.storchaka -larry stage: -> needs patch type: -> behavior