[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9043

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since the author of PR 5849 had not the time to work on it, I have created PR 
9652 which properly replaces a DeprecationWarning with a SyntaxWarning. It also 
updates the documentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Jakub Wilk


Jakub Wilk  added the comment:

Also broke pyflakes: https://github.com/PyCQA/pyflakes/issues/367

--
nosy: +jwilk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

What do you think the problem is? The output of the script is what I'd expect 
it to be.

Note that str.find() returns -1 when the needle is not present (and the first 
offset where the needle is found when it is present).

--
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Michael Felt


New submission from Michael Felt :

On AIX test_sqlite fails with:

==
FAIL: test_database_source_name (sqlite3.test.backup.BackupTests)
--
Traceback (most recent call last):
  File "/home/aixtools/python/git/aix-pr/Lib/sqlite3/test/backup.py", line 146, 
in test_database_source_name
['SQL logic error', 'SQL logic error or missing database']
AssertionError: 'unrecognized error code: 1' not found in ['SQL logic error', 
'SQL logic error or missing database']

Likely this is because the sqlite3 that is installed either has a bug, is too 
old, or was overly optimized and the expected error message is not being 
returned.

A simple addition as:
def test_database_source_name(self):
with sqlite.connect(':memory:') as bck:
self.cx.backup(bck, name='main')
with sqlite.connect(':memory:') as bck:
self.cx.backup(bck, name='temp')
with self.assertRaises(sqlite.OperationalError) as cm:
with sqlite.connect(':memory:') as bck:
self.cx.backup(bck, name='non-existing')
self.assertIn(
str(cm.exception),
['SQL logic error', 'SQL logic error or missing database', 
'unrecognized error code: 1']
)

allows to test to pass.

Again, this is not a problem with either python or AIX - only yhe 
implementation of sqlite3 installed.

My hope is that the PR with the modification above (add 'unrecognized error 
code: 1') will be accepted.

Thx for your consideration.

--
messages: 326769
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: fix test_sqlite for AIX

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Michael Felt


Change by Michael Felt :


--
keywords: +patch
pull_requests: +9044
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Berker Peksag


Berker Peksag  added the comment:

Could you try latest master? I think this is a duplicate of issue 34743 and it 
has already been fixed in 
https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread INADA Naoki


INADA Naoki  added the comment:

Thanks, Nathaniel.  I totally concur with you.

This is tutorial section.  We should focus on readers of the tutorial.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Guido, the check-in message for this section indicates that Fred Drake added 
this wording at your behest.  Do you still agree with the guidance and examples 
or would you like to have it removed from all active versions of the 
documentation as proposed?

https://docs.python.org/3.8/tutorial/errors.html#user-defined-exceptions

--
assignee: docs@python -> gvanrossum
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The test code for the third case looks incorrect in two places:

Given:   if str.find("\n\r"):  
^-- should compare to -1 
  - these are reversed

Corrected:   if str.find("\r\n") != -1:

Also note that *str* is a confusing variable name because it shadows the 
builtin *str*.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I suspect that there may also be confusion about the line ending in multiline 
strings. Is there any documentation on the fact that this is always "\n" and 
not "\r\n" (even on Windows)?  

The closest I've found is the Lexical Analysis part of the language reference 
() which states 
that lines in source code are separated by NEWLINE (that is "\n").

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Tal Einat


Tal Einat  added the comment:

I couldn't reproduce this issue with any of the 3.7.1rc1 and 3.6.7rc1 
installers from python.org on my macOS.

This certainly seems like an issue with Tcl/Tk versions before 8.6.8.

It is unfortunate that ActiveState have still not released ActiveTcl 8.6.8; the 
latest version is 8.6.7 which does exhibit this issue.

ISTM we should update the section of the docs about GUI programming on macOS, 
which suggests using the latest version of Tcl/Tk from ActiveState:
https://docs.python.org/3/using/mac.html#gui-programming-on-the-mac

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread pashkasan


pashkasan  added the comment:

>I suspect that there may also be confusion about the line ending in multiline 
>strings. Is there any documentation on the fact that this is always "\n" and 
>not "\r\n" (even on Windows)?  

the problem is that "\r\n" not found in source multiline strings str, str2, but 
exists
i tested on windows , unix

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@pahskazan: It is correct that '\r\n' is not found in those strings, Python 
source code is always parsed after conversion to "Unix" line endings with "\n" 
between lines.  This is basicly the same as the "universal newlines" feature of 
the open function .

The output you get is therefore expected behaviour. See also Raymond's note 
about how to use str.find() and the other typo in that line.

--
resolution:  -> not a bug
stage:  -> resolved
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

@taleinat

The issues appear with both Tk 8.6.[:8] and (8.5.[:18] + 8.5.[19:], just in 
case you update the docs. For 32/64 bit installers on macOS, the only version 
(built by myself or ActiveState) without crashes is 8.5.18 (on my Mac).

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30156] PYTHONDUMPREFS segfaults on exit

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e972c13624c32d0efdceb08ff83917fb6b488525 by Victor Stinner in 
branch 'master':
bpo-30156: Remove property_descr_get() optimization (GH-9541)
https://github.com/python/cpython/commit/e972c13624c32d0efdceb08ff83917fb6b488525


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Tal Einat


Tal Einat  added the comment:

Vlad, you previously mentioned that with Tcl/Tk 8.6.8 you also didn't see this 
issue. Have you tried building Tcl/Tk 8.6.8 yourself? When I did so everything 
worked fine.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset cd602b8af2d14ff686261eeb18b80f718bb16550 by Andrew Svetlov 
(Hrvoje Nikšić) in branch 'master':
bpo-34476: Document that asyncio.sleep() always suspends. (#9643)
https://github.com/python/cpython/commit/cd602b8af2d14ff686261eeb18b80f718bb16550


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30156] PYTHONDUMPREFS segfaults on exit

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

I proposeto leave Python 3.6 and 3.7 unchanged. I don't think that this 
specific bug matters enough to remove to remove an optimization from these 
stable branches. Since the optimization has been added (2015, bpo-23910), I'm 
only aware of two bug reports on PYTHONDUMPREFS (this one, and my duplicate).

If someone considers that the optimization must die in 3.6 and 3.7, please 
reopen the issue (or just add a comment).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9045

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23910] property_descr_get reuse argument tuple

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

This optimization caused multiple crashes, so it has been decided to remove it 
:-( See bpo-30156.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

Yes, like in the Pythonic Tk 8.6.[:8] :), starting at version 8.6.8 (-dev, too) 
I see no crash. Tcl/Tk 8.6.8 is built by myself (the last time I checked there 
was no 8.6.8 built on ActiveState).
As for the old 8.5 series, only 8.5.18 works with the dual 32/64 bit Python(s).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 655608a1112e592cd6a9155ebe774dd285f561f3 by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.7':
bpo-34476: Document that asyncio.sleep() always suspends. (GH-9643) (#9654)
https://github.com/python/cpython/commit/655608a1112e592cd6a9155ebe774dd285f561f3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34812] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

In the C code, sys.flags.isolated clearly documented as linked to the -I option:

static PyStructSequence_Field flags_fields[] = {
{"debug",   "-d"},
{"inspect", "-i"},
{"interactive", "-i"},
{"optimize","-O or -OO"},
{"dont_write_bytecode", "-B"},
{"no_user_site","-s"},
{"no_site", "-S"},
{"ignore_environment",  "-E"},
{"verbose", "-v"},
/* {"unbuffered",   "-u"}, */
/* {"skip_first",   "-x"}, */
{"bytes_warning",   "-b"},
{"quiet",   "-q"},
{"hash_randomization",  "-R"},
{"isolated","-I"},
{"dev_mode","-X dev"},
{"utf8_mode",   "-X utf8"},
{0}
};

> The only thing here is that '-I' returns '-s -E -I' unlike other options 
> where args can be used for comparison logic in check_options.

I expect to get:

$ python3 -I -c 'import subprocess; 
print(subprocess._args_from_interpreter_flags())'
['-I']

instead of:

['-s', '-E']

-I is different from -s -E: it also avoids to add the script directory or an 
empty string to sys.path.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-01 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +easy
title: support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag 
-> [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) 
flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

> I actually have a patch (...)

Please open a new issue, since that one is closed. You can reference this issue 
from your new issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34831] Asyncio Tutorial

2018-10-01 Thread Caleb Hattingh

Caleb Hattingh  added the comment:

> * I think we should stick to your structure and push things to 
> docs.python.org as soon as every next section is somewhat ready.

Ok. I'll get a PR going for the start page of the tutorial.

> * Every big section should probably have its own page, linking prev/next 
> tutorial pages.
> * I'd organize the tutorial in a dedicated directory like 
> "Doc/library/asyncio-tutorial/".

Agree.

> BTW, maybe we should consider using the new iPythonn async repl: 
> https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7   What do you 
> think about that?

I saw ​Matthias' tweets about that recently too. It's cool! but...for teaching 
purposes it's not great to introduce a whole new complex tool (ipython) to 
explain a different complex tool (asyncio). My experience is that *every* 
single new thing that is mentioned adds cognitive load for learners. For this 
tutorial my feeling is to keep as much to "ordinary" Python stuff as possible, 
i.e., stdlib.

> Just a quick note: I'd try to not mention the low-level loop APIs as long as 
> possible (e.g. no loop.run_until_complete() etc).

For sure, I agree with you 100% on this. But I find it hard to do as soon as I 
have to make a real thing. I think you're right that we focus initially on only 
high-level stuff first (and for most of the tut). That is doable.

> I think we'll collapse first two section into one ("Coroutines" and 
> "Awaitables" into "Awaitables") and link the tutorial from that new section.

