[issue30640] NULL + 1 in _PyFunction_FastCallDict(), PyEval_EvalCodeEx()

2017-07-30 Thread Zackery Spytz

Zackery Spytz added the comment:

As mentioned in PR 2919, this is an issue in PyEval_EvalCodeEx() as well.

--
nosy: +ZackerySpytz
title: NULL + 1 in _PyFunction_FastCallDict() -> NULL + 1 in 
_PyFunction_FastCallDict(), PyEval_EvalCodeEx()

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue31087] asyncio.create_subprocess_* do not honor `encoding`

2017-07-30 Thread Alex

Changes by Alex :


--
components: +asyncio
nosy: +yselivanov
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



[issue31087] asyncio.create_subprocess_* do not honor `encoding`

2017-07-30 Thread Alex

New submission from Alex:

Regardless of the value of `encoding`, StreamReaders returned for the 
`asyncio.subprocess.Process`'s `stdout` and `stderr` would be in binary mode.

import sys
import asyncio
import subprocess

async def main():
sp = await asyncio.create_subprocess_exec('ls', '-la',
  stdin=None,
  stdout=subprocess.PIPE,
  encoding='utf8')
await sp.wait()
data = await sp.stdout.read()
print(data)
print(isinstance(data, bytes))

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

There are two naive solutions:

- `create_subprocess_*` could explicitly raise when provided any `encoding` and 
`errors` (like it now does with `universal_newlines`).

- or implement encoding conversions for StreamReaders (and StreamWriters), and 
forward those.

Of course it would be better to have conversions, but I don't know how those 
will have to deal with decoding partially available data - e.g. returning in 
the middle of surrogate pair, or having only half a codepoint for UTF16. There 
should likely cache partial data to process at the next read, but this would 
require rewriting codecs to support partial decode... seems like it's not that 
easy :(

--
messages: 299537
nosy: toriningen
priority: normal
severity: normal
status: open
title: asyncio.create_subprocess_* do not honor `encoding`

___
Python tracker 

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



[issue30987] Support for ISO-TP protocol in SocketCAN

2017-07-30 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3004

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Steven D'Aprano

Steven D'Aprano added the comment:

If you don't care about the name, just pass '_' for it.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue31086] Add namedattrgetter function which acts like attrgetter but uses namedtuple

2017-07-30 Thread Isaac Morland

Isaac Morland added the comment:

Here is the diff.  Note that I assume implementation of #31085, which allows me 
to push determination of a name for the namedtuple down into namedtuple itself:

diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 62cf708..d507d23 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -14,7 +14,8 @@ list, set, and tuple.
 
 '''
 
-__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
+__all__ = ['deque', 'defaultdict', 'namedtuple', 'namedattrgetter',
+'UserDict', 'UserList',
 'UserString', 'Counter', 'OrderedDict', 'ChainMap']
 
 # For backwards compatibility, continue to make the collections ABCs
@@ -23,7 +24,7 @@ from _collections_abc import *
 import _collections_abc
 __all__ += _collections_abc.__all__
 
-from operator import itemgetter as _itemgetter, eq as _eq
+from operator import itemgetter as _itemgetter, attrgetter as _attrgetter, eq 
as _eq
 from keyword import iskeyword as _iskeyword
 import sys as _sys
 import heapq as _heapq
@@ -451,6 +452,14 @@ def namedtuple(typename, field_names, *, verbose=False, 
rename=False, module=Non
 
 return result
 
+def namedattrgetter (attr, *attrs):
+ag = _attrgetter (attr, *attrs)
+
+if attrs:
+nt = namedtuple (None, (attr,) + attrs, rename=True)
+return lambda obj: nt._make (ag (obj))
+else:
+return ag
 
 
 ###  Counter

--

___
Python tracker 

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



[issue31086] Add namedattrgetter function which acts like attrgetter but uses namedtuple

2017-07-30 Thread Isaac Morland

New submission from Isaac Morland:

This is meant to replace my proposal in #30020 to change attrgetter to use 
namedtuple.  By creating a new function implemented in Python, I avoid making 
changes to the existing attrgetter, which means that both the need of 
implementing a C version and the risk of changing the performance or other 
characteristics of the existing function are eliminated.

My suggestion is to put this in the collections module next to namedtuple.  
This eliminates the circular import problem and is a natural fit as it is an 
application of namedtuple.

--
components: Library (Lib)
messages: 299534
nosy: Isaac Morland
priority: normal
severity: normal
status: open
title: Add namedattrgetter function which acts like attrgetter but uses 
namedtuple
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



[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +rhettinger

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Isaac Morland

Isaac Morland added the comment:

I'm hoping to make a pull request but while I figure that out here is the diff:

diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 8408255..62cf708 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -384,7 +384,6 @@ def namedtuple(typename, field_names, *, verbose=False, 
rename=False, module=Non
 if isinstance(field_names, str):
 field_names = field_names.replace(',', ' ').split()
 field_names = list(map(str, field_names))
-typename = str(typename)
 if rename:
 seen = set()
 for index, name in enumerate(field_names):
@@ -394,6 +393,10 @@ def namedtuple(typename, field_names, *, verbose=False, 
rename=False, module=Non
 or name in seen):
 field_names[index] = '_%d' % index
 seen.add(name)
+if typename is None:
+typename = '__'.join (field_names)
+else:
+typename = str(typename)
 for name in [typename] + field_names:
 if type(name) is not str:
 raise TypeError('Type names and field names must be strings')

--

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-07-30 Thread Isaac Morland

New submission from Isaac Morland:

I would like to have the possibility of creating a namedtuple type without 
explicitly giving it a name.  I see two major use cases for this:

1) Automatic creation of namedtuples for things like CSV files with headers 
(see #1818) or SQL results (see #13299).  In this case at the point of calling 
namedtuple I have column headings (or otherwise automatically-determined 
attribute names), but there probably isn't a specific class name that makes 
sense to use.

2) Subclassing from a namedtuple invocation; I obviously need to name my 
subclass, but the name passed to the namedtuple invocation is essentially 
useless.

My idea is to allow giving None for the typename parameter of namedtuple, like 
this:

class MyCustomBehaviourNamedtuple (namedtuple (None, ['a', 'b'])):
...

In this case namedtuple will generate a name based on the field names.

This should be backward compatible because right now passing None raises a 
TypeError.  So there is no change if a non-None typename is passed, and an 
exception is replaced by computing a default typename if None is passed.

Patch to follow.

--
components: Library (Lib)
messages: 299532
nosy: Isaac Morland
priority: normal
severity: normal
status: open
title: Add option for namedtuple to name its result type automatically
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



[issue26732] multiprocessing sentinel resource leak

2017-07-30 Thread Kevin Quick

Kevin Quick added the comment:

Hi Antoine,

> ... an implementation detail rather than a documented feature

I understand your desire, but this is a leaky abstraction and I would still 
suggest that it should be more clear that the fork method will inherit *all* 
resources from the parent, including multiprocessing internal resources related 
to other processes.  This is potentially important if there are (a) large 
numbers of processes to be created and (b) for security aspects.

Regards,
  Kevin

--

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Much easier the 2nd time ;-)

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

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 8c4e5be1dfb4d1c74e8cc7ac925e3196818e07ac by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31050: IDLE: Factor GenPage class from ConfigDialog (GH-2952) (#2955)
https://github.com/python/cpython/commit/8c4e5be1dfb4d1c74e8cc7ac925e3196818e07ac


--

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3003

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset e8eb17b2c11dcd1550a94b175e557c234a804482 by Terry Jan Reedy 
(csabella) in branch 'master':
bpo-31050: IDLE: Factor GenPage class from ConfigDialog (#2952)
https://github.com/python/cpython/commit/e8eb17b2c11dcd1550a94b175e557c234a804482


--

___
Python tracker 

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



[issue30842] pyenv activate for bash and tcsh

2017-07-30 Thread Arnon Sela

Arnon Sela added the comment:

The procedure:

pushd $fullpath
fullpath=$(pwd -P)
popd

Can be made sh (and other shells) friendly by:

here=$PWD # or $(pwd)
cd $fullpath
fullpath=$(pwd -P)
cd $here

More to write, but should work, right?

--

___
Python tracker 

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



[issue31084] QueueHandler not formatting messages

2017-07-30 Thread favll

Changes by favll :


--
pull_requests: +3001

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2017-07-30 Thread Alexander Mohr

Alexander Mohr added the comment:

I'm tracking something very similar issue to this in bug: 
http://bugs.python.org/issue31061  Given its similarities, anyone have any 
ideas?  Based on the second callstack I'm starting to think this is an issue 
with defaultdict

--
nosy: +thehesiod

___
Python tracker 

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



[issue31084] QueueHandler not formatting messages

2017-07-30 Thread favll

New submission from favll:

QueueHandler does not seem to format messages when setting a Formatter and 
attaching the QueueHandler to a logger. See attachement for a concise example.

According to the internal documentation of the QueueHandler's prepare method it 
is expected that self.format(record) will format the message and put the 
message into record.message. However, this is not the case and 
self.format(record) only returns the message. So this should be ab easy fix.

--
components: Library (Lib)
files: queue_handler_bug.py
messages: 299525
nosy: favll
priority: normal
severity: normal
status: open
title: QueueHandler not formatting messages
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file47052/queue_handler_bug.py

___
Python tracker 

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



[issue31083] IDLE: document new TabPage(Frame) design for configdialog

2017-07-30 Thread Terry J. Reedy

New submission from Terry J. Reedy:

We are in the process of moving blocks of ConfigDialog methods pertaining to 
one tab page to a separate class. FontPage is more or less done.  GenPage is in 
process.  This issue is about documenting the generic structure of the classes 
in a comment block.  The following is extracted from msg299519 of #31050.

# class TabPage(Frame):
#def __init__(self, master):
#super().__init__(master)
#self.create_page_tab()
#self.load_tab_cfg()
#def create_page_tab():
# ...
 
The rest will be an adaptation of the description of the old design in the same 
message plus what we have actually done so far.

This issue includes editing FontPage to conform to the documented design.

--
assignee: terry.reedy
components: IDLE
messages: 299524
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: document new TabPage(Frame) design for configdialog
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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I intentionally left using non-default options other than traversal for a new 
issue or issues, after we finish ttk replacement.  I imagine there will be 
discussions about choices, and I will invite other participants.  I would like 
to direct visual design discussions, as opposed to internal implementation 
discussion, to idle_dev.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-30 Thread Alexander Mohr

Alexander Mohr added the comment:

btw got slightly difference stacktrace on second core file

--
Added file: http://bugs.python.org/file47051/python crash2.txt

___
Python tracker 

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



[issue31082] reduce takes iterable, not just sequence

2017-07-30 Thread Stefan Pochmann

New submission from Stefan Pochmann:

functools.reduce has a parameter called "iterable" and it only needs to be an 
iterable, not a sequence.

The paragraph documenting it says "sequence" instead of "iterable" six times:
https://docs.python.org/3/library/functools.html#functools.reduce

The help shown by executing "help(functools.reduce)" in Python additionally 
actually names the parameter "sequence" in the signature.

--
assignee: docs@python
components: Documentation
messages: 299520
nosy: Stefan Pochmann, docs@python
priority: normal
severity: normal
status: open
title: reduce takes iterable, not just sequence
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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I did not refresh this before writing the above.  It still applies, including 
deleting the commented out code once tests pass.  See review.

Whoops: I forgot that using make_default means that we can (and should) delete 
the replaced var_changed defs.  I added the one for space_num back because I 
mistakenly thought it was needed to make the test pass.

I will open a new issue to add a comment documenting the new TabPage(Frame) 
class design.  The new rules will include using default var_changes when 
possible. Patch will include adjusting FontTab to follow the new rules.

--

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Above, I left out the last step, "* remove old general block".

The old configdialog had an unwritten and undocumented template and rules for 
pages on the dialog.  It went something like the following.
# def create_widgets():
  * Pick names for the pages.  They are both tab labels and page ids.
  * Send names to tabbed_pages.
  * Call create_page_name functions.
# def load_configs():
  * Call each load_name_config.
# def create_page_name(): for each name.
 * Extract frame from tabbed_pages using name.
 * Define tk vars.
 * Create subframes and widgets
 * Pack widgets
# def var_changed_var_name(), for each tk var
 * Perhaps send change to changes dict.
# def other_method():, for each name, semi-sorted
# def load_name_config() for each name.
# Tack on extensions mostly ignoring the above.

What I said in the message above is that we have redefined the template well 
enough to follow it.  We have a mostly abstract template.

class NamePage(Frame):
def __init__(self, master):
super().__init__(master)
self.create_page_name()
self.load_name_cfg()
...

Note that the parameter is 'master', not 'parent', as is standard for widgets.  
It is also not saved, as it is not needed.  TkVars for the page can use self as 
master.

I considered making that an actual base class.  But there is little common 
code; it does not quite fit FontPage; and would require uniform 'create_page' 
and 'load_cfg' names.  The more specific names are easier to find with ^F ;-).

I do want to add a comment block above FontPage giving the design.  I also want 
to change FontPage to use self as master for tk vars and other widgets.

Lets freeze the General page block until this is done.

--

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3000

___
Python tracker 

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



[issue31050] IDLE, configdialog: Factor out GenTab class from ConfigDialog

2017-07-30 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Made all the changes without any issue.

One thing - I noticed that the var_changed_autosave, etc for the General tab 
were back, even though they aren't used by VarTrace.  I know I had deleted 
them, so I'm not sure how they came back.  Unless you re-added them?  That's 
what happened to me yesterday -- changes I knew I had made were back again.  
Anyway, if you want them back, sorry about deleting them again.  I just figured 
it was something that happened on my end.

Also, I snuck in a change to the Notebook.  I know it should be in its own PR.  
If you like it, I can leave it here or make a new PR.  :-)

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-30 Thread Alexander Mohr

Alexander Mohr added the comment:

hmm, how would I do that? btw I'm not 100% sure this is due to asyncio.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-30 Thread Alexander Mohr

Alexander Mohr added the comment:

this is the comment on the assert:

/* Python's cyclic gc should never see an incoming refcount 
 * of 0:  if something decref'ed to 0, it should have been 
 * deallocated immediately at that time. 
 * Possible cause (if the assert triggers):  a tp_dealloc  
 * routine left a gc-aware object tracked during its teardown 
 * phase, and did something-- or allowed something to happen -- 
 * that called back into Python.  gc can trigger then, and may 
 * see the still-tracked dying object.  Before this assert 
 * was added, such mistakes went on to allow gc to try to 
 * delete the object again.  In a debug build, that caused 
 * a mysterious segfault, when _Py_ForgetReference tried 
 * to remove the object from the doubly-linked list of all 
 * objects a second time.  In a release build, an actual 
 * double deallocation occurred, which leads to corruption 
 * of the allocator's internal bookkeeping pointers.  That's 
 * so serious that maybe this should be a release-build 
 * check instead of an assert?  
 */  

I've also attached a file that's similar to the code we run in production, 
however couldn't get it to reproduce the crash.  In the datafile it uses it has 
some tuples like the following:
StationTuple = namedtuple('StationTuple', ['stationname', 'stationsubtype', 
's2id'])

--
Added file: http://bugs.python.org/file47050/python_crash.py

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-30 Thread Yury Selivanov

Yury Selivanov added the comment:

>ok got a full debug core file, let me know what other information I can 
>provide.


Thank you. Does the crash happen with python versions of Tasks and Future?

--

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

At last! On to the next one.

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

___
Python tracker 

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



[issue30842] pyenv activate for bash and tcsh

2017-07-30 Thread Vinay Sajip

Vinay Sajip added the comment:

Note that the activate script currently also works with /bin/sh (using . 
venv-dir/bin/activate) but pushd and popd are not supported there, and 
introducing them would presumably break this script on /bin/sh.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-30 Thread Alexander Mohr

Alexander Mohr added the comment:

ok got a full debug core file, let me know what other information I can provide.

--
status: closed -> open
Added file: http://bugs.python.org/file47049/python crash.txt

___
Python tracker 

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



[issue31081] Release Build Failure on Ubuntu 14.04

2017-07-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> third party
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



[issue31081] Release Build Failure on Ubuntu 14.04

2017-07-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, if it's really a compiler bug, there's nothing we can do against it.  You 
should still be able to build without the --with-optimizations flag, which will 
give you a build perhaps 20% slower but still fully functional.

--

___
Python tracker 

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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-07-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue31081] Release Build Failure on Ubuntu 14.04

2017-07-30 Thread Scott Colby

Scott Colby added the comment:

You make a fair point. I didn't realize that my version of gcc was so far 
behind. Perhaps I ought to seek out a binary distribution of Python 3.6, since 
upgrading the whole of gcc doesn't seem quite worth my time.

If you don't think there is anything else to be done on Python's end, feel free 
to mark this resolved in some way.

(And indeed, the entire 4.8 series is no longer maintained.)

--

___
Python tracker 

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



[issue31081] Release Build Failure on Ubuntu 14.04

2017-07-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, as the log you posted shows, this seems to be a gcc bug.  Of course, I 
don't know if the gcc project still accepts bug reports for gcc 4.8, but we're 
unlikely to be able to help you here.

--
nosy: +pitrou

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 7582226a92481ca63dedbfe14ef465d1349d66a9 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) 
(GH-2905) (#2950)
https://github.com/python/cpython/commit/7582226a92481ca63dedbfe14ef465d1349d66a9


--

___
Python tracker 

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



[issue31081] Release Build Failure on Ubuntu 14.04

2017-07-30 Thread Scott Colby

New submission from Scott Colby:

After downloading and decompressing the latest 3.6.2 source release, I 
attempted to build as follows:

$ ./configure --enable-optimizations --enable-ipv6  # seems fine
$ make -s -j$(nproc)

At the end of the build I have this error reported:

Failed to build these modules:
_socket


Following modules built successfully but were removed because they could 
not be imported:
_asyncio  _ssl

Scrolling up, I see that the _asyncio and _ssl failures are due to _socket 
being missing. Scrolling up further, I see several warnings and errors, to wit:

*a series of tests that seem to go okay*
0:05:14 load avg: 0.62 [161/405] test_hash
0:05:15 load avg: 0.65 [162/405] test_hashlib
Fatal Python error: Segmentation fault

Current thread 0x2afbece8e380 (most recent call first):
  File "/usr/local/src/python/Python-3.6.2/Lib/test/support/__init__.py", 
line 1508 in gc_collect
  File 
"/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/save_env.py", line 271 
in __exit__
  File 
"/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/runtest.py", line 172 
in runtest_inner
  File 
"/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/runtest.py", line 137 
in runtest
  File "/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/main.py", 
line 374 in run_tests_sequential
  File "/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/main.py", 
line 454 in run_tests
  File "/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/main.py", 
line 530 in _main
  File "/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/main.py", 
line 504 in main
  File "/usr/local/src/python/Python-3.6.2/Lib/test/libregrtest/main.py", 
line 573 in main
  File "/usr/local/src/python/Python-3.6.2/Lib/test/regrtest.py", line 46 
in _main
  File "/usr/local/src/python/Python-3.6.2/Lib/test/regrtest.py", line 50 
in 
  File "/usr/local/src/python/Python-3.6.2/Lib/runpy.py", line 85 in 
_run_code
  File "/usr/local/src/python/Python-3.6.2/Lib/runpy.py", line 193 in 
_run_module_as_main
Segmentation fault (core dumped)

After this, the build seems to think all the tests are done and continues with 
"Rebuilding with profile guided optimizations:". There are a lot of warnings 
here, mostly about missing execution counts, which I assume comes from 3/4 of 
the tests not being run. Later on, however, we have this gem:

/usr/local/src/python/Python-3.6.2/Modules/socketmodule.c:7693:1: internal 
compiler error: in edge_badness, at ipa-inline.c:895
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Preprocessed source stored into /tmp/ccMFxPIP.out file, please attach this 
to your bugreport.
ERROR: Cannot create report: [Errno 17] File exists: 
'/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1.1000.crash'

I have gcc (Ubuntu 4.8.4-2ubuntu~14.04.3) 4.8.4

I'm new to building Python and even newer to reporting bugs here, so please let 
me know what additional information I should provide or steps I should take.

--
components: Build
files: ccMFxPIP.out
messages: 299507
nosy: scolby33
priority: normal
severity: normal
status: open
title: Release Build Failure on Ubuntu 14.04
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file47048/ccMFxPIP.out

___
Python tracker 

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



[issue31079] mathematically wrong results from int and long bit_length methods

2017-07-30 Thread Stefan Krah

Stefan Krah added the comment:

Thank you for your expertise.

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



[issue31079] mathematically wrong results from int and long bit_length methods

2017-07-30 Thread vinsci

vinsci added the comment:

>>> (0).bit_length.__doc__
"int.bit_length() -> int\n\nNumber of bits necessary to represent self in 
binary.\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6"

The library documentation has clearly been written in disregard of the 
advertised functionality in the docstrings of the methods.

The documentation is just echoing the flaws of the unit tests.

For the Python 3 variant of this issue, it can be added that the library 
documentation wrongly states that the method is "New in version 3.1.".

--

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2999

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset c9c85321df7803137a413d26db41aaa377b13d79 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-30928: Update IDLE News.txt. (GH-2948) (#2949)
https://github.com/python/cpython/commit/c9c85321df7803137a413d26db41aaa377b13d79


--

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 9397e2a87ed6e0e724ad71a0c751553620cb775e by Terry Jan Reedy 
(csabella) in branch 'master':
bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) (#2905)
https://github.com/python/cpython/commit/9397e2a87ed6e0e724ad71a0c751553620cb775e


--

___
Python tracker 

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



[issue31080] Allow `logging.config.fileConfig` to accept kwargs

2017-07-30 Thread Preston Landers

New submission from Preston Landers:

The function `logging.config.fileConfig` accepts `args` but it would be nice if 
it also accepted `kwargs`.

A simple patch seems to do it:

diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index d692514..4672b48 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -145,7 +145,9 @@ def _install_handlers(cp, formatters):
 klass = _resolve(klass)
 args = section["args"]
 args = eval(args, vars(logging))
-h = klass(*args)
+kwargs = section.get("kwargs", '{}')
+kwargs = eval(kwargs, vars(logging))
+h = klass(*args, **kwargs)
 if "level" in section:
 level = section["level"]
 h.setLevel(level)


Unless there are any objections I plan to submit a pull request. In my use case 
I have a Pyramid service which
uses `concurrent-log-handler` and it seems better to be able to name keyword 
args for file configuration.

--
components: Library (Lib)
messages: 299502
nosy: planders
priority: normal
severity: normal
status: open
title: Allow `logging.config.fileConfig` to accept kwargs
type: enhancement

___
Python tracker 

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



[issue31079] mathematically wrong results from int and long bit_length methods

2017-07-30 Thread Stefan Krah

Stefan Krah added the comment:

Look at Include/longobject.h and 
https://docs.python.org/3/library/stdtypes.html?highlight=bit_length#int.bit_length
 .

--
nosy: +skrah

___
Python tracker 

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



[issue31079] mathematically wrong results from int and long bit_length methods

2017-07-30 Thread vinsci

New submission from vinsci:

It takes as many bits to store the number 0 as the number 1, but the 
implementation claims it takes no bits at all to store a 0.

>>> (1).bit_length() == (0).bit_length() and True or False
False

It takes one extra bit to store the sign for negative numbers, but this isn't 
reflected in the implementations.

>>> (-1).bit_length() == 1 + (1).bit_length() and True or False
False

--
components: Library (Lib)
messages: 299500
nosy: vinsci
priority: normal
severity: normal
status: open
title: mathematically wrong results from int and long bit_length methods
type: behavior
versions: Python 2.7, Python 3.3, 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



[issue29670] argparse: does not respect required args pre-populated into namespace

2017-07-30 Thread paul j3

paul j3 added the comment:

Another pre-existing namespace issue

http://bugs.python.org/issue28734

When positional nargs='?' or '*', the default (or []) overwrites the namespace 
value.  That's because the posiitonals are always 'seen' (by an empty string), 
and `get_values` has special handling.  This action interacts with 
`take_action` and the handling of mutually_exclusive_groups.

--
versions: +Python 3.7 -Python 2.7

___
Python tracker 

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



[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-07-30 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue29504] blake2: compile error with -march=bdver2

2017-07-30 Thread devurandom

Changes by devurandom :


--
nosy: +devurandom

___
Python tracker 

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



[issue24827] round(1.65, 1) return 1.6 with decimal

2017-07-30 Thread Huan Wang

Huan Wang added the comment:

Hi Mark,

Thank you for your reply.

I went over again the answer from Zachary Ware published on 2015-08-08 09:36. I 
got the point that it is better to use string type of number.

>>> from decimal import Decimal, ROUND_HALF_UP
>>> Decimal("1.45")
Decimal('1.45')

>>> Decimal(Decimal("1.45").quantize(Decimal("0.1"), rounding=ROUND_HALF_UP))
Decimal('1.5')

I think it is better to make a tip in the Python tutorial.

--

___
Python tracker 

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



[issue24827] round(1.65, 1) return 1.6 with decimal

2017-07-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Huan,

This isn't a bug: see the earlier comments from Zachary Ware on this issue for 
explanations. When you compute `rounded(1.45, 0.1)`, you convert the *float* 
1.45 to a Decimal instance. Thanks to the What You See Is Not What You Get 
nature of binary floating point, the actual value stored for 1.45 is:

1.4499555910790149937383830547332763671875

Conversion from float to Decimal is exact, so the Decimal value you're working 
with is also a touch under 1.45:

>>> from decimal import Decimal
>>> Decimal(1.45)
Decimal('1.4499555910790149937383830547332763671875')

And so it correctly rounds down to `1.4`.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-07-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2998

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-07-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset c3aa47f655abe564a2c2fb6d091ab19bdc0113b5 by Terry Jan Reedy in 
branch 'master':
bpo-30928: Update IDLE News.txt. (#2948)
https://github.com/python/cpython/commit/c3aa47f655abe564a2c2fb6d091ab19bdc0113b5


--

___
Python tracker 

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



[issue30962] Add caching to logging.Logger.isEnabledFor()

2017-07-30 Thread Vinay Sajip

Changes by Vinay Sajip :


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



[issue30522] Allow replacing a logging.StreamHandler's stream

2017-07-30 Thread Vinay Sajip

Changes by Vinay Sajip :


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



[issue30522] Allow replacing a logging.StreamHandler's stream

2017-07-30 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 2543f50033208c1a8df04999082b11aa09e82a04 by Vinay Sajip in branch 
'master':
bpo-30522: Implemented a method to allow setting a logging.StreamHander's 
stream. (GH-2921)
https://github.com/python/cpython/commit/2543f50033208c1a8df04999082b11aa09e82a04


--

___
Python tracker 

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



[issue30962] Add caching to logging.Logger.isEnabledFor()

2017-07-30 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 78c18a9b9a1445f7c755929917a790ba02b4a5e0 by Vinay Sajip (Avram 
Lubkin) in branch 'master':
bpo-30962: Added caching to Logger.isEnabledFor() (GH-2752)
https://github.com/python/cpython/commit/78c18a9b9a1445f7c755929917a790ba02b4a5e0


--

___
Python tracker 

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



[issue24827] round(1.65, 1) return 1.6 with decimal

2017-07-30 Thread Huan Wang

Huan Wang added the comment:

Hello,
I was confused by the decimal module. The problem is that I want to 

from decimal import Decimal, ROUND_HALF_UP
def rounded(number, n):
''' Round the digits after the n_th decimal point by using
decimal module in python.

For example:
2.453 is rounded by the function of deal_round(2.453, 1),
it will return 2.5.
2.453 is rounded by the function of deal_round(2.453, 2),
it will return 2.45.
'''
val = Decimal(number)
acc = str(n)  # n = 0.1 or 0.01 or 0.001
return Decimal(val.quantize(Decimal(acc), rounding=ROUND_HALF_UP))

for x in np.arange(1.0, 4.01, 0.01):
rounded_val = rounded(x, 0.1)
print("{:}\t{:}".format(x, rounded_val))



The results obtained from the numpy array looks fine, but if I directly used 
rounded(1.45, 0.1), it yielded Decimal('1.4'), rather than Decimal('1.5').


I think it would be a bug.

--
nosy: +Huan
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-07-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2997

___
Python tracker 

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