[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Given that Steve  has not found anything useful in the logs, I agree.  In any 
case, the 3.7.0a4 installer has be superceded by multiple installers, including 
finally, 3.7.0.  Anyone wanting 3.7 now should use that (and report problems 
with the same).

By the way, we appreciate people following up and given feedback on our 
responses, so we can learn too.

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



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

2018-08-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8121

___
Python tracker 

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



[issue34312] Allow str.endswith and str.startswith to accept an iterable

2018-08-01 Thread Tal Einat


Change by Tal Einat :


--
nosy: +taleinat

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-08-01 Thread Tal Einat


Tal Einat  added the comment:

After reading everything here, I'm not sure there's anything wrong or to be 
improved with Python's Windows installers in this regard.  All of the 
installation errors reported here appear to be caused by external circumstances 
breaking MSI installation in general.

IMO this should be resolved as "not a bug".

--
nosy: +taleinat

___
Python tracker 

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



[issue34315] Regex not evalauated correctly

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



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

2018-08-01 Thread miss-islington


miss-islington  added the comment:


New changeset d9fc795487f74531ea43760469cc215858d0d908 by Miss Islington (bot) 
in branch '3.7':
bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
https://github.com/python/cpython/commit/d9fc795487f74531ea43760469cc215858d0d908


--
nosy: +miss-islington

___
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-08-01 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +8120

___
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-08-01 Thread Eric Wieser


Eric Wieser  added the comment:

New issue opened at https://bugs.python.org/issue34305, along with a PR linked 
there.

--

___
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-08-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8119

___
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-08-01 Thread Tal Einat


Tal Einat  added the comment:


New changeset 10ea9409ceb5da83cb380b610750551e26561044 by Tal Einat in branch 
'master':
bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
https://github.com/python/cpython/commit/10ea9409ceb5da83cb380b610750551e26561044


--

___
Python tracker 

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



[issue34315] Regex not evalauated correctly

2018-08-01 Thread Raman


New submission from Raman :

Sample code below

import re

regex = 
r'DELETE\s*(?P[a-zA-z_0-9]*)\s*FROM\s*(?P[a-zA-z_0-9]+)\s*([a-zA-Z0-9_]*)\s*(?PWHERE){0,1}(\s.)*?'

test_str = 'DELETE FROM my_table1 t_ WHERE id in (1,2,3)'

matches = re.finditer(regex, test_str, re.MULTILINE)

print([m.groupdict() for m in matches])

Below is the expected output.

[{'table_alias': '', 'table_name': 'my_table1', 'where_statement': 'WHERE'}]

But in Win Server 2012 R2, the output is
[{'table_alias': '', 'table_name': 'mytable1', 'where_statement': None}]

Using 3.7 in Win Server 2012 R2 also the output is not as expected. But in Win 
10 and other linux variants, expected output is obtained.

--
components: Regular Expressions
messages: 322916
nosy: ezio.melotti, mrabarnett, ram, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Regex not evalauated correctly
type: behavior
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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-08-01 Thread chipstuff

chipstuff  added the comment:

Experienced the same issue, this is either Permissions or Antivirus blocking 
Python from being installed.

After uninstall third party AV (avast) and running the following commands to 
update Defender's signature files the installation was completed.


“%PROGRAMFILES%\Windows Defender\MPCMDRUN.exe” -RemoveDefinitions -All

“%PROGRAMFILES%\Windows Defender\MPCMDRUN.exe” -SignatureUpdate

Source: https://appuals.com/

--
nosy: +chipstuff

___
Python tracker 

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



[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton


James Emerton  added the comment:

@rhettinger See #34311 about formatting Decimals using locale.format(). I'd 
like to see the problem fixed in one place or the other.

Also, this is seems relatively straightforward to implement as it's really just 
a combination of the fixed precision 'f' and the locale specific 'n' format 
types.

--

___
Python tracker 

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



[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I would like to see locale() remain somewhat decoupled from the rest of string 
formatting.  IIRC locale() is finicky especially when concurrency is involved.  
I think a best practice is for an app to address locale issues explicitly 
rather than inside string formatting.  I'll defer to those with more experience 
using locale -- I just have a vague recollection of this being an area fraught 
with landmines.

--
nosy: +rhettinger

___
Python tracker 

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



[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

os.walk() and glob.glob() used *only* stat(), opendir() and readdir() syscalls 
(and stat() syscalls dominated). The effect of reducing the number of the 
stat() syscalls is significant. shutil.rmtree() uses also the unlink() syscall. 
Since it is usually cheap (but see issue32453), the benefit still is good, but 
not such large. Actually I had concerns about using scandir() in 
shutil.rmtree().

shutil.copytree() needs to open, read, and write files. This is not so cheap, 
and the benefit of reducing the number of the stat() syscalls is hardly noticed 
in real cases. shutil.copytree() was not converted to using scandir() 
intentionally.

--

___
Python tracker 

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



[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton


James Emerton  added the comment:

So far, I've implemented this for Decimal

--

___
Python tracker 

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



[issue34312] Allow str.endswith and str.startswith to accept an iterable

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have same concerns as Raymond.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34314] Like __hash__, allow setting MyClass.__init__ to None to prevent it being called by type.__call__

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Setting __hash__ to None doesn't do what you think. It doesn't prevent __hash__ 
from being called by hash(), instead it produces a TypeError.

>>> class A: __hash__ = None
... 
>>> hash(A())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'A'

Actually the effect of special casing __hash__ is not raising a TypeError, but 
raising a TypeError with better error message. A TypeError was already raised 
before if set __hash__ to a non-callable. In 2.7:

>>> class A: __hash__ = None
... 
>>> hash(A())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object is not callable


If you want to prevent an inherited __init__ from being called by types's 
__call__, you can define an __init__ with an empty body.

def __init__(self, *args, **kwargs):
pass

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34314] Like __hash__, allow setting MyClass.__init__ to None to prevent it being called by type.__call__

2018-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Right now, you really gotta jump through hoops
> in some cases if you only want to use __new__ 
> and don't care about __init__ 

I'm now sure I see the difficulty. It is easy to define a classes with __new__ 
and without __init__:

>>> class A:
def __new__(cls, *args):
print('New called with', cls, 'and', args)
return object.__new__(cls)

>>> a = A(10, 20, 30)
New called with  and (10, 20, 30)
>>> isinstance(a, A)
True

> Like __hash__, allow setting MyClass.__init__ to None

FWIW, the API for hashing being set-to-None wasn't done because we like it 
(there a numerous downsides). It was done because we needed hashing to be on by 
default and there needed to be a way to turn it off.  The downsides are that it 
confuses users, it is hard to teach and remember, and it adds a branch to 
various APIs which would then need to test for None.  Instead, we prefer the 
pattern of having object() provide a default dummy method that either does 
nothing or gives up (like object.__init__ or the various rich comparison 
methods for object).  This simplifies downstream code than doesn't have to 
check for a rare special case.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue34314] Like __hash__, allow setting MyClass.__init__ to None to prevent it being called by type.__call__

2018-08-01 Thread Dan Snider


New submission from Dan Snider :

Right now, you really gotta jump through hoops in some cases if you only want 
to use __new__ and don't care about __init__ (is there ever a time where you'd 
use both?). The problem originates in type.__call__. I'm attaching a full 
Python implementation of type_call/object_init at the end, but here's a tl;dr 
representation of the issue i type_call (where the whole thing can be basically 
summarized as this):

def type_call(type, *args, **kws):
   r = type.__new__(type, *args, **kws)
   if not issubclass(r, type):
   type(r).__init__(r, *args, **kws)
   return r

So if type(r).__init__ is object.__init__ or some other method with an 
incompatible signature to the metaclass's, errors are raised, which leads to 
having to implement really annoying workarounds. The annoyingness is compounded 
further by the fact that all object_init does is make sure it didn't receive 
any arguments. 

All of that can be avoided by setting __init__ in the class to None, which 
would have the same effect as setting tp_init to NULL on an extension type. 
Perhaps with a caveat that the only current reachable __init__ is 
object.__init__?

I don't really find myself in situations involving the need for __new__ too 
often, but wouldn't this have a profoundly positive impact on pickle as well? 
One thing I can think of is there can be a universal pickle implementation for 
extension types with Py_TPFLAGS_BASETYPE set and a nonzero dict offset since if 
it detected a NULL init all it has to do is memcpy the base struct and pickle 
the instance dict.

Anyway, the C code is pretty easy to understand but here's a Python 
implementation almost exactly equivalent that shows a case where a metaclass 
can be used as a callable that accepts an arbitrary number of arguments instead 
of a forced three and returns a class:


PyType_Type = type
Py_TYPE = type
PyType_IsSubtype = issubclass
PyTuple_Check = tuple.__instancecheck__
PyDict_Check = dict.__instancecheck__
PyDict_GET_SIZE = dict.__len__
PyTUple_GET_SIZE = tuple.__len__

NULL = 0
ALLOW_NULL_INIT = False

def excess_args(args, kws):
return args or kws

class Object:

def __init__(self, *args, **kws):
# object_init literally does nothing but check for zero len args/kws
# (bit of a tangent but why is excess_args not a macro...?)
if ALLOW_NULL_INIT:
return
tp = Py_TYPE(self)
print('Object.__init__, type is:', tp.__name__)
if excess_args(args, kws):
if tp.__init__ is object.__init__:
raise TypeError("object.__init__() takes no arguments")
raise TypeError(f'{tp.__name__}.__init__() takes no arguments')

def fake_init(*args, **kws):
pass

class Type(type):

def __getattribute__(self, attr):
value = type.__getattribute__(self, attr)
if attr == '__init__':
if ALLOW_NULL_INIT and value is None:
return fake_init
return super(type(self).__mro__[1], self).__init__
return value

def __call__(tp, *args, **kws):

if getattr(tp, '__new__', 0) == NULL:
raise TypeError(f"cannot create {tp.__name__} instances")

obj = tp.__new__(tp, *args, **kws)
if (tp is type and
PyTuple_Check(args) and PyTuple_GET_SIZE(args)== 1 and
(kws == NULL or
 (PyDict_Check(kws) and PyDict_GET_SIZE(kws)==0))):
return obj

if not PyType_IsSubtype(Py_TYPE(obj), tp):
return obj

tp = Py_TYPE(obj)

# Here's where the problem is. What could possibly be negatively
# affected by this?
if getattr(tp, '__init__', 0):
res = tp.__init__(obj, *args, **kws)

return obj

def autoname(arg):
return '_'.join(arg.split())

def autobase(opt):
return () if not opt else (opt,)

class MetaBase(Object, type):
pass

class Mixin1:
pass

class Meta(MetaBase, metaclass=Type):

__init__ = None

def __new__(metacls, name, opt=None):
return super().__new__(metacls, autoname(name), autobase(opt), {})

if __name__ == '__main__':
try:
foobar = Meta('foo bar', Mixin1)
except TypeError as er:
print(f'could not make foobar because: {er}')
print('setting ALLOW_NULL_INIT to True;')
ALLOW_NULL_INIT = True
foobar = Meta('foo bar', Mixin1)
print('foobar.__name__ is:', foobar.__name__)
print('foobar__mro__ is:', foobar.__mro__)

--
components: Interpreter Core
messages: 322907
nosy: bup
priority: normal
severity: normal
status: open
title: Like __hash__, allow setting MyClass.__init__ to None to prevent it 
being called by type.__call__
type: enhancement
versions: Python 3.8

___
Python tracker 

___
__

[issue34259] Improve docstring of list.sort

2018-08-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue34312] Allow str.endswith and str.startswith to accept an iterable