ok

> Yay for streams!
> I never use tkinter myself :( I remember trying to use it and it didn't work 
> on my macOS.  So I'd try to either:
> * build a simple browser app (that would require us to implement HTTP 0.9 
> which can be fun);
> * build a terminal app;
> * use iPython repl to connect to our asyncio server (might end up being more 
> complicated than the first two options).

I too have bashed my head for many hours over the years trying to get Tkinter 
to work on Mac, but a lot of work has gone into this recently and the newer 
(release) Python's have bundled Tk 8.6: 
https://www.python.org/download/mac/tcltk/ (this is what learners will prob use 
on Mac)

Tkinter gets a bad rap, but it's really quite powerful--and portable. Runs 
great on a Raspberry Pi for example.

Noticing your hesitation towards tkinter ;) , I spent a few hours on Sunday 
sketching out my "chat server/client" idea a little more, using Tkinter for the 
client UI:

https://github.com/cjrh/chat

(Notice especially in the README all the different aspects of asyncio, streams 
etc. that we would be able to cover and explain with an actual use-case. THESE 
are the kinds of tricky things people desperately want help with.)

It's still rough obviously (I can prob reduce the total LOC footprint by 20% & 
I'm sure you can improve on some parts) but I just wanted to show you something 
runnable you can prod and poke to give a concrete idea of what I'm suggesting. 
It works on Windows, should work on Linux but I haven't tested yet.

My proposal is that we slowly build up towards this, starting with the "hello 
world" simple case (asyncio.run calling main() which prints out "hello world" 
or something), and then adding the necessary features, piece by piece, with 
commentary along the way on what each piece does, and why it is done in a 
particular way. (I specifically like to write like this: simplistic case first, 
and then improve incrementally)

- Only requires stdlib (so we don't have to explain or link to pip/virtualenv 
etc. etc.)
- shows a wide range of *interoperating* asyncio features in a condensed app
- client has a proper GUI, i.e. "looks" like an actual application, not just an 
ugly CLI thing
- client handles reconnection, if the server goes down and comes back later.
- using signal handling to trigger shutdown (esp. the server)
- signal handling works on Windows (CTRL-C and CTRL-BREAK near-instant 
controlled shutdown)
- server is 100% asyncio (so that situation is covered), but client requires 
marrying two loops (so this situation is also covered), one for tkinter and one 
for asyncio. (This is a common problem, not just with UI frameworks but also 
with game programming frameworks like pygame, pyarcade and so on. Again, this 
is the kind of problem many people ask for help with.)
- thus, an example showing how to run asyncio in a thread. (asyncio.run works 
great in a thread, nice job!)
- an actual SSL example that works (this was surprisingly hard to find, 
eventually found one at PyMOTW)

I fully realise that this case study implementation might look weird and ugly, 
and we don't really want to mention threads at all, and we don't want to 
explicitly refer to the loop, or create a Future instance, etc., but this is 
the kind of case study that will give people guidance on how to handle these 
*actual problems* that they are going to come across.

