[issue33083] math.factorial accepts non-integral Decimal instances

2018-07-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

> accepting non-integral floats but not non-integral Decimals and Fractions.

I don't think anyone is proposing to accept non-integral floats. non-integral 
floats are _already_ rejected with a ValueError. Did you mean "integral" 
instead of "non-integral"?

--

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-07-30 Thread Tal Einat


Tal Einat  added the comment:

>> accepting non-integral floats but not non-integral Decimals and Fractions.

> I don't think anyone is proposing to accept non-integral floats. non-integral 
> floats are _already_ rejected with a ValueError. Did you mean "integral" 
> instead of "non-integral"?

Indeed, yes.

--

___
Python tracker 

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



[issue27163] IDLE entry for What's New in Python 3.6

2018-07-30 Thread Tal Einat


Change by Tal Einat :


--
resolution:  -> out of date
stage: needs patch -> 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



[issue33204] IDLE: remove \b from colorizer string prefix

2018-07-30 Thread Tal Einat


Tal Einat  added the comment:

Should this be closed as resolved?

--
nosy: +taleinat

___
Python tracker 

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



[issue34278] Documentation: os.waitid and os.WNOHANG

2018-07-30 Thread crzbear


New submission from crzbear :

os.waitid states that  None  is returned
if WNOHANG was specified and no children are in a waitable state

os.WNOHANG states that the return value in this case would be  (0, 0)  


Python 3.6.5 returns None, so the latter probably needs to be changed

--
assignee: docs@python
components: Documentation
messages: 322660
nosy: crzbear, docs@python
priority: normal
severity: normal
status: open
title: Documentation: os.waitid and os.WNOHANG
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



[issue33204] IDLE: remove \b from colorizer string prefix

2018-07-30 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved

___
Python tracker 

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



[issue33204] IDLE: remove \b from colorizer string prefix

2018-07-30 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue34258] Python shell keeps restarting

2018-07-30 Thread Aleksa Bulatovic


Aleksa Bulatovic  added the comment:

Well the error looks like this

= RESTART: F:\Python Shell Learning\Games\How smart are you Test.py =
i think it's normal but it won't show '>>> '.I will see what i can do,but 
thanks for some help.

--

___
Python tracker 

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



[issue31844] HTMLParser: undocumented not implemented method

2018-07-30 Thread Berker Peksag


Berker Peksag  added the comment:

HTMLParser.error() method was deprecated in Python 3.4 
(https://github.com/python/cpython/commit/88ebfb129b59dc8a2b855fc93fcf32457128d64d#diff-1a7486df8279dbac7f20abd487947845R157)
 and removed in Python 3.5 
(https://github.com/python/cpython/commit/73a4359eb0eb624c588c5d52083ea4944f9787ea#diff-1a7486df8279dbac7f20abd487947845L171)

_markupbase is a private and undocumented module and its only user is 
HTMLParser (sgmllib was removed from the stdlib in 2008) Since we already have 
removed HTMLParser.error(), I think we can just remove 
_markupbase.ParserBase.error() without a deprecation period.

--
nosy: +berker.peksag
stage:  -> needs patch
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue31844] HTMLParser: undocumented not implemented method

2018-07-30 Thread Berker Peksag


Change by Berker Peksag :


--
keywords: +patch
pull_requests: +8076
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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-07-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

So I'm against _adding_ support for Decimal and Fraction on various grounds:

(1) If it's our intention to deprecate acceptance of non-integral types, then 
it seems odd to deliberately add a new intentional feature (acceptance of 
integral-valued Decimal objects) that we know we want to deprecate long term. 
It's only if we don't intend any such deprecation that it would make sense to 
add those new features.

(2) Implementation: adding support for Decimal objects in a math module is 
going to be messy, adding significant complication to the C code. The math 
module would have to import Decimal (something it doesn't currently need to do) 
in order to make the Decimal instance checks. @taleinat: how would you see the 
implementation working?

(3) If we support Fraction, should we also support arbitrary numbers.Rational 
instances? What's the exact rule for what should and shouldn't be accepted. The 
line isn't clear. In contrast, if the rule is that only floats and integer-like 
things are accepted, it's much clearer.

I think there's a clear goal here, which is that `math.factorial` should accept 
only integral types, defined as those implementing `__index__`. This is the 
same thing that `math.gcd` does.

To avoid gratuitous breakage, and because acceptance of floats was a deliberate 
design decision, we should continue to accept integral floats in the short 
term, perhaps eventually deprecating. But deliberately supporting integral 
Decimals and Fractions takes us further from the goal.

--

___
Python tracker 

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



[issue16399] argparse: append action with default list adds to list instead of overriding

2018-07-30 Thread Evgeny


Evgeny  added the comment:

You don't need action='append'. 
For desired behavior you can pass action='store' with nargs='*'.
I think it's a simplest workaround.

--
nosy: +gun146

___
Python tracker 

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



[issue34075] asyncio: We should prohibit setting a ProcessPoolExecutor in with set_default_executor

2018-07-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 22d25085db2590932b3664ca32ab82c08f2eb2db by Victor Stinner (Elvis 
Pranskevichus) in branch 'master':
bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() 
(GH-8533)
https://github.com/python/cpython/commit/22d25085db2590932b3664ca32ab82c08f2eb2db


--

___
Python tracker 

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



[issue34075] asyncio: We should prohibit setting a ProcessPoolExecutor in with set_default_executor

2018-07-30 Thread STINNER Victor


STINNER Victor  added the comment:

Elvis Pranskevichus: well done, your first PR was already good to be merged ;-)

--
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



[issue34279] RFC: issue a warning in regrtest when no test have been executed?

2018-07-30 Thread STINNER Victor


New submission from STINNER Victor :

Python test runner regrtest has many options to select tests: -u (resources), 
-m and --matchfile, -x (exclude), etc. Sometimes, I do a mistake and I run 0 
test, but I still get a success.

Maybe regrtest should be modified to fail with an error when no test is run? At 
least, it would help to understand my mistake if regrtest could emit a warning 
in such case.

Example:
---
$ ./python  -W error  -m test test_asyncio -m 
test_set_default_executor_deprecation_warnings 
Run tests sequentially
0:00:00 load avg: 0.27 [1/1] test_asyncio

== Tests result: SUCCESS ==

1 test OK.

Total duration: 266 ms
Tests result: SUCCESS
---

Success ok, but is there a typo in the test method?

Another example:
---
$ ./python  -W error  -m test test_asyncio -m test_no_such_test -v
== CPython 3.8.0a0 (heads/pr/8533:50c0499950, Jul 30 2018, 12:41:53) [GCC 8.1.1 
20180712 (Red Hat 8.1.1-5)]
== Linux-4.17.6-200.fc28.x86_64-x86_64-with-glibc2.26 little-endian
== cwd: /home/vstinner/prog/python/master/build/test_python_5505
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.31 [1/1] test_asyncio

--
Ran 0 tests in 0.001s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 318 ms
Tests result: SUCCESS
---

Success but no test have been executed. It's not obvious at all without the 
verbose mode:
---
$ ./python  -W error  -m test test_asyncio -m test_no_such_test 
Run tests sequentially
0:00:00 load avg: 0.31 [1/1] test_asyncio

== Tests result: SUCCESS ==

1 test OK.

Total duration: 260 ms
Tests result: SUCCESS
---

--
components: Tests
messages: 322667
nosy: pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: RFC: issue a warning in regrtest when no test have been executed?
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



[issue34263] asyncio: "relative *delay* or absolute *when* should not exceed one day"

2018-07-30 Thread STINNER Victor


STINNER Victor  added the comment:

For python 3.7, i suggest to fix the bug but don't remove the note from 3.7 
doc, dince 3.7.0 and older have the bug.

--

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-07-30 Thread Tal Einat


Tal Einat  added the comment:

Understood. Thanks for making the time and effort to clarify!

--

___
Python tracker 

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



[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

A C function with signature METH_NOARGS takes two arguments where the first is 
"self" and the second is guaranteed to be NULL. Given that this second argument 
really should never be used, I would like to drop the guarantee that the 
argument is NULL.

Concretely, I propose to change:

1. the documentation for METH_NOARGS

2. some functions in Modules/_io/bufferedio.c which actually do use the second 
argument of a METH_NOARGS function.

For the moment, the second argument is still NULL, but one is not supposed to 
rely on that.

The reason for this patch is that this second argument can be re-purposed in 
PEP 580 (and possibly PEP 573) to pass the function object.

--
components: Interpreter Core
messages: 322670
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: METH_NOARGS: no longer require that second arg is NULL
type: enhancement
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



[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue31658] xml.sax.parse won't accept path objects

2018-07-30 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


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

___
Python tracker 

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



[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

This is an issue with Python 2 too which I hope can be fixed too. The original 
logic in the code was committed around 16 years back : 
https://github.com/python/cpython/commit/bbc0568a5c7d3849a22c78d545823a4b952c0933
 and tests are also around 10 years old too.

➜  cpython git:(2bea771609) ✗ ./python.exe
Python 2.7.15+ (remotes/upstream/2.7:2bea771609, Jul 30 2018, 18:07:51)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
➜  cpython git:(2bea771609) ✗ ./python.exe bpo34276.py
file://root/a [SplitResult(scheme='file', netloc='root', path='/a', query='', 
fragment='')]
file://root/a
ROUNDTRIP: True

file:///root/a [SplitResult(scheme='file', netloc='', path='/root/a', query='', 
fragment='')]
file:///root/a
ROUNDTRIP: True

file:root/a [SplitResult(scheme='file', netloc='', path='//root/a', 
query='', fragment='')]
file://root/a
ROUNDTRIP: False

file:/root/a [SplitResult(scheme='file', netloc='', path='///root/a', 
query='', fragment='')]
file:///root/a
ROUNDTRIP: False


Thanks

--

___
Python tracker 

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



[issue31844] HTMLParser: undocumented not implemented method

2018-07-30 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Good call. Maybe it's actually time to retire _markupbase and merge ParserBase 
into HTMLParser.

--

___
Python tracker 

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



[issue34281] "Go to Line" broken on OS X

2018-07-30 Thread Eric Martin


New submission from Eric Martin :

After entering a line number, clicking OK brings to the foreground and makes 
active the first hidden window (in the simplest case where we have just one 
window for a .py file and the Shell window, the former being in the foreground, 
clicking OK brings the Shell window to the foreground).

--
assignee: terry.reedy
components: IDLE
messages: 322673
nosy: eamartin, terry.reedy
priority: normal
severity: normal
status: open
title: "Go to Line" broken on OS X
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