2018-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

ISTM that this would encourage silently inefficient coding patterns like:

   url.endswith({'.html', '.txt', '.php'})
   # The set object gets rebuilt on every call
   # and a new set iterator object gets built on every call.
   # Looping over the contents uses the slower iterator protocol
   # rather than the existing superfast PyTuple_GET_SIZE() and
   # PyTuple_GET_ITEM() macros which are entirely in-lined.

Do we have any known use cases or user requests where the existing API doesn't 
suffice?

--
nosy: +rhettinger

___
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 tests have been executed?

2018-08-01 Thread ppperry


Change by ppperry :


--
title: RFC: issue a warning in regrtest when no test have been executed? -> 
RFC: issue a warning in regrtest when no tests have been executed?

___
Python tracker 

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



[issue34259] Improve docstring of list.sort

2018-08-01 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Copying from the sorted built-in's docstring would make sense here, given that 
sorted is implemented in terms of list.sort in the first place.

--
nosy: +josh.r

___
Python tracker 

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



[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton


Change by James Emerton :


--
nosy: +jemerton

___
Python tracker 

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



[issue34311] locale.format() and locale.format_string() cast Decimals to float

2018-08-01 Thread James Emerton


James Emerton  added the comment:

Certainly adding another letter to the format spec would solve my issue and 
would in fact be somewhat preferable to using local.format directly.

I think this could be fixed in the locale module by transforming the format 
spec and using new-style formatting, but I'm not familiar enough with the 
corner cases to know if its practical to cover all the possible cases; 
particularly those coming from format_string().

--

___
Python tracker 

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



[issue34311] locale.format() and locale.format_string() cast Decimals to float

2018-08-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

Would my suggestion in #33731 of adding another letter in the format spec for 
float and decimal.Decimal solve your problem? I guess if you're using 
monetary=True you'd need two additional letters: like 'f' but locale aware, and 
like 'f' but locale aware and monetary=True.  Maybe 'l' and 'L' for these? In 
this case, there would be no changes to the locale module.

I don't see any good way of using new-style formatting without changing 
float.__format__ and decimal.Decimal.__format__.

--
components: +Interpreter Core
type:  -> enhancement
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



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

2018-08-01 Thread Berker Peksag


Berker Peksag  added the comment:

I ran "python3.7 -m test test_lib2to3" in a separate terminal. I don't remember 
the exact location, but I'm sure it wasn't the build location (it was probably 
my home directory)

Is it possible to add some debug print()s inside 
https://github.com/python/cpython/blob/3.7/Lib/lib2to3/tests/support.py#L37 ? 
My only guess is that the test code somehow finds the wrong refactorer.

--

___
Python tracker 

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



[issue34311] locale.format() and locale.format_string() cast Decimals to float

2018-08-01 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2018-08-01 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

I agree the provided benchmark on Linux should be more refined. And I'm not 
sure if "echo 3 | sudo tee /proc/sys/vm/drop_caches" before running it is 
enough honestly.

The main point here is the reduction of stat() syscalls (-38%) and that can 
make a considerable  difference, especially with network filesystems. That's 
basically the reason why scandir() was introduced in the first place and used 
in os.walk() glob.glob() and shutil.rmtree(), so I'm not sure why we should use 
a different rationale for shutil.copytree().

--

___
Python tracker 

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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread Seonggi Kim


Seonggi Kim  added the comment:

I thing so too, it's my fault.

--

___
Python tracker 

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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread ksg97031


Change by ksg97031 :


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

___
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-08-01 Thread Matthias Klose


Matthias Klose  added the comment:

strange. I see it succeeding in the build location, not the install location.  
Did you make sure to cd /tmp before running the test?

I still can reproduce it:

$ python3.7 -m test test_lib2to3
Run tests sequentially
0:00:00 load avg: 0.24 [1/1] test_lib2to3
test test_lib2to3 failed -- multiple errors occurred; run in verbose mode for 
details
test_lib2to3 failed

== Tests result: FAILURE ==

1 test failed:
test_lib2to3

Total duration: 5 sec 211 ms
Tests result: FAILURE

--

___
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-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume then that you tested PR8603 without opening an editor (which is 
certainly possible).

10.13.6 was released in the last month.

PCBuild/build.bat -e downloads missing external dependency source code into 
externals/ and then compiles it into compatible .dlls.  This includes doing 
updates as appropriate. I presume that the source and compilation flags are the 
same as used to make a release. AFAIK, Zach Ware is mainly responsible for the 
current easy-to-use, easy-to-get-right status.

For a stripped-down reporducer, you might start with the files I attached to 
#34047.

--
assignee: terry.reedy -> 
components: +macOS
nosy: +ned.deily, ronaldoussoren -gpolo

___
Python tracker 

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



[issue24255] Replace debuglevel-related logic with logging

2018-08-01 Thread Conrad Ho


Conrad Ho  added the comment:

Hi,

I have referenced the original patch and created an updated patch that uses the 
logging module + f-strings in place of the print statements in the http.client 
module. Also updated the relevant tests for print/logging in test_httplib to 
reflect these changes.

The HTTPHandlerTest testcase from test_logging was also affected. In the 
testcase, it gets a logger with name 'http' and adds a logging.HTTPHandler to 
it. In our patch, we create a http.client logger, which happens to be 
considered a child of this testcase logger under the logger naming hierarchy.

This causes http.client logging events to propagate up to the 'http' logger and 
for the testcase to loop infinitely (ie. the HTTPHandler calls http.client 
functions internally. These functions log events using the http.client logger, 
which propagate up to the testcase http logger which calls HttpHandler again).

I have simply changed the testcase getLogger name to not be 'http' and clash 
with that http.client module logger.

--
nosy: +Conrad Ho
Added file: https://bugs.python.org/file47727/http-client-logging-v2.patch

___
Python tracker 

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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Eric Snow


Eric Snow  added the comment:

Also, PEP 3121 provides a good summary of some of the issues at hand.

--

___
Python tracker 

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-01 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

No, I think this is a bug that deserves fixing, at least in 3.8.

--
versions: +Python 3.8 -Python 2.7, Python 3.5, 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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Eric Snow


Eric Snow  added the comment:

Also, part of the motivation for PEP 489 (extension module initialization) was 
to help with reloading extension modules.

--
nosy: +petr.viktorin

___
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-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Removing 2.7 was unintended, from simultaneous editing.  This is one of the 
exceptional cases where a backport is worth the risk (which seems here 
extremely low).  I will remove it from the PR because auto backport will fail 
because of file renames, in addition to internal changes.  Here are the new 
name to old name translations, where not a just a case change, needed to 
prepare a 2.7 patch.

config_key  keybindingDialog
help_about aboutDialog
query  .  # New in 3.6. Grep 2.7 code for 'grab_set' to find any usages in 
deleted code that query replaced.

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-01 Thread Andrey Vlasovskikh


Andrey Vlasovskikh  added the comment:

I've added a PR with a patch I developed during the EuroPython 2018 sprint.

I've fixed this issue in a way that is more or less consistent with how 
'_thread' threads interact with sys.excepthook, but I haven't added the log 
line they print to sys.stderr about an unhandled exception in a thread:

Unhandled exception in thread started by  at 0x108c840d0>

I can add these messages if they are needed.

I'd like to mention the issue I discussed with Victor Stinner at the sprints 
(adding Victor to the nosy list as he requested). The fix could possibly break 
the de facto contract that has been there for ages that 'theading' threads 
don't invoke sys.excepthook on uncaught exceptions.

If the fact that sys.execepthook doesn't work with threading is considered a 
feature, then an alternative solution could be a new threading-specific hook: 
threading.excepthook.

--
nosy: +vlasovskikh, vstinner

___
Python tracker 

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-01 Thread Andrey Vlasovskikh


Change by Andrey Vlasovskikh :


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



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

2018-08-01 Thread Tal Einat


Tal Einat  added the comment:

Why remove the 2.7 version? This bug occurs with 2.7.15 on macOS.

--

___
Python tracker 

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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Eric Snow


Eric Snow  added the comment:

Ah, thanks for clarifying.  So which of these is the main thing you really want:

1. reload extension modules
2. completely restart Python

It sounds like #1.  If that's the case then there are a number of issues to 
resolve to make it work.  However, there are some serious technical challenges 
to overcome. :/

So if it's #1 the problem space is relatively focused so a solution (if 
possible) would be tractable in the "short" term, so it *could* happen. :)  
However, if it's #2 then a lot of things will have to fixed and so 
realistically it might never happen.