If you have a look and still don't want to go this way, that's ok, I'm happy to 
go wi

[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-01 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Victor for the details. 

> In the C code, sys.flags.isolated clearly documented as linked to the -I 
> option:

With respect to documentation I was talking about '-I' not being documented in 
the table at https://docs.python.org/3.7/library/sys.html#sys.flags though it's 
present in the C code and in sys.flags.isolated.

> -I is different from -s -E: it also avoids to add the script directory or an 
> empty string to sys.path.

'-I' also implies '-s -E' and hence adding isolated to 
args_from_interpreter_flags will also return ['-s', '-E', '-I'] as output and 
hence I suggested modifying the comparison logic.

# Since '-I' implies '-s' and '-E' those flags are also set returning '-s -E -I'

./python.exe --help | rg '\-I'
-I : isolate Python from the user's environment (implies -E and -s)

./python.exe -I -c 'import sys; print(sys.flags)'
sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, 
no_user_site=1, no_site=0, ignore_environment=1, verbose=0, bytes_warning=0, 
quiet=0, hash_randomization=1, isolated=1, dev_mode=False, utf8_mode=0)

# patching args_from_interpreter_flags to support '-I' would return below

./python.exe -I -c 'import subprocess; 
print(subprocess._args_from_interpreter_flags())'
['-s', '-E', '-I']


Thanks

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread pashkasan


pashkasan  added the comment:

str2 = open('sample.txt', 'rU').read()


if "\n" in str2:
print ("\\n found")
else:
print ("\\n not found")

if "\r" in str2:
print ("\\r found")
else:
print ("\\r not found")


if "\r\n" in str2:
print ("\\r\\n found")
else:
print ("\\r\\n not found")

print str2

output
http://prntscr.com/l0sc11

strange that print() has \r\n
do i have to open file in binary mode or something to have \r not stripped?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-01 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

> ./python.exe -I -c 'import subprocess; 
> print(subprocess._args_from_interpreter_flags())'
> ['-s', '-E', '-I']

This looks wrong, I would prefer to only get ['-I'].

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller

New submission from Anders Hovmöller :

The standard output for cProfile when run from a command line is not very 
useful. It has two main flaws:

- Default sort order is by name of function
- It strips the full path of source files

The first makes it very hard to look at the output. The second is very annoying 
when you get a bunch of __init__.py in the output.

Suggested solution:

- Default cumulative time sort order
- Show one additional folder level when filename is __main__ or __init__

--
components: Library (Lib)
messages: 326793
nosy: Anders.Hovmöller
priority: normal
severity: normal
status: open
title: Improve cProfile standard output
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller

Change by Anders Hovmöller :


--
keywords: +patch
pull_requests: +9046
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Michael Felt


Michael Felt  added the comment:

I just pulled master, did not see Modules/_sqlite/connection.c

in the list, but I redo everything for just in case and update later.

On 10/1/2018 10:49 AM, Berker Peksag wrote:
> Berker Peksag  added the comment:
>
> Could you try latest master? I think this is a duplicate of issue 34743 and 
> it has already been fixed in 
> https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.
>
> --
> nosy: +berker.peksag
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33117] asyncio example uses non-existing/documented method

2018-10-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

@xtreak is right, `run_coroutine_threadsafe()` returns 
`concurrent.futures.Future` object.

Personally, I like the fact that `fut.result()` is called with timeout 
parameter to reflect the fact of the different object type.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34846] Runtime failure with Failed to import site module

2018-10-01 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Can you please add the full stack trace as text in the 
comment so that it's more accessible? Searching along similar lines there is an 
open issue about corrupted .pyc causing import related failure in issue28007 
with a patch and a test case.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30167] site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set

2018-10-01 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset d4c76d960b8b286b75c933780416ace9cda682fd by INADA Naoki in branch 
'master':
bpo-30167: Add test for module.__cached__ is None (GH-7617)
https://github.com/python/cpython/commit/d4c76d960b8b286b75c933780416ace9cda682fd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33331] Clean modules in the reversed order

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If move a module to the end of sys.modules when it have finished execution, we 
will get the following order:

D, C, B, A, Y, Z, X, __main__

In can be cleaned from the end, and each module will be cleaned before its 
dependencies.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Sun, Sep 30, 2018 at 10:24:41PM +, Nathaniel Smith wrote:
> 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?

I'm not really sure that "chaos" is a good name for that. Contrast 
the rather restricted scope ("disable caches") with this example of 
chaos:

https://en.wikipedia.org/wiki/Chaos_Monkey

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34859] python core in string substring search

2018-10-01 Thread Ammar Askar


Ammar Askar  added the comment:

Please read this excerpt from the documentation Ronald linked for open:

newline controls how universal newlines mode works (it only applies to text 
mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows:

When reading input from the stream, if newline is None, universal newlines mode 
is enabled. Lines in the input can end in '\n', '\r', or '\r\n', and these are 
translated into '\n' before being returned to the caller. If it is '', 
universal newlines mode is enabled, but line endings are returned to the caller 
untranslated. If it has any of the other legal values, input lines are only 
terminated by the given string, and the line ending is returned to the caller 
untranslated.
When writing output to the stream, if newline is None, any '\n' characters 
written are translated to the system default line separator, os.linesep. If 
newline is '' or '\n', no translation takes place. If newline is any of the 
other legal values, any '\n' characters written are translated to the given 
string.

--
nosy: +ammar2
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28604] Exception raised by python3.5 when using en_GB locale

2018-10-01 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34811] test_gdb fails with latest gdb

2018-10-01 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Tested so far only on a 3.7.0 build.

--
versions:  -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34811] test_gdb fails with latest gdb

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Tested so far only on a 3.7.0 build.

I'm unable to reproduce the failure on 3.7.1rc1, so I consider that the bugs 
have been fixed.

Recent test_gdb and Tools/gdb/ fixes:

* bpo-32962
* bpo-30983

Commits:

* commit 5fe59f8e3a0a56a155c18f9d581205ec533764b6
* commit 019d33b7a447e78057842332fb5d3bad01922122
* commit d22fc0bc7de7882da204abe50884bbde2da4f9e7

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Consider moving the chaos discussion to a new issue.

