[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01885f78b299 by Martin Panter in branch '2.7':
Issue #26439: Document that RTLD_NOW is always added
https://hg.python.org/cpython/rev/01885f78b299

New changeset 0db4403e62c4 by Martin Panter in branch '3.5':
Issue #26439: Document that RTLD_NOW is always added
https://hg.python.org/cpython/rev/0db4403e62c4

New changeset 4b7e51998a90 by Martin Panter in branch '3.6':
Issue #26439: Merge ctypes doc from 3.5 into 3.6
https://hg.python.org/cpython/rev/4b7e51998a90

New changeset f496fb6bf4a0 by Martin Panter in branch 'default':
Issue #26439: Merge ctypes doc from 3.6
https://hg.python.org/cpython/rev/f496fb6bf4a0

--
nosy: +python-dev

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-26 Thread Kubilay Kocak

Kubilay Kocak added the comment:

This (adding support for pkg-config) should be done in tandem with adding 
--with-foo-{include,library} arguments for each *external* dependency, which 
can be used for: libffi, readline, libintl, openssl, sqlite, db*, among others.

Values obtained from pkg-config should then use the same variables, but only if 
they are/have not been specified at the command line (./configure).

Doing this and a few other best-practice, standard autoconf things will enable 
us to drastically simplify and remove hacks in the Python configure.ac, 
Makefile and setup.py's long term.

--
nosy: +koobs

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM except tests.

But we should at least document the behavior of itermonthdates(), 
monthdatescalendar() and yeardatescalendar() at corner cases.

--

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-26 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Yes pkg-config is not ubiquitous. My idea is using it as a fallback, so that 
non-standard paths can be picked up easily.

> Note the bootstrap issue with that idea though; you'll need to make sure 
> _posixsubprocess is built before importing subprocess.

distutils.spawn.spawn or os.system can be used. setup.py uses the latter.

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

###
# Flipping a biased coin

from collections import Counter
from random import choices

print(Counter(choices(range(2), [0.9, 0.1], k=1000)))

###
# Bootstrapping

'From a small statistical sample infer a 90% confidence interval for the mean'
# http://statistics.about.com/od/Applications/a/Example-Of-Bootstrapping.htm

from statistics import mean
from random import choices

data = 1, 2, 4, 4, 10
means = sorted(mean(choices(data, k=5)) for i in range(20))
print('The sample mean of {:.1f} has a 90% confidence interval from {:.1f} to 
{:.1f}'.format(
  mean(data), means[1], means[-2]))

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Equidistributed examples:

choices(c.execute('SELECT name FROM Employees').fetchall(), k=20)
choices(['hearts', 'diamonds', 'spades', 'clubs'], k=5)
choices(list(product(card_facevalues, suits)), k=5)

Weighted selection examples:

  Counter(choices(['red', 'black', 'green'], [18, 18, 2], k=3800))   # american 
roulette
  Counter(choices(['hit', 'miss'], [5, 1], k=600))   # russian 
roulette
  choices(fetch('employees'), fetch('years_of_service'), k=100)  # tenure 
weighted
  choices(cohort, map(cancer_risk, map(risk_factors, cohort)), k=50) # risk 
weighted

Star unpacking example:

   transpose = lambda s: zip(*s)
   craps = [(2, 1), (3, 2), (4, 3), (5, 4), (6, 5), (7, 6), (8, 5), (9, 4), 
(10, 3), (11, 2), (12, 1)]
   print(choices(*transpose(craps), k=10))

Comparative APIs from other languages:

http://www.mathworks.com/help/stats/randsample.html
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.choice.html
https://stat.ethz.ch/R-manual/R-devel/library/base/html/sample.html
https://reference.wolfram.com/language/ref/RandomChoice.html

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39a4be5e003d by Raymond Hettinger in branch '3.6':
Issue #18844: Make the number of selections a keyword-only argument for 
random.choices().
https://hg.python.org/cpython/rev/39a4be5e003d

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Xiang Zhang

Xiang Zhang added the comment:

Patch LGTM. 

> I would rather not mess up with itermonthdates(), particularly in a bugfix 
> release.  We can postpone the discussion of a better way to handle date 
> over/underflow in itermonthdates() until 3.7.

Before finally find a better way, can we at least make the two extreme cases 
behaviours consistent? Both emitting an exception or a shorter list.

--

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer

Bert JW Regeer added the comment:

Updated versions this applies to.

--
versions: +Python 3.3, Python 3.4, 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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer

Changes by Bert JW Regeer :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer

Bert JW Regeer added the comment:

On line #890 in self.make_file() the check for _binary_file should be changed 
to also check for self.length >= 0.

https://github.com/python/cpython/blob/3.4/Lib/cgi.py#L890

becomes:

if self._binary_file or self.length >= 0:

_binary_file is only ever set if there is a content disposition, which there is 
not in the test case provided. In the case of no content disposition we can use 
the content-length as a hint that we have a file that has been uploaded. All 
files uploaded should be treated as binary if they are not a text type.

This is a duplicate of #27308, however the patch in that report is incorrect 
IMHO.

--
nosy: +X-Istence, haypo

___
Python tracker 

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



[issue27308] Inconsistency in cgi.FieldStorage() causes unicode/byte TypeError.

2016-09-26 Thread Bert JW Regeer

Bert JW Regeer added the comment:

This is not a duplicate of https://bugs.python.org/issue24764

--
nosy: +X-Istence

___
Python tracker 

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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-26 Thread Martin Panter

Martin Panter added the comment:

The purpose of the test seems to be to check that finding and loading works for 
widely-available libraries. However I suspect find_library("c") can fail on 
other platforms as well. Presumably that is why there is the special case for 
Cygwin at the top of the file.

Open SSL is also widely available, but not universal. I think it is even 
possible to build Python without SSL support, and the tests should not fail in 
this case.

Perhaps it would be okay to remove "m" and just run the test on 
find_library("c"). If so, we can adjust the test to call self.skipTest("C 
library not found"), which will warn that the test could not be run.

--
components: +Tests
nosy: +martin.panter
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue28282] find_library("c") defers to find_msvcrt()

2016-09-26 Thread Martin Panter

New submission from Martin Panter:

Issue 1793 added ctypes.util.find_msvcrt(), and special cases that map 
find_library("c") and "m" to the new function. However this contradicts the 
documentation 
:

‘On Windows, . . . a call like find_library("c") will fail and return None.’

I think the documentation needs updating or clarifying.

--
assignee: docs@python
components: Documentation, Windows, ctypes
messages: 277479
nosy: docs@python, martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: find_library("c") defers to find_msvcrt()
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-26 Thread naught101

naught101 added the comment:

It would be helpful if the docs at 
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.map
 and in `help(Pool.map)` mentioned starmap in a "see also" section at the 
bottom.

--
nosy: +naught101

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-26 Thread INADA Naoki

Changes by INADA Naoki :


--
versions: +Python 3.5

___
Python tracker 

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



[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

My patch for issue 28253 fixes this problem for itermonthdays2() and 
itermonthdays() methods.  As discussed there, fixing itermonthdates() would 
require changing a documented public interface.

--
assignee:  -> belopolsky
nosy: +belopolsky

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

issue28253-4.diff is issue28253-3.diff with tests.

--
Added file: http://bugs.python.org/file44837/issue28253-4.diff

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

issue28253-3.diff uses itertools.repeat().

--
Added file: http://bugs.python.org/file44836/issue28253-3.diff

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

issue28253-2.diff is a small performance improvement over issue28253.diff

--
Added file: http://bugs.python.org/file44835/issue28253-2.diff

___
Python tracker 

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



[issue20100] epoll docs are not clear with regards to CLOEXEC.

2016-09-26 Thread STINNER Victor

STINNER Victor added the comment:

I dislike this change. Python is not responsible to check parameters of OS
syscalls, this function should be a thin wrapper to the OS function. Linux
may add new flags in the future.

Le lundi 26 septembre 2016, Roundup Robot  a écrit :

>
> Roundup Robot added the comment:
>
> New changeset ac24e5c2fd3e by Berker Peksag in branch 'default':
> Issue #20100: Simplify newPyEpoll_Object()
> https://hg.python.org/cpython/rev/ac24e5c2fd3e
>
> --
>
> ___
> Python tracker >
> 
> ___
>

--

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +doerwalter

___
Python tracker 

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



[issue8957] strptime(.., '%c') fails to parse output of strftime('%c', ..) in some locales

2016-09-26 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Thank you for your 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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1aae9b7ff321 by Serhiy Storchaka in branch '2.7':
Issue #27897: Backported tests.
https://hg.python.org/cpython/rev/1aae9b7ff321

--

___
Python tracker 

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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c739660489c1 by Serhiy Storchaka in branch '3.5':
Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
https://hg.python.org/cpython/rev/c739660489c1

New changeset c2eb90422aec by Serhiy Storchaka in branch '3.6':
Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
https://hg.python.org/cpython/rev/c2eb90422aec

New changeset 9fc2b6dba9c2 by Serhiy Storchaka in branch 'default':
Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
https://hg.python.org/cpython/rev/9fc2b6dba9c2

--
nosy: +python-dev

___
Python tracker 

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



[issue28279] setuptools failing to read from setup.cfg only in Python 3.6

2016-09-26 Thread Roy Williams

Changes by Roy Williams :


--
type:  -> behavior

___
Python tracker 

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



[issue24098] Multiple use after frees in obj2ast_* methods

2016-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Please note that Python/Python-ast.c is automatically generated by 
Parser/asdl_c.py.

--
nosy: +benjamin.peterson, berker.peksag

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> unless we remove all date limits that is much harder issue

I don't think this is too hard.  I think the original implementation did not 
have date limits.  I've opened a separate issue for this.  See #28281.

--

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-26 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

The calendar module currently relies on datetime for some calculations and is 
therefore restricted to years 1 through .  With exception to some public 
methods that are documented to return datetime.date instances, this dependence 
on the datetime module can be removed.

--
assignee: belopolsky
messages: 277467
nosy: belopolsky, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Remove year limits from calendar
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



[issue20100] epoll docs are not clear with regards to CLOEXEC.

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac24e5c2fd3e by Berker Peksag in branch 'default':
Issue #20100: Simplify newPyEpoll_Object()
https://hg.python.org/cpython/rev/ac24e5c2fd3e

--

___
Python tracker 

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



[issue20100] epoll docs are not clear with regards to CLOEXEC.

2016-09-26 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Yury Selivanov

Yury Selivanov added the comment:

> Jim ask for a backport.

Sorry Jim, was replying from my email client, didn't see all messages.

> This is arguably a security issue because it's a DoS vector.

Yeah, I can see why.  I can commit this to 3.4 in a week.  Christian, feel free 
to commit this if you want this issue to be closed earlier.

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I am attaching the proposed reimplementation of itermonthdays2() and 
itermonthdays().  It does not use itermonthdates() and is not that complicated. 
 It passes test_calendar, but I did not test it further than that.

I would rather not mess up with itermonthdates(), particularly in a bugfix 
release.  We can postpone the discussion of a better way to handle date 
over/underflow in itermonthdates() until 3.7.

--
Added file: http://bugs.python.org/file44834/issue28253.diff

___
Python tracker 

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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
stage:  -> patch review
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



[issue10673] multiprocess.Process join method - timeout indistinguishable from success

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 112060f8abe8 by Berker Peksag in branch '3.5':
Issue #10673: Document that Process.exitcode can be used to determine timeout
https://hg.python.org/cpython/rev/112060f8abe8

New changeset 0414ce8a3b5c by Berker Peksag in branch '3.6':
Issue #10673: Merge from 3.5
https://hg.python.org/cpython/rev/0414ce8a3b5c

New changeset f91650739061 by Berker Peksag in branch 'default':
Issue #10673: Merge from 3.6
https://hg.python.org/cpython/rev/f91650739061

--
nosy: +python-dev

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Jim Fulton

Jim Fulton added the comment:

This is arguably a security issue because it's a DoS vector.

I don't feel strongly about it though.

--

___
Python tracker 

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



[issue10673] multiprocess.Process join method - timeout indistinguishable from success

2016-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Tom.

--
components:  -Library (Lib)
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Jim ask for a backport. In case the problem is not a security issue that needs 
to be backported, feel free to close the ticket.

--

___
Python tracker 

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



[issue27914] Incorrect comment in PyModule_ExcDef

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch!

--
nosy: +serhiy.storchaka
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Yury Selivanov

Yury Selivanov added the comment:

Isn't 3.4 in security fixes only mode?

--
status: pending -> open

___
Python tracker 

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



[issue27914] Incorrect comment in PyModule_ExcDef

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cf16c627c17 by Serhiy Storchaka in branch '3.6':
Issue #27914: Fixed a comment in PyModule_ExcDef.
https://hg.python.org/cpython/rev/2cf16c627c17

New changeset a944b08d1ac7 by Serhiy Storchaka in branch 'default':
Issue #27914: Fixed a comment in PyModule_ExcDef.
https://hg.python.org/cpython/rev/a944b08d1ac7

--
nosy: +python-dev

___
Python tracker 

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



[issue18893] invalid exception handling in Lib/ctypes/macholib/dyld.py

2016-09-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue18893] invalid exception handling in Lib/ctypes/macholib/dyld.py

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9f34d382eda by Berker Peksag in branch '3.5':
Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py
https://hg.python.org/cpython/rev/e9f34d382eda

New changeset 708337cd8e6a by Berker Peksag in branch '3.6':
Issue #18893: Merge from 3.5
https://hg.python.org/cpython/rev/708337cd8e6a

New changeset b9d9c49d5b50 by Berker Peksag in branch 'default':
Issue #18893: Merge from 3.6
https://hg.python.org/cpython/rev/b9d9c49d5b50

--
nosy: +python-dev

___
Python tracker 

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5d80a8e16edd by Serhiy Storchaka in branch '3.6':
issue #28144: Decrease empty_keys_struct's dk_refcnt
https://hg.python.org/cpython/rev/5d80a8e16edd

New changeset a579a0354d85 by Serhiy Storchaka in branch 'default':
issue #28144: Decrease empty_keys_struct's dk_refcnt
https://hg.python.org/cpython/rev/a579a0354d85

--
nosy: +python-dev

___
Python tracker 

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Xiang Zhang!

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  -> patch review
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



[issue28222] test_distutils fails

2016-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Distutils
nosy: +dstufft, eric.araujo
stage:  -> needs patch

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, the current documentation is an impossibility (unless we remove all date 
limits that is much harder issue). Raisin OverflowError will make the 
implementation of itermonthdays2() and itermonthdays() more complex. Yielding 
dummy instances or None requires rewriting user code (less with a dummy 
instance if we are lucky). I agree that in long perspective yielding None looks 
better.

--

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee: christian.heimes -> 
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually the behavior of the print statement in Python 2 is more complex.

"print x," doesn't output a space after x, but sets the softspace attribute of 
the file to true (unless x is a string ending with non-space whitespace 
character like \n or \t). print tests this flag before outputting a value and 
outputs a space if it is true. Any output to a file resets this flag. This 
behavior can't be exactly reproduced in Python 3.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Yuri, are you going to backport the fix to 3.4?

--
assignee:  -> yselivanov
nosy: +christian.heimes
status: open -> pending
versions:  -Python 3.5

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> itermonthdates() is documented public method

The current documentation is an impossibility:

"The iterator will yield datetime.date values and will always iterate through 
complete weeks, so it will yield dates outside the specified
month."

The current implementation deals with this impossibility differently for months 
(, 12) and (1, 1).  In the first case, the iterators stops on an out of 
bounds date:

>>> list(calendar.Calendar().itermonthdates(, 12))[-1]
datetime.date(, 12, 31)
>>> list(calendar.Calendar().itermonthdates(, 12))[-1].weekday()
4

but in the second, it raises the OverflowError:

>>> next(calendar.Calendar(1).itermonthdates(1, 1))
Traceback (most recent call last):
  File "", line 1, in 
  File "calendar.py", line 160, in itermonthdates
date -= datetime.timedelta(days=days)
OverflowError: date value out of range

Returning dummy instances instead of datetime.date in these cases will only 
make debugging harder for the users of .itermonthdates().  Sooner or later they 
would want to do something the returned value that the dummy won't support.  If 
you are willing to sacrifice the "will yield datetime.date values" for "will 
always iterate through complete weeks", I would make it yield None for out of 
bounds values and require the caller to deal with this possibility right away.

A better solution would be to simply raise OverflowError whenever the range of 
itermonthdates() does not fit within [date.min, date.max].

--

___
Python tracker 

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



[issue28182] Expose OpenSSL verification results in SSLError

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

For hostname verification it might be a good idea to add a replacement for 
ssl.CertificateError.

--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-09-26 Thread Bar Harel

Bar Harel added the comment:

I personally prefer the __copy__ mechanism as I think a bugfix shouldn't be 
10% backwards compatible, chances of issues are low, and it's cleaner, more 
efficient and how things should be.

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Note that the stop on date.max behavior was introduced in #15421.

--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-09-26 Thread Bar Harel

Changes by Bar Harel :


Added file: http://bugs.python.org/file44833/issue27141_patch_rev1_opt2.patch

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-09-26 Thread Bar Harel

Bar Harel added the comment:

Alright. 2 patches are available.

opt_1 makes the use of __copy__.

Advantages:

- Clean
- Does not affect pickling at all
- More memory efficient

Disadvantages:

- Might be missing something from the normal copy mechanism (e.g. UserList 
doesn't implement __slots__ but it somewhat interferes with future 
implementation)
- Doesn't call __reduce__, __getstate__, ... while people might rely on it for 
some reason during copy, thus it might not be entirely backwards compatible

opt_2 makes use of __reduce__.

Advantages:

- Lowest in the chain. Shouldn't cause any backwards compatibility issues as if 
the user manually defined __getstate__ or __reduce_ex__ himself, the code as 
far as he's concerned did not change.
- Uses the default mechanism for copying. Changes in the protocol will not 
cause any bug in here.

Disadvantages:

- Affects pickling, messes up with the __reduce__ protocol.
- Takes more memory during pickling as it recreates the dict.
- Uglier as a personal opinion.

__getstate__ was not attempted as it will break backwards compatibility for 
sure if someone wrote a __reduce__ method (as it won't be called), but it's 
also a viable option.

Both patches contain tests and both fix the bug in UserDict and UserList.

--
versions: +Python 3.7
Added file: http://bugs.python.org/file44832/issue27141_patch_rev1_opt1.patch

___
Python tracker 

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



[issue28194] Clean up some checks in dict implementation

2016-09-26 Thread Serhiy Storchaka

Changes 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



[issue28194] Clean up some checks in dict implementation

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1d41d741bb5b by Serhiy Storchaka in branch '3.6':
Issue #28194: Clean up some checks in dict implementation.
https://hg.python.org/cpython/rev/1d41d741bb5b

New changeset b83a70afca39 by Serhiy Storchaka in branch 'default':
Issue #28194: Clean up some checks in dict implementation.
https://hg.python.org/cpython/rev/b83a70afca39

--
nosy: +python-dev

___
Python tracker 

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



[issue28280] Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items

2016-09-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() can return a list or 
tuple (because they use PySequence_Fast). But end users of this API often work 
only with lists and raise an exception if corresponding mapping methods return 
an instance of other type (actually only for tuples). See 
Modules/posixmodule.c, Modules/_winapi.c, Modules/_sre.c. The type is even not 
checked in the latter file.

Old documentation said that PyMapping_Keys(o) is equivalent to the Python 
expression list(o.keys()). Maybe it is worth to make this true. Make 
PyMapping_Keys(o) etc always returning a list. This could simplify the code 
that uses this C API. Since keys() etc usually return a dict view, a list or a 
generator, but not a tuple, this unlikely will cause performance regression.

--
components: Interpreter Core
messages: 277443
nosy: rhettinger, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items
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



[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-26 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Well, I could see a "friendly" repr being avoided to:

1. Save work (iterating safely involves iteration guards and explicitly 
acquiring strong references to every key)
2. Avoid pretending the state is stable (the repr at time X could be different 
at time X+epsilon)
3. Avoiding the possibility of __repr__ implementations for contained items 
doing terrible things (e.g. mutating the WeakKeyDictionary, or deleting the 
last external reference to a key). In the case where a __repr__ deletes the 
last external reference to a key that WeakKeyDictionary's __repr__ already 
iterated past, it means the repr is wrong before it even returns.
4. The repr wouldn't match the normal repr behavior; ideally, you can copy and 
paste a repr and get back an equivalent object. But of course, copy and pasting 
WeakKeyDictionary({Spam(1): 1, Spam(2): 2}) would actually get you back 
WeakKeyDictionary({}), because the objects you passed in don't share the 
identity of the ones in the original WeakKeyDictionary (which have existing 
references somewhere), and the instant the constructor returns, they'd lose 
their last reference and be deleted from the newly created WeakKeyDictionary
5. The above problems get even worse if the repr ends up being reentrant (which 
is more likely in this case; weakrefs are often used to break cycles); any 
stage of the recursive repr could end up mutating

None of these mean that the feature would be impossible/undesirable. #4 *might* 
be a reason to keep __repr__ as is though, and have __str__ display the more 
friendly version (e.g. `return '{}({!r})'.format(type(self).__name__, 
dict(self))` ); __str__ is supposed to be friendly without being a means of 
reproducing the object, so it wouldn't be quite as misleading.

--
nosy: +josh.r

___
Python tracker 

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



[issue28211] Wrong return value type in the doc of PyMapping_Keys/Values/Items

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your report and patch Xiang Zhang!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue28211] Wrong return value type in the doc of PyMapping_Keys/Values/Items

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68fc808bed9f by Serhiy Storchaka in branch '3.5':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/68fc808bed9f

New changeset 21336392a680 by Serhiy Storchaka in branch '3.6':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/21336392a680

New changeset 1229de1ab5c8 by Serhiy Storchaka in branch 'default':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/1229de1ab5c8

--

___
Python tracker 

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



[issue25909] Incorrect documentation for PyMapping_Items and like

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68fc808bed9f by Serhiy Storchaka in branch '3.5':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/68fc808bed9f

New changeset 21336392a680 by Serhiy Storchaka in branch '3.6':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/21336392a680

New changeset 1229de1ab5c8 by Serhiy Storchaka in branch 'default':
Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
https://hg.python.org/cpython/rev/1229de1ab5c8

--

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-26 Thread Ned Deily

Ned Deily added the comment:

Any solution using pkg-config would need to take into account that pkg-config 
may not be available (by default) on platforms we support; for example, AFAIK, 
Apple does not ship pkg-config in the base OS or any of its developer tools.  
And the solution would need to be careful to not break the ability to use the 
subset of Distutils the top-level setup.py needs to bootstrap build the 
standard library.  Also keep in mind that a lot of this proposed functionality 
is (or should be) available today by using Modules/Setup.local.

--
nosy: +ned.deily

___
Python tracker 

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



[issue25909] Incorrect documentation for PyMapping_Items and like

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Seems I was wrong. PyDict_Keys/PyDict_Values/PyDict_Items return a list in 
Python 3. Thus comments in Include/abstract.h were correct. Xiang Zhang noticed 
this in issue28211.

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

itermonthdates() is documented public method. We should do something with it. 
Maybe emitting dummy data instances is the simplest way to solve this issue.

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On the second thought, I don't see why itermonthdays2() and itermonthdays() 
need to use itermonthdates() at all.  It looks like it is easy to implement 
those using monthrange() and some simple integer arithmetics.

--

___
Python tracker 

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



[issue28279] setuptools failing to read from setup.cfg only in Python 3.6

2016-09-26 Thread Roy Williams

New submission from Roy Williams:

Howdy,

I'm attempting to make a change to the mock package in Python (related to 
http://bugs.python.org/issue28260), and it appears their CI is broken in Python 
3.6 only. The problem appears to originate from setuptools, but this only fails 
in Python 3.6

Here's the last time the mock jobs passed:
https://travis-ci.org/testing-cabal/mock/jobs/153850304 
Here's where they started failing:
https://travis-ci.org/testing-cabal/mock/jobs/159121114

Here's the core of the issue. AFAICT in Python 3.6 setuptools isn't parsing (or 
is incorrectly parsing) setup.cfg.  I filed 
https://github.com/pypa/setuptools/issues/800 with the PyPA folks, but honestly 
I am unsure if the issue is Python itself or setuptools.

Interestingly, when this build went from "passing" to "failing", both were 
running Python 3.6.0a4+.  

1.43s$ pip install -U .[docs,test]
Processing /home/travis/build/testing-cabal/mock
  mock 2.0.1.dev2 does not provide the extra 'docs'
  mock 2.0.1.dev2 does not provide the extra 'test'
Installing collected packages: mock
  Found existing installation: mock 2.0.0
Uninstalling mock-2.0.0:
  Successfully uninstalled mock-2.0.0
  Running setup.py install for mock ... done
Successfully installed mock-2.0.1.dev2
I attempted to force travis to pin to the latest version of setuptools and had 
the same issue (only in Python 3.6, not 3.5 - 
https://travis-ci.org/testing-cabal/mock/builds/162838672)

--
components: Distutils
messages: 277434
nosy: Roy Williams, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: setuptools failing to read from setup.cfg only in Python 3.6
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



[issue28253] calendar.prcal(9999) output has a problem

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I would leave itermonthdates() alone and just fix itermonthdays2() (and 
itermonthdays() for consistency) as Xiang suggested.  The fix can be 
implemented by breaking on date.month != month and adding something like

for wd in range(date.weekday(), 7):
yield (0, wd)

after the existing for loop.

--
nosy: +belopolsky

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-09-26 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The "What’s New In Python 3.6" page should really get an update to mention 
Flag, IntFlag and auto as enhancements to the enum module. Right now, the ssl 
module update docs mentions (but does not properly link for some reason) 
IntFlag, but otherwise, there is no mention of the new feature in either the 
"What's New" docs or even in the theoretically comprehensive changelog; if you 
don't think to look at the enum module itself, you'd never know there were new 
features to use.

--
nosy: +josh.r

___
Python tracker 

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



[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +fdrake, pitrou
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-26 Thread Ram Rachum

New submission from Ram Rachum:

Both `WeakKeyDictionary` and `WeakValueDictionary` have opaque `__repr__` 
methods:

>>> x = weakref.WeakKeyDictionary({object: 2, type: 4,})
>>> x

>>> dict(x)
{: 4, : 2}

This makes it annoying to view them at a glance. Is there a reason for it? (I 
don't know, maybe because they're weakref? Though I'm not sure how that would 
affect this decision.)

If there isn't a reason, then maybe there should be a nice `__repr__` that lets 
you see the objects inside?

--
components: Library (Lib)
messages: 277431
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Make `weakref.WeakKeyDictionary.__repr__` meaningful
type: enhancement
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



[issue28190] Detect curses headers correctly for cross-compiling

2016-09-26 Thread Matthias Klose

Matthias Klose added the comment:

looks good to me, thanks for working on this.

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-09-26 Thread Michael Felt

Michael Felt added the comment:

Sigh - missed the feature cutoff that would have made this easier to get into 
python...

Anyway - have learned a few new things about python def: syntax and removed 
some bits that I thought were suitable for variable "initialization" - but tend 
to be static (not what I was thinking).

Also, "new and improved" comments about what the code is doing.

Thank you all for your patience and feedback - especially Martin!

--
versions: +Python 3.7
Added file: http://bugs.python.org/file44831/Python3.6.Lib.ctypes.160926.patch

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Ah, I misunderstood MSG_TRUNC. It's not a buffer overflow. MSG_TRUNC does not 
write beyond the end of the buffer. In this example the libc function recv() 
writes two bytes into the buffer but returns a larger value than 2.

---
import socket
a, b = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
a.send(b'abcdefgh')
result = b.recv(2, socket.MSG_TRUNC)
print(len(result), result)
---
stdout: 2 b'ab'

To fix the wrong result of recv() with MSG_TRUNC, only resize when outlen < 
recvlen (line 3089).

To get the size of the message, you have to use recv_into() with a buffer.

---
a, b = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
a.send(b'abcdefgh')
msg = bytearray(2)
result = b.recv_into(msg, flags=socket.MSG_TRUNC)
print(result, msg)
---
stdout: 8 bytearray(b'ab')

--
priority: critical -> high
type: security -> behavior
versions:  -Python 3.4

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

MSG_TRUNC literally causes a buffer overflow. In the example sock_recv() and 
friends only allocate a buffer of size 1 on the heap. With MSG_TRUNC recv() 
ignores the maximum size and writes beyond the buffer. We cannot recover from a 
buffer overflow because the overflow might have damanged other data structures. 
Instead Python should detect the problem and forcefully abort() the process 
with Py_FatalError().

--
priority: normal -> critical
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



[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2016-09-26 Thread SpaceOne

SpaceOne added the comment:

Nice that you investigate again into this issue. Could you please test if this 
still happens on python 2.7.10 as I unfortunately have no environment with that 
version. This would be very kind of you!

--

___
Python tracker 

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



[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2016-09-26 Thread R. David Murray

R. David Murray added the comment:

Christian: it looks like, unlike the original report, this one involves only 
stdlib code.  So maybe there really is a bug here.

--

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-26 Thread Zachary Ware

Zachary Ware added the comment:

Note the bootstrap issue with that idea though; you'll need to make sure 
_posixsubprocess is built before importing subprocess.

--

___
Python tracker 

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



[issue28275] LZMADecompressor.decompress Use After Free

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
priority: normal -> critical
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



[issue18880] ssl.SSLSocket shutdown doesn't behave like socket.shutdown

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Sounds fine, but it's not a security issue. I'm re-targeting the bug for 3.7.

--
assignee: christian.heimes -> 
nosy:  -giampaolo.rodola
stage:  -> patch review
type: security -> behavior
versions: +Python 3.7 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 
3.5, Python 3.6

___
Python tracker 

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



[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

You get advice on the Python user mailing list, 
https://mail.python.org/mailman/listinfo/python-list . The bug tracker is not a 
support/help forum.

--
nosy: +christian.heimes
stage:  -> resolved

___
Python tracker 

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



[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2016-09-26 Thread SpaceOne

SpaceOne added the comment:

Hello,
The resolution of this bug is "not a bug". If that is the case can you please 
add information how to fix/workaround this.
I have got the following valid-seeming code:
"""
import cookielib
import urllib
import urllib2
cookie = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
opener.open('https://www.google.com', timeout=2)
"""

Which results in:
Traceback (most recent call last):
  File "httplib_context_bug.py", line 6, in 
opener.open('https://www.google.com', timeout=2)
  File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
  File "/usr/lib/python2.7/urllib2.py", line 1166, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
TypeError: __init__() got an unexpected keyword argument 'context'

$ python 
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
$ cat /etc/issue
Debian GNU/Linux 8 \n \l

--
nosy: +spaceone

___
Python tracker 

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



[issue17305] IDNA2008 encoding missing

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue24201] _winreg PyHKEY Type Confusion

2016-09-26 Thread Steve Dower

Steve Dower added the comment:

Agreed.

--
resolution:  -> wont fix
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



[issue17305] IDNA2008 encoding missing

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes
components: +SSL
priority: normal -> high
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue24098] Multiple use after frees in obj2ast_* methods

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
priority: normal -> high
stage: needs patch -> patch review
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



[issue24098] Multiple use after frees in obj2ast_* methods

2016-09-26 Thread paul

paul added the comment:

Fix by replacing static 'len' in loops with a macro, so that mutations of   
size of the containter do not casue OOB reads.

--
keywords: +patch
Added file: http://bugs.python.org/file44830/issue24098.patch

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Oren Milman

Oren Milman added the comment:

my build (release):
Python 3.7.0a0 (default:da2c96cf2ce6, Sep 26 2016, 13:08:47) [MSC v.1900 32 bit 
(Intel)] on win32

ISTM we can close this issue.

--

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Antti Haapala

Antti Haapala added the comment:

Totally inlined when built with GCC, release mode, there is no trace of the 
maybe_small_long symbol, I couldn't even really decipher where it was being 
done in the disassembly of longobject.c. Was this the Windows release build?

--
nosy: +ztane

___
Python tracker 

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



[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Michael, does the fix work for you?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-26 Thread Michael Felt

Michael Felt added the comment:

The assert to be added is much more simple:

i.e., self.assertTrue(lib)

And then you get something like:

root@x064:[/data/prj/python/python-3.6.0.177/Lib/ctypes/test]../../../python -m 
unittest test_loading.py
libc_name is libc.a(shr.o)
sslib is None
F.sss
==
FAIL: test_find (test_loading.LoaderTest)
--
Traceback (most recent call last):
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/test/test_loading.py", 
line 55, in test_find
self.assertTrue(lib)
AssertionError: None is not true

--
Ran 7 tests in 0.126s

FAILED (failures=1, skipped=5)

--

___
Python tracker 

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



[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-26 Thread Christian Heimes

Changes by Christian Heimes :


--
stage:  -> commit review
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



[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26c73ee77fbb by Christian Heimes in branch '3.6':
Issue #28277: remove linefeed character from iomodule.h. Patch by Michael Felt
https://hg.python.org/cpython/rev/26c73ee77fbb

New changeset b77bd401f08a by Christian Heimes in branch 'default':
Issue #28277: remove linefeed character from iomodule.h. Patch by Michael Felt
https://hg.python.org/cpython/rev/b77bd401f08a

--
nosy: +python-dev

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-26 Thread Christian Heimes

Christian Heimes added the comment:

Simple implementation idea:

* add a pkg_config option to Extension()
* run subprocess.call(["pkg-config", self.pkg_config, "--exists"])
* if return value is 0, extend self.extra_compile_args with ["pkg-config", 
self.pkg_config, "--cflags"] and self.extra_link_args with ["pkg-config", 
self.pkg_config, "--libs"]
* otherwise print a warning

We could split and parse the output to handle -I, -L and -l in a more elegant 
way.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-26 Thread Michael Felt

New submission from Michael Felt:

Python-3.6.0.a2 (a2 == 162)

root@x064:[/data/prj/python/python-3.6.0.162]xlc  -DNDEBUG -O -I/opt/include 
-qmaxmem=-1 -qarch=pwr4 -O3 -I/opt/buildaix/includes -O -I. -IInclude 
-I./Include -I/opt/include -I/opt/buildaix/inclu
de   -DPy_BUILD_CORE  -I./Modules/_io -c ./Modules/_io/_iomodule.c -o 
Modules/_iomodule.o
root@x064:[/data/prj/python/python-3.6.0.162]
** Notice no messges - while:

root@x064:[/data/prj/python/python-3.6.0.177]xlc  -DNDEBUG -O -I/opt/include 
-qmaxmem=-1 -qarch=pwr4 -O3 -I/opt/buildaix/includes -O -I. -IInclude 
-I./Include -I/opt/include ->
"./Modules/_io/_iomodule.h", line 156.2: 1506-766 (S) The universal character 
name "
" is not in the allowable range for an identifier.
"./Modules/_io/_iomodule.c", line 804.2: 1506-198 (S) #if, #else, #elif, 
#ifdef, #ifndef block must be ended with #endif.
root@x064:[/data/prj/python/python-3.6.0.177]

Looks to be a simple typo on line 156 - #endif^L is not seen as #endif by XLC.

  +154  #ifdef MS_WINDOWS
  +155  extern char _PyIO_get_console_type(PyObject *);
  +156  #endif^L

Once I remove the "formfeed" character, as is well again.

--
components: Build
messages: 277412
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was 
fine.
type: compile error
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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-26 Thread Michael Felt

Changes by Michael Felt :


--
components: +ctypes

___
Python tracker 

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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-26 Thread Michael Felt

New submission from Michael Felt:

in Lib/ctypes/test/test_loading.py there is the following test

def test_find(self):
for name in ("c", "m"):
lib = find_library(name)
if lib:
cdll.LoadLibrary(lib)
CDLL(lib)


1. on AIX, the test is "broken" because lib is None for both names because:
a1) find_library is basically broken for AIX (needs ldconfig, gcc, and/or other 
tools not generally available on AIX (production) servers
a2) "m" will always fail because there is no equivalent to libm.so - AIX libm.a 
only has static members - none are shared.
2. IMHO - the test is misnamed "test_find" - as None is an acceptable answer - 
which is why it 'appears' to PASS on AIX

As far as library names to look for I suggest switching "m" to "ssl" - as 
something that should be everywhere.

And the test should be something more like:

self.assertEqual(lib not None)

OR is the test actually testing LoadLibrary and CDLL (as well)

Back to my humble opinion: assuming the real test is to test LoadLibrary and 
CDLL by accepting None as a valid result from find_library - false POSITIVE is 
the result when find_library() is not working.

--
messages: 277411
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: test_loading.py - false positive result for "def test_find" when 
find_library() is not functional or the (shared) library does not exist
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



  1   2   >