FYI, either way none of it will be backported, so the functionality would not 
be available on Python 3.7 or earlier.

---

FWIW, in VS Code they run their plugins (extensions) in a separate process.  
Their docs give some insight into plugin system design. :)

   
https://code.visualstudio.com/docs/extensionAPI/patterns-and-principles#_stability-extension-isolation

--

___
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-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I wrote the following justification for adding grab_release while Tal was 
revising his PR to make the change.  I will look at the PR now and test on 
Windows.
---

Vlad, I was wondering about modality.  Properly de-modalizing a dialog requires 
more than just removing grab_set.  The parent of a modal dialog is a window 
with a menu, an instance of idlelib.  If a dialog were not modal, its parent 
could be deleted, which would also delete the dialog and any un-saved and 
un-acted-upon data.  This is true of Debugger, whose parent is Shell.  
Duplicate dialogs would also be possible, as is true of IDLE Help, whose parent 
is root, unless explicitly prevented, as is true of Debugger (Shell knows if 
there is a Debugger instance).

Removing modality has been discussed in various places, such as in #24760, 
which focuses on Settings.  If it were de-modalized, its parent should be root 
and only one copy allowed.  Mark Roseman noted on the issue that "because modal 
doesn't fully work on the Mac, you can actually create multiple copies of the 
config dialog!".