[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I just checked back the behavior on Perl's https://github.com/libwww-perl/URI/ 
. It seems to handle that along with other additional cases. Maybe some of the 
tests can be adopted from there for better coverage too 
(https://github.com/libwww-perl/URI/blob/master/t/split.t)

$ cat bpo34276.pl
use URI::Split qw(uri_split uri_join);

sub print_url{
my $uri = shift;
print "original uri ", $uri, "\n";
($scheme, $auth, $path, $query, $frag) = uri_split($uri);
$uri = uri_join($scheme, $auth, $path, $query, $frag);
print "returned uri ", $uri, "\n";
}

print_url("file://root/a");
print_url("file:///root/a");
print_url("file:root/a");
print_url("file:/root/a");

$ perl bpo34276.pl
original uri file://root/a
returned uri file://root/a
original uri file:///root/a
returned uri file:///root/a
original uri file:root/a
returned uri file:root/a
original uri file:/root/a
returned uri file:/root/a


Thanks

--

___
Python tracker 

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



[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Martin Panter

Martin Panter  added the comment:

This may be a very old regression (from 2002) caused by Issue 591713 and 
Mercurial rev. 554f975073a0. The original check for the double slash, added in 
0d6bd391acd8, “escapes” a path beginning with a double slash by prefixing it 
with two more slashes (empty “netloc”). This should round-trip Chris’s problem 
URLs.

I think the logic in “urlsplit” should always add the extra double slash for 
the netloc, regardless of path, at least if a scheme is present and it is 
registered in “uses_netloc”. This should fix Chris’s instance of the bug, since 
“file:” is registered. There is already a patch in Issue 1722348 which should 
do this (although it includes other changes as well).

The double slash should also be escaped if no scheme is present. (The empty 
scheme string is already in “uses_netloc”.) This might satisfy Issue 23505.

IMO it would be better to do the escaping by default, for all schemes unknown 
to “urllib”, and to blacklist specific schemes like “mailto:” instead. But that 
would be out of scope for a bug fix.

--
nosy: +martin.panter

___
Python tracker 

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



[issue23505] Urlparse insufficient validation leads to open redirect

2018-07-30 Thread Martin Panter

Martin Panter  added the comment:

Issue 34276 was opened about a similar case for “file:” URLs. I believe both 
“file:” scheme and no-scheme cases are a regression and could be fixed by 
adding another pair of slashes (an empty “netloc” part):

>>> urlparse("foo.com")  # No change
ParseResult(scheme='', netloc='', path='//foo.com', params='', query='', 
fragment='')
>>> urlunparse(_)  # Knows to escape slashes with another double-slash
'foo.com'

--

___
Python tracker 

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



[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2018-07-30 Thread Martin Panter

Martin Panter  added the comment:

In Issue 34276 I suggested a fix to “urlunsplit”. In this case it would send 
“Location: www.python.org/%2f../", with an extra pair of slashes denoting 
an empty host name. This should stop a browser from seeing “www.python.org” as 
a host name.

--

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-07-30 Thread EV


EV  added the comment:

I have an issue with the assumption that if all parameters are forced to be 
prepended by -- instead of only one dash, that you would then convert the -- to 
a single dash and have issues with single-dashed strings, when all other 
parameters are dual-dashed. This is especially crazy if the user specifies that 
prefix_chars="--" when creating the parser! You wouldn't mix up ** with * just 
because it's a two char string, so why do this for -- in this day and age when 
parameters can take on very different and complicated structures?!

--
nosy: +fennec15

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-07-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

FTR, here "fixed point" refers to the output representation (a decimal string) 
rather than the input (a floating-point binary value). The output of %f gives a 
*fixed* number of places after the decimal point (6 by default).

Contrast with %e, which gives a floating-point output representation.

But yes, there are probably less confusing ways to word this. Did you have a 
particular alternative wording in mind?

Here's the behaviour of %f for different scale values: note that the output 
always has the same number of digits after the point, but the number of 
significant digits varies.

>>> "%f" % math.pi
'3.141593'
>>> "%f" % (100.0 * math.pi)
'314.159265'
>>> "%f" % (0.01 * math.pi)
'0.031416'

And here's %e. Now it's the other way around: the number of significant digits 
stays the same, but the exponent changes to reflect the magnitude.

>>> "%e" % math.pi
'3.141593e+00'
>>> "%e" % (100 * math.pi)
'3.141593e+02'
>>> "%e" % (0.01 * math.pi)
'3.141593e-02'

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue34258] Python shell keeps restarting

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Again, that RESTART line is NOT an error.  IDLE's prompt is not displayed until 
your program is completely done.  It initially pauses on the second line 'check 
= input()', waiting for user input.

Start with a one-line file:

print('Hello to my game')

Run that and you will see the prompt.

--

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-07-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8079

___
Python tracker 

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



[issue34282] Enum._convert shadows members named _convert

2018-07-30 Thread orlnub123


Change by orlnub123 :


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

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 8567 moves argument parsing tests from test_capi to test_getargs2.

It also makes tests defined in _testcapi more discoverable. Now you can run 
"./python -m test -v -m test_buildvalue_N test_capi".

--

___
Python tracker 

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



[issue34282] Enum._convert shadows members named _convert

2018-07-30 Thread orlnub123


New submission from orlnub123 :

If an enum has a member named _convert it gets shadowed by the _convert method 
as shown below.

>>> import enum
>>>
>>> class Test(enum.Enum):
... _convert = enum.auto()
...
>>> Test._convert
>

I've came up with a couple of solutions:

1. Add _convert to the invalid names list, next to mro
2. Rename _convert to _convert_ as sunder names are reserved
3. Move _convert to the metaclass

I think the first solution would be the worst as it would break existing enums 
that have _convert as a member (although unusable).

The problem with the second solution would be breaking external code that uses 
it although I think that's a moot point as it's meant for internal use. Another 
shortcoming would be having to update all the stdlib code that uses it.

The third solution might be a bit confusing on its own if an existing enum with 
a _convert member suddenly removed it leaving you with a bound method instead 
of raising an AttributeError.

--
components: Library (Lib)
messages: 322681
nosy: ethan.furman, orlnub123
priority: normal
severity: normal
status: open
title: Enum._convert shadows members named _convert
type: behavior
versions: 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



[issue34283] [Windows] Python 2 mishandles console code page after setlocale

2018-07-30 Thread Segev Finer


Change by Segev Finer :


--
title: Python 2 mishandles console code page after setlocale -> [Windows] 
Python 2 mishandles console code page after setlocale

___
Python tracker 

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



[issue34283] Python 2 mishandles console code page after setlocale

2018-07-30 Thread Segev Finer

New submission from Segev Finer :

Found by trying to use pip: https://github.com/pypa/pip/issues/5665.

This is likely affected by the console code page.

Python version: 2.7.15 64 bit
OS: Windows 10.0.17134.165 x64
The console locale is set to cp872.
The console font is consolas.

Apparently, msvcrt does charset conversion when writing to its file descriptors 
based on the set locale! and it's even special cased to handle the OEM console 
code page (You can see this in crt/src/write.c:_write_nolock if you have MSVC 
2008).

When the "C" locale is set, no conversion is done. Python encodes to the OEM 
code page, and it passes through to the console unscathed. But once you do 
setlocale than the CRT expects you to use the ANSI code page, but Python will 
be encoding to the OEM code page which will result in this error from fwrite.

file.encoding in Python 2 is also not settable directly from Python (C API 
only), it's only used for stdio and set internally on startup: 
Python/pythonrun.c:349-378.

I found this describing this: Why printf can display non-ASCII characters when 
“C” locale is used?.

#!/usr/bin/env python2
from __future__ import print_function
import locale

print(u' |\u2588')  # Works
locale.setlocale(locale.LC_ALL, '')
print(u' |\u2588')  # IOError: [Errno 42] Illegal byte sequence

--
components: Windows
messages: 322683
nosy: Segev Finer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 2 mishandles console code page after setlocale
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no test have been executed?

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do we need to output OK and SUCCESS many times? I would prefer shorter and 
totally different from the normal output in case of no tests ran.

--

___
Python tracker 

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



[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2018-07-30 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2018-07-30 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-07-30 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 9045199c5aaeac9b52537581be127d999b5944ee by Andrew Svetlov 
(twisteroid ambassador) in branch 'master':
bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)
https://github.com/python/cpython/commit/9045199c5aaeac9b52537581be127d999b5944ee


--

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8082

___
Python tracker 

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



[issue24809] Add getprotobynumber to socket module

2018-07-30 Thread Brian Haley


Brian Haley  added the comment:

Any chance this will get accepted?  I actually have a use case in Openstack 
where we might get a protocol number and want to save the name along with it.  
Right now we're looking at using libc getprotoent() directly which isn't that 
pretty.  Thanks!

--
nosy: +brianphaley

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread ppperry


New submission from ppperry :

> type(sys.flags).__new__(type(sys.flags))
Traceback (most recent call last):
  File "", line 1, in 
type(sys.flags).__new__(type(sys.flags))
TypeError: tuple.__new__(sys.flags) is not safe, use sys.flags.__new__()

Ignoring the confusion caused by both the type and the instance being called 
"sys.flags", this error doesn't make sense. I am using "sys.flags" (the 
type).__new__, so why is it complaining?

"type(sys.flags)()" produces the standard "non-instantiable type" error. 

The same behavior also happens for "sys.version_info", but strangely not for 
any of the other sys constants.

--
components: Interpreter Core, Library (Lib)
messages: 322688
nosy: ppperry
priority: normal
severity: normal
status: open
title: Nonsensical exception message when calling `__new__` on some sys objects
type: behavior
versions: 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



[issue33833] ProactorEventLoop raises AssertionError

2018-07-30 Thread miss-islington


miss-islington  added the comment:


New changeset d5c75be55504fae1ff510eed66cddbd27bfbdbe2 by Miss Islington (bot) 
in branch '3.7':
bpo-33833: Fix ProactorSocketTransport AssertionError (GH-7893)
https://github.com/python/cpython/commit/d5c75be55504fae1ff510eed66cddbd27bfbdbe2


--
nosy: +miss-islington

___
Python tracker 

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



[issue34283] [Windows] Python 2 mishandles console code page after setlocale

2018-07-30 Thread Steve Dower


Steve Dower  added the comment:

I have no intention of changing how encodings work in 2.7. Use codecs.open if 
you want to specify text IO encoding.

Someone else may be willing to look at it.

--

___
Python tracker 

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



[issue34283] [Windows] Python 2 mishandles console code page after setlocale

2018-07-30 Thread Steve Dower


Change by Steve Dower :


--
nosy:  -steve.dower

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-07-30 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
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



[issue34258] Python shell keeps restarting

2018-07-30 Thread Aleksa Bulatovic


Aleksa Bulatovic  added the comment:

Thanks Terry J. ReedyTerry.

--

___
Python tracker 

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



[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray


R. David Murray  added the comment:

I don't see you asserting utf8=True in your example, so I don't see what it has 
to do with the utf8 flag, since that is False by default.

Maybe you are running up against the default value of refold_header, which is 
'long'?

--

___
Python tracker 

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



[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan


Bryce Drennan  added the comment:

Yes, utf8 is set to false. Despite that, the dkim-signature header, which 
contains no unicode characters, is getting filled with ?utf-8?q? values.

My reading of the documentation of the utf8 flag is that headers should not be 
encoded like this if its set to False.  Its possible I am misunderstanding.

--

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-07-30 Thread STINNER Victor


STINNER Victor  added the comment:

Why not fixing Python 3.6? It is not affected?

--

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

I'm trying to do something about this. Let me know if you have some ideas.

--
nosy: +Vadim Pushtaev

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Here is what I learned:

1) Nothing is wrong with that "tuple.__new__(sys.flags) is not safe" part. 
`__new__` is deleted from `type(sys.flags)`, so parent's `__new__` is called. 
`tuple` is indeed a base class for `type(sys.flags)`.

2) Another part where we recommend to use "sys.flags.__new__()" doesn't make 
much sense, so I choose to delete this advice if there is no `__new__` in a 
class.

3) This second part also may suggest a wrong class to call `__new__` from:


In [1]: from collections import namedtuple

In [2]: class A(namedtuple('A', 'z')):
   ...: pass
   ...:

In [3]: object.__new__(A)
---
TypeError Traceback (most recent call last)
 in ()
> 1 object.__new__(A)

TypeError: object.__new__(A) is not safe, use tuple.__new__()


This should be A.__new__(), not tuple.__new__().

--

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


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

___
Python tracker 

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



[issue34275] Problems with tkinter and tk8.6 on MacOS

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Two more pieces of evidence that there is a problem with tkinter/tk8.6 on Mac.  
On #34120, Vlad T. confirmed the misbehavior on 3.5 compiled for 8.6.  #34281 
reports another problem with an editor subwindow on 3.7 Mac.

There are now 4 issues about some IDLE feature failing specifically on MacOS 
with tcl/tk 8.6.8.  (All but 1 with 3.7.0.)
#34047: editor scrollbar slider 'sticks' at bottom
#34120: freeze when closing config and about dialogs
#34281: (new today) wrong window activates when closing "Go to Line" box
#34275: (this issue) calltips do not appear

The editor scrollbar was touched last May.  The config and about dialogs 
contents were edited last summer.  But the calltip and and goto code is 
essentially untouched for 2 years.

I am changing the title from 'IDLE: no calltips on MacOS with tk 8.6' and 
adding tkinter as component and Serhiy as Nosy.

I have never used a Mac, but I have available a 2012 MacBook Air, which I just 
upgraded to current High Sierra 10.13.6.  I intend to install 3.7, confirm the 
bugs, and try to find simpler failing examples.  But I cannot patch _tkinter, 
let alone tcl/tk.

--
assignee: terry.reedy -> 
components: +Tkinter
nosy: +serhiy.storchaka
title: IDLE: no calltips on MacOS with tk 8.6 -> Problems with tkinter and 
tk8.6 on MacOS

___
Python tracker 

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



[issue34281] IDLE: closing "Go to Line" on OS X 3.7 activates wrong window

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I suspect that this results from a problem with the new tkinter/tcl/tk8.6 
delivered with 3.7.  See #34275.

--
dependencies: +Problems with tkinter and tk8.6 on MacOS
title: "Go to Line" broken on OS X -> IDLE: closing "Go to Line" on OS X 3.7 
activates wrong window

___
Python tracker 

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



[issue34120] IDLE: Freeze when closing Settings (& About) dialog on MacOS

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks.  This is evidence for my suspicion that this results from a problem 
with the new tkinter/tcl/tk8.6 delivered with 3.7.  See #34275.

PS: when replying by email, please delete the quote, which is redundant with 
the post on the web page.

--
dependencies: +Problems with tkinter and tk8.6 on MacOS

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread ppperry


ppperry  added the comment:

Your PR is not an improvement:
1. In this case, this will produce the error "tuple.__new__(sys.flags) is not 
safe". But I didn't call "tuple.__new__", I called sys.flags.__new__, and 
type(X).__new__(type(X)) should always be safe
2. The change in error message for namedtuples (A) isn't related and (B) isn't 
correct. `tuple.__new__(NamedTuple)` works, and produces a namedtuple object, 
so tuple.__new__ is what the error should point to.

--

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable object

2018-07-30 Thread ppperry


ppperry  added the comment:

Same thing happens for other objects, like 
`type(sys._getframe(0)).__new__(type(sys._getframe_))`, and presumably any 
object that one cannot instantiate by calling

--
title: Nonsensical exception message when calling `__new__` on some sys objects 
-> Nonsensical exception message when calling `__new__` on non-instaniable 
object

___
Python tracker 

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



[issue34285] regrtest: in case of test failure, add "always look on the bright side of life"

2018-07-30 Thread STINNER Victor


New submission from STINNER Victor :

Debugging tests failures can be depressing, especially when working on race 
conditions of Python buildbots. I propose to add an easter egg in regrtest for 
that: in case of test of failure, write "Tests failed but... always look on the 
bring side of life".

This idea should be credited to Pablo Salgado!

Would it be possible to also play the song in background? Or maybe that's too 
much.

Maybe it should be a command line option? 
--always-look-on-the-bright-side-of-life, enabled by make buildbot?

--
components: Tests
messages: 322701
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: regrtest: in case of test failure, add "always look on the bright side 
of life"
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



[issue34047] IDLE: on macOS, scroll slider 'sticks' at bottom of file

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Re-reading, I notice this from Tal: "With Python 3.6.5 on OSX, I'm seeing all 
of the issues ...".  3.6.5 was released 2018 March 28, *before* we revised 
editor scrolling in May.  What tk version?  Was the new 8.6 compile even 
available for that?

--

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

> 1. In this case, this will produce the error "tuple.__new__(sys.flags) is not 
> safe". But I didn't call "tuple.__new__", I called sys.flags.__new__, and 
> type(X).__new__(type(X)) should always be safe

Should it? There is no sys.flags.__new__, tuple.__new__ is called and it has 
different __new__.

> 2. The change in error message for namedtuples (A) isn't related and (B) 
> isn't correct. `tuple.__new__(NamedTuple)` works, and produces a namedtuple 
> object, so tuple.__new__ is what the error should point to.

I believe you are right about (A), it's not related and should be discussed 
separately.

--
title: Nonsensical exception message when calling `__new__` on non-instaniable 
object -> Nonsensical exception message when calling `__new__` on some sys 
objects

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-07-30 Thread ppperry


ppperry  added the comment:

The error I'm expecting here is "cannot create sys.flags objects". Anything 
else violates the fact that type(*args) is sugar for:

result = type.__new__(type, *args)
if isinstance(result, type):
result.__init__(*args)

("type" in the above snippet is a variable name, not the actual builtin "type")

--
title: Nonsensical exception message when calling `__new__` on some sys objects 
-> Nonsensical exception message when calling `__new__` on non-instaniable 
objects

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-07-30 Thread ppperry


ppperry  added the comment:

Thus, I think the bug is that "type(sys.flags).__new__" is an alias for 
"tuple.__new__" and is not in the code for __new__ calls that your PR touches.

--

___
Python tracker 

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



[issue34282] Enum._convert shadows members named _convert

2018-07-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

ISTM it would be better to keep METH_NOARGS as-is and if you need another 
argument, then use a different calling pattern.  The METH_NOARGS flag is very 
old and widely adopted -- it is unknowable how changing the assumptions will 
affect deployed code.  Also, it just feels weird to go down the proposed path 
-- for clarity, METH_NOARGS should mean "no args" -- any other meaning is 
certain to create confusion.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray

R. David Murray  added the comment:

You are indeed misunderstanding.  The docs say:

If False, follow RFC 5322, supporting non-ASCII characters in headers by 
encoding them as “encoded words”. If True, follow RFC 6532 and use utf-8 
encoding for headers. Messages formatted in this way may be passed to SMTP 
servers that support the SMTPUTF8 extension (RFC 6531).

That is, when the flag is False, encoded words may be used, which is what the 
=?utf-8?q??= constructs are.  If it is True, those are *not* used, but 
instead utf8 character encoding is used, which would look on your terminal like 
the international characters themselves, not encoded stuff.

So, what you are seeing is the DKIM header getting re-encoded using encoded 
words in order to make it fit in the standard line length for email headers (78 
characters max).  The fact that that wasn't happening before was actually a bug 
in the folder that was fixed by the changeset you cite.

You can get the behavior you want by setting the policy control 'refold_source' 
to 'none', or changing max_line_length to some value larger than you expect 
DKIM headers to be (or to None, which means don't fold).

If the standard DKIM headers really are not respecting the standard default 
email header line length, that is a very sad thing.

I think perhaps the default value of refold_source was a poor choice, and we 
should have gone with none.  Changing that could be discussed, but since it 
changes behavior it may be controversial.

--

___
Python tracker 

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



[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan


Bryce Drennan  added the comment:

That makes sense. Apologies for my misreading. Thanks for taking time to 
explain that. 

I think there is still something strange here since it's unnecessarily using 
encoded words when it could just "fold" without them. My tests with gmail show 
that it accepts a multi-line dkim-signature headers but does not handle the 
encoded words syntax.

While not python's job to maintain compatibility with gmail, I suspect many 
DKIM implementations don't expect encoded words syntax and thus this change 
could cause many email handling systems to break.

I'll dig in more and open a separate ticket. Thank you again for your time.

--
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



[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray


R. David Murray  added the comment:

Well, it can't fold them and have them fit in the 78 character limit without 
adding whitespace that isn't in the original headers (unless there's a more 
subtle bug :)

The email package has the possibility of having special behavior based on the 
name of the header, so if DKIM headers have special rules, there is the 
possibility of implementing those special rules.  Basically, you can implement 
a parser that recognizes dkim headers and represents what parts can legally be 
folded using the resulting parse tree.  So it may be possible to fix this 
without changing the refold_source default.  It is also possible to specify 
that encoded words may not be used in a given header (that's a simple toggle), 
which may be all that is needed here.

--

___
Python tracker 

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



[issue34281] IDLE: closing "Go to Line" on OS X 3.7 activates wrong window

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After doing some experiments, I decided that this is the same issue with a 
different window.

--
dependencies:  -Problems with tkinter and tk8.6 on MacOS
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE: Freeze when closing Settings (& About) dialog on MacOS

___
Python tracker 

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



[issue34275] Problems with tkinter and tk8.6 on MacOS

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With 64 bit 3.7.0, I verified multiple problems.  Calltips do not display 
either automatically or manually with ^B or menu selection.  I closed #34281 in 
favor of #34120 and will report there and on #34047.

--

___
Python tracker 

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



[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan


Bryce Drennan  added the comment:

As far as I can tell in my manual tests with gmail, extra whitespace is fine.  
The addition of `=?utf-8?q?` is what trips both gmail and the python dkim 
library up.

I agree that the paths you propose are viable.  For now my email projects will 
be pinned to 3.6.3.  

If I find time, the new ticket will perhaps focus just on being able to "fold" 
without the encoded-words syntax.

--

___
Python tracker 

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



[issue34286] lib2to3 tests fail on the 3.7 branch (used to work with 3.7.0)

2018-07-30 Thread Matthias Klose


New submission from Matthias Klose :

running the lib2to3 tests from an installed location, I see the following 
failures on the 3.7 branch:

==
FAIL: test (lib2to3.tests.test_fixers.Test_reload)
--
Traceback (most recent call last):
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 294, in test
self.check(b, a)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 36, in check
tree = self._check(before, after)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 32, in _check
self.assertEqual(after, str(tree))
AssertionError: 'import importlib\nimportlib.reload(a)\n\n' != 'import 
imp\nimp.reload(a)\n\n'
- import importlib
?   --
+ import imp
- importlib.reload(a)
?--
+ imp.reload(a)
  


==
FAIL: test_comment (lib2to3.tests.test_fixers.Test_reload)
--
Traceback (most recent call last):
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 299, in 
test_comment
self.check(b, a)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 36, in check
tree = self._check(before, after)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 32, in _check
self.assertEqual(after, str(tree))
AssertionError: 'import importlib\nimportlib.reload( a ) # comment\n\n' != 
'import imp\nimp.reload( a ) # comment\n\n'
- import importlib
?   --
+ import imp
- importlib.reload( a ) # comment
?--
+ imp.reload( a ) # comment
  


==
FAIL: test_space (lib2to3.tests.test_fixers.Test_reload)
--
Traceback (most recent call last):
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 309, in 
test_space
self.check(b, a)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 36, in check
tree = self._check(before, after)
  File "/usr/lib/python3.7/lib2to3/tests/test_fixers.py", line 32, in _check
self.assertEqual(after, str(tree))
AssertionError: 'import importlib\nimportlib.reload( a )\n\n' != 'import 
imp\nimp.reload( a )\n\n'
- import importlib
?   --
+ import imp
- importlib.reload( a )
?--
+ imp.reload( a )
  


--
Ran 650 tests in 27.363s

FAILED (failures=3)
test test_lib2to3 failed
1 test failed again:
test_lib2to3

== Tests result: FAILURE then FAILURE ==

390 tests OK.

1 test failed:
test_lib2to3

--
components: Library (Lib)
keywords: 3.7regression
messages: 322714
nosy: brett.cannon, doko, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: lib2to3 tests fail on the 3.7 branch (used to work with 3.7.0)

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-07-30 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy: +koobs
title: test_cmd_line test_utf8_mode test_warnings fail in AMD64 FreeBSD CURRENT 
buildbots -> test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x 
(3.8) buildbots

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue31506.

--
nosy: +ncoghlan, serhiy.storchaka

___
Python tracker 

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



[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Thanks for all the extra info. A couple more comments:

1. I came across this issue when diagnosing the following pip issue ("pip 
install git+file://" not working for Windows UNC paths):
https://github.com/pypa/pip/issues/3783

2. URLs of the form "file:root" (with four or more leading slashes) are 
perhaps not valid URI's technically. See Section 3. "Syntax Components" of RFC 
3986, where it says, "When authority [i.e. netloc] is not present, the path 
cannot begin with two slash characters ('//')":
https://tools.ietf.org/html/rfc3986#section-3

However, I don't think that means Python shouldn't try to roundtrip it 
successfully. Also, git-clone is apparently okay with URLs of this form, and 
does the right thing with them.

--

___
Python tracker 

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



[issue34120] IDLE: Freeze when closing Settings (& About) dialog on MacOS

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I closed #34281 as a duplicate of this.  Eric Martin said "After entering a 
line number, clicking OK brings to the foreground and makes active the first 
hidden window (in the simplest case where we have just one window for a .py 
file and the Shell window, the former being in the foreground, clicking OK 
brings the Shell window to the foreground)."

Normally, one window is active, as indicated by the traffic lights, and one 
widget has the focus, which for entry widgets is indicated by the cursor.  I 
tested with 3.7.0 with MacOS 10.13.6 and a shell and editor window.

IDLE > About IDLE: closing either way turns lights on in original window but 
text does not get focus (no cursor).  Neither TAB nor click return focus, but 
the window is not frozen either.  Selection, deselection, and copy work, cut 
and paste do not.

As far as I know, on Mac, cut and paste as well as copy and selection are 
handled entirely by tk, and not IDLE.  My interpretation is that the window is 
'stuck' in an 'illegal' state, partly enabled, partly disabled.  Clicking and 
activating the other window disables the stuck window, so that clicking on it 
enables it.

IDLE > Settings works the same.  But...

Options > Configure IDLE works as Eric described above.  Closing with OK or 
Cancel or Red light activates the *other* window, in a stuck state.
(If there is no other IDLE window, then something else must be clicked to 
unstick the originally active window.)

Edit > Go to line: If one cancels, behavior is normal.  If one enters a number 
and clicks OK, the other window is activated (lights on) without a cursor while 
the cursor goes where requested in the original, apparently 'inactive' window.  
And keyboard input goes where the cursor is, in that unlighted window.  AFAIK, 
this is 'impossible'.

--
nosy: +eamartin, serhiy.storchaka

___
Python tracker 

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



[issue34120] IDLE: Freeze when closing Settings (& About) dialog on MacOS

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After more experiments on Windows, the 'stuck' window -- active, no cursor, 
only copy works -- is a read-only window.  I looked at other windows.

Modal
Edit > Find (Command F)
Edit > Replace (Command R)
When closed, neither window is activated. This seems wrong (on Windows, the 
original is), but I don't know what normal is on Linux or Mac.

Options > Settings > Keys Tab > Get New Keys for Selection: When this is 
closed, the text window rather than the settings dialog is activated in 
read-only state.  Must click on Settings dialog.  New selections does appear in 
keys list.

Options > Settings > Highlights > Choose Color for: When closed, all blue 
highlights on tab disappear.  Colorchooser is supplied by tk and might be from 
Apple.

File > Save (Copy) As: This OS supplied dialog is an oddball.  Only the red 
light turns gray and cursor remains without blinking.  The dialog has no lights 
and closed it turns the red back on and the cursor blinks.

Non-modal
Help > IDLE Help
Debug > Debugger
Debug > Stack Viewer
Help > Turtle Demo
When closed, last active other window is activated.

Conclusion: With the exception of Save and cancelled Goto, closing modal 
dialogs seems bugged in various ways.

--

___
Python tracker 

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



[issue34047] IDLE: on macOS, scroll slider 'sticks' at bottom of file

2018-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.7.0 on 10.13.6: Vertical cursor sticks at both ends.  Sticking at the top 
also is Tal's observation 1 above.  I also verified dead zone under slider and 
always down with 2-finger swipe, and that this is not normal Mac behavior.

--

___
Python tracker 

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



[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2018-07-30 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Stefan Behnel


Stefan Behnel  added the comment:

Agree with Raymond. If the goal is to pass something else, then functions that 
want to make use of that "something else" have to be modified anyway, in which 
case also changing the call type wouldn't hurt (assuming the new value still 
fits into the flag options, but it should).

Only drawback is that adding a new calling convention breaks *calling* code 
that does not go through the C-API for calling functions, or that otherwise 
makes direct use of the calling convention flags. But that should be very rare 
and I think it's acceptable to require such code to be adapted. It would very 
likely be amongst the beneficiaries of the proposed calling changes anyway.

--
nosy: +scoder

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset c48e26dcadbff8620bb5881d3bd148fc8894d0ef by INADA Naoki in branch 
'master':
bpo-27671: Update FAQ about why len is function (GH-8432)
https://github.com/python/cpython/commit/c48e26dcadbff8620bb5881d3bd148fc8894d0ef


--

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8085

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8086

___
Python tracker 

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



[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Martin Panter


Martin Panter  added the comment:

I think your URLs are valid by RFC 3986. "When authority is not present" refers 
to URLs without the double-slash prefix, like the 
"urn:example:animal:ferret:nose". The RFC treats empty authority and no 
authority as different cases. If authority is present, the format for hier-part 
has to be

"//" authority path-abempty

Authority may be an empty string:

authority = [userinfo "@"] host [":" port]
host = IP-literal / IPv4address / reg-name
reg-name = *(unreserved / pct-encoded / sub-delims)  ; May be empty

Path-abempty may begin with two slashes if the first two segments are empty 
strings:

path-abempty = *("/" segment)
segment = *pchar  ; May be empty

--

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8087

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


miss-islington  added the comment:


New changeset a621f406402e05febb302cf31962e9d2d747d8f6 by Miss Islington (bot) 
in branch '3.7':
bpo-27671: Update FAQ about why len is function (GH-8432)
https://github.com/python/cpython/commit/a621f406402e05febb302cf31962e9d2d747d8f6


--
nosy: +miss-islington

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


miss-islington  added the comment:


New changeset 0b376eb0d63e0c51ed55c620b40edae6ded4ea48 by Miss Islington (bot) 
in branch '3.6':
bpo-27671: Update FAQ about why len is function (GH-8432)
https://github.com/python/cpython/commit/0b376eb0d63e0c51ed55c620b40edae6ded4ea48


--

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-30 Thread miss-islington


miss-islington  added the comment:


New changeset dc9039da239ee572eaaf56e4a026be1fc4d74e24 by Miss Islington (bot) 
in branch '2.7':
bpo-27671: Update FAQ about why len is function (GH-8432)
https://github.com/python/cpython/commit/dc9039da239ee572eaaf56e4a026be1fc4d74e24


--

___
Python tracker 

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



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
https://github.com/python/cpython/commit/48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202


--

___
Python tracker 

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



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2018-07-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue34275] Problems with tkinter and tk8.6 on MacOS

2018-07-30 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

https://core.tcl.tk/tk/tktview/769367b4c9b8e4fc05afaf67dc0aa6e3c1dba682 is an 
Tcl/Tk issue about issue34275, which is also about Tooltips. 

I've added a comment to the Tk issue to note that IDLE also has problems (the 
other ticket is about a 3th-party library).

--

___
Python tracker 

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



[issue1764286] inspect.getsource does not work with decorated functions

2018-07-30 Thread Eric Wieser


Eric Wieser  added the comment:

This now leaves `inspect.getsource` inconsistent with `inspect.getsourcefile`:

>>> import inspect
>>> from contextlib import contextmanager

>>> @contextmanager
... def func():
...yield

>>> inspect.getsource(func)
'@contextmanager\ndef func():\nyield\n'
>>>inspect.getsourcefile(func)
'C:\\Program Files\\Python 3.5\\lib\\contextlib.py'

Should `getsourcefile` be changed to match?

This is causing numpy/numpy#11639, but it's not clear if this is a bug or by 
design.

--
nosy: +Eric.Wieser

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ac20e0f98d6727ba97a9575bfa2a11b2f6247c35 by Serhiy Storchaka in 
branch 'master':
bpo-1617161: Make the hash and equality of methods not depending on the value 
of self. (GH-7848)
https://github.com/python/cpython/commit/ac20e0f98d6727ba97a9575bfa2a11b2f6247c35


--

___
Python tracker 

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



[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4b8a7f51da224d1a0ad8159935f78ba4e6e16037 by Serhiy Storchaka in 
branch 'master':
 Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a 
generator expression (GH-3771)" (#8241)
https://github.com/python/cpython/commit/4b8a7f51da224d1a0ad8159935f78ba4e6e16037


--

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8088

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4b8a7f51da224d1a0ad8159935f78ba4e6e16037 by Serhiy Storchaka in 
branch 'master':
 Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a 
generator expression (GH-3771)" (#8241)
https://github.com/python/cpython/commit/4b8a7f51da224d1a0ad8159935f78ba4e6e16037


--
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



[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2018-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8089

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-07-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



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

2018-07-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f1d36d8efaecd5c84cb35e35119b283f37d83c40 by Serhiy Storchaka in 
branch 'master':
bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)
https://github.com/python/cpython/commit/f1d36d8efaecd5c84cb35e35119b283f37d83c40


--

___
Python tracker 

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



  1   2   >