[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7928

___
Python tracker 

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



[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7929

___
Python tracker 

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



[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset d04f46c59f1d07d9bcc0ba910741296ac88d370d by Berker Peksag in 
branch 'master':
bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
https://github.com/python/cpython/commit/d04f46c59f1d07d9bcc0ba910741296ac88d370d


--

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Berker Peksag


Change by Berker Peksag :


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



[issue29336] merge tuples in module

2018-07-22 Thread INADA Naoki


Change by INADA Naoki :


--
resolution: postponed -> duplicate
stage:  -> resolved
status: pending -> closed
superseder:  -> Same constants in tuples are not merged while compile()

___
Python tracker 

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



[issue34192] FunctionType.__new__ can generate functions that immediately crash

2018-07-22 Thread Dan Snider


New submission from Dan Snider :

The following program crashes on 3.3.1, 3.4.2, 3.5.2, and 3.6.1 because despite 
having a non-empty co_cellvars slot due to the generator object, the NOFREE 
flag was set. 3.7 isn't immune to some bad behavior here, either. 

While I only have access to 3.7.03b right now, I noted the assertion at the 
bottom failing because it appears CodeType.__new__ is silently stripping the 
NOFREE flag out, which is why it's highlighted as well.

Since the interpreter doesn't actually use FunctionType.__new__ it shouldn't 
hurt performance too much to add a check for when NOFREE is set that 
co_cellvars and co_freevars are indeed empty. Anyway, the code:

from functools import reduce
from itertools import repeat
from operator import or_
from types import FunctionType, CodeType

OPTIMIZED, NEWLOCALS, NOFREE = 1, 2, 64
FLAGS = [OPTIMIZED, NEWLOCALS, NOFREE]
fields=('argcount kwonlyargcount nlocals stacksize flags code consts '
'names varnames filename name firstlineno lnotab freevars cellvars').split()

def edit_code(code, *args, **kws):
"""Construct a new code object using `code` as a template"""

params = []
atrs = ('co_%s'%a for a in fields)
kwds = map(kws.pop, fields, repeat(kws))
for arg, kwv, k in zip(args, kwds, atrs):
if kwv is not kws:
raise TypeError("edit_code() got multiple parameters for %r"%k)
params.append(arg)
for kwv, atr in zip(kwds, atrs):
params.append(kwv if kwv is not kws else getattr(code, atr))
if kws:
k, v = kws.popitem()
raise TypeError("edit_code() got unexpected keyword argument %r"%k)
return CodeType(*params)

def get_co_flags(flags):
if isinstance(flags, FunctionType):
flags = flags.__code__.co_flags
elif isinstance(flags, CodeType):
flags = flags.co_flags
return reduce(or_, (i for i in FLAGS if flags & i))

if __name__ == '__main__':
co = get_co_flags.__code__
ns = get_co_flags.__globals__
flags = co.co_flags
assert flags == OPTIMIZED|NEWLOCALS
assert NOFREE == 64
a = FunctionType(edit_code(co, flags=flags), ns)
b = FunctionType(edit_code(co, flags=flags|NOFREE), ns)
# this assertion fails on 3.7.0b3
assert b.__code__.co_flags == OPTIMIZED|NEWLOCALS|NOFREE
print('calling a...')
a(get_co_flags)
t = input("Blow up the universe? y/n : ")
if t != 'n':
b(get_co_flags)

--
components: Interpreter Core
messages: 322174
nosy: bup
priority: normal
severity: normal
status: open
title: FunctionType.__new__ can generate functions that immediately crash
type: crash
versions: Python 3.4, 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



[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

Patch works!

--
assignee: eric.araujo -> berker.peksag

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread mattip


mattip  added the comment:

It would be sufficient to modify the documentation to reflect the code. 

There are other objects like `file` that recommend[0] calling a method to 
release resources without depending on implementation-specific details like 
garbage collection.

[0] 
https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files

--
nosy: +mattip

___
Python tracker 

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



[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2018-07-22 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks for the PR and for the work you've been doing to fix similar bugs in 
Python!

The Cache class is an implementation detail and it has no practical use for 
third party users. See issue 30262 for a discussion on making it private.

If a user somehow finds the Cache class, wants to do something with it, it's 
their problem if it crashes the interpreter.

So, unless you can demonstrate that these problems can be reproduced without 
using the Cache class directly, I'm inclined to close this issue as 'wontfix'.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Victor, please don't try to get your way by adopting a tone of shoving people 
around or mis-parsing their words try to catch them in a contradiction. There 
is in fact a boundary between argument parsing logic and application logic. In 
my view, the proposed behavior crosses that boundary.  Where the docs mention 
"transformations", they do so in limited ways (such as type conversion) that 
are tightly bound to argument parsing and are not part of the application logic.

FWIW, I'm not the one you need to convince. Steven Bethard is the module 
maintainer and arbiter of feature requests.  Recommendations from Zachary and 
me are meant to help inform his decision.

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

> Did you consider my suggestion to make it a "SyntaxError" for
> "del __annotations__" on a class level or even module level or at all?
> Or does this go too far?

That's not reasonable. __annotations__ is just an identifier.
There are lots of other things that shouldn't be deleted --
should we try to enumerate them all and make them all syntax errors?
Surely not.

--

___
Python tracker 

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



[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Victor Porton


Victor Porton  added the comment:

@Raymond:
"Downstream processing or transformation of inputs is beyond the scope of 
argparse which should stick to its core responsibilities of argument 
extraction."

You somehow contradict the official documentation:
"One particularly effective way of handling sub-commands is to combine the use 
of the add_subparsers() method with calls to set_defaults() so that each 
subparser knows which Python function it should execute."

The official documentation seems to recommend to pass real Python functions to 
the parser. So it does do simple "processing or transformation of inputs" which 
you recommend against.

--

___
Python tracker 

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



[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Zachary.  Downstream processing or transformation of inputs is 
beyond the scope of argparse which should stick to its core responsibilities of 
argument extraction.

--
assignee:  -> bethard
nosy: +bethard, rhettinger
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Nice work.  Thanks for the patch.

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



[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 1426daa4fe47d8f8be0d416f7cba7adae1d5839f by Raymond Hettinger 
(Xtreak) in branch 'master':
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
https://github.com/python/cpython/commit/1426daa4fe47d8f8be0d416f7cba7adae1d5839f


--

___
Python tracker 

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



[issue34191] argparse: Missing subparser error message should be more clear

2018-07-22 Thread Victor Porton


New submission from Victor Porton :

argparse produces a long unreadable, non-understandable for non-programmers 
error message when a subparser is not specified in the command line.

Note that the below message contains Ubuntu specifics, but it seems it would be 
nearly as unclear on other OSes too.

The worst thing about this error message is that to produce something readable 
instead I need to somehow parse the command string (or at least to catch 
TypeError).

$ python3.7 test.py 
Traceback (most recent call last):
  File "test.py", line 10, in 
args = parser.parse_args()
  File "/usr/lib/python3.7/argparse.py", line 1754, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 1786, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 2021, in _parse_known_args
', '.join(required_actions))
TypeError: sequence item 0: expected str instance, NoneType found
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in 
apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in 
from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in 
import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in 

from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in 

import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in 
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "test.py", line 10, in 
args = parser.parse_args()
  File "/usr/lib/python3.7/argparse.py", line 1754, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 1786, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 2021, in _parse_known_args
', '.join(required_actions))
TypeError: sequence item 0: expected str instance, NoneType found

The script follows.

#!/usr/bin/env python

import argparse

parser = argparse.ArgumentParser(description="Automatically process XML")
subparsers = parser.add_subparsers(title='subcommands')

chain_parser = subparsers.add_parser('chain', aliases=['c'], 
help='Automatically run a chain of transformations')

args = parser.parse_args()

--
components: Library (Lib)
messages: 322164
nosy: porton
priority: normal
severity: normal
status: open
title: argparse: Missing subparser error message should be more clear
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Same error in the x86 Gentoo Refleaks 3.7 buildbot:

https://buildbot.python.org/all/#/builders/114/builds/174

--

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-22 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The x86 Gentoo Refleaks 3.x report that test_sys_setprofile is potentially 
leaking referenecs:

https://buildbot.python.org/all/#/builders/1/builds/292

--
Ran 21 tests in 0.007s
OK
.
test_sys_setprofile leaked [1, 1, 1] references, sum=3
1 test failed again:
test_sys_setprofile
== Tests result: FAILURE then FAILURE ==
408 tests OK.
10 slowest tests:
- test_asyncio: 28 min 19 sec
- test_concurrent_futures: 23 min 10 sec
- test_multiprocessing_spawn: 22 min 1 sec
- test_multiprocessing_forkserver: 11 min 24 sec
- test_multiprocessing_fork: 8 min 35 sec
- test_lib2to3: 6 min 39 sec
- test_zipfile: 6 min 21 sec
- test_decimal: 6 min 18 sec
- test_io: 5 min 44 sec
- test_gdb: 5 min 39 sec
1 test failed:
test_sys_setprofile
8 tests skipped:
test_devpoll test_kqueue test_msilib test_startfile
test_winconsoleio test_winreg test_winsound test_zipfile64
1 re-run test:
test_sys_setprofile
Total duration: 2 hour 10 min
Tests result: FAILURE then FAILURE

--
components: Tests
messages: 322162
nosy: pablogsal
priority: normal
severity: normal
status: open
title: x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] 
references, sum=3
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



[issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7

2018-07-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

It seems that this buildbot failure is related to this issue:

https://buildbot.python.org/all/#/builders/105/builds/192


1 test failed:
test_regrtest
43 tests skipped:
test_aepack test_al test_applesingle test_bsddb185 test_bsddb3
test_cd test_cl test_commands test_crypt test_curses test_dbm
test_dl test_epoll test_fcntl test_fork1 test_gdb test_gdbm
test_gl test_grp test_imgfile test_ioctl test_kqueue
test_linuxaudiodev test_macos test_macostools test_mhlib test_nis
test_openpty test_ossaudiodev test_pipes test_poll test_posix
test_pty test_pwd test_readline test_resource test_scriptpackages
test_spwd test_sunaudiodev test_threadsignals test_wait3
test_wait4 test_zipfile64
2 skips unexpected on win32:
test_gdb test_readline
1 re-run test:
test_regrtest
Total duration: 29 min 51 sec
Tests result: FAILURE then FAILURE
test test_regrtest failed -- Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windowsvs9\build\lib\test\test_regrtest.py",
 line 662, in test_env_changed
self.check_executed_tests(output, [testname], env_changed=testname)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windowsvs9\build\lib\test\test_regrtest.py",
 line 140, in check_executed_tests
self.check_line(output, regex)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windowsvs9\build\lib\test\test_regrtest.py",
 line 87, in check_line
self.assertRegexpMatches(output, regex)
AssertionError: Regexp didn't match: '^1 test altered the execution 
environment:\\ntest_regrtest_noop33$' not found in 'Run tests 
sequentially\n0:00:00 [1/1] test_regrtest_noop33\n\n== Tests result: SUCCESS 
==\n\n1 test OK.\n\nTotal duration: 20 ms\nTests result: SUCCESS\n'


Both failures mention "test_regrtest_noop33".

--
nosy: +pablogsal

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 46cb5fd706563673663e676bb70f46a73f4edc89 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396). 
(GH-8400)
https://github.com/python/cpython/commit/46cb5fd706563673663e676bb70f46a73f4edc89


--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0ff174643437f34c50c8625462b5419b1a643b57 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8399)
https://github.com/python/cpython/commit/0ff174643437f34c50c8625462b5419b1a643b57


--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c7b91d95d8890a4bafefa797f194a1ae3f0f0abb by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8398)
https://github.com/python/cpython/commit/c7b91d95d8890a4bafefa797f194a1ae3f0f0abb


--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7926

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7927

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7925

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c75c1e0e8aeb720ac3fcfab119b70cabba4e8235 by Serhiy Storchaka in 
branch 'master':
bpo-34189: Fix checking for bugfix Tcl version. (GH-8397)
https://github.com/python/cpython/commit/c75c1e0e8aeb720ac3fcfab119b70cabba4e8235


--

___
Python tracker 

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



[issue34180] bool(Q) always return True for a priority queue Q

2018-07-22 Thread Tim Peters


Tim Peters  added the comment:

I'm sure Guido designed the API to discourage subtly bug-ridden code relying on 
the mistaken belief that it _can_ know the queue's current size.  In the 
general multi-threaded context Queue is intended to be used, the only thing 
`.qsize()`'s caller can know is that the queue _had_ the returned size at some 
time in the past.  It can't know what the size is at the time the returned 
value is used.

Note that the docstrings still say that the `.empty()` and `.full()` methods 
are "likely to be removed at some point".  The only surprise to me is that 
`.qsize()` doesn't also say that.  As is, I still see race-ridden code on 
StackOverflow from time to time using `.qsize()`.  There are already plenty of 
warnings about that in the docs.

--
nosy: +tim.peters

___
Python tracker 

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



[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

We don't normally backport an exception message change unless its content, as 
opposed to style, is erroneous.

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7924

___
Python tracker 

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



[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread ppperry


Change by ppperry :


--
title: Use dicts to "transform" argparse arguments to values -> Allow dict 
choices to "transform" values in argpagse

___
Python tracker 

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



[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 041a4ee9456d716dd449d38a5328b82e76f5dbc4 by Serhiy Storchaka 
(Zackery Spytz) in branch '2.7':
bpo-25943: Check for integer overflow in bsddb's DB_join(). (GH-8392)
https://github.com/python/cpython/commit/041a4ee9456d716dd449d38a5328b82e76f5dbc4


--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e271ca78e37a502b3dc1036f824aa3999efcd56b by Serhiy Storchaka in 
branch 'master':
bpo-34189: Add simple tests for new Tk widget options. (GH-8396)
https://github.com/python/cpython/commit/e271ca78e37a502b3dc1036f824aa3999efcd56b


--

___
Python tracker 

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



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Few new options were added: see issue34189.

--

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Brett Cannon


Brett Cannon  added the comment:

I think we said backporting fixers was fine but I honestly don't remember.

On Sat, Jul 21, 2018, 23:22 Berker Peksag,  wrote:

>
> Berker Peksag  added the comment:
>
> Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do
> backport mimetypes additions (see
> https://github.com/python/cpython/commit/8204b903683f9e0f037ccfaa87622716019914d7
> for an example) I think lib2to3 falls into the same category as mimetypes
> and it might be better to keep fixers in sync at least in 3.7 and 3.8.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread Windson Yang


Windson Yang  added the comment:

Add a __del__ method in the Pool class should work. But I'm not sure we should 
do this.

--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The following PR adds simple tests for Tk widget options added in Tk 8.6.5.

TIP 441: Add -justify Configuration Option to the listbox Widget
https://core.tcl.tk/tips/doc/trunk/tip/441.md

TIP 437: Tk panedwindow options for proxy window
https://core.tcl.tk/tips/doc/trunk/tip/437.md

--
assignee: serhiy.storchaka
components: Tests, Tkinter
messages: 322149
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add simple tests for new Tk widget options
type: enhancement
versions: Python 2.7, 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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread Windson Yang


Change by Windson Yang :


--
nosy: +zach.ware

___
Python tracker 

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



[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-07-22 Thread Anjali Bansal


Anjali Bansal  added the comment:

Thank you for the information. I had started working on this issue. You can 
assign it to me if needed. I will create a PR soon.
Github Username: bansalanjali2512

--

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread tzickel


tzickel  added the comment:

But alas that does not work...

--
nosy: +davin, pitrou

___
Python tracker 

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



[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have added a simple patch based on the changes by 
https://bugs.python.org/issue29951. The C code related error messages doesn't 
seem to have been covered by tests and I have added some tests. I have limited 
knowledge of C and this is my first C patch so code comments if any will be 
helpful.

Thanks

--

___
Python tracker 

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



[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue20906] Issues in Unicode HOWTO

2018-07-22 Thread A.M. Kuchling


Change by A.M. Kuchling :


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



[issue34186] [3.6.6 on macOS] os.listdir replacing "/" with ":"

2018-07-22 Thread Todd

Todd  added the comment:

Ah, thank you for the link. I looked for something like that, but I obviously 
didn’t use the right wording while searching. 

Sorry for the false report and thanks for the quick help.

-Todd

Sent from my iPhone

> On Jul 21, 2018, at 10:10 PM, Zachary Ware  wrote:
> 
> 
> Zachary Ware  added the comment:
> 
> That's nothing to do with Python and everything to do with macOS.  As a test, 
> open Terminal, do `ls ~/Example`, and you'll see `AC:DC` instead of `AC/DC`.  
> As a further test, do `mkdir ~/Example/dir:with:colons` and then have a look 
> in Finder.
> 
> See here [1] for more information.
> 
> [1] 
> https://apple.stackexchange.com/questions/173529/when-did-the-colon-character-become-an-allowed-character-in-the-filesystem
> 
> --
> nosy: +zach.ware
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Zachary Ware


Zachary Ware  added the comment:

I like to think I'm fairly reasonable :).  You can get what you want by 
specifying `type=choices_dict.get`, or by extracting from the dict manually 
after calling `parse_args`.

--
nosy: +zach.ware

___
Python tracker 

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



[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +7920

___
Python tracker 

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



[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Zackery Spytz


Zackery Spytz  added the comment:

Integer overflow can also occur in DB_join().

--

___
Python tracker 

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



[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Victor Porton


New submission from Victor Porton :

The below code produces "rock", but it should produce "a". This (to use dict 
value instead of the key by argparse result) is both to be a new useful feature 
(for example to map strings in a command line to certain functions or classes 
provided as dict values) and conform to intuition better.

My feature proposal breaks backward compatibility, but I think no reasonable 
programmer wrote it in such a way that he relied on the current behavior for 
`dict` values for `choices`.

import argparse

parser = argparse.ArgumentParser(prog='game.py')
parser.add_argument('move', choices={'rock':'a', 'paper':'b', 'scissors':'c'})
print(parser.parse_args(['rock']))

--
components: Library (Lib)
messages: 322142
nosy: porton
priority: normal
severity: normal
status: open
title: Use dicts to "transform" argparse arguments to values
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



[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Victor Porton


Change by Victor Porton :


--
type:  -> behavior

___
Python tracker 

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



[issue34166] Tools/msgfmt.py emits a DeprecationWarning under Python 3.7

2018-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34181] Lib/test/test_typing.py failed when ran as a script

2018-07-22 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



[issue34181] Lib/test/test_typing.py failed when ran as a script

2018-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 81f85d09f4cc83fc35452afcca75baaf64831b22 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380) (GH-8385)
https://github.com/python/cpython/commit/81f85d09f4cc83fc35452afcca75baaf64831b22


--

___
Python tracker 

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-07-22 Thread Martin Panter

Martin Panter  added the comment:

FWIW more oddities with this paragraph could be fixed by:

* removing the first “and” from “HH is . . ., [and] MM is . . ., SS is . . . 
and uu is”,
* changing the condition for omitting “uu” from “a whole number of 
[minutes]” to “seconds”, and
* changing “the [SS parts are] omitted” to singular “SS part is”.

--
nosy: +martin.panter

___
Python tracker 

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



[issue34115] code.InteractiveConsole.interact() closes stdin

2018-07-22 Thread Eryk Sun


Eryk Sun  added the comment:

> On Windows Console, sys.stdin.close() does not prevent a second 
> interact call.  This might be considered a bug.

This is a bug in io._WindowsConsoleIO. 

In Python 3, the sys.std* file objects that get created at startup use 
closefd=False:

>>> sys.stdin.buffer.raw.closefd
False
>>> sys.stdout.buffer.raw.closefd
False
>>> sys.stderr.buffer.raw.closefd
False

Since the REPL uses C FILE streams (or in 3.6+ the underlying console file 
handle in Windows), closing sys.stdin does not cause the REPL to exit, and the 
PyOS_ReadLine call in the interactive loop continues to work in both POSIX and 
Windows. 

That said, closing sys.stdin should cause input() to raise ValueError due to 
sys.stdin.fileno() failing (i.e. take the non-tty path) and subsequently 
sys.stdin.readline() failing. A second call to 
code.InteractiveConsole.interact() should thus fail. The issue is that the 
fileno() method of _WindowsConsoleIO isn't raising ValueError like it should 
when the file is closed and closefd is false. I've created issue 34187 with a 
suggested fix.

--
nosy: +eryksun

___
Python tracker 

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



[issue34187] Issues with lazy fd support in _WindowsConsoleIO fileno() and close()

2018-07-22 Thread Eryk Sun


New submission from Eryk Sun :

The _WindowsConsoleIO implementation of fileno should raise a ValueError if the 
internal handle value is INVALID_HANDLE_VALUE. Currently it raises 
io.UnsupportedOperation, and only if closefd=True. 

>>> f = open('conin$', 'r')
>>> f.close()
>>> f.fileno()
Traceback (most recent call last):
  File "", line 1, in 
io.UnsupportedOperation: Console buffer does not support fileno

>>> f = open(0, 'r', closefd=False)
>>> f.close()
>>> f.fileno()
0

Also, if lazily opening an fd fails when opening by name (con, conin$, 
conout$), it should also close the file handle to maintain a consistent state. 

This can be fixed as follows: error out immediately and call err_closed instead 
of err_mode; and close the handle if _open_osfhandle fails (i.e. fd == -1) and 
closehandle is set:

static PyObject *
_io__WindowsConsoleIO_fileno_impl(winconsoleio *self)
{
if (self->handle == INVALID_HANDLE_VALUE) {
return err_closed();
}

if (self->fd < 0) {
_Py_BEGIN_SUPPRESS_IPH
if (self->writable) {
self->fd = _open_osfhandle((intptr_t)self->handle,
_O_WRONLY | _O_BINARY);
} else {
self->fd = _open_osfhandle((intptr_t)self->handle,
_O_RDONLY | _O_BINARY);
}
_Py_END_SUPPRESS_IPH
}

if (self->fd < 0) {
if (self->closehandle) {
CloseHandle(self->handle);
}
self->handle = INVALID_HANDLE_VALUE;
return err_closed();
}

return PyLong_FromLong(self->fd);
}

On a related note, there's a bug in internal_close that could potentially be a 
race condition that closes a handle to an unrelated object. If an fd has been 
opened, the CRT takes control of the handle. Calling close() will also close 
the underlying handle. In this case CloseHandle should not be called. This just 
needs a minor fix to add an `else` clause:

static int
internal_close(winconsoleio *self)
{
if (self->handle != INVALID_HANDLE_VALUE) {
if (self->closehandle) {
if (self->fd >= 0) {
_Py_BEGIN_SUPPRESS_IPH
close(self->fd);
_Py_END_SUPPRESS_IPH
} else {
CloseHandle(self->handle);
}
}
self->handle = INVALID_HANDLE_VALUE;
self->fd = -1;
}
return 0;
}

--
components: IO, Windows
keywords: easy (C)
messages: 322138
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Issues with lazy fd support in _WindowsConsoleIO fileno() and close()
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



[issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE

2018-07-22 Thread Martin Panter

Martin Panter  added the comment:

Closing in faviour of Issue 30154, which suggests documentation or adjusting 
the timeout implementation. There is also Issue 26534 proposing a new 
“kill_group” option when using the timeout feature.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> subprocess.run with stderr connected to a pipe won't timeout 
when killing a never-ending shell commanad

___
Python tracker 

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



[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-07-22 Thread Martin Panter

Martin Panter  added the comment:

Can’t you use Python’s existing CLI 
 and environment 
variable  
to control the ResourceWarning messages?

Warnings where enabled by default when using the “unittest” module in Issue 
10535. There is probably a way to disable them, at least by using the 
“warnings” module directly. But I think ResourceWarning should stay enabled by 
default when running tests. As you said, the warnings help testing for bugs.

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2018-07-22 Thread STINNER Victor


STINNER Victor  added the comment:

I would say that Python no longer officially supports sparc and solaris
because of the lack of volunteer.

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-22 Thread Kay Hayen


Kay Hayen  added the comment:

As somebody whose opinion is even less important: Did you consider my 
suggestion to make it a "SyntaxError" for "del __annotations__" on a class 
level or even module level or at all? Or does this go too far?

Yours,
Kay

--

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do 
backport mimetypes additions (see 
https://github.com/python/cpython/commit/8204b903683f9e0f037ccfaa87622716019914d7
 for an example) I think lib2to3 falls into the same category as mimetypes and 
it might be better to keep fixers in sync at least in 3.7 and 3.8.

--

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +7919

___
Python tracker 

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