So my preferred short-term fix, once confirmed, for 3.7.1, would be the 
addition of grab_release.

Merely removing grab would have to be Mac-specific, and I would expect new 
problems and complaints.  Properly de-modalizing on all platforms, where 
sensible, is a longer-term project.  Notepad++ on Windows, for instance, has a 
non-modal singleton Find dialog (with Replace and Find in Files on separate 
tabs), designed as such, that operates on the 'current' editor tab, unless one 
selects 'Find All in All Open Documents' to work on all of them.

PS: Tal Einat also get 'autorelease pool' errors when trying to run IDLE on 
locally built 3.7.0.

--
dependencies:  -Problems with tkinter and tk8.6 on MacOS
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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +scoder

___
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-08-01 Thread Tal Einat


New submission from Tal Einat :

On macOS 10.13.5 (the latest available) with ActiveTcl 8.6.7 (the latest 
available), I'm building Python from latest master (to be 3.8.0).  I'm 
consistently having IDLE crash almost immediately, just by opening any file for 
editing.  The crash results in the following error:

$ root/bin/python3 -m idlelib
objc[50759]: Invalid or prematurely-freed autorelease pool 0x7fb74091f050.
[1]50759 abort  root/bin/python3 -m idlelib

In issue34120, @vtudorache reported a similar issue (also on macOS).

With Python 3.7.0 from python.org, everything works fine.

Strangely, replacing ActiveTcl with version 8.5.18.0 resolves this issue.

I'm not sure whether this is specific to IDLE; I'll try to provide a minimal 
way to reproduce.

--
assignee: terry.reedy
components: IDLE, Tkinter
messages: 322888
nosy: gpolo, serhiy.storchaka, taleinat, terry.reedy, vtudorache
priority: normal
severity: normal
status: open
title: IDLE crashes with Tk-related error on macOS with ActiveTcl 8.6
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



[issue34312] Allow str.endswith and str.startswith to accept an iterable

2018-08-01 Thread Brett Cannon


New submission from Brett Cannon :

str.endswith() and str.startswith() only takes str or a tuple of str. It might 
be nice to make this str or an iterable of str (and that order must be kept so 
that a string isn't treated as an iterable of length-1 str).

--
components: Interpreter Core
messages: 322887
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Allow str.endswith and str.startswith to accept an iterable
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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread chris


chris  added the comment:

Thanks for your comments and the link to the issue from the year 2000.

> You mention "embedded python interpreter", but it sounds more like you mean 
> "embedded python runtime"

Yes that's right. Sorry for imprecise wording.

> Why is completely resetting Python "a strong requirement"?

Because otherwise, if this is not an option, we need to restart the embedding 
C/C++ application whenever a python module is changed and need to be reloaded. 
This is occurring frequently in our use case and it is the main reason we want 
to embed python for rapid development purposes. (The application itself is a 
development environment for computer vision algorithms, where python is only 
one of multiple interacting, configurable plugins.)

Being forced to restart the whole application on code changes compromises the 
advantage of using a scripting language without edit/compile/link steps to a 
degree which questions the whole idea. I'm not very confident in hacking 
reload(...) stuff in the modules. 

Interestingly enough, our use case matches exactly the one which has been 
described as unlikely in the original issue 
(https://bugs.python.org/issue401713#msg34524): the python runtime is 
dynamically loaded at runtime as a plugin :) I haven't tried it, but I suppose 
that we get the very same issues when we reload the plugin, because the dynamic 
libraries of extension modules are still loaded with an invalid state.

Maybe using processes and some kind of socket / shared memory communication 
would suit our needs better, but this is also much more complicated and 
error-prone to implement than simply embedding python into the main process.

--

___
Python tracker 

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



[issue34311] locale.format() and locale.format_string() cast Decimals to float

2018-08-01 Thread James Emerton


New submission from James Emerton :

We use locale.format('%.2f', x, True) to convert Decimal values to strings for 
display. Unfortunately, the locale module is using %-formatting to generate the 
initial string before applying locale specific formatting. As a result, any 
value which cannot be accurately represented as a float will produce incorrect 
results.

I've built some formatting that uses new-style string formatting (and some 
internal locale functions) which corrects the problem.

Unfortunately, making this change in the locale module would require converting 
the input format string to the new syntax, so '%.2f' would become '{:.2f}'.

See also #33731

--
components: Library (Lib)
messages: 322885
nosy: jemerton
priority: normal
severity: normal
status: open
title: locale.format() and locale.format_string() cast Decimals to float
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



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

2018-08-01 Thread Tal Einat


Change by Tal Einat :


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



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