On Mon, Oct 1, 2018 at 6:33 AM Steven D'Aprano 
wrote:

>
> Steven D'Aprano  added the comment:
>
> On Sun, Sep 30, 2018 at 10:24:41PM +, Nathaniel Smith wrote:
> > 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?
>
> I'm not really sure that "chaos" is a good name for that. Contrast
> the rather restricted scope ("disable caches") with this example of
> chaos:
>
> https://en.wikipedia.org/wiki/Chaos_Monkey
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think as a general recommendation it is not such a good idea that we should 
specifically mention it. (Is it in PEP 8 too? If so it should be removed there 
too.)

It's a pattern that is sometimes helpful, sometimes not. I don't think that 
people need to hear about it from the official docs about exceptions. People 
can learn from the standard exception hierarchy that sometimes it's useful to 
have a common base class *for exceptions that are related in some way*, in 
particular if there would be a reason to catch all of them with the same 
handler.

So I'm in agreement with Nathaniel M here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Just as extra data point:

It is fairly common to have a common exception class which is then used a mixin 
class together with the standard exception classes, so that you can indeed 
identify the source of an exception and catch errors based on the source (e.g. 
say you want to catch database errors coming from MySQL specifically).

The Python DB-API also requires to create a separate hierarchy for this purpose.

Overall, I wouldn't call this a non-best practice. It depends on the use case, 
whether it's useful or not.

--
nosy: +lemburg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2018-10-01 Thread twisteroid ambassador


twisteroid ambassador  added the comment:

I have finally managed to reproduce this one reliably. The issue happens when 
i) async generators are not finalized immediately and must be garbage collected 
in the future, and ii) the garbage collector happens to run in a different 
thread than the one running the event loop. (Obviously, if there are more than 
one Python threads, eventually gc will run in those other threads, causing 
problems.)

I have attached a script reproducing the problem. I tried several ways of using 
async generators (the use_agen_*() coroutines), and the only way to make them 
not finalize immediately is use_agen_anext_separate_tasks(), which is the 
pattern used in my Happy Eyeballs library.

--
Added file: https://bugs.python.org/file47838/asyncgen_test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

Wow.  Thanks so much for figuring this out, I know how hard it is to debug 
issues like this.

Now I see it clearly: _asyncgen_finalizer_hook should be using 
loop.call_soon_threadsafe.  Interestingly, I used _write_to_self there, so I 
knew about the issue, but figured that using call_soon() + _write_to_self is 
safe enough; evidently I was wrong.

Anyways, here's the diff that fixed it for me: 
https://gist.github.com/1st1/c1c9fc853cac1fadb7102ccc6201fb70

Could you please create a PR (ideally with a unittest)?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

Rereading your first message:

> When testing my happy eyeballs library, I occasionally run into issues with 
> async generators seemingly not finalizing. After setting 
> loop.set_debug(True), I have been seeing log entries like these:

The bug we are fixing now is that async generators were not finalizing properly 
*in debug mode*.  

The "I occasionally run into issues with async generators seemingly not 
finalizing" part will need further investigation if you experienced it with 
debug mode off.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34811] test_gdb fails with latest gdb

2018-10-01 Thread Miro Hrončok

Miro Hrončok  added the comment:

I've reproduced this on 3.7.1rc1:

https://src.fedoraproject.org/rpms/python3/pull-request/58
log (x86_64): 
https://kojipkgs.fedoraproject.org//work/tasks/2460/29992460/build.log

--
nosy: +hroncok

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32962] test_gdb fails in debug build with `-mcet -fcf-protection -O0`

2018-10-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9048

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34430] Symmetrical chaining futures in asyncio.future.wrap_future

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

The PR needs a very careful review, but in general I'm OK with the idea.  I'm 
also curious why do you want to fix wrap_future -- how are you using it?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34811] test_gdb fails with latest gdb

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

> I've reproduced this on 3.7.1rc1: (...)

Oh. I reopen the issue.

It seems like the bug occurred on the debug build of Python:

+ /builddir/build/BUILD/Python-3.7.1rc1/build/debug/python -m test.regrtest -wW 
--slowest --findleaks -x test_distutils -x test_bdist_rpm


Extract of commands to build Python in debug mode:



+ topdir=/builddir/build/BUILD/Python-3.7.1rc1
+ export 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
+ export 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
++ pkg-config --cflags-only-I libffi
+ export CPPFLAGS=
+ CPPFLAGS=
+ export 'OPT=-O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
+ OPT='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv'
+ export LINKCC=gcc
+ LINKCC=gcc
++ pkg-config --cflags openssl
+ export 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv '
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv '
++ pkg-config --libs-only-L openssl
+ export 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now 
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g '
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now 
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g '
+ BuildPython debug '--without-ensurepip --with-pydebug' -O0
STARTING: BUILD OF PYTHON FOR CONFIGURATION: debug
+ ConfName=debug
+ ExtraConfigArgs='--without-ensurepip --with-pydebug'
+ MoreCFlags=-O0
+ ConfDir=build/debug
+ echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: debug
+ mkdir -p build/debug
+ pushd build/debug
~/build/BUILD/Python-3.7.1rc1/build/debug ~/build/BUILD/Python-3.7.1rc1
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv '
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-

[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9049

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34014] loop.run_in_executor should propagate current contextvars

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

So we're deprecating passing non-ThreadPoolExecutor instances to 
loop.set_default_executor.  In 3.9 that will trigger an error.

For this issue we have basically the next few options:

(1) Do nothing;

(2) Fix "run_in_executor" to start copying and running in correct context 
automatically

(3) Add a new keyword-only parameter to "run_in_executor": 
"retain_context=False"

(4) Design a new async/await friendly API for using thread- and process-pools.

Now, (4) will happen.  The "run_in_executor" method is low-level and requires 
accessing the event loop to use it.  We probably have enough time to design 
this new API before 3.8.

As for implementing (3) in 3.8 -- I'd be OK with that too.  Andrew, your 
thoughts?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34014] loop.run_in_executor should propagate current contextvars

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

One problem with (3) is what will happen if someone uses "retain_context=True" 
and a ProcessPoolExecutor.  It has to fail in a graceful and obvious way.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34824] _ssl.c: Possible null pointer dereference

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good catch, but there is more than one error here.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think that the resolution of this issue should be revision of at least the 
tkinter paragraph in 
https://docs.python.org/3/using/mac.html#gui-programming-on-the-mac, and I 
think at least the tkinter revision should be cherry-picked into the upcoming 
releases.  Ned, what do you want to do?

