[issue27298] redundant iteration over digits in _PyLong_AsUnsignedLongMask

2016-09-23 Thread Oren Milman

Changes by Oren Milman :


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



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

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your report lijp. This is interesting issue. It is not specific 
for Windows.

itermonthdates() yields shortened sequence of dates at the end of maximal year. 
The formatted row of day numbers is centered. Since the number of days is less 
than expected, additional spaces are added at the left.

--
assignee:  -> serhiy.storchaka
components: +Library (Lib) -Windows
nosy: +rhettinger, serhiy.storchaka -paul.moore, steve.dower, tim.golden, 
zach.ware
versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 3.4

___
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-23 Thread Xiang Zhang

Xiang Zhang added the comment:

calendar internally relies on datetime and uses datetime.date. datetime.date 
can't represent date more than .12.31 so some logic is broken for 
it(normally the week list should be of length 7, date outside the month will be 
(0, x) pair but this is not the case for .12). This won't affect prmonth 
since it doesn't do center formatting. We can change to that behaviour to fix 
this. calendar_pryear_ tires to fix this.

--
nosy: +xiang.zhang

___
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-23 Thread Xiang Zhang

Changes by Xiang Zhang :


--
keywords: +patch
Added file: http://bugs.python.org/file44789/calendar_pryear_.patch

___
Python tracker 

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



[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

Ping myself!

I just cited this GCC attribute in a recent discussion on deprecating macros in 
the C API:
https://mail.python.org/pipermail/python-dev/2016-September/146537.html

--

___
Python tracker 

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



[issue28223] test_tools fails with timeout on AMD64 Snow Leop 3.x buildbot

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

Ping!

--
components: +Macintosh
nosy: +ned.deily, ronaldoussoren

___
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-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Html calendar formats the last week differently for years 9982 and .

Year 9982:
2728293031  

Year :
2728293031

I think this issue should be fixed on lower level than text calendar formatter.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

Marc-Andre: "Consensus then was to use the minimum as basis for benchmarking: 
(...) There are arguments both pro and con using min or avg values."

To be honest, I expect that most developer are already aware that minimum is 
evil and so I wouldn't have to convince you. I already posted two links for the 
rationale. It seems that you are not convinced yet, it seems like I have to 
prepare a better rationale :-)

Quick rationale: the purpose of displaying the average rather than the minimum 
in timeit is to make timeit more *reliable*. My goal is that running timeit 5 
times would give exactly the same result. With the current design of timeit 
(only run one process), it's just impossible (for different reasons listed in 
my first article linked on this issue). But displaying the average is less 
worse than displaying the minimum to make results more reproductible.

--

___
Python tracker 

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



[issue28099] Drop Mac OS X Tiger support in Python 3.6

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

@Ned Deily: Ping?

--
components: +Macintosh
nosy: +ronaldoussoren

___
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-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Something like this?

diff -r 15f82b64eee0 Lib/calendar.py
--- a/Lib/calendar.py   Thu Sep 22 17:11:53 2016 -0700
+++ b/Lib/calendar.py   Fri Sep 23 16:27:03 2016 +0800
@@ -181,6 +181,9 @@
 yield (0, date.weekday())
 else:
 yield (date.day, date.weekday())
+if year ==  and month == 12 and date.day == 31:
+yield (0, 6)
+yield (0, 7)
 
 def itermonthdays(self, year, month):
 """

Is there a more elegant way? I considered this but didn't quite like it so 
abandoned it.

--

___
Python tracker 

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



[issue27374] Cygwin: Makefile does not install DLL import library

2016-09-23 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

I don't know why Cygwin packaging script (cygport) doesn't copy direct 
libpythonX.Ym.dll.a to /usr/lib.  Hence I wrote the patch that doesn't conflict 
with cygport script.

In current makefile rule for Cygwin, Install $(LDLIBRARY) into $(LIBPL).  
Therefore I prefer symlink from $(LIBPL) than copying direct library file to 
$(LIBDIR).
What do you think of makefile rule addition that is same effect (symlink from 
LIBPL) as cygport script?

--

___
Python tracker 

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



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-23 Thread py.user

py.user added the comment:

Added a reply to the patch about SubElement(). (Realy email notification 
doesn't work in review. I left a message while publication, and it didn't come.)

--

___
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-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is not just not elegant, but it doesn't work if firstweekday is not 0.

The lowest level in the calendar module is itermonthdates(). But the problem is 
that dates outside supported range can't be represented.

While the output for December of the year  looks badly formatted, calendar 
doesn't work at all with January of the year 1 if firstweekday is not 0:

>>> import calendar
>>> calendar.setfirstweekday(6)
>>> calendar.prmonth(1, 1)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython-3.6/Lib/calendar.py", line 318, in prmonth
print(self.formatmonth(theyear, themonth, w, l), end=' ')
  File "/home/serhiy/py/cpython-3.6/Lib/calendar.py", line 331, in formatmonth
for week in self.monthdays2calendar(theyear, themonth):
  File "/home/serhiy/py/cpython-3.6/Lib/calendar.py", line 211, in 
monthdays2calendar
days = list(self.itermonthdays2(year, month))
  File "/home/serhiy/py/cpython-3.6/Lib/calendar.py", line 179, in 
itermonthdays2
for date in self.itermonthdates(year, month):
  File "/home/serhiy/py/cpython-3.6/Lib/calendar.py", line 162, in 
itermonthdates
date -= datetime.timedelta(days=days)
OverflowError: date value out of range

--

___
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-23 Thread Xiang Zhang

New submission from Xiang Zhang:

Currently TextCalendar.prweek/month/year outputs an extra whitespace which 
makes the output weird:

>>> calendar.TextCalendar().prweek([(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7)], 
>>> 2)
 1  2  3  4  5  6  7 >>> calendar.TextCalendar().prmonth(2016,9)
   September 2016
Mo Tu We Th Fr Sa Su
  1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
 >>>

--
components: Library (Lib)
files: calendar_whitespace.patch
keywords: patch
messages: 277256
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: TextCalendar.prweek/month/year outputs an extra whitespace character
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44790/calendar_whitespace.patch

___
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-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM. Could you please add tests?

I suppose this is a consequence of porting from Python 2 to Python 3 (maybe 
with 2to3). Usually "print x," in Python 2 corresponds to "print(x, end=' ')" 
in Python 3. But if x ends with \n, print with a comma in Python 2 don't add a 
space, this corresponds to "print(x, end='')". Similar issue was fixed not long 
ago. Maybe there are other similar issues in the stdlib or scripts.

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



[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2016-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Build
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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 23/09/2016 à 10:21, STINNER Victor a écrit :
> 
> Quick rationale: the purpose of displaying the average rather than
> the
minimum in timeit is to make timeit more *reliable*. My goal is that
running timeit 5 times would give exactly the same result.

Why would it? System noise can vary from run to run.

--

___
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-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

prweek() in Python 2 adds a final space. Python 3 version looks correct.

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cbe049647a04 by Victor Stinner in branch '3.5':
Issue #27829: regrtest -W displays stderr if env changed
https://hg.python.org/cpython/rev/cbe049647a04

New changeset 12e3023d19bd by Victor Stinner in branch '3.6':
Merge 3.5 (issue #27829)
https://hg.python.org/cpython/rev/12e3023d19bd

New changeset 8210873bd684 by Victor Stinner in branch 'default':
Merge 3.6 (issue #27829)
https://hg.python.org/cpython/rev/8210873bd684

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

I was able to reproduce the missing warning by modifying test_sys.py to modify 
sys.path and then run:
./python -m test -W test_sys

The -W eats stderr even if the environment changed. I modified regrtest to copy 
stderr if the test doesn't pass which includes: fail, interrupted, env changed, 
etc.

--

___
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-23 Thread Xiang Zhang

Xiang Zhang added the comment:

> prweek() in Python 2 adds a final space. Python 3 version looks correct.

Really? `print '1',` in my mind will output a newline and no trailing space. 
And I think we should also add a comma in pryear in py2.

--
Added file: http://bugs.python.org/file44791/calendar_whitespace_v2.patch

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I thought sys.stderr is line buffered and doesn't need flush=True if prints a 
complete line.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

> I thought sys.stderr is line buffered and doesn't need flush=True if prints a 
> complete line.

I tried random changes since I was unable to reproduce the issue and didn't 
understand why the the warning was not printed.

I'm not sure that stderr is always line buffered. Is it the case even if stderr 
is redirected to a pipe?

--

___
Python tracker 

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



[issue28256] Cleanup Modules/_math.c

2016-09-23 Thread STINNER Victor

New submission from STINNER Victor:

On a code coverage report, I noticed that _math.c has a very bad coverage. In 
fact, we define dead code when the system provides most required math functions.

Attached patch avoids declaring unused functions.

See the coverage at:
http://tiran.bitbucket.org/python-lcov/Modules/index.html

--
files: math.patch
keywords: patch
messages: 277266
nosy: christian.heimes, haypo, mark.dickinson
priority: normal
severity: normal
status: open
title: Cleanup Modules/_math.c
versions: Python 3.7
Added file: http://bugs.python.org/file44792/math.patch

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

> I tried random changes since I was unable to reproduce the issue and didn't 
> understand why the the warning was not printed.

Ooops, I forgot to say: my flush=True changes may be removed if my latest 
change fixed the issue (if the warning is now displayed).

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

Cool, my change fixed this issue. Examples:

http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/builds/1953/steps/test/logs/stdio
Warning -- threading._dangling was modified by test_logging

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/8590/steps/test/logs/stdio
Warning -- files was modified by test_distutils3

--

___
Python tracker 

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



[issue28223] test_tools fails with timeout on AMD64 Snow Leop 3.x buildbot

2016-09-23 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +buildbot

___
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-23 Thread Xiang Zhang

Changes by Xiang Zhang :


--
Removed message: http://bugs.python.org/msg277263

___
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-23 Thread Xiang Zhang

Xiang Zhang added the comment:

A single `print x,` seems to me won't add the trailing space. And I don't 
understand why in py2 repl even with comma there is still a newline:

>>> print 'a',
a
>>> 

>>> print('a', end='')
a>>>

--

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Kay Hayen

New submission from Kay Hayen:

Hello,

there is a regression in the beta (alpha 4 was ok) for this kind of code:

print("Complex call with both invalid star list and star arguments:")

try:
a = 1
b = 2.0

functionWithDefaults(1,c = 3,*a,**b)
except TypeError as e:
print(repr(e))

try:
a = 1
b = 2.0

functionWithDefaults(1,*a,**b)
except TypeError as e:
print(repr(e))

try:
a = 1
b = 2.0

functionWithDefaults(c = 1, *a,**b)
except TypeError as e:
print(repr(e))

try:
a = 1
b = 2.0

functionWithDefaults(*a,**b)
except TypeError as e:
print(repr(e))

This prints with beta1 3.6

Complex call with both invalid star list and star arguments:
TypeError("'int' object is not iterable",)
TypeError("'int' object is not iterable",)
TypeError("'float' object is not iterable",)
TypeError('functionWithDefaults() argument after ** must be a mapping, not 
float',)

The later message is what they all probably should be like. This is 3.5 output:

Complex call with both invalid star list and star arguments:
TypeError('functionWithDefaults() argument after ** must be a mapping, not 
float',)
TypeError('functionWithDefaults() argument after ** must be a mapping, not 
float',)
TypeError('functionWithDefaults() argument after ** must be a mapping, not 
float',)
TypeError('functionWithDefaults() argument after ** must be a mapping, not 
float',)

The function itself doesn't matter obviously, it's never called. Please restore 
the old behavior, thanks.

Yours,
Kay

--
messages: 277270
nosy: kayhayen
priority: normal
severity: normal
status: open
title: Regression for star argument parameter error messages
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

> Marc-Andre: "Consensus then was to use the minimum as basis for benchmarking: 
> (...) There are arguments both pro and con using min or avg values."
> 
> To be honest, I expect that most developer are already aware that minimum is 
> evil and so I wouldn't have to convince you. I already posted two links for 
> the rationale. It seems that you are not convinced yet, it seems like I have 
> to prepare a better rationale :-)

I'm not sure I follow. The first link clearly says that "So for better or 
worse, the choice of which one is better comes down to what we think the 
underlying distribution will be like." and it ends with "So personally I use 
the minimum when I benchmark.".

http://blog.kevmod.com/2016/06/benchmarking-minimum-vs-average/

If we display all available numbers, people who run timeit can then see where 
things vary and possibly look deeper to find the reason.

As I said and the above articles also underlines: there are cases where min is 
better and others where avg is better. So in the end, having both numbers 
available gives you all the relevant information.

I have focused on average in pybench 1.0 and then switched to minimum for 
pybench 2.0. Using minimum resulted in more reproducible results at least on 
the computers I ran pybench on, but do note that pybench 2.0 still does print 
out the average values as well. The latter mostly due to some test runs I found 
where (probably due to CPU timers not working correctly), the min value 
sometimes dropped to very low values which did not really make sense compared 
to the average values.

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

More warnings.

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/5058/steps/test/logs/stdio

Warning -- threading._dangling was modified by test_logging
Warning -- files was modified by test_io

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/5148/steps/test/logs/stdio

Warning -- threading._dangling was modified by test_logging
Warning -- threading._dangling was modified by test_asyncio
Warning -- files was modified by test_io

http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/1573/steps/test/logs/stdio

Warning -- files was modified by test_distutils
Warning -- threading._dangling was modified by test_asyncio

--

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-23 Thread Jan Niklas Hasse

Jan Niklas Hasse added the comment:

Why not?

--

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-23 Thread INADA Naoki

INADA Naoki added the comment:

I want locale free Python which behaves like on C.UTF-8 locale.
(stdio encoding, preferred encoding, weekday in _strptime._strptime,
and more maybe)

But Python 3.6 is feature freeze already >_<;;

--
nosy: +inada.naoki

___
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-23 Thread Xiang Zhang

Xiang Zhang added the comment:

How about the approach in calendar_prcal__demo.patch? If it's not bad I can 
add tests then.

--
Added file: http://bugs.python.org/file44793/calendar_prcal__demo.patch

___
Python tracker 

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



[issue28256] Cleanup Modules/_math.c

2016-09-23 Thread Christian Heimes

Christian Heimes added the comment:

It think you have the #ifdef checks reversed, e.g. #ifdef HAVE_ACOSH instead of 
#ifndef HAVE_ACOSH.

--

___
Python tracker 

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



[issue28258] Broken python-config generated with Estonian locale

2016-09-23 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

When Estonian locale (e.g. et_EE.UTF-8) is set, then the following line in 
Makefile.pre.in does not match all required strings:

sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh 
>python-config

In Estonian locale:
[A-Z] does not match: T, U, V, W, X, Y
[a-z] does not match: t, u, v, w, x, y
https://en.wikipedia.org/wiki/Estonian_orthography

Run-time result without fix applied:

$ LC_ALL=C bash python-config --help
python-config: line 45: LDVERSION: command not found
python-config: line 49: VERSION: command not found
python-config: line 51: prefix: command not found
python-config: line 51: VERSION: command not found
Usage: python-config 
--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir

I attach patch (also fixing distclean target).

--
assignee: twouters
components: Build
files: python-use_C_locale.patch
keywords: patch
messages: 277277
nosy: Arfrever, twouters
priority: normal
severity: normal
status: open
title: Broken python-config generated with Estonian locale
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44794/python-use_C_locale.patch

___
Python tracker 

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



[issue28258] Broken python-config generated with Estonian locale

2016-09-23 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue28258] Broken python-config generated with Estonian locale

2016-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a consequence of issue27213. Actually there are two issues: with 
var-positional and var-keyword arguments.

But Python 3.5 is not consistent. It raises an exception with less detailed 
message if there are multiple var-positional or var-keyword arguments.

Var-positional arguments:

>>> f(*0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after * must be an iterable, not int
>>> f(1, *0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after * must be an iterable, not int
>>> f(*[], *0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable

Python 3.6 just raises the latter message in case of positional arguments and 
single var-positional argument.

>>> f(*0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after * must be an iterable, not int
>>> f(1, *0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable
>>> f(*[], *0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable

This issue can't be fixed without adding new bytecode 
(BUILD_TUPLE_UNPACK_WITH_CALL). If it will be decided to fix it in 3.6, it may 
be worth to backport this to 3.5.

Var-keyword arguments:

Python 3.5:

>>> f(**[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after ** must be a mapping, not list
>>> f(x=1, **0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after ** must be a mapping, not int
>>> f(x=1, **[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after ** must be a mapping, not list
>>> f(**{}, **0)   
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable
>>> f(**{}, **[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not a mapping

Python 3.6 raises less detailed error message in case of keyword arguments and 
single var-keyword argument.

>>> f(**0)  
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after ** must be a mapping, not int
>>> f(**[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() argument after ** must be a mapping, not list
>>> f(x=1, **0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable
>>> f(x=1, **[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not a mapping
>>> f(**{}, **0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not a mapping
>>> f(**{}, **[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not a mapping

This issue can be fixed without changing bytecode. The patch 
faster_build_map_unpack_with_call.patch for issue27358 fixes it.

--
components: +Interpreter Core
dependencies: +BUILD_MAP_UNPACK_WITH_CALL is slow
nosy: +Demur Rumed, haypo, larry, ned.deily, serhiy.storchaka
versions: +Python 3.5, Python 3.7

___
Python tracker 

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



[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The side effect of the last patch is fixing a regression in 3.6 and a bug in 
3.5 (issue28257).

--

___
Python tracker 

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



[issue28256] Cleanup Modules/_math.c

2016-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28258] Broken python-config generated with Estonian locale

2016-09-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

I get "500 Server Error" page when trying to write response in Rietveld, so I 
will write here...

On 2016/09/23 16:00:58, storchaka wrote:
> https://bugs.python.org/review/28258/diff/18650/Makefile.pre.in
> File Makefile.pre.in (right):
> 
> https://bugs.python.org/review/28258/diff/18650/Makefile.pre.in#newcode1633
> Makefile.pre.in:1633: LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o
> -name '*~' \
> Does it work with ";"?

Yes.
Expansion is performed here by shell (spawned by make) itself before arguments 
are passed to find.
So LC_ALL=C must be set as a separate command.

$ export LC_ALL=et_EE.UTF-8
$ mkdir -p /tmp/test/{a,t,z}
$ find /tmp/test/[a-zA-Z]*
/tmp/test/a
/tmp/test/z
$ LC_ALL=C find /tmp/test/[a-zA-Z]*
/tmp/test/a
/tmp/test/z
$ LC_ALL=C; find /tmp/test/[a-zA-Z]*
/tmp/test/a
/tmp/test/t
/tmp/test/z
$

--

___
Python tracker 

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



[issue28258] Broken python-config generated with Estonian locale

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks for your explanation, now I see this. The patch LGTM.

--

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ned and Larry.

Is it allowed to use the patch from issue27358 for fixing a regression in 3.6 
and inconsistency in 3.5 for var-keyword arguments? The patch introduces new 
private function _PyDict_MergeEx() and touches the implementation of 
PyDict_Merge(). Maybe this can be fixed with smaller patch, but I don't know.

Is it allowed to add new opcode BUILD_TUPLE_UNPACK_WITH_CALL for fixing a 
regression in 3.6 and inconsistency in 3.5 for var-positional arguments? This 
is the only way. The bytecode already was changed in a bugfix release of 3.5 
for more serious need: fixing potential segfault or security issue (issue27286).

--
priority: normal -> deferred blocker

___
Python tracker 

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



[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Microbenchmarks:

$ ./python -m timeit -s "def f(**kw): pass" -s "b = {'b': 2}" -- "f(a=1, **b)"
Unpatched:  10 loops, best of 3: 7.64 usec per loop
Patched:10 loops, best of 3: 3.14 usec per loop

$ ./python -m timeit -s "def f(**kw): pass" -s "a = {'a': 1}; b = {'b': 2}" -- 
"f(**a, **b)"
Unpatched:  10 loops, best of 3: 6.93 usec per loop
Patched:10 loops, best of 3: 2.66 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "b = {'b': 2}" -- 
"f(a=1, **b)"
Unpatched:  10 loops, best of 3: 7.27 usec per loop
Patched:10 loops, best of 3: 2.83 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "a = {'a': 1}; b = 
{'b': 2}" -- "f(**a, **b)"
Unpatched:  10 loops, best of 3: 6.47 usec per loop
Patched:10 loops, best of 3: 2.31 usec per loop

--

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Larry Hastings

Larry Hastings added the comment:

It's too late to change this for 3.5.

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



[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-09-23 Thread STINNER Victor

STINNER Victor added the comment:

> $ ./python -m timeit -s "def f(**kw): pass" -s "b = {'b': 2}" -- "f(a=1, **b)"
> Unpatched:  10 loops, best of 3: 7.64 usec per loop
> Patched:10 loops, best of 3: 3.14 usec per loop

Impressive numbers but... is it a perf regression compared to Python 3.5 (and 
even 2.7)? Or a perf speedup compared to Python 3.5?

--

___
Python tracker 

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



[issue28259] Ctypes bug windows

2016-09-23 Thread Aristotel

New submission from Aristotel:

I'm wrapping C function using ctypes. Function has following prototype:
bool func(some_struct* pointer, uint32_t a, uint16_t b, uint16_t c, const 
uint8_t *d, const uint8_t *e, const uint8_t *f, some_enum *e);
I tried a lot of variants of wrapper but on windows I always have "access 
violation reading 0x" in console. On Linux everything works fine. I 
tested it with different versions of Python, it presents at least in 3.3 - 3.5. 
I think bug is in passing uint8_t *d, uint8_t *e, uint8_t *f, because wrapper 
for almost the same function with 1 pointer instead of 3 works as expected.

--
components: ctypes
messages: 277286
nosy: PlatonAdCo
priority: normal
severity: normal
status: open
title: Ctypes bug windows
type: crash
versions: Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it is expected perf regression compared to Python 3.5 and 2.7 when pass 
keyword arguments and single var-keyword argument (because 3.6 uses 
BUILD_MAP_UNPACK_WITH_CALL, while 2.7 and 3.5 don't need it for this case). In 
case of multiple var-keyword arguments (all versions need 
BUILD_MAP_UNPACK_WITH_CALL) even unpatched 3.6 is faster than 3.5.

$ ./python -m timeit -s "def f(**kw): pass" -s "b = {'b': 2}" -- "f(a=1, **b)"
Python 2.7:10 loops, best of 3: 2.21 usec per loop
Python 3.5:10 loops, best of 3: 4.31 usec per loop
Python 3.6 unpatched:  10 loops, best of 3: 7.64 usec per loop
Python 3.6 patched:10 loops, best of 3: 3.14 usec per loop

$ ./python -m timeit -s "def f(**kw): pass" -s "a = {'a': 1}; b = {'b': 2}" -- 
"f(**a, **b)"
Python 3.5:10 loops, best of 3: 11.6 usec per loop
Python 3.6 unpatched:  10 loops, best of 3: 6.93 usec per loop
Python 3.6 patched:10 loops, best of 3: 2.66 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "b = {'b': 2}" -- 
"f(a=1, **b)"
Python 2.7:10 loops, best of 3: 1.97 usec per loop
Python 3.5:10 loops, best of 3: 3.75 usec per loop
Python 3.6 unpatched:  10 loops, best of 3: 7.27 usec per loop
Python 3.6 patched:10 loops, best of 3: 2.83 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "a = {'a': 1}; b = 
{'b': 2}" -- "f(**a, **b)"
Python 3.5:10 loops, best of 3: 10.6 usec per loop
Python 3.6 unpatched:  10 loops, best of 3: 6.47 usec per loop
Python 3.6 patched:10 loops, best of 3: 2.31 usec per loop

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> More warnings.

Excellent result!

> my flush=True changes may be removed if my latest change fixed the issue

Don't bother. The buffering of standard streams was changed in 3.x and I'm not 
sure it always work as expected. For example the meaning of the -u option seems 
was changed. Maybe my beliefs about this are wrong.

--

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

That is a fairly big change to go in now but the error message regression is 
also big.  With a review from a core developer and assuming no other 
objections, I think this can go into 360b2.

--

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-23 Thread Roy Williams

New submission from Roy Williams:

I am investigating a migration to Python 3, and to facilitate this we are using 
the -3 flag as decribed here: 
https://docs.python.org/3/howto/pyporting.html#prevent-compatibility-regressions
 . When using this flag I encountered
some issues inside of mock itself.

Python 3 now requires you to implement __hash__ if you implement __eq__. See 
https://docs.python.org/3.6/reference/datamodel.html#object.%5F%5Fhash%5F%5F .

{mock.ANY}  # Fine in Python 2, Throws in Python 3

I've created a PR that explicitly sets the __hash__ method on these objects as 
None to ensure the behavior is consistent in Python 3 as well as Python 2.  The 
folks over at testing-in-python suggested I submit a bug here first and then 
the fix can be backported to testing-cabal/mock

https://github.com/testing-cabal/mock/pull/378

--
components: Library (Lib)
messages: 277290
nosy: Roy Williams
priority: normal
severity: normal
status: open
title: mock._Any and mock._Call implement __eq__ but not __hash__
versions: Python 2.7

___
Python tracker 

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



[issue28100] Refactor error messages in symtable.c

2016-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 966b57281536 by Christian Heimes in branch '3.6':
Issue #28100: Refactor error messages, patch by Ivan Levkivskyi
https://hg.python.org/cpython/rev/966b57281536

New changeset a953112116ac by Christian Heimes in branch 'default':
Issue #28100: Refactor error messages, patch by Ivan Levkivskyi
https://hg.python.org/cpython/rev/a953112116ac

--
nosy: +python-dev

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with all of Mark-Andre's comments.

FWIW, when I do timings with the existing timeit, I use a repeat of 7.  It 
gives stable and consistent results.  The whole idea of using the minimum of 
those runs is to pick the least noisy measurement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> It's too late to change this for 3.5.

The whole point of having a beta release is to detect issues like this.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

Raymond, Larry's comment was about 3.5, not 3.6.  See my comment above.

--

___
Python tracker 

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



[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2016-09-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

What use case do you have that warrants a C API expansion rather than just 
using PyObject_Call?  I don't recall this ever having been requested which 
suggests that it is either unnecessary or that people fear opening a can of 
worms.

--
nosy: +rhettinger

___
Python tracker 

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



[issue25591] refactor imaplib tests

2016-09-23 Thread Maciej Szulik

Changes by Maciej Szulik :


--
hgrepos:  -322

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-23 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



[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2016-09-23 Thread Oren Milman

New submission from Oren Milman:

 current state 
In few places in the codebase, PyArg_ParseTuple is called in order to parse a 
normal tuple (instead of the usual case of parsing the arguments tuple of a 
function).
In some of these places, failure of PyArg_ParseTuple is handled simply by 
cleanup (if needed) and returning an error code, and so an exception with the 
generic error message is raised.
The generic error message is appropriate in case the parsed tuple is the 
arguments tuple of a function, but might be really wrong in case it is a normal 
tuple.

For example, such case in Modules/socketmodule.c in socket_getnameinfo leads to 
the following:
>>> import socket
>>> socket.getnameinfo(tuple(), 1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: function takes at least 2 arguments (0 given)
>>>


 proposed changes 
In each of these places, add to the format string (which is passed to 
PyArg_ParseTuple) a ';', followed by an appropriate error message, as already 
done in Modules/audioop.c in audioop_ratecv_impl:
if (!PyArg_ParseTuple(state,
"iO!;audioop.ratecv: illegal state argument",
&d, &PyTuple_Type, &samps))
goto exit;


 diff 
The proposed patches diff file is attached.


 tests 
I wrote an ugly script to verify the wrong error messages on CPython without my 
patches, and to test the patches on CPython with my patches. The script is 
attached (but it might fail on a non-Windows machine).

In addition, I ran 'python_d.exe -m test -j3' (on my 64-bit Windows 10) with 
and without the patches, and got quite the same output.
The outputs of both runs are attached.

--
components: IO
files: testBugsOrPatches.py
messages: 277296
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: wrong error messages when using PyArg_ParseTuple to parse normal tuples
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file44795/testBugsOrPatches.py

___
Python tracker 

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



[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2016-09-23 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44797/patchedCPythonTestOutput_ver1.txt

___
Python tracker 

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



[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2016-09-23 Thread Oren Milman

Changes by Oren Milman :


--
keywords: +patch
Added file: http://bugs.python.org/file44796/issue28261_ver1.diff

___
Python tracker 

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



[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2016-09-23 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44798/CPythonTestOutput.txt

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-09-23 Thread Roy Williams

Changes by Roy Williams :


--
nosy: +Roy Williams

___
Python tracker 

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



[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Victor's comments.

--
Added file: 
http://bugs.python.org/file44799/faster_build_map_unpack_with_call2.patch

___
Python tracker 

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



[issue27979] Remove bundled libffi

2016-09-23 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

https://docs.python.org/3/license.html#libffi may need a change, too.

--

___
Python tracker 

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



[issue28262] Header folder folds incorrectly causing MissingHeaderBodySeparatorDefect

2016-09-23 Thread Vincent Vanlaer

New submission from Vincent Vanlaer:

Example:

X-Report-Abuse:
 
=?us-ascii?q?=3Chttps=3A=2F=2Fwww=2Emailitapp=2Ecom=2Freport=5Fabuse=2Ephp=3Fmid=3Dxxx-xxx-?=
 =?us-ascii?q?=3D=3D-xxx-xx-xx=3E?=

When this header is parsed and reencoded as bytes using policy.default, the 
result is this:

X-Report-Abuse: 

Since the header does not require its value to be an encoded word, it is 
written as plain text. This removes the FWS between the encoded words. However, 
it appears that it is still seen as a, now invalid, folding point. When an 
email with this header is parsed again, it causes a 
MissingHeaderBodySeparatorDefect

--
components: email
messages: 277299
nosy: barry, r.david.murray, vincenttc
priority: normal
severity: normal
status: open
title: Header folder folds incorrectly causing MissingHeaderBodySeparatorDefect
type: behavior
versions: 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



[issue28228] imghdr does not support pathlib

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

Since better pathlib support in standard library modules has been a focus of 
3.6, I'm willing to allow this and the related changes for gzip, tarfile, 
zipfile, bz2, lzma, and compilall (Issue28226 through Issue28321) if thay 
introduce no backward incompatibilities, are reviewed, and are pushed in time 
for 360b2.

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



[issue28228] imghdr does not support pathlib

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

Since better pathlib support in standard library modules has been a focus of 
3.6, I'm willing to allow this and the related changes for gzip, tarfile, 
zipfile, bz2, lzma, and compilall (Issue28225 through Issue28231) if thay 
introduce no backward incompatibilities, are reviewed, and are pushed in time 
for 360b2.

--

___
Python tracker 

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



[issue28228] imghdr does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg277300

___
Python tracker 

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



[issue28225] bz2 does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily
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



[issue28226] compileall does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily
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



[issue28227] gzip does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily
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



[issue28229] lzma does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily
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



[issue28230] tarfile does not support pathlib

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily
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



[issue28262] Header folder folds incorrectly causing MissingHeaderBodySeparatorDefect

2016-09-23 Thread R. David Murray

R. David Murray added the comment:

It seems to me this has been reported before, but I couldn't lay hands on the 
issue in a quick search.  With this description of the problem and example, I 
think I see what is wrong.  The folding algorithm is probably trying to handle 
the encoded words one by one instead of joining the ascii-only runs together 
first.

I'll try to take a look at this this weekend.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

Until we have a consensus on this change and a final, reviewed patch, it is 
premature to consider inclusion in 3.6.  If there is such prior to 360b2, we 
can reconsider.

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



[issue27292] Warn users that os.urandom() prior to 3.6 can return insecure values

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy:  -ned.deily

___
Python tracker 

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



[issue28250] typing.NamedTuple instances are not picklable Two

2016-09-23 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-23 Thread Ned Deily

Ned Deily added the comment:

I agree with Ethan that the PEP needs to be accepted first and afterwards, 
unless there is a very strong case made quickly, it would not qualify for a 
late-feature exemption for 360b2.

Nick, any updates on the status of PEP 467?

--
nosy: +ncoghlan, ned.deily
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



[issue28184] Trailing whitespace in C source code

2016-09-23 Thread Ned Deily

Changes by Ned Deily :


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



[issue28263] Python 2.7's `-3` flag warns about __eq__ being implemented without __hash__ even if __hash__ is never accessed.

2016-09-23 Thread Roy Williams

New submission from Roy Williams:

I'm finding the -3 flag to be super useful at identifying problems with code 
when porting to Python 3.  One of the most common failures, however, is 
"DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x".  
While implementing __eq__ without implementing __hash__ is very much an 
anti-pattern, this warning would be much less noisy if it could be thrown at 
time of access (like the __getslice__ warning) instead of time of declaration. 

See Also:
https://github.com/nedbat/coveragepy/pull/17
http://bugs.python.org/issue28260

--
components: Interpreter Core
messages: 277305
nosy: Roy Williams
priority: normal
severity: normal
status: open
title: Python 2.7's `-3` flag warns about __eq__ being implemented without 
__hash__ even if __hash__ is never accessed.
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue28264] Python 3.4.4 Turtle library - Turtle.onclick events blocked by Turtle.stamp

2016-09-23 Thread George Fagin

New submission from George Fagin:

After a Turtle.stamp() command, turtle click notifications enabled via 
Turtle.onclick() are blocked until subsequent turtle commands are issued. 
Examples of the functions that re-enable click notifications include undo(), 
fd(0), left(0), etc. I've verified this behavior on both Python 3.4.2 (my 
Raspberry Pi) and Python 3.4.4 (my Windows 7 laptop).

The attached sample code demonstrates that it's not difficult to work around 
the issue by using one of those functions immediately after any Turtle.click(), 
but I'd think that should be handled by the library to it's transparent to the 
user.

--
components: Library (Lib)
files: click_and_stamp.py
messages: 277306
nosy: George Fagin
priority: normal
severity: normal
status: open
title: Python 3.4.4 Turtle library - Turtle.onclick events blocked by 
Turtle.stamp
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file44800/click_and_stamp.py

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2016-09-23 Thread Steve Dower

Changes by Steve Dower :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-23 Thread Martin Panter

Martin Panter added the comment:

That would get the patch mostly working with 2.6+. Is it okay to break Python < 
2.6 support? I know there was an OS X Tiger buildbot using 2.5 until recently; 
see Issue 28039.

Personally, I would rather focus on the problems with make dependencies, build 
configuration, etc, rather than changing what versions of Python the code runs 
on.

Regarding CRLFs on Windows: the existing code opens files in binary mode (wb), 
so Windows will not translate \n into CRLF. Changing this behaviour is separate 
to the goal of Python 3 compatibility. IMO the build process should not change 
the contents of checked-in files, regardless of whether there is a version 
control system like Mercurial or Git in use or not. See also Issue 27425.

On the other hand, the Python 3 code does use text mode with CRLF translation, 
so maybe it is not a big deal. (I never built Python on Windows, so I don’t 
know.)

+++ b/Parser/spark.py
@@ -171,7 +171,7 @@ class GenericParser:
-rules = string.split(doc)
+rules = str.split(doc)

This would read better as doc.split(); see 
.

@@ -825,15 +828,15 @@ class GenericASTMatcher(GenericParser):
-print '\t', item
+print('\t', item)
 for (lhs, rhs), pos in states[item[0]].items:
-print '\t\t', lhs, '::=',
+print('\t\t', lhs, '::=', end=" ")
. . .
+print(string.join(rhs[:pos]), end=" ")
+print('.', end=" ")
+print(string.join(rhs[pos:]))

The string quoting is inconsistent. Also, I suspect string.join() is not right 
for Python 3. And you are adding an extra space after the '\t' characters.

For what it’s worth, here are some similar changes made to the Py 3 branch:

r57749: raise syntax
r51578: `. . .` → repr()
http://svn.python.org/view?view=revision&revision=55329: Unpack tuples inside 
functions (Malthe’s patch unpacks as the function is called instead); map() → 
list comprehension
http://svn.python.org/view?view=revision&revision=55143: Various Py 3 changes
r59154: Write files in text mode
r53189: Avoid has_key()
http://svn.python.org/view?view=revision&revision=55167: xrange() → range()

--

___
Python tracker 

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



[issue28221] Unused indata in test_ssl.ThreadedTests.test_asyncore_server

2016-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4a1e1715efc3 by Martin Panter in branch '2.7':
Issue #28221: Remove unused assignment from test_asyncore_server()
https://hg.python.org/cpython/rev/4a1e1715efc3

New changeset 97ff9934ad2d by Martin Panter in branch '3.5':
Issue #28221: Remove unused assignment from test_asyncore_server()
https://hg.python.org/cpython/rev/97ff9934ad2d

New changeset d8d047217da1 by Martin Panter in branch '3.6':
Issue #28221: Merge SSL test cleanup from 3.5 into 3.6
https://hg.python.org/cpython/rev/d8d047217da1

New changeset 65e83846ed51 by Martin Panter in branch 'default':
Issue #28221: Merge SSL test cleanup from 3.6
https://hg.python.org/cpython/rev/65e83846ed51

--
nosy: +python-dev

___
Python tracker 

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



[issue28221] Unused indata in test_ssl.ThreadedTests.test_asyncore_server

2016-09-23 Thread Martin Panter

Changes by Martin Panter :


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