2018-08-01 Thread Tal Einat


Change by Tal Einat :


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



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

2018-08-01 Thread Tal Einat


Tal Einat  added the comment:

Adding grab_release() calls also resolves the issue. Tested on mac and win.

PR updated with this approach, IMO ready for review.

--

___
Python tracker 

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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Why are we getting multiple tracker items opening and closing for this at the 
same time?  Something odd is happening.  Please don't close the tracker and 
change user ids in the middle of a conversation:

   https://bugs.python.org/issue34298
   https://bugs.python.org/issue34295

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Eric Snow


Eric Snow  added the comment:

Regarding your 3 points:

> a) Py_Finalize cannot be used reliably

Note that unloading extension modules is not the only thing that Py_Finalize 
isn't doing that it probably should be.  I expect that you would find a number 
of memory leaks and potentially cases that crash the process when calling 
Py_Initialize() after Py_Finalize().

As bpo-401713 indicates, calling Py_Initialize/Py_Finalize multiple times isn't 
a well supported pattern.  The docs indicate likewise (see 
https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx).  That said, I'm 
sure everyone agrees that it *should* work and that we should fix issues there 
when we can.  It's mostly a matter of finding folks motivated enough to work on 
it. :)

> b) There is no possibility to reliably reset the python interpreter otherwise

At the level of the interpreter (main or otherwise), the C-API doesn't really 
provide anything like that, though I suppose it could.  However, it's mostly 
simpler to just make a new interpreter.  So I doubt we'd introduce an explicit 
concept of resetting an interpreter.  What would be the advantage?

At the level of the *runtime* the C-API likewise doesn't offer anything for 
reset, other than what you've already tried.  It would really help to 
understand why resetting is needed.

>  (because the sub-interpreters are also not working reliably,
> which is stated in the documentation)

This is something I'm actively working on, including improving isolation 
between interpreters (minimizing global state) and improving the extension 
module experience when using subinterpreters.  The latter is tricky, 
particularly with extension modules that use libraries that have their own C 
globals.

Note that isolation between interpreters will never be perfect.  If you need 
perfect isolation then use multiple processes.  All interpreters in the same 
process will always share the runtime state, as well as process-wide data.

FWIW, even if we were to completely isolate the Python runtime, allowing more 
than one runtime in a process, the runtimes would still share the process-wide 
data.

> c) manually reloading changed modules via importlib.reload is not a
> feasible solution

Yeah, while I suppose it could work for some extensions, I expect it would not 
work for many.

--

___
Python tracker 

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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Eric Snow


Eric Snow  added the comment:

The matter of unloading extension modules is partly covered in bpo-401713.  
However, note that a few things have changed in the last 18 years. :)  I think 
it would be worth revisiting the decision in that issue at this point.

If that were sorted out would there be other issues to address?

Regardless, If I understood right, your only objective here is to completely 
reset Python in the current process to the initial state.  You mention 
"embedded python interpreter", but it sounds more like you mean "embedded 
python runtime" (particularly since you are using Py_Initialize and 
Py_Finalize).  Why is completely resetting Python "a strong requirement"?

--
nosy: +brett.cannon, eric.snow, ncoghlan

___
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-08-01 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

I've checked again the source code in config_key.py, configdialog.py, 
help_about.py, query.py, searchbase.py, textview.py and added a 
self.grab_release() in functions like ok() and cancel() before the call to 
self.destroy() and I see no more lock/focus issues. Maybe the grab was kept in 
the non-existent (destroyed) dialog window, so the click events could not be 
transferred to the pyshell or editor, but, because of a local (not global) 
grab, clicking on another application's window, by losing focus and grab, 
completely freed the event-chain, then clicks in IDLE were correctly received.
Can you confirm if adding the grab_release() calls works for you too (do not 
remove the grab_set() calls!)?

--

___
Python tracker 

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



[issue9372] pulldom.DOMEventStream.__getitem__ is broken

2018-08-01 Thread Berker Peksag


Berker Peksag  added the comment:

I've fixed a bug that uses DOMEventStream.__getitem__ at work today. I've 
opened PR 8609 to deprecate __getitem__ methods of DOMEventStream, FileInput 
and FileWrapper classes.

--
components: +Library (Lib)
nosy: +berker.peksag
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



[issue9372] pulldom.DOMEventStream.__getitem__ is broken

2018-08-01 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +8115

___
Python tracker 

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



[issue34307] NullHandler init refusing arguments

2018-08-01 Thread Vinay Sajip

Vinay Sajip  added the comment:

> I expected it to be a "dummy" handler that might accept any argument

I don't know why you expected that, but your expectation wasn't valid. You will 
need to define your own BaseHandler which handles any arguments passed by your 
logging configuration.

NullHandler's __init__ is inherited from logging.Handler. There are no plans to 
change that. The documentation for it states:

"The NullHandler class, located in the core logging package, does not do any 
formatting or output. It is essentially a ‘no-op’ handler for use by library 
developers."

This does not indicate that it is suitable for use as a base class. If you want 
to use a base class for your handler, use logging.Handler.

--
resolution:  -> rejected
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



[issue34310] Build error with option "--with-pydebug" on Mac OS 10.13.6

2018-08-01 Thread Wu Yu


New submission from Wu Yu :

I'm encountering a build error from the master branch of CPython 
(heads/master-dirty:d17fe275a3) on Mac OS 10.13.6, with "--with-pydebug" turned 
on. 

The error message:

./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Assertion failed: (TYPE(ch) == test || TYPE(ch) == test_nocond || TYPE(ch) == 
star_expr), function seq_for_testlist, file Python/ast.c, line 1205.
/bin/sh: line 1: 34527 Abort trap: 6   ./python.exe -E -S -m sysconfig 
--generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1

--
components: Build
messages: 322877
nosy: wuyu
priority: normal
severity: normal
status: open
title: Build error with option "--with-pydebug" on Mac OS 10.13.6
type: compile error
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



[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread chris


New submission from chris :

I'm linking an issue from numpy here: https://github.com/numpy/numpy/issues/8097

Embedding python suffers from a possibility to reliably reset the state of the 
python interpreter. For my use case, I noticed that when using numpy with 
Py_Initialize() and Py_Finalize():

Py_Initialize()
// call code importing numpy
Py_Finalize()
Py_Initialize()
// call same code again

The above code will result in a crash.

One of the comments in the referenced issue is that Py_Finalize doesn't unload 
loaded DLL's or shared objects. Doing that would probably fix the issues.

As of now, embedding python is fundamentally broken for applications which want 
to embed non-trivial scientific python scripts involving user-adapted python 
code, because

a) Py_Finalize cannot be used reliably
b) There is no possibility to reliably reset the python interpreter otherwise 
(because the sub-interpreters are also not working reliably, which is stated in 
the documentation)
c) manually reloading changed modules via importlib.reload is not a feasible 
solution

The possibility to reset an embedded python interpreter to an initial state is 
a strong requirement for such applications.

--
components: Extension Modules, Interpreter Core
messages: 322876
nosy: christoph.wiedem...@hs-weingarten.de
priority: normal
severity: normal
status: open
title: Embedding Python; Py_Initialize / Py_Finalize cycles
type: crash
versions: Python 3.5

___
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-08-01 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

Adding self.grab_release() in the ok() method for the dialogs BEFORE destroy() 
solved the problem for me, keeping the grab_set() methods in place 
(uncommented, actives).

--

___
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-08-01 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

I can confirm that removing the grab_set() calls fixes the locking. But am I 
the only one to notice that the dialogs aren't modal any more?

--

___
Python tracker 

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



[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

For dropping disc caches on Linux run

with open('/proc/sys/vm/drop_caches', 'ab') as f: f.write(b'3\n')

before every test.

--

___
Python tracker 

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



[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I'm not convinced that this change should be merged. The benefit is small, and 
1) it is only for an artificial set of tiny files, 2) the benchmarking ignores 
the real IO, it measures the work with a cache. When copy real files 
(/usr/include or Lib/) with dropped caches the difference is insignificant. On 
other hand, this optimization makes the code more complex. It can make the case 
with specifying the ignore argument slower.

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-01 Thread STINNER Victor


STINNER Victor  added the comment:

"""
TODO list, open questions:

* Should isolated=1 always imply config->ignore_environment=1 and 
config->user_site_directory = 0?
* Should we rename debug to parser_debug? "debug" is a very generic term, 
whereas this flag is really specific to the parser
* Remove _Py_CheckHashBasedPycsMode: replace it with 
config._check_hash_pycs_mode?
"""

=> DONE!

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80b762f010097ab8137782e5fbdc89c5c620ed4e by Victor Stinner in 
branch 'master':
bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)
https://github.com/python/cpython/commit/80b762f010097ab8137782e5fbdc89c5c620ed4e


--

___
Python tracker 

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



[issue31650] implement PEP 552

2018-08-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80b762f010097ab8137782e5fbdc89c5c620ed4e by Victor Stinner in 
branch 'master':
bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)
https://github.com/python/cpython/commit/80b762f010097ab8137782e5fbdc89c5c620ed4e


--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8114

___
Python tracker 

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



[issue31650] implement PEP 552

2018-08-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8113

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6 by Victor Stinner in 
branch 'master':
bpo-34170: Add Python/coreconfig.c for _PyCoreConfig (GH-8607)
https://github.com/python/cpython/commit/6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6


--

___
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-08-01 Thread Berker Peksag


Berker Peksag  added the comment:

I'm not able to reproduce this:

 ./configure
 make -s -j
 sudo make install
 python3.7 -m test test_lib2to3

 Run tests sequentially
 0:00:00 load avg: 0.86 [1/1] test_lib2to3

 == Tests result: SUCCESS ==

 1 test OK.

 Total duration: 13 sec 456 ms
 Tests result: SUCCESS

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8112

___
Python tracker 

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



[issue34308] shutil.copystat fails in dockered Linux (Debian) on Azure (Windows)

2018-08-01 Thread Chantal Ackermann


New submission from Chantal Ackermann :

root:/media/documents# df -h
FilesystemSize  Used Available Use% Mounted on
overlay  29.0G 24.0G  5.0G  83% /
tmpfs 1.7G 0  1.7G   0% /dev
tmpfs 1.7G 0  1.7G   0% /sys/fs/cgroup
//storage01.file.core.windows.net/kubernetes-dynamic-pvc-526aa3da-6993-11e8-8c6f-0a58ac1f00ad
  1.0G384.0K   1023.6M   0% /media
root:/media/documents# ls -al
insgesamt 267
drwxrwxrwx 2 1000 1000  0 Jul 31 15:29 .
drwxrwxrwx 2 1000 1000  0 Jul 31 15:29 ..
-rwxrwxrwx 1 1000 1000 136479 Jul 31 16:48 orig.pdf
-rwxrwxrwx 1 1000 1000 136479 Jul 31 15:29 testfile
root:/media/documents# lsattr 
--S-c-jI--- ./orig.pdf
--S-c-jI--- ./testfile
root:/media/documents# python
Python 3.6.6 (default, Jul 17 2018, 11:12:33) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copystat('orig.pdf', 'testfile')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.6/shutil.py", line 225, in copystat
_copyxattr(src, dst, follow_symlinks=follow)
  File "/usr/local/lib/python3.6/shutil.py", line 157, in _copyxattr
names = os.listxattr(src, follow_symlinks=follow_symlinks)
OSError: [Errno 38] Function not implemented: 'orig.pdf'
>>> shutil.copystat('orig.pdf', 'testfile', follow_symlinks=False)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.6/shutil.py", line 225, in copystat
_copyxattr(src, dst, follow_symlinks=follow)
  File "/usr/local/lib/python3.6/shutil.py", line 157, in _copyxattr
names = os.listxattr(src, follow_symlinks=follow_symlinks)
OSError: [Errno 38] Function not implemented: 'orig.pdf'
>>> 

shutil.py#164ff:

if hasattr(os, 'listxattr'):
def _copyxattr(src, dst, *, follow_symlinks=True):
try:
names = os.listxattr(src, follow_symlinks=follow_symlinks)
except OSError as e:
if e.errno not in (errno.ENOTSUP, errno.ENODATA):
raise
return

=> This is true inside the docker container. However, calling os.listxattr 
fails with errno.ENOSYS (Error 38).

The documentation states that "copystat() never returns failure."

StackOverflow link: 
https://stackoverflow.com/questions/51616058/shutil-copystat-fails-inside-docker-on-azure#51635427

I can provide a pull request, if it is OK to add errno.ENOSYS to the list of 
ignored errors. (Would be a similar fix to the one provided for 
https://bugs.python.org/issue24564 
(https://github.com/python/cpython/pull/8601).)

--
components: Library (Lib)
messages: 322866
nosy: nuarhu
priority: normal
severity: normal
status: open
title: shutil.copystat fails in dockered Linux (Debian) on Azure (Windows)
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



[issue32752] no information about accessing typing.Generic type arguments

2018-08-01 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> 3.7 is less convenient and less consistent

Taking into account that internal API is something one should never use, I 
don't think these terms apply here. Anyway, we will provide some helpers for 
external use in one of the next releases.

--

___
Python tracker 

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



[issue33499] Environment variable to set alternate location for pycache tree

2018-08-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fc96437db4fa95dff99d43d4500beaf12bad5bff by Victor Stinner in 
branch 'master':
bpo-33499: Fix pymain_init_pycache_prefix() (GH-8596)
https://github.com/python/cpython/commit/fc96437db4fa95dff99d43d4500beaf12bad5bff


--
nosy: +vstinner

___
Python tracker 

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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

That's ok, I hadn't expected that you'd sign the CLA before being asked to do 
so :-)

Good luck.

--

___
Python tracker 

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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread Seonggi Kim


Seonggi Kim  added the comment:

Sorry, I'm waiting for permit CLA signing.
I will request PR after CLA was signed.

--
nosy: +hacksg

___
Python tracker 

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



[issue34307] NullHandler init refusing arguments

2018-08-01 Thread Berker Peksag


Change by Berker Peksag :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue34307] NullHandler init refusing arguments

2018-08-01 Thread Romuald Brunet


Change by Romuald Brunet :


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

___
Python tracker 

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



[issue34307] NullHandler init refusing arguments

2018-08-01 Thread Romuald Brunet


New submission from Romuald Brunet :

Context:

I'm using a custom Handler that relies on a third-party library that may not be 
present

try:
  from acme.logging import CustomHandler as BaseHandler
except ImportError:
  import logging.NullHandler as BaseHandler

class MoreCustomHandler(BaseHandler):
  def handle(self):
self.stuff()

The logging configuration has some arguments for the CustomHandler. The problem 
is that the NullHandler does not accept them.

I expected it to be a "dummy" handler that might accept any argument

--
components: Library (Lib)
messages: 322861
nosy: Romuald
priority: normal
severity: normal
status: open
title: NullHandler init refusing arguments
type: behavior
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



[issue34306] minidom: wrong processing of xmlns attributes

2018-08-01 Thread Victor Porton


New submission from Victor Porton :

The below script prints

http://www.w3.org/2000/xmlns/
aa:aa

It should print

None
aa:aa

because xmlns:z is NOT an attribute of xmlns namespace.

~~~
import xml.dom.minidom

x = xml.dom.minidom.parseString("")

for i in x.documentElement.attributes.values():
print(i.namespaceURI)
~~~

--
components: XML
messages: 322860
nosy: porton
priority: normal
severity: normal
status: open
title: minidom: wrong processing of xmlns attributes
versions: Python 2.7, 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



[issue34302] Avoid inefficient way to find start point in deque.index

2018-08-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm not sure what your proposal is. Do you have a patch that increases the 
performance of collections.deque in some cases?  If so please share that patch, 
preferably as a pull request on GitHub (see 
 for an explanation).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue34211] Cygwin build broken due to use of &PyType_Type in static declaration in _abc module

2018-08-01 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Linker issues are always tricky...

I understand that there is no problem within libpython, so the questions below 
refer to extension modules. I am asking them from the point of view of somebody 
writing Python extension modules who is clueless about Cygwin.

So you're saying that it's not allowed to refer to &PyType_Type in a static 
struct? But it is OK to refer to &PyType_Type in code?

I assume that there is nothing special about PyType_Type and that this apply 
for all variables. Are functions OK? For example, in functools.c I see

static PyGetSetDef partial_getsetlist[] = {
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
{NULL} /* Sentinel */
};

What makes functions different from variables? Aren't they essentially just 
pointers?

--

___
Python tracker 

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



[issue34211] Cygwin build broken due to use of &PyType_Type in static declaration in _abc module

2018-08-01 Thread Erik Bray


Erik Bray  added the comment:

> For those who are not very aware of Cygwin issues: what is wrong with
>
> PyVarObject_HEAD_INIT(&PyType_Type, 0);

I'm glad you asked, because it actually got me thinking, and since I added a 
fix (albeit an unsatisfying one) for issue34212, this fix is no longer strictly 
necessary *so long as* the _abc module is always built as a core built-in (that 
is, linked into libpython).

IIUC that is the case since _abc is required for the core, but I'm not sure.

The problem is explained somewhat in issue21124, but what it comes down to is 
that if the linker can't resolve PyType_Type at link time it will make a 
complaint like "can't initialize global with a non-constant".

Because of issue34212, when compiling _abc.c it was using the wrong external 
linkage for PyType_Type (treating it as some data that needs to be imported 
from an other DLL, rather than data in the same DLL).  But with a fix for 
issue34212 this is not a problem (again, so long as the _abc module is included 
in libpython).

--

___
Python tracker 

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



[issue25095] test_httpservers hangs since Python 3.5

2018-08-01 Thread William Pickard


William Pickard  added the comment:

My computer was running BitDefender Total Security 2018 (At the time, currently 
running the 2019 edition) and MalwareBytes 3 Premium.

BitDefender has both a built-in firewall and a web protection module while 
MalwareBytes has a web protection module.

--

___
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-08-01 Thread Kevin Walzer


Kevin Walzer  added the comment:

Tal, your proposed revisions to the patch work fine. It's harmless to leave the 
older calls to MacWindowStyle there. New patch attached.

--
Added file: https://bugs.python.org/file47726/calltips_w-2.diff

___
Python tracker 

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



[issue34304] clarification on escaping \d in regular expressions

2018-08-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you want to replace %d with literal \d, you need to repeat the backslash 4 
times:

pattern = re.sub('%d', 'd+', pattern)

or use a raw string literal and repeat the backslash 2 times:

pattern = re.sub('%d', r'\\d+', pattern)

Since the backslash has a special meaning in the replacement pattern, it needs 
to be escaped with a backslash, i.e. duplicated. But since it has a special 
meaning in Python string literals, every of these backslashes needs to be 
escaped with a backslash in a non-raw string literal, i.e. repeated 4 times.

Python 3.6 is more lenient. It keeps a backslash if it is followed by a 
character which doesn't compound a known escape sequences in a replacement 
string. But it emits a deprecation warning, which you can see when run Python 
with corresponding -W option.

$ python3.6 -Wa -c 'import re; print(re.sub("%d", "\d+", "DBMS_NAME: string(%d) 
%s"))'
:1: DeprecationWarning: invalid escape sequence \d
/usr/lib/python3.6/re.py:191: DeprecationWarning: bad escape \d
  return _compile(pattern, flags).sub(repl, string, count)
DBMS_NAME: string(\d+) %s

$ python3.6 -Wa -c 'import re; print(re.sub("%d", "\\d+", "DBMS_NAME: 
string(%d) %s"))'
/usr/lib/python3.6/re.py:191: DeprecationWarning: bad escape \d
  return _compile(pattern, flags).sub(repl, string, count)
DBMS_NAME: string(\d+) %s

$ python3.6 -Wa -c 'import re; print(re.sub("%d", "\\\d+", "DBMS_NAME: 
string(%d) %s"))'
:1: DeprecationWarning: invalid escape sequence \d
DBMS_NAME: string(\d+) %s

$ python3.6 -Wa -c 'import re; print(re.sub("%d", "d+", "DBMS_NAME: 
string(%d) %s"))'
DBMS_NAME: string(\d+) %s

Here "invalid escape sequence \d" is generated by the Python parser, "bad 
escape \d" is generated by the RE engine.

--
nosy: +serhiy.storchaka
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



[issue34304] clarification on escaping \d in regular expressions

2018-08-01 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

The reported behavior is reproducible in master as well as of ea68d83933 but 
not on 3.6.0. I couldn't bisect to the exact commit between 3.7.0 and 3.6.0 
where this change was introduced though. I can also see some deprecation 
warnings as below while running the script : 

➜  cpython git:(master) ./python.exe ../backups/bpo34034.py
../backups/bpo34034.py:4: DeprecationWarning: invalid escape sequence \[
  sym = ['\[','\]','\(','\)']
../backups/bpo34034.py:4: DeprecationWarning: invalid escape sequence \]
  sym = ['\[','\]','\(','\)']
../backups/bpo34034.py:4: DeprecationWarning: invalid escape sequence \(
  sym = ['\[','\]','\(','\)']
../backups/bpo34034.py:4: DeprecationWarning: invalid escape sequence \)
  sym = ['\[','\]','\(','\)']
../backups/bpo34034.py:15: DeprecationWarning: invalid escape sequence \(
  result=re.match("DBMS_NAME python4: string\(\d+\) .*?", "DBMS_NAME python4: 
string(8) \"DB2/NT64\" ")
DBMS_NAME: string(%d) %s
DBMS_NAME: string(%d) %s
DBMS_NAME: string\(%d) %s
DBMS_NAME: string\(%d\) %s
DBMS_NAME: string\(%d\) .*?
Traceback (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/sre_parse.py", 
line 1045, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\d'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../backups/bpo34034.py", line 11, in 
pattern = re.sub('%d', '\\d+', pattern)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/re.py", line 
192, in sub
return _compile(pattern, flags).sub(repl, string, count)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/re.py", line 
309, in _subx
template = _compile_repl(template, pattern)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/re.py", line 
300, in _compile_repl
return sre_parse.parse_template(repl, pattern)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/sre_parse.py", 
line 1048, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \d at position 0


Thanks

--

___
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-08-01 Thread Michael Fischer


Michael Fischer  added the comment:

Thank you for your quick reply. I understand why you chose this description 
better now. However in C %f behaves exactly the same as in Python (for 
floating-point numbers) and you will mostly find the description for it along 
the lines of:

'%f' Print a floating-point number in normal (fixed-point) notation. [The GNU C 
Library Reference Manual - 
https://www.gnu.org/software/libc/manual/pdf/libc.pdf]

For the sake of simplicity I suggest the following wording:

Fixed point notation. Displays the (floating-point) number as a fixed-point 
number. The default precision is 6.

In my opinion this emphasizes the intent (fixed precision representation) and 
hints at the independence of input type, by putting the floating-point in 
brackets.

--

___
Python tracker 

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



[issue34303] micro-optimizations in functools.reduce()

2018-08-01 Thread INADA Naoki


Change by INADA Naoki :


--
type: enhancement -> performance
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



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

2018-08-01 Thread Tal Einat


Tal Einat  added the comment:

Confirmed on macOS 10.13.5 with the new Python 2.7.15 64-bit from python.org 
which bundles Tcl/Tk 8.6.8.

The same fix works: Removing the grab_set() calls fixes the freezing after 
closing the about and config dialogs.

--

___
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-08-01 Thread Tal Einat


Tal Einat  added the comment:

I can confirm that removing .grab_set() calls fixes this issue on macOS 10.13.5 
with Python 3.7.0 from python.org.

Searching for those calls in all of IDLE's code lead me to discover additional 
similar issues, e.g. with the search dialog and the text viewer.  Removing the 
.grab_set() and .grab_release() calls fixes those issues as well.

I tried IDLE with these changes on Windows 10 with python build from the latest 
master branch.  Things appear to be working well without these calls.

Is it reasonable to simply remove the grab calls entirely?  I've created a PR 
with such a change to facilitate evaluating this approach.

--
stage: patch review -> needs patch

___
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-08-01 Thread Tal Einat


Change by Tal Einat :


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



[issue34304] clarification on escaping \d in regular expressions

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



[issue34303] micro-optimizations in functools.reduce()

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



[issue23078] unittest.mock patch autospec doesn't work on staticmethods

2018-08-01 Thread Kamil Gałuszka

Kamil Gałuszka  added the comment:

This affects all versions from 3.4 up to 3.8-dev. Would be nice if someone 
could do the review of the supplied patch. 

Thanks for awesome work on Python!

I'm here because it just hit me also and I was for 1 h thinking that I don't 
know how to use patch/mock. ;)

--
nosy: +galuszkak
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



[issue24564] shutil.copytree fails when copying NFS to NFS

2018-08-01 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

[ https://bugs.python.org/issue24564#msg246278 ]

> Adding `EINVAL` to the ignored errnos would fix the problem, but might hide 
> real failures (I'm not sure about the real failures, but it seems logical).

I think this is an acceptable compromise considering that:

1) because of this the copy operation will ultimately fail (despite file will 
be copied)
2) there is nothing we can do except emit a warning somehow 
3) EPERM and ENODATA are already silently ignored (also ENOTSUP but that is 
more legit)

For completeness, other than copytree() also copy2() and move() are affected. 
I submitted a PR: https://github.com/python/cpython/pull/8601.

--
nosy: +giampaolo.rodola
pull_requests: +8109
stage:  -> patch review
versions: +Python 2.7, 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



[issue34305] inspect.getsourcefile and inspect.getcomments do not work with decorated functions

2018-08-01 Thread Eric Wieser


Change by Eric Wieser :


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

___
Python tracker 

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



  1   2   >