[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-05-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 903f189b6e528cbe9500014c6f990c6511b38918 by Serhiy Storchaka in 
branch '2.7':
bpo-33096: Removed unintentionally backported from Python 3 Tkinter files. 
(GH-6724)
https://github.com/python/cpython/commit/903f189b6e528cbe9500014c6f990c6511b38918


--

___
Python tracker 

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



[issue33413] asyncio.gather should not use special Future

2018-05-08 Thread twisteroid ambassador

twisteroid ambassador  added the comment:

I would like to comment on the last observation about current_task().cancel(). 
I also ran into this corner case recently. 

When a task is cancelled from outside, by virtue of there *being something 
outside doing the cancelling*, the task being cancelled is not currently 
running, and that usually means the task is waiting at an `await` statement, in 
which case a CancelledError will be raised at this `await` statement the next 
time this task runs. The other possibility is that the task has been created 
but has not had a chance to run yet, and in this case the task is marked 
cancelled, and code inside the task will not run.

When one cancels a task from the inside by calling cancel() on the task object, 
the task will still run as normal until it reaches the next `await` statement, 
where a CancelledError will be raised. If there is no `await` between calling 
cancel() and the task returning, however, the CancelledError is never raised 
inside the task, and the task will end up in the state of done() == True, 
cancelled() == False, exception() == CancelledError. Anyone awaiting for the 
task will get a CancelledError without a meaningful stack trace, like this:

Traceback (most recent call last):
  File "cancel_self.py", line 89, in run_one
loop.run_until_complete(coro)
  File "C:\Program Files\Python36\lib\asyncio\base_events.py", line 467, in 
run_until_complete
return future.result()
concurrent.futures._base.CancelledError

This is the case described in the original comment.

I would also consider this a bug or at least undesired behavior. Since 
CancelledError is never raised inside the task, code in the coroutine cannot 
catch it, and after the task returns the return value is lost. For a coroutine 
that acquires and returns some resource (say asyncio.open_connection()), this 
means that neither the task itself nor the code awaiting the task can release 
the resource, leading to leakage.

I guess one should be careful not to cancel the current task from the inside.

--
nosy: +twisteroid ambassador

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6418

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I propose the following changes to the file_actions parameter in PR 6725. 
Currently it is the fourth positional-only parameter with the default value 
None.

1. Change its default value to an empty tuple. None will no longer be accepted 
as a special case. This will simplify a mental model.

2. Since the order of parameters already doesn't math the natural order of the 
corresponding C function, and many other keyword-only parameters will be added 
in PR 6693, it makes sense to make file_actions a keyword-only parameter too.

--

___
Python tracker 

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



[issue33437] Defining __init__ in enums

2018-05-08 Thread Andres Ayala

Andres Ayala  added the comment:

I see, with mixed types you need to use __new__ to construct the elements (I 
imagine is specially important for non mutable types)

I have modified the example of the coordinates to try to use a mixed type. Is 
not the most useful thing, but it mix the bytes class.
Is it not obvious how to correctly use the mixin + __new__ operator so it is 
easy that the example is not correct or can be done better.

class Coordinate(bytes, Enum):
"""
Coordinate with binary codes that can be indexed by the int code.
"""
def __new__(cls, value, label, unit):
obj = bytes.__new__(cls, [value])
obj._value_ = value
obj.label = label
obj.unit = unit
return obj

PX = (0, 'P.X', 'km')
PY = (1, 'P.Y', 'km')
VX = (2, 'V.X', 'km/s')
VY = (3, 'V.Y', 'km/s')


# This works as expected
for element in Coordinate:
print("{0}: {0.label}[{0.unit}] = {0.value}".format(element))

# And this Work
print("Obtain P.Y from the name:", Coordinate['PY'])
print("Obtain V.Y from the index:", Coordinate(3))

# This shall be False
print('Coordinate.PY == 1 is:', Coordinate.PY == 1)
# But this shall be True
print("Coordinate.PY == b'\\01' is:", Coordinate.PY == b'\01')

Thanks!

--

___
Python tracker 

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



[issue33419] Add functools.partialclass

2018-05-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm -1 on this change. It looks as an uncommon case, and the correct general 
implementation is hard (it may be even more hard that it looked to me now). The 
stdlib should't provide an incomplete implementation which can be replaced with 
just three lines of code in a concrete case if the user doesn't care about 
subtle details.

--

___
Python tracker 

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



[issue33444] Memory leak/high usage on copy in different thread

2018-05-08 Thread MultiSosnooley

New submission from MultiSosnooley :

On linux (ubuntu 16.04, 18.04 tested) with python 3.6.5, 3.5.5 and 3.7-dev 
(windows is not affected) there is ~850Mb of memory used by python process at 
sleep point. Replacing `submit` `result` with plain function call causes normal 
~75Mb at sleep point.
Maybe it is linux side issue (or normal behavior).

--
components: Interpreter Core
files: test-memory-leak.py
messages: 316285
nosy: MultiSosnooley
priority: normal
severity: normal
status: open
title: Memory leak/high usage on copy in different thread
versions: Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47576/test-memory-leak.py

___
Python tracker 

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



[issue33399] site.abs_paths should handle None __cached__ type

2018-05-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan
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



[issue33444] Memory leak/high usage on copy in different thread

2018-05-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +bquinlan, pitrou

___
Python tracker 

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



[issue33365] http/client.py does not print correct headers in debug

2018-05-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +barry, r.david.murray
versions:  -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



[issue33144] random._randbelow optimization

2018-05-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset ec1622d56c80d15740f7f8459c9a79fd55f5d3c7 by Serhiy Storchaka in 
branch 'master':
bpo-33144: Fix choosing random.Random._randbelow implementation. (GH-6563)
https://github.com/python/cpython/commit/ec1622d56c80d15740f7f8459c9a79fd55f5d3c7


--

___
Python tracker 

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



[issue33144] random._randbelow optimization

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



[issue32717] Document PEP 560

2018-05-08 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread Jeroen Demeyer

New submission from Jeroen Demeyer :

When this test from Lib/test/test_profile.py fail, it just prints a message and 
doesn't fail the testsuite:

def test_cprofile(self):
results = self.do_profiling()
expected = self.get_expected_output()
self.assertEqual(results[0], 1000)
for i, method in enumerate(self.methodnames):
if results[i+1] != expected[method]:
print("Stats.%s output for %s doesn't fit expectation!" %
  (method, self.profilerclass.__name__))
print('\n'.join(unified_diff(
  results[i+1].split('\n'),
  expected[method].split('\n'

--
components: Tests
messages: 316287
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: test_cprofile should fail instead of displaying a message

___
Python tracker 

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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread Jeroen Demeyer

Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue33437] Defining __init__ in enums

2018-05-08 Thread Ethan Furman

Ethan Furman  added the comment:

That new example looks great!  Note that you don't need the parenthesis, though.

FYI: The same thing using the aenum library* would look like:

from aenum import Enum

class Coord(bytes, Enum):
_init_ = 'value label unit'

PX = [0], 'P.X', 'km'
PY = [1], 'P.Y', 'km'
VX = [2], 'V.X', 'km/s'
VY = [3], 'V.Y', 'km/s'


* aenum is the Advanced Enum library I wrote that has a few extra abilities.

--

___
Python tracker 

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



[issue33444] Memory leak/high usage on copy in different thread

2018-05-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Yes, this looks surprising, but there is no memory leak here, just memory 
fragmentation in the glibc allocator.  This is the program I used to diagnose 
it:
https://gist.github.com/pitrou/6c5310d4c721436165666044e3c31158

At the end the program prints glibc allocator stats as returned by mallinfo() 
(see http://man7.org/linux/man-pages/man3/mallinfo.3.html). On my system, the 
process takes 480 MB RSS and "fordblks" (the total number of bytes in free 
blocks) is 478 MB. However, "keepcost" (the releasable free space) is only 30 
MB.  The rest is probably interspersed with internal interpreter structures 
that have stayed alive.

The fragmentation seems to depend on the number of threads.  If you start the 
executor with only one thread, memory consumption is much lower.  This makes 
sense: by ensuring all operations happen in order with little concurrency, we 
minimize the chance that short-lived data gets interspersed with longer-lived 
data.

--

___
Python tracker 

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



[issue33444] Memory leak/high usage on copy in different thread

2018-05-08 Thread Antoine Pitrou

Change by Antoine Pitrou :


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



[issue33446] destructors of local variables are not traced

2018-05-08 Thread Xavier de Gaye

New submission from Xavier de Gaye :

In the following code, the destructors of objects referenced by the 'a' and 'b' 
local variables are not traced by the 'step' command of pdb.

 1 class C:
 2 def __init__(self, name):
 3 self.name = name
 4
 5 def __del__(self):
 6 print('"%s" destructor' % self.name)
 7
 8 def main():
 9 a = C('a')
10 b = C('b')
11 import pdb; pdb.set_trace()
12 a = 1
13
14 main()

--
components: Interpreter Core, Library (Lib)
messages: 316290
nosy: xdegaye
priority: normal
severity: normal
status: open
title: destructors of local variables are not traced
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



[issue32717] Document PEP 560

2018-05-08 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset bd5f96581bf23f6d05fc106996428a8043b6b084 by Ivan Levkivskyi in 
branch 'master':
bpo-32717: Document PEP 560 (GH-6726)
https://github.com/python/cpython/commit/bd5f96581bf23f6d05fc106996428a8043b6b084


--

___
Python tracker 

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



[issue32717] Document PEP 560

2018-05-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6421

___
Python tracker 

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



[issue33446] destructors of local variables are not traced

2018-05-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


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

___
Python tracker 

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



[issue33446] destructors of local variables are not traced

2018-05-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

In both cases the destructor cannot be traced because it is invoked from 
functions called from [1] call_trace() where tracing is disabled:

  Case local variable 'a':
On line 12, just before executing this line with a pdb step command, the 
object referenced by 'a' lives in frame->f_locals. The step command causes the 
ceval loop to execute the bytecodes corresponding to the statement on line 12 
and to eventualy call [2] call_trampoline() with a 'return' trace event and to 
call PyFrame_FastToLocalsWithError() here. This last call causes the last 
reference to the previous 'a' object in frame->f_locals to be decremented and 
the object to be deallocated but without its destructor being traced as tracing 
has been disabled in call_trace().

  Case local variable 'b':
Upon exiting the frame of the 'main' function, pdb keeps a reference to 
frame->f_locals through its own attribute curframe_locals.  Next, after 
returning to the 'main' caller, this reference is decremented since 
pdb.curframe_locals references now another object and the dictionary referenced 
by the previous frame f_locals (the frame of 'main') is deallocated, but this 
happens within pdb where tracing is disabled and the destructor of the object 
that had been referenced by 'b' is therefore not traced.

PR 6730 proposes a fix for both cases.

[1] https://github.com/python/cpython/blob/master/Python/ceval.c#L4247
[2] https://github.com/python/cpython/blob/master/Python/sysmodule.c#L462

--

___
Python tracker 

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



[issue32717] Document PEP 560

2018-05-08 Thread miss-islington

miss-islington  added the comment:


New changeset 101d0d585f99a3b8c8d070b9d4dea15fa3daff62 by Miss Islington (bot) 
in branch '3.7':
bpo-32717: Document PEP 560 (GH-6726)
https://github.com/python/cpython/commit/101d0d585f99a3b8c8d070b9d4dea15fa3daff62


--
nosy: +miss-islington

___
Python tracker 

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



[issue16653] reference kept in f_locals prevents the tracing/profiling of a destructor

2018-05-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Closing as a duplicate of issue 33446 which has a wider scope and a PR.

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



[issue33446] destructors of local variables are not traced

2018-05-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



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

2018-05-08 Thread steverweber

steverweber  added the comment:

ref to other projects that hit this issue.

https://gitlab.idiap.ch/bob/bob.buildout/issues/15
https://github.com/saltstack/salt/issues/45080
https://groups.google.com/forum/#!msg/comp.lang.python/tpfiHAJhl9Y/hZj1f50vBQAJ

--
nosy: +steverweber

___
Python tracker 

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



[issue27465] IDLE:Make help source menu entries unique and sorted.

2018-05-08 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

> Currently, names are displayed in the order added.  I believe sorting would 
> be better, especially when one adds more than 2 entries.  That should also be 
> easy.

I'm wondering if it would be worthwhile to add Drag and Drop functionality to 
the Help listbox to allow users to move the items into any order they want?

--
nosy: +csabella

___
Python tracker 

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



[issue32717] Document PEP 560

2018-05-08 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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



[issue13044] pdb throws AttributeError at end of debugging session

2018-05-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Nosying Serhiy as this post attempts to answer one of the questions raised in 
msg315588 in issue 33328:
> Is it good that the debugger is enabled at the shutdown stage?

This post has four different sections showing that the successive and 
incremental attempts at fixing the current code to have a destructor traced in 
the shutdown stage may lead to a segfault.

Section 1 - Current status:
---
A run with Python 3.6.5 of the following code proposed in the previous 
msg176993 gives now a different output and the C destructor is still not 
traced, but now it is not even called:

1 class C:
2 def __del__(self):
3 print('deleted')
4
5 c = C()
6 import pdb; pdb.set_trace()
7 x = 1

$ python test_destructor.py
> test_destructor.py(7)()
-> x = 1
(Pdb) step
--Return--
> test_destructor.py(7)()->None
-> x = 1
(Pdb) step
--Call--
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.6/types.py", line 27, in _ag
  File "/usr/lib/python3.6/bdb.py", line 53, in trace_dispatch
  File "/usr/lib/python3.6/bdb.py", line 85, in dispatch_call
  File "/usr/lib/python3.6/pdb.py", line 251, in user_call
  File "/usr/lib/python3.6/pdb.py", line 351, in interaction
  File "/usr/lib/python3.6/pdb.py", line 1453, in print_stack_entry
  File "/usr/lib/python3.6/bdb.py", line 394, in format_stack_entry
TypeError: 'NoneType' object is not callable

Section 2 - Fix using PR 6730:
--
PR 6730 in issue 33446 fixes a bug in the pdb module that leaks a reference to 
frame->f_locals through its curframe_locals attribute.
There is no major change when the current Python master branch is run with PR 
6730, the destructor is still not traced and not called.

Section 3 - Fix a bdb leak:
---
After returning from the '__main__' module, the Bdb.bdb instance keeps a 
reference to the module through its botframe attribute and prevents the 
corresponding frame from being deallocated at the end of 
_PyEval_EvalCodeWithName() (the frame reference count is 2 instead of 1).  The 
attached bdb_leak.diff patch fixes this, and when PR 6730 and bdb_leak.diff are 
run, the destructor is now traced but this fails with an exception in bdb:

$ /home/xavier/src/python/master/python test_destructor.py
> ./test_destructor.py(7)()
-> x = 1
(Pdb) step
--Return--
> ./test_destructor.py(7)()->None
-> x = 1
(Pdb) step
Exception ignored in: 
Traceback (most recent call last):
  File "test_destructor.py", line 3, in __del__
  File "test_destructor.py", line 3, in __del__
  File "/home/xavier/src/python/master/Lib/bdb.py", line 88, in trace_dispatch
  File "/home/xavier/src/python/master/Lib/bdb.py", line 115, in dispatch_line
  File "/home/xavier/src/python/master/Lib/pdb.py", line 262, in user_line
  File "/home/xavier/src/python/master/Lib/pdb.py", line 352, in interaction
  File "/home/xavier/src/python/master/Lib/pdb.py", line 1454, in 
print_stack_entry
  File "/home/xavier/src/python/master/Lib/bdb.py", line 544, in 
format_stack_entry
ImportError: sys.meta_path is None, Python is likely shutting down

Section 4 - Remove the lazy import:
---
The attached lazy_import.diff patch includes the changes in bdb_leak.diff patch 
and replaces the lazy imports causing the previous ImportError with imports at 
the start of the bdb module.  Running test_destructor.py fails now with a 
segfault:

$ /home/xavier/src/python/master/python test_destructor.py
> ./test_destructor.py(7)()
-> x = 1
(Pdb) step
--Return--
> ./test_destructor.py(7)()->None
-> x = 1
(Pdb) step
> ./test_destructor.py(3)__del__()
-> print('deleted')
Segmentation fault (core dumped)

The gdb back trace is attached at gdb_backtrace.txt.

Conclusion:
---
It seems that tracing should be prevented in the shutdown stage and that 
multiple little bugs have hidden that fact (when tracing is done with pdb).
Not sure if tracing with PyEval_SetTrace() could be allowed in that stage.
BTW coverage.py uses PyEval_SetTrace() and I have noticed that coverage.py does 
not trace either the destructor in test_destructor.py (nosying Ned).

--
keywords: +patch
nosy: +nedbat, serhiy.storchaka
Added file: https://bugs.python.org/file47577/bdb_leak.diff

___
Python tracker 

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



[issue13044] pdb throws AttributeError at end of debugging session

2018-05-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


Added file: https://bugs.python.org/file47579/gdb_backtrace.txt

___
Python tracker 

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



[issue13044] pdb throws AttributeError at end of debugging session

2018-05-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


Added file: https://bugs.python.org/file47578/lazy_import.diff

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-08 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
pull_requests: +6423

___
Python tracker 

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



[issue33414] Make shutil.copytree use os.scandir to take advantage of cached is_(dir|file|symlink)

2018-05-08 Thread Andrés Delfino

Andrés Delfino  added the comment:

I believe you are right about being conservative with changing working code, 
specially when there's no proof about performance being improved.

I think its best to close this ticket. I'd do it myself, but I know what 
resolution applies here.

--

___
Python tracker 

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



[issue27675] IDLE file completion has 2 bugs depending on open quote used

2018-05-08 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I can't seem to recreate this. I tried on Ubuntu with master and Windows with 
3.6.3.  I'm not sure if it's been fixed by another change or if I'm not doing 
the steps correctly to recreate it.

--
nosy: +csabella

___
Python tracker 

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



[issue16733] Solaris ctypes_test failures

2018-05-08 Thread Greg Onufer

Greg Onufer  added the comment:

The bitfields failures are due to Python not implementing bitfields the same as 
the compiler.

https://docs.oracle.com/cd/E77782_01/html/E77792/gqexw.html

"Signed and Unsigned int Bit-fields
Bit-fields which are declared as int (not signed int or unsigned int) can be 
implemented by the compiler using either signed or unsigned types. This makes a 
difference when extracting a value and deciding whether to sign extend it.

The Oracle Developer Studio compiler uses unsigned types for int bit-fields and 
the gcc compiler uses signed types. Use the gcc –funsigned-bitfields flag to 
control this behavior.

For more information, see the sixth list item at 
https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Non_002dbugs.html.";

When the test compares the ctypes extraction of the bitfield (signed) and the 
compiler-native extraction of the bitfield (unsigned), they miscompare if the 
high-bit of the field is set.

If Python wants bitfields extracted from signed integral types to be signed, 
the C code in the test case needs to account for the compiler implementation 
defined behavior and sign extend the bitfield before returning it.

See patch in attachment.  The bitfield tests pass with those changes.

--
keywords: +patch
nosy: +gco
Added file: 
https://bugs.python.org/file47580/0001-Fix-ctypes-bitfield-test-code-to-account-for-compile.patch

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-08 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 43d12a6bd82bd09ac189069fe1eb40cdbc10a58c by Ivan Levkivskyi in 
branch 'master':
bpo-28556: Minor fixes for typing module (GH-6732)
https://github.com/python/cpython/commit/43d12a6bd82bd09ac189069fe1eb40cdbc10a58c


--

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6424

___
Python tracker 

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



[issue33420] [typing] __origin__ invariant broken

2018-05-08 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

This is now fixed on master by 
https://github.com/python/cpython/commit/43d12a6bd82bd09ac189069fe1eb40cdbc10a58c
 (the comment is updated).

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

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-08 Thread miss-islington

miss-islington  added the comment:


New changeset 3c28a6387b48bad3fcae47906bc166d02a2f8ed2 by Miss Islington (bot) 
in branch '3.7':
bpo-28556: Minor fixes for typing module (GH-6732)
https://github.com/python/cpython/commit/3c28a6387b48bad3fcae47906bc166d02a2f8ed2


--
nosy: +miss-islington

___
Python tracker 

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



[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon

New submission from Noah Simon :

It would be very useful to add an asynchronous lambda syntax, as a shortcut for 
coroutines. I'm not experienced enough to write a PEP or edit the C source, but 
I have some ideas for syntax:

import asyncio
foo = async lambda a,b: 5 + await bar(b)

--
components: asyncio
messages: 316304
nosy: Noah Simon, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Asynchronous lambda syntax
type: enhancement
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



[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon

Noah Simon  added the comment:

Actually, you wouldn't even need to import asyncio.

--

___
Python tracker 

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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset ac9240b9be31d073d1b2e50ce53481ff0fc9ed23 by Benjamin Peterson 
(jdemeyer) in branch 'master':
closes bpo-33445: fail properly in test_cprofile() (GH-6727)
https://github.com/python/cpython/commit/ac9240b9be31d073d1b2e50ce53481ff0fc9ed23


--
nosy: +benjamin.peterson
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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6425

___
Python tracker 

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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6426

___
Python tracker 

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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread miss-islington

miss-islington  added the comment:


New changeset 263523ae217e1af580628b4fe0609194823a51aa by Miss Islington (bot) 
in branch '3.7':
closes bpo-33445: fail properly in test_cprofile() (GH-6727)
https://github.com/python/cpython/commit/263523ae217e1af580628b4fe0609194823a51aa


--
nosy: +miss-islington

___
Python tracker 

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



[issue33445] test_cprofile should fail instead of displaying a message

2018-05-08 Thread miss-islington

miss-islington  added the comment:


New changeset c925108b991b9c5f0402feb0e7f725ee3ac7da11 by Miss Islington (bot) 
in branch '3.6':
closes bpo-33445: fail properly in test_cprofile() (GH-6727)
https://github.com/python/cpython/commit/c925108b991b9c5f0402feb0e7f725ee3ac7da11


--

___
Python tracker 

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



[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-05-08 Thread Shlomo Anglister

Shlomo Anglister  added the comment:

Thanks @serhiy.storchaka and @corona10 !
I read it, documented the relation and failed to see the duplication.

--

___
Python tracker 

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2018-05-08 Thread Shlomo Anglister

Change by Shlomo Anglister :


--
nosy: +anglister

___
Python tracker 

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



[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-05-08 Thread Shlomo Anglister

Shlomo Anglister  added the comment:

This issue is in review stage for a long time.
What's holding it?

On Wed, May 9, 2018 at 8:24 AM, Shlomo Anglister 
wrote:

>
> Shlomo Anglister  added the comment:
>
> Thanks @serhiy.storchaka and @corona10 !
> I read it, documented the relation and failed to see the duplication.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27609] IDLE completions: format, factor, and fix

2018-05-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In re-verifying #27675, the color bug seems to be gone.  The completion bug is 
still here, at least on Windows.

It would be good to sort the issues by whether they appear to affect 
autocomplete.py or autocomplete_w.py or both.

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



[issue27675] IDLE file completion has 2 bugs depending on open quote used

2018-05-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I believe the report in August 2016 was about the time of the preliminary.0a4 
release, months before the final 3.6.0 release.  Something could have easily 
changed after.

I should have been more detailed and accurate is what I wrote.  In paragraph 2, 
I said I observed the color bug with ' or '''.  In paragraph 4, I said that the 
color bug depended on the number rather than type of quote.  The later was 
accurate.

My C: directory contains a Logs directory.  If in 3.5.4, I type '/, the / is 
green and the selction box appears.  When I type L, the L is green and the 
selection moves to Logs.  When I type o, the o is white (I am using IDLEDark).  
Or if I backspace and type L, the L is white.  Or if I move with the cursor, 
the inserted word is white.

This is not true in 3.6.5.  The color bug seems fixed.  The autocompletion 
window, which handles interaction when the window is open, was patched in 
#24570 for a Mac-specific bug.

The completion bug remains in 3.6.5 and newer.  If I type '/L' or '''/L''', L 
is not completed to Logs and the box does not disappear. The opposite is true 
for " and """.  "/L" completes to "/Logs" and the box goes away.  Also, "/L/ 
completes to "/Logs/, leaving the box open for selection of a subdirectory.  
"// does not complete to the first item in the box -- at least one action is 
needed.

The effect of // is analogous to .. in attribute completion.  []. brings up the 
box.  A second . completes the selected name and brings up a new box with 
subattributes.  This does not require an inbetween action.

Cheryl, is this clear enough to reproduce?  It is possible that Linux does not 
have the bug.  It should be in autocomplete_w.py and we already know that this 
has system-specific behavior.

I would be reluctant do anything beyond trivial without improving the 
autocomplete tests.  I added #30348 and #30666 as dependencies, at least for 
the present. This issue is a dependency master autocompletion issue #27609.

--
dependencies: +IDLE: Add test_autocomplete unittest, IDLE: add tests for 
autocomplete window.

___
Python tracker 

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