PyObjC paragraph: move to end?

Tkinter paragraph: rewrite to something like...

The standard Python GUI toolkit is tkinter, based on the cross-platform Tk 
toolkit (https://www.tcl.tk). Starting with the 64-bit installer in 3.6.6 and 
both installers in 3.7.0, an Aqua-native version of Tk is bundled the 
installer.  Users are urged to install the most recent bug-fix releases.

'Other' paragraphs:  combine into something like ...

*wxPython* and *PyQt* are other cross-platform GUI toolkits that runs natively 
on Mac OS X. See https://www.wxpython.org or 
https://riverbankcomputing.com/software/pyqt/intro.

[Does the other Qt wrapping, PySide, run natively on Mac?]

--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Michael Felt


Michael Felt  added the comment:

Yes, that seems to have fixed it already. Closing the PR and issue!

Thx for the quick response!

On 10/1/2018 1:37 PM, Michael Felt wrote:
> Michael Felt  added the comment:
>
> I just pulled master, did not see Modules/_sqlite/connection.c
> 
> in the list, but I redo everything for just in case and update later.
>
> On 10/1/2018 10:49 AM, Berker Peksag wrote:
>> Berker Peksag  added the comment:
>>
>> Could you try latest master? I think this is a duplicate of issue 34743 and 
>> it has already been fixed in 
>> https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.
>>
>> --
>> nosy: +berker.peksag
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Michael Felt


Michael Felt  added the comment:

duplicate of issue34743

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34860] fix test_sqlite for AIX

2018-10-01 Thread Berker Peksag


Change by Berker Peksag :


--
superseder:  -> test_database_source_name fails with SQLite 3.7.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34862] No longer builds on OpenBSD due to missing definition of convert_sched_param

2018-10-01 Thread William Orr


New submission from William Orr :

[ worr on locke ] ( cpython ) % make -j15   
[0]
gcc -pthread -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall  
-O2 -pipe   -std=c99 -Wextra -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration   -I. 
-I./Include   -fPIC  -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o 
Modules/posixmodule.o
./Modules/posixmodule.c:5164: warning: 'convert_sched_param' used but never 
defined
gcc -pthread -c -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall  -O2 -pipe   -std=c99 -Wextra -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration   -I. 
-I./Include   -fPIC -DPy_BUILD_CORE  -DGITVERSION="\"`LC_ALL=C git --git-dir 
./.git rev-parse --short HEAD`\""  -DGITTAG="\"`LC_ALL=C git --git-dir ./.git 
describe --all --always --dirty`\""  -DGITBRANCH="\"`LC_ALL=C git --git-dir 
./.git name-rev --name-only HEAD`\""  -o Modules/getbuildinfo.o 
./Modules/getbuildinfo.c
if test libpython3.8m.so.1.0 != libpython3.8m.so; then  gcc -pthread -shared 
-fPIC   -Wl,-hlibpython3.8m.so.1.0 -o libpython3.8m.so.1.0 
Modules/getbuildinfo.o  Parser/acceler.o  Parser/grammar1.o  Parser/listnode.o  
Parser/node.o  Parser/parser.o  Parser/bitset.o  Parser/metagrammar.o  
Parser/firstsets.o  Parser/grammar.o  Parser/pgen.o Parser/myreadline.o 
Parser/parsetok.o Parser/tokenizer.o  Objects/abstract.o  Objects/accu.o  
Objects/boolobject.o  Objects/bytes_methods.o  Objects/bytearrayobject.o  
Objects/bytesobject.o  Objects/call.o  Objects/cellobject.o  
Objects/classobject.o  Objects/codeobject.o  Objects/complexobject.o  
Objects/descrobject.o  Objects/enumobject.o  Objects/exceptions.o  
Objects/genobject.o  Objects/fileobject.o  Objects/floatobject.o  
Objects/frameobject.o  Objects/funcobject.o  Objects/iterobject.o  
Objects/listobject.o  Objects/longobject.o  Objects/dictobject.o  
Objects/odictobject.o  Objects/memoryobject.o  Objects/methodobject.o  
Objects/moduleobject.o 
  Objects/namespaceobject.o  Objects/object.o  Objects/obmalloc.o  
Objects/capsule.o  Objects/rangeobject.o  Objects/setobject.o  
Objects/sliceobject.o  Objects/structseq.o  Objects/tupleobject.o  
Objects/typeobject.o  Objects/unicodeobject.o  Objects/unicodectype.o  
Objects/weakrefobject.o  Python/_warnings.o  Python/Python-ast.o  Python/asdl.o 
 Python/ast.o  Python/ast_opt.o  Python/ast_unparse.o  Python/bltinmodule.o  
Python/ceval.o  Python/codecs.o  Python/compile.o  Python/coreconfig.o  
Python/dynamic_annotations.o  Python/errors.o  Python/frozenmain.o  
Python/future.o  Python/getargs.o  Python/getcompiler.o  Python/getcopyright.o  
Python/getplatform.o  Python/getversion.o  Python/graminit.o  Python/import.o  
Python/importdl.o  Python/marshal.o  Python/modsupport.o  Python/mysnprintf.o  
Python/mystrtoul.o  Python/pathconfig.o  Python/peephole.o  Python/pyarena.o  
Python/pyctype.o  Python/pyfpe.o  Python/pyhash.o  Python/pylifecycle.o  
Python/pymath.o  Python/pystate.o  Python/co
 ntext.o  Python/hamt.o  Python/pythonrun.o  Python/pytime.o  
Python/bootstrap_hash.o  Python/structmember.o  Python/symtable.o  
Python/sysmodule.o  Python/thread.o  Python/traceback.o  Python/getopt.o  
Python/pystrcmp.o  Python/pystrtod.o  Python/pystrhex.o  Python/dtoa.o  
Python/formatter_unicode.o  Python/fileutils.o  Python/dynload_shlib.o
Modules/config.o  Modules/getpath.o  Modules/main.o  Modules/gcmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  
Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  
Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  
Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  
Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o 
Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o 
Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  
Modules/_tracemalloc.o Modules/
 hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o  Python/frozen.o   
-lpthread  -lutil -lm  -lm ;  ln -f libpython3.8m.so.1.0 libpython3.8m.so;  
else  gcc -pthread -shared -fPIC   -o libpython3.8m.so Modules/getbuildinfo.o  
Parser/acceler.o  Parser/grammar1.o  Parser/listnode.o  Parser/node.o  
Parser/parser.o  Parser/bitset.o  Parser/metagrammar.o  Parser/firstsets.o  
Parser/grammar.o  Parser/pgen.o Parser/myreadline.o Parser/parsetok.o 
Parser/tokenizer.o  Objects/abstract.o  Objects/accu.o  Objects/boolobject.o  
Objects/bytes_methods.o  Objects/bytearrayobject.o  Objects/bytesobject.o  
Objects/call.o  Objects/cellobject.o  Objects/classobject.o  
Objects/codeobject.o  Objects/complexobject.o  Objects/descrobject.o  
Objects/enumobject.o  Objects/exceptions.o  Objects/genobject.o  
Objects/fileobject.o  Objects/floatobject.o  Objects/frameobject.o  
Objects/funcobject.o  Obj

[issue34862] No longer builds on OpenBSD due to missing definition of convert_sched_param

2018-10-01 Thread William Orr


Change by William Orr :


--
keywords: +patch
pull_requests: +9050
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34838] Improve arg clinic code generation for cases with type checking

2018-10-01 Thread Ammar Askar


Change by Ammar Askar :


--
keywords: +patch
pull_requests: +9052
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34838] Improve arg clinic code generation for cases with type checking

2018-10-01 Thread Ammar Askar


Ammar Askar  added the comment:

I've attached a PR that implements this. From the looks of it, there aren't a 
lot of uses of subclass_of within argument clinic converted functions at the 
moment. Additionally, most of the places it is used tend to have some non 
object arguments so a call to _PyArg_ParseStack() gets placed anyway.

Attached as part of separate commit in the PR is the conversion of some files 
over to use the new code. These are mostly just to serve as examples. 

While converting would still leave a call to ParseStack in most places, I'd 
like to do some benchmarking and figure out if there is still a benefit. Like 
you said, the fact that branch-prediction is easier might be useful given that 
these functions are usually called with the right types of arguments anyway.

--
nosy: +ammar2
stage: patch review -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34751] Hash collisions for tuples

2018-10-01 Thread Tim Peters


Tim Peters  added the comment:

If SeaHash is interesting to us (it is to me), I suggest dropping our DJB/FNV 
combining part entirely and using a purer form, like so:

Py_uhash_t t = (Py_uhash_t)y;
x ^= t ^ (t << 1);
x *= (Py_uhash_t)0x6eed0e9da4d94a4fULL;
x ^= (x >> 32) >> (x >> 60);
x *= (Py_uhash_t)0x6eed0e9da4d94a4fULL;

The only collisions with that were 14 in the new tuple test.  Rotate t right by 
3 first, and that drops to 13.  Much better than utter catastrophe ;-)

100% pure SeaHash does

x ^= t;

at the start first, instead of `t ^ (t << 1)` on the RHS.  That fails the 
second tuple test, with 98 collisions.  Not catastrophic, just "too many".  But 
there's only so much we can expect from a cheap non-crypto-strength hash.  `t ^ 
(t << 1)` is a pragmatic tweek to get rid of masses of uselessly repeated sign 
bits, which do occur in realistic tuples (mixing positive and negative ints).  
Adding that tweak shouldn't harm any of SeaHash's provable global properties, 
since `t ^ (t << 1)` is just a permutation of the input space.

Different constants would be needed for a 32-bit version (best guesses, 
untried:  a 31-bit random prime; s/32/16/; s/60/29/).

I don't yet know about potential SeaHash licensing issues.  It's part of Rust:

https://docs.rs/seahash/3.0.5/seahash/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34863] Idle Mac scrolling only down

2018-10-01 Thread Andy Harrington


New submission from Andy Harrington :

In a source file in Idle I scroll down no matter which way I rotate the mouse 
wheel.   This happens in no other app.

Mac High Sierra OS.

I have the Mac scrolling setup "natural" - backwards from the Windows 
directions.

--
assignee: terry.reedy
components: IDLE
messages: 326821
nosy: andyharrington, terry.reedy
priority: normal
severity: normal
status: open
title: Idle Mac scrolling only down
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34864] In Idle, Mac tabs make bottom editor line with cursor location disappear

2018-10-01 Thread Andy Harrington


New submission from Andy Harrington :

Mac now puts multiple tabs inside of application window instead of starting a 
separate window (with some OS settings).

With just one file being edited in Idle (no tab line) the bottom line with the 
numerical cursor coordinates is visible.  When there are multiple tabs (and the 
tabbing heading therefore) the bottom cursor coordinates are missing.

--
assignee: terry.reedy
components: IDLE
messages: 326822
nosy: andyharrington, terry.reedy
priority: normal
severity: normal
status: open
title: In Idle, Mac tabs make bottom editor line with cursor location disappear
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2018-10-01 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34818] test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__

2018-10-01 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34834] test_ssl.test_options does not correctly account for built-in ctx defaults with openssl 1.1.1

2018-10-01 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34836] test_ssl.test_default_ecdh_curve needs no tls1.3 flag in 2.7, for now

2018-10-01 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32117] Tuple unpacking in return and yield statements

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

assertEquals() is deprecated, use assertEqual() instead. This causes tests 
failure when run with -Werror.

--
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34865] Incorrect assignment of optional argument when partial match with different argument found.

2018-10-01 Thread Rob Dalton


New submission from Rob Dalton :

Parsing an unknown optional argument whose leading characters (e.g. '--user') 
match those of another, known optional argument (e.g. '--userdata') causes the 
unknown argument to be parsed as the known one.

For example - passing the unknown argument '--user' to a parser with the known 
argument '--userdata' assigns the passed '--user' value to '--userdata'.

Here's my setup info:
  Python: Python 3.6.3 :: Anaconda custom (64-bit)
  OS: MacOS High Sierra 10.13.6 

Wrote up some example cases here:
  https://gist.github.com/rob-dalton/9ec06b8d5e2e9083713ddc7884d16072

--
components: Library (Lib)
messages: 326824
nosy: rob-dalton
priority: normal
severity: normal
status: open
title: Incorrect assignment of optional argument when partial match with 
different argument found.
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Tests are failed when ran with -Werror.

$ ./python -Werror -m test -vuall test_asyncgen
...
==
ERROR: test_async_gen_asyncio_01 (test.test_asyncgen.AsyncGenAsyncioTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncgen.py", line 404, in 
test_async_gen_asyncio_01
res = self.loop.run_until_complete(self.to_list(gen()))
  File "/home/serhiy/py/cpython/Lib/asyncio/base_events.py", line 582, in 
run_until_complete
return future.result()
  File "/home/serhiy/py/cpython/Lib/test/test_asyncgen.py", line 391, in to_list
async for i in gen:
  File "/home/serhiy/py/cpython/Lib/test/test_asyncgen.py", line 398, in gen
await asyncio.sleep(0.01, loop=self.loop)
  File "/home/serhiy/py/cpython/Lib/asyncio/tasks.py", line 598, in sleep
warnings.warn("The loop argument is deprecated and scheduled for "
DeprecationWarning: The loop argument is deprecated and scheduled for removal 
in Python 3.10.

==
...
(the full log is too long)

$ ./python -Werror -m test -vuall test_asyncio
...
==
FAIL: test_sleep_cancel 
(test.test_asyncio.test_tasks.PyTask_PyFuture_SubclassTests)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/utils.py", line 510, in 
close_loop
loop.close()
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/utils.py", line 362, in 
close
self._gen.send(0)
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 
1363, in gen
self.assertAlmostEqual(10.0, when)
AssertionError: 10.0 != 0 within 7 places (10.0 difference)

==
FAIL: test_run_coroutine_threadsafe_task_factory_exception 
(test.test_asyncio.test_tasks.RunCoroutineThreadsafeTests)
Test coroutine submission from a tread to an event loop
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 
3189, in test_run_coroutine_threadsafe_task_factory_exception
self.assertEqual(len(callback.call_args_list), 1)
AssertionError: 2 != 1

--
...
(the full log is too long)

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-10-01 Thread STINNER Victor


STINNER Victor  added the comment:

> We should raise a DeprecationWarning in Python 3.8 and 3.9 and remove it in 
> 4.0.

On python-committers, it has been said that 3.10 will follow Python 3.9, no?

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31310] semaphore tracker isn't protected against crashes

2018-10-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Tests are failed when ran with -Werror.

$ ./python -We -m test -vuall test_multiprocessing_fork 
test_multiprocessing_forkserver test_multiprocessing_spawn
...
==
ERROR: test_semaphore_tracker_sigkill 
(test.test_multiprocessing_fork.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4582, 
in test_semaphore_tracker_sigkill
self.check_semaphore_tracker_death(signal.SIGKILL, True)
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4546, 
in check_semaphore_tracker_death
_semaphore_tracker.ensure_running()
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
64, in ensure_running
warnings.warn('semaphore_tracker: process died unexpectedly, '
UserWarning: semaphore_tracker: process died unexpectedly, relaunching.  Some 
semaphores might leak.

--
...
==
ERROR: test_semaphore_tracker_sigint 
(test.test_multiprocessing_forkserver.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4574, 
in test_semaphore_tracker_sigint
self.check_semaphore_tracker_death(signal.SIGINT, False)
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4546, 
in check_semaphore_tracker_death
_semaphore_tracker.ensure_running()
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
64, in ensure_running
warnings.warn('semaphore_tracker: process died unexpectedly, '
UserWarning: semaphore_tracker: process died unexpectedly, relaunching.  Some 
semaphores might leak.

==
ERROR: test_semaphore_tracker_sigkill 
(test.test_multiprocessing_forkserver.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4582, 
in test_semaphore_tracker_sigkill
self.check_semaphore_tracker_death(signal.SIGKILL, True)
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4554, 
in check_semaphore_tracker_death
sem = ctx.Semaphore()
  File "/home/serhiy/py/cpython/Lib/multiprocessing/context.py", line 82, in 
Semaphore
return Semaphore(value, ctx=self.get_context())
  File "/home/serhiy/py/cpython/Lib/multiprocessing/synchronize.py", line 126, 
in __init__
SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)
  File "/home/serhiy/py/cpython/Lib/multiprocessing/synchronize.py", line 80, 
in __init__
register(self._semlock.name)
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
104, in register
self._send('REGISTER', name)
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
111, in _send
self.ensure_running()
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
64, in ensure_running
warnings.warn('semaphore_tracker: process died unexpectedly, '
UserWarning: semaphore_tracker: process died unexpectedly, relaunching.  Some 
semaphores might leak.

--
...
==
ERROR: test_semaphore_tracker_sigint 
(test.test_multiprocessing_spawn.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4574, 
in test_semaphore_tracker_sigint
self.check_semaphore_tracker_death(signal.SIGINT, False)
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4546, 
in check_semaphore_tracker_death
_semaphore_tracker.ensure_running()
  File "/home/serhiy/py/cpython/Lib/multiprocessing/semaphore_tracker.py", line 
64, in ensure_running
warnings.warn('semaphore_tracker: process died unexpectedly, '
UserWarning: semaphore_tracker: process died unexpectedly, relaunching.  Some 
semaphores might leak.

==
ERROR: test_semaphore_tracker_sigkill 
(test.test_multiprocessing_spawn.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/_test_multiprocessing.py", line 4582, 
in test_semaphore_tracker_sigkill
self.check_semaphore_tracker_death(signal.SIGKILL, True)
  File "/home/serhiy/py/cpython/Lib/test/_test

[issue34865] Incorrect assignment of optional argument when partial match with different argument found.

2018-10-01 Thread Zachary Ware


Zachary Ware  added the comment:

Would using `allow_abbrev=False` fix this for you?

https://docs.python.org/3/library/argparse.html#allow-abbrev

--
nosy: +zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-10-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-10-01 Thread Luna Chen


Luna Chen  added the comment:

Thank you Vinay!
I think you have some good points! :)

I'm going to make the following changes
- re-raise the keyError into ValueError in XXXStyle.format
- add validate() methods to XXXstyle class, and call them in logging.Formatter

Best regards,
Luna Chen

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34865] Incorrect assignment of optional argument when partial match with different argument found.

2018-10-01 Thread Rob Dalton


Rob Dalton  added the comment:

It does. Thanks! I feel dumb for not finding that.

Guess I'd just suggest making the default `false`, seems more intuitive to
me.

On Mon, Oct 1, 2018 at 2:00 PM Robert Dalton  wrote:

> It does. Thanks! I feel dumb for not finding that.
>
> Guess I'd just suggest making the default `false`, seems more intuitive to
> me.
>
> On Mon, Oct 1, 2018 at 1:48 PM Zachary Ware 
> wrote:
>
>>
>> Zachary Ware  added the comment:
>>
>> Would using `allow_abbrev=False` fix this for you?
>>
>> https://docs.python.org/3/library/argparse.html#allow-abbrev
>>
>> --
>> nosy: +zach.ware
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
>
>
> --
> Best,
> Rob Dalton
>
>
> (814) 571-0462 | robdalton.me | robcdal...@gmail.com
>

-- 
Best,
Rob Dalton

(814) 571-0462 | robdalton.me | robcdal...@gmail.com

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34866] CGI DOS vulnerability via long post list

2018-10-01 Thread Matthew Belisle


New submission from Matthew Belisle :

Copied from email to secur...@python.org:

I have been doing memory profiling on a few python web frameworks and I noticed 
this issue in the cgi.FieldStorage class.

$ python example.py
Memory used: 523935744 bytes

The problem is there is no easy way to limit the number of MiniFieldStorage 
objects created by FieldStorage, so it goes unchecked in many frameworks like 
pyramid, pylons, webapp2, and flask. The end result is that on these 
frameworks, a 9MB request body (gzipped down to 9KB) can chew up ~500MB of 
memory on the server which is enough to effectively DOS it. The obvious way to 
prevent this currently is to check the content-length header and fail if it 
exceeds some value. But that solution has a major shortcoming because many 
frameworks want to allow large payloads, sometimes up to 10MB, as long as they 
contain a reasonable number of fields.

After talking with the secur...@python.org
 team and pylons dev team about it, we think the best solution is to add a 
max_num_fields param to the FieldStorage class, defaulting to None, which 
throws an error if max_num_fields is exceeded.

--
components: Library (Lib)
messages: 326831
nosy: Matthew Belisle
priority: normal
severity: normal
status: open
title: CGI DOS vulnerability via long post list
type: security
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34866] CGI DOS vulnerability via long post list

2018-10-01 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +9053
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-10-01 Thread Yury Selivanov


Yury Selivanov  added the comment:

> On python-committers, it has been said that 3.10 will follow Python 3.9, no?

Victor, you're looking at an outdated comment on this issue.  This is what's in 
the master branch:

https://github.com/python/cpython/blob/d4c76d960b8b286b75c933780416ace9cda682fd/Lib/asyncio/tasks.py#L598-L599

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34863] Idle Mac scrolling only down

2018-10-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Fixed in 3.7.1rc1, See the Mac downloads at
https://www.python.org/downloads/release/python-371rc1/
If no problems, 3.7.1 itself will follow in a week or so.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE: on macOS, scroll slider 'sticks' at bottom of file

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27643] test_ctypes fails on AIX with xlc

2018-10-01 Thread Michael Felt

Michael Felt  added the comment:

well, update: the issue34603 merged 16 days ago has broken this PR - that has 
been waiting for nearly 10 months.

Unhappy camper.

And, just as a short reminder - there were earlier ¨patches (that I just 
copied) going back more than 2 years.

Please, some attention.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34751] Hash collisions for tuples

2018-10-01 Thread Tim Peters


Tim Peters  added the comment:

>Py_uhash_t t = (Py_uhash_t)y;
>x ^= t ^ (t << 1);
>x *= (Py_uhash_t)0x6eed0e9da4d94a4fULL;
>x ^= (x >> 32) >> (x >> 60);
>x *= (Py_uhash_t)0x6eed0e9da4d94a4fULL;

Comment out either one of the multiplies, and it still passes all the tests.  
Commenting out the first one is "more valuable", because on all but the last 
loop iteration the latency of the last-line multiply will overlap with the next 
call to hash a tuple component.  It even reduces the number of collisions in 
the new tuple test (down to 7 - and still no collisions at all in other tests).

I'm not clear on why there are two multiplies.  With both, or either one alone, 
low and high bits still get their chances to affect the other end.

Presumably it boils down to some detail in "the proofs" - but, as for FNV, 
while various things are _claimed_, I can't find a writeup of "the proofs" 
anywhere :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-10-01 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +9054
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34865] Incorrect assignment of optional argument when partial match with different argument found.

2018-10-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

As much as I agree that allow_abbrev=False would be a much better default, at 
this point we can't change it. Doing so would break who knows how many existing 
scripts when they upgraded Python versions.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread Ezio Melotti


Change by Ezio Melotti :


--
assignee: docs@python -> ezio.melotti
keywords: +easy
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread Ezio Melotti


Change by Ezio Melotti :


--
keywords: +patch
pull_requests: +9055
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9056

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread Ezio Melotti


Ezio Melotti  added the comment:


New changeset 30534cc7172f36092e0002bb7df482edc0d539ce by Ezio Melotti in 
branch 'master':
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662)
https://github.com/python/cpython/commit/30534cc7172f36092e0002bb7df482edc0d539ce


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9057

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34867] Add mode to disable small integer and interned string caches

2018-10-01 Thread Steven D'Aprano


New submission from Steven D'Aprano :

Split off from #34850 by Guido's request.

To help catch incorrect use of `is` when `==` is intended, perhaps we should 
add an interpreter mode that disables the caches for small ints and interned 
strings.

Nathaniel called it "chaos mode" but I don't like the name as there is nothing 
chaotic about the lack of such caches, and it doesn't come close to chaos 
testing (e.g. Netflix's Chaos Monkey tool).

--
components: Interpreter Core
messages: 326838
nosy: gregory.p.smith, njs, steven.daprano
priority: normal
severity: normal
status: open
title: Add mode to disable small integer and interned string caches
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31865] html.unescape does not work as per documentation

2018-10-01 Thread Ezio Melotti


Ezio Melotti  added the comment:


New changeset 27d7f93f633f0163b96d0a95e312f0eb5615abfd by Ezio Melotti (Miss 
Islington (bot)) in branch '3.7':
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9663)
https://github.com/python/cpython/commit/27d7f93f633f0163b96d0a95e312f0eb5615abfd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >