[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 9557 to fix the issue. test_socket fails frequently on Travis CI, on 
the three Python 3.x branches.

--

___
Python tracker 

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



[issue31865] html.unescape does not work as per documentation

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. The relevant regex to is at 
https://github.com/python/cpython/blob/f6c8007a29b95b3ea3ca687a9b4924769a696328/Lib/html/__init__.py#L118
 added with the commit 4a9ee26750aa8cb37b5072b2bb4dd328819febb4 . As far as I 
can see from the tests I can confirm this is a doc issue. Would you like to 
propose a PR for this?

The changes have to be done are at below places : 

* 
https://github.com/python/cpython/blob/f6c8007a29b95b3ea3ca687a9b4924769a696328/Lib/html/__init__.py#L125
* https://github.com/python/cpython/blob/master/Doc/library/html.rst

I am adding @ezio.melotti for a confirmation of the same.

Thanks

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue34748] Incorrect HTML link in functools.partial

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks @xitop for the report. Seems reasonable to me to link to 
https://docs.python.org/3.8/library/functools.html#partial-objects . Along 
similar lines I would suggest the below too where "partial objects" could be 
linked #partial-objects instead of #functools.partial . I will leave it for the 
reviewers though to decide on this.

"When func is a descriptor (such as a normal Python function, classmethod(), 
staticmethod(), abstractmethod() or another instance of partialmethod), calls 
to __get__ are delegated to the underlying descriptor, and an appropriate 
partial object returned as the result."


Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34794] memory leak in TkApp:_createbytearray

2018-09-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> The low bits are already un-improvable in the most important cases.

Maybe you misunderstood me. Suppose that there is a hash collision, say 
hash((3, 3)) == hash((-3, -3)) and you change the hashing algorithm to fix this 
collision. If that change does NOT affect the lower N bits, then you still have 
a collision hash((3, 3)) % 2**N == hash((-3, -3)) % 2**N. This is relevant 
because the dict implementation starts by taking the lower bits first. So 
ideally we want to avoid hash collisions in the lower bits too.

This may also be a reason to avoid the standard FNV multipliers: the 64-bit FNV 
multiplier was chosen with the full 64-bit hash range in mind. It was never 
meant to work well when truncated to some lower N bits.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> When testing what, specifically?  And the standard 32-bit FNV multiplier, or 
> the standard 64-bit FNV multiplier?

FNV-1a with the t ^= 2 * t mangling running my new testsuite on either PR 9471 
or PR 9534 using the 64-bit FNV multiplier to produce 64-bit hashes. In other 
words, the code from PR 9534 but just changing the multiplier.

On the full 64-bit range, I got 2 collisions (where statistically 0 would be 
expected). When truncated to 32-bits, I got about 1700 collisions (where 
statistically about 15 would be expected).

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> j is even implies (j ^ -3) == -(j ^ 3)

This follows from what I posted before: if j is even, then j ^ 3 is odd, so we 
can apply the rule x ^ -2 = -x to x = j ^ 3:

(j ^ 3) ^ -2 = -(j ^ 3)

which implies

j ^ (3 ^ -2) = -(j ^ 3)

or equivalently

j ^ -3 = -(j ^ 3)

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> And one more:

x = (x * mult) ^ t;

also appears to work equally well.

The order of operations does not really matter: you can write the loop as

x *= mult   # Appears only in FNV-1
x ^= t[0]
x *= mult
x ^= t[1]
x *= mult
x ^= t[2]
x *= mult
x ^= t[3]
x *= mult  # Appears only in FNV-1a

The initial multiplication is equivalent to changing the initial value and the 
final multiplication is just a permutation of the outputs. None of those should 
really affect the quality of the hash.

--

___
Python tracker 

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



[issue31628] test_emails failure on FreeBSD

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I just searched for the error and a very similar or in fact the same issue that 
fails with the same test was reported. It was closed as outdated since there 
were no errors on buildbots I hope. Adding it here the issue here that might be 
helpful in debugging. 

I would propose closing this and reopening the other issue which might be 
helpful since it has more context and Serhiy can still reproduce this on 
FreeBSD with 3.7. Thoughts on closing this?

Relevant issue : https://bugs.python.org/issue15750

Thanks

--

___
Python tracker 

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



[issue31636] test_locale failure on OpenBSD

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Related issue on OpenBSD that proposes a patch catching the exception and 
skipping the test : https://bugs.python.org/issue25191 . I propose closing 
either of these as duplicate. It seems the PR 9178 was added to the issue by 
mistake and is not related to this issue.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> I want to leave low-order hash bits alone.  That's deliberate.

Since I didn't understand the rationale for this and since shifting << 1 also 
seems to work well, I edited PR 9471 to use DJBX33A with t ^= t << 1.

Since you insisted on adding 97531 at the end, I put that back.

--

___
Python tracker 

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



[issue27903] Avoid ResourceWarnings from platform._dist_try_harder

2018-09-25 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Thanks for the report and patch Ville. CPython development now uses GitHub PR 
instead of patches. It seems usages of this function was removed in 
8b94b41ab7b12f745dea744e8940631318816935 during removal of 
platform.linux_distribution. This essentially seems to be unused code on master 
which I hope can be removed. So this patch is effective only for 3.7 and 3.6. 
Would you like to make a PR to take this forward?

No usages on master except definition.

➜  cpython git:(master) rg _dist_try_harder
Lib/platform.py
230:def _dist_try_harder(distname, version, id):


Thanks

--

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report Raghunath. Regarding timezone detection there is a 
limitation with %Z supporting only UTC, GMT and `time.tzname` which is not 
documented and it's an open issue tracked at issue22377 . Regarding a directive 
to determine Era I think it falls under a feature request and compile error is 
used for errors during compiling python interpreter itself. So I am changing 
this from compile error to enhancement.

# Support for GMT, UTC and error on PDT

$ ./python.exe
Python 3.8.0a0 (heads/master:f6c8007a29, Sep 25 2018, 12:30:43)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime("2018-06-14 10:10:11 GMT", "%Y-%m-%d %H:%M:%S 
>>> %Z")
datetime.datetime(2018, 6, 14, 10, 10, 11)
>>> datetime.datetime.strptime("2018-06-14 10:10:11 UTC", "%Y-%m-%d %H:%M:%S 
>>> %Z")
datetime.datetime(2018, 6, 14, 10, 10, 11)
>>> datetime.datetime.strptime("2018-06-14 10:10:11 PDT", "%Y-%m-%d %H:%M:%S 
>>> %Z")
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_strptime.py", 
line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_strptime.py", 
line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2018-06-14 10:10:11 PDT' does not match format '%Y-%m-%d 
%H:%M:%S %Z'

Hope this helps!

Thanks

--
type: compile error -> enhancement

___
Python tracker 

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



[issue34763] Python lacks 0x4E17

2018-09-25 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue34320] Creating dict from OrderedDict doesn't preserve order

2018-09-25 Thread INADA Naoki


INADA Naoki  added the comment:

> Perhaps another good test of the same thing would be with a metaclass that 
> returns an OrderedDict from __prepare__():


It is not relating to this issue: there are no conversion happened.
Should I add the test in this PR?

--

___
Python tracker 

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



[issue33797] json int encoding incorrect for dbus.Byte

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34334] QueueHandler logs exc_info twice

2018-09-25 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Hi Vinay,

Thanks for the explanation!  I'm good with changing the PR.  I do have one 
question though.

You wrote -
> but I forgot that record.exc_text should also be zapped, as it should always 
> reflect the contents of record.exc_info.

Based on the 'always reflect' statement, I'm wondering if there should be a 
change to `format()` to add an else to the record.exc_info check:
if record.exc_info:
if not record.exc_text:
record.exc_text = self.formatException(record.exc_info)
else:
record.exc_text = None
  
Or if should just be in the `prepare()`.

I hope to have the new PR sometime today.  I think the cutoff for 3.7.1 was 
yesterday, but if you want to try to get this in to that release feel free to 
make changes.

--

___
Python tracker 

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



[issue33643] Mock functions with autospec STILL don't support assert_called_once, assert_called, assert_not_called

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Can you please add a sample script that reproduces the 
error and the version of Python you are using? The fix was not merged to Python 
3.5 as per msg278214 and I am little confused that this issue has Python 3.6 as 
affected version.

--
nosy: +xtreak

___
Python tracker 

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



[issue33442] Python 3 doc sidebar dosnt follow page scrolling like 2.7 doc sidebar.

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Tal Einat


Tal Einat  added the comment:

Working on getting this in now. Just in time, it seems.

--

___
Python tracker 

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



[issue33797] json int encoding incorrect for dbus.Byte

2018-09-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue34797] Convert heapq to the argument clinic

2018-09-25 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Convert the accelerator module `_heapqmodule.c` to the argument clinic.

--
components: Argument Clinic
messages: 326344
nosy: larry, pablogsal
priority: normal
severity: normal
status: open
title: Convert heapq to the argument clinic
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue33442] Python 3 doc sidebar dosnt follow page scrolling like 2.7 doc sidebar.

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report Pete. The Python documentation theme is maintained at 
https://github.com/python/python-docs-theme/ and this particular issue is 
tracked at https://github.com/python/python-docs-theme/issues/20 . Related 
issues : issue34378, issue28044 . I am closing this as duplicate of issue28044. 
Feel free to open an issue at GitHub if it's different from the existing issue.

Thanks

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Make the sidebar in the documentation follow the section 
automatically

___
Python tracker 

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



[issue34797] Convert heapq to the argument clinic

2018-09-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue33563] fileinput input's and Fileinput's bufsize=0 do not remit deprecationWarnings

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue27934] json float encoding incorrect for dbus.Double

2018-09-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This change broke a trick used for serializing Decimal to JSON without loss 
(see msg176158). It was good to break it in a new release, but I have doubts 
about breaking it in a bugfix release of 2.7.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34797] Convert heapq to the argument clinic

2018-09-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +rhettinger

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Tal Einat


Tal Einat  added the comment:

This seems like it would need a "What's New" entry.

How does this work with IDLE re. new features being backported?

--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Tal Einat


Tal Einat  added the comment:


New changeset 604e7b9931f9e7881a2941816e538f5f15930db8 by Tal Einat in branch 
'master':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/604e7b9931f9e7881a2941816e538f5f15930db8


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8963

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8964

___
Python tracker 

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



[issue32750] lib2to3 log_error method behavior is inconsitent with documentation

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue31962] test_importlib double free or corruption

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue31541] Mock called_with does not ensure self/cls argument is used

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 321f28c5f4b7361fa1b6330697b28481b4565ec8 by Miss Islington (bot) 
in branch '3.7':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/321f28c5f4b7361fa1b6330697b28481b4565ec8


--
nosy: +miss-islington

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 0b3e1208033aa1eb5452afe9387f86f299ef24e5 by Miss Islington (bot) 
in branch '3.6':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/0b3e1208033aa1eb5452afe9387f86f299ef24e5


--

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-25 Thread Ammar Askar


Ammar Askar  added the comment:

There's some context on the github PR but essentially it boiled down to:

- It would make it inconsistent with line offsets which are 1-indexed.
- Breaking change to a public C API (PyErr_SyntaxLocationObject)
- IDLE and other tools that catch syntax errors rely on it being 1-indexed and 
this would be a breaking change for them. As a quick example of that I found 
this vim plugin: 
https://github.com/vim-syntastic/syntastic/commit/6c91e8d802a77005d793d9cdd055c3da29f74a1b

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Regarding t ^= t << 7: I tested PR 9471 with all shift values from 1 to 20. The 
new testsuite passed for all shifts from 1 to 13, except for 6. It failed for 6 
and for 14 to 20. This indicates that smaller shift values are better (even 
when looking at 32-bit outputs).

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2018-09-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Convert heapq to the argument clinic

___
Python tracker 

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



[issue34334] QueueHandler logs exc_info twice

2018-09-25 Thread Vinay Sajip


Vinay Sajip  added the comment:

> I'm wondering if there should be a change to `format()` to add an else

There's no need; the field is initialised to None in the LogRecord constructor 
and then only set later if there is a traceback to be cached.

> I think the cutoff for 3.7.1 was yesterday, but if you want to try to get 
> this in to that

There's no need to deviate from the normal process to get it into this release, 
from my point of view.

--

___
Python tracker 

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



[issue34334] QueueHandler logs exc_info twice

2018-09-25 Thread Vinay Sajip


Change by Vinay Sajip :


--
versions: +Python 3.8

___
Python tracker 

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



[issue34736] Confusing base64.b64decode output

2018-09-25 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue2771] Test issue

2018-09-25 Thread Ernest W. Durbin III


Change by Ernest W. Durbin III :


--
nosy: +EWDurbin

___
Python tracker 

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



[issue2771] Test issue

2018-09-25 Thread Ernest W. Durbin III


Ernest W. Durbin III  added the comment:

test comment

--

___
Python tracker 

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



[issue25095] test_httpservers hangs since Python 3.5

2018-09-25 Thread William Pickard


Change by William Pickard :


--
pull_requests: +8966

___
Python tracker 

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



[issue34794] memory leak in TkApp:_createbytearray

2018-09-25 Thread David Talkin

David Talkin  added the comment:

Attached please find a Python script that demonstrates the bug.

David

On Tue, Sep 25, 2018 at 2:55 AM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> Thanks for the report David. Feel free to attach reproducible script if
> any that might trigger this. I am adding Serhiy who might have a better
> understanding of this. Relevant issue where _createbytearray was added :
> issue21580 .
>
> --
> nosy: +serhiy.storchaka, xtreak
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file47821/leak_demo.py

___
Python tracker 

___#!/usr/bin/python

#
#
# Copyright 2018 David Talkin.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

"""This demonstrates that Tkinter.PhotoImage leaks memory with each data update.

To see the leak, run this as a main program and watch memory usage on
the system monitor.  The leak occurs in LeakDemo.ShowImage.

"""
import sys
import math
import Tkinter as tk
import numpy as np

__author__ = 'dtal...@gmail.com (David Talkin)'


class LeakDemo(object):
"""Demonstrates the memory leak due to calls to TkApp._createbytearray.
"""
def __init__(self, height=600, width=1000):
self.height = height
self.width = width
self.root = tk.Tk()
self.frame = tk.Frame(self.root)
self.frame.pack()
self.canvas = tk.Canvas(self.frame, height=self.height,
width=self.width)
self.canvas.pack(side=tk.TOP, expand=tk.YES, fill=tk.BOTH)
self.image = None
self.photo = None
self.phase = 0.0

def MakeSignals(self):
"""Create signals that will modulate the red, blue and green
intensities in the image.  Return them as a three-element list of
numpy arrays.
"""
freqs = [5.0, 7.0, 9.0]
sigs = []
amp = 128.0
for freq in freqs:
arg = math.pi * 2.0 * freq / self.width
ara = np.zeros(self.width, dtype=np.float32)
for i in range(self.width):
ara[i] = amp * math.sin(self.phase + (arg * i))
sigs.append(ara)
self.phase += math.pi / 100.0
return sigs

def CreateImage(self, sigs):
"""Accept a list of three arrays that represent the red, blue and
green intensities across the canvas.  Return a PPN-format image to be
displayed.
"""
odata = np.array(sigs).transpose().flatten()
amax = 128
if len(odata) > self.width * 3:
odata = odata[:self.width * 3]
head = 'P6\n%d %d\n%d\n' % (len(odata)/3, self.height, amax)
bdata = head + (np.array([min(amax, max(0, (128 + v) / 2))
  for v in odata],
 dtype=np.uint8).tostring() * (self.height))
return bdata

def ShowImage(self, image_data):
"""The leak happens here when PhotoImage is instantiated an after each
call to configure.
"""
if not self.photo:
self.photo = tk.PhotoImage(master=self.root, data=image_data,
   format='PPM')
self.image = self.canvas.create_image((1 + self.width) / 2,
  (1 + self.height) / 2,
  image=self.photo)
else:
self.photo.configure(data=image_data)

def RunDemo(self):
sigs = self.MakeSignals()
image = self.CreateImage(sigs)
self.ShowImage(image)
self.root.after(33, self.RunDemo)  # About 30 frames/second.


def Main(unused_args):
demo = LeakDemo()
demo.RunDemo()
tk.mainloop()


if __name__ == '__main__':
Main(sys.argv)
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34320] Creating dict from OrderedDict doesn't preserve order

2018-09-25 Thread Eric Snow


Eric Snow  added the comment:

There is a conversion.  See builtin___build_class__ in Python/bltinmodule.c 
(and the LOAD_BUILD_CLASS target in Python/ceval.c).  Specifically, the 
metaclass (e.g. the builtin type) is instantiated using the namespace from the 
class definition.  The metaclass copies that namespace into a new dict.  So the 
following two bits of code are equivalent:

  # using a class definition

  ns = OrderedDict()

  class Meta(type):
  def __prepare__(*args, **kwargs):
  return ns

  class Spam(metaclass=Meta):
  a = 1
  b = 2
  ns.move_to_end('a')

  # using the metaclass directly

  ns = OrderedDict()
  ns['a'] = 1
  ns['b'] = 2
  ns.move_to_end('a')
  Spam = Meta('Spam', (object,), ns)

In both cases Spam.__dict__ will be a proxy for a new dict copied from ns.

--

___
Python tracker 

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



[issue34320] Creating dict from OrderedDict doesn't preserve order

2018-09-25 Thread INADA Naoki


INADA Naoki  added the comment:

Conversion is happens when type() (or metaclass()) is called.
And I added test for it already.
https://github.com/python/cpython/pull/8624/files#diff-7ba610fbe5686a1d67c5504312be4817R1977

Why regression test for this bugfix need to use __prepare__?

--

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug


New submission from Nicolas Hug :

Dict representations that exceed the line width are printed with one line per 
key-value pair, ignoring the compact=True parameter:

>>> pprint.pprint({i: 0 for i in range(15)}, compact=True)
{0: 0,
 1: 0,
 2: 0,
 3: 0,
 4: 0,
 5: 0,
 6: 0,
 7: 0,
 8: 0,
 9: 0,
 10: 0,
 11: 0,
 12: 0,
 13: 0,
 14: 0}

Expected behavior:

>>> pprint.pprint({i: 0 for i in range(15)}, compact=True)
{0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0,
 12: 0, 13: 0, 14: 0}

Note that lists are correctly compacted, and that dicts that don't exceed line 
width are printed on a single line, regardless on the compact parameter.

I could try to work on that if needed?

--
messages: 326358
nosy: Nicolas Hug
priority: normal
severity: normal
status: open
title: pprint ignores the compact parameter for dicts
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue27526] test_venv.TestEnsurePip fails mysteriously when /tmp is too small

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset c8c0249c9e8f61ab7670119a5a5278354df27bbb by Miss Islington (bot) 
(Joe Pamer) in branch 'master':
bpo-32557: allow shutil.disk_usage to take a file path on Windows also (GH-9372)
https://github.com/python/cpython/commit/c8c0249c9e8f61ab7670119a5a5278354df27bbb


--
nosy: +miss-islington

___
Python tracker 

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



[issue34799] When function in tracing returns None, tracing continues.

2018-09-25 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

https://docs.python.org/3/library/sys.html#sys.settrace explicitly states:

The local trace function should return a reference to itself (or to another 
function for further tracing in that scope), or None to turn off tracing in 
that scope.

Yet, it seems this happens only on the return of a 'call'. If None is returned 
in a 'line' event, apparently the previous tracing function is reused (but if a 
new function is returned, the new function is used properly).

I'm attaching a test case which shows the issue. I've tested on 2.7, 3.6 and 
3.7 and this issue is present on all.

If I set frame.f_trace = None before returning it seems to work though (so, I 
think that either this behavior should be fixed or the docs should be updated 
to reflect that).

--
files: issue_in_tracing_func.py
messages: 326360
nosy: fabioz
priority: normal
severity: normal
status: open
title: When function in tracing returns None, tracing continues.
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47822/issue_in_tracing_func.py

___
Python tracker 

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



[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-25 Thread Steve Dower


Change by Steve Dower :


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



[issue34687] asyncio: is it time to make ProactorEventLoop as the default event loop?

2018-09-25 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 6ea29c5e90dde6c240bd8e0815614b52ac307ea1 by Yury Selivanov 
(Victor Stinner) in branch 'master':
bpo-34687: Make asynico use ProactorEventLoop by default (GH-9538)
https://github.com/python/cpython/commit/6ea29c5e90dde6c240bd8e0815614b52ac307ea1


--

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 46f40be8b907854deb81c6132b7cb038e9e5202a by Victor Stinner in 
branch 'master':
bpo-33937: Catch ENOMEM error in test_socket (#9557)
https://github.com/python/cpython/commit/46f40be8b907854deb81c6132b7cb038e9e5202a


--

___
Python tracker 

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



[issue34800] email.contentmanager raises error when policy.max_line_length==None or 0

2018-09-25 Thread silane

New submission from silane :

The document of the email.policy.Policy says max_line_length=0 or None 
indicates that no line wrapping should be done at all.
But email.contentmanager doesn't handle this properly and raises error when 
calling set_content() with bytes or non-ascii str.


---Code to reproduce the bug---

from email.message import EmailMessage
from email.policy import default
msg=EmailMessage(default.clone(max_line_length=None)) # or max_line_length=0

msg.set_content('あ') # raise error
# or
msg.set_content(b'a',maintype='application',subtype='octet-stream') # raise 
error

---


This bug is caused by contentmanager._encode_text() and 
contentmanager.set_bytes_content().
These don't assume policy.max_line_length to be None or 0.

I tested this on python3.7 3.6 3.5, but probably 3.4 has the same bug.

--
components: email
messages: 326364
nosy: barry, r.david.murray, silane
priority: normal
severity: normal
status: open
title: email.contentmanager raises error when policy.max_line_length==None or 0
versions: 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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8968

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8967

___
Python tracker 

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



[issue34800] email.contentmanager raises error when policy.max_line_length==None or 0

2018-09-25 Thread silane


Change by silane :


--
type:  -> behavior

___
Python tracker 

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



[issue34687] asyncio: is it time to make ProactorEventLoop as the default event loop?

2018-09-25 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you for the review Yury ;-)

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



[issue34320] Creating dict from OrderedDict doesn't preserve order

2018-09-25 Thread Eric Snow


Eric Snow  added the comment:

> Conversion is happens when type() (or metaclass()) is called.

Right.  So an extra test to cover the __prepare__ case is somewhat redundant.  
I only suggested it because type() is called implicitly and the test would make 
the conversion case clear.  However, it was only a suggestion for you to 
consider, not something I considered necessary. :)  I'm fine with not adding a 
test that uses __prepare__.

--

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset ef1173ab141ba5387598f8859ba96f98d20d743e by Miss Islington (bot) 
in branch '3.7':
bpo-33937: Catch ENOMEM error in test_socket (GH-9557)
https://github.com/python/cpython/commit/ef1173ab141ba5387598f8859ba96f98d20d743e


--
nosy: +miss-islington

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8969

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8970

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 857b0028c0832c3159927489bc55f802bc5146cb by Miss Islington (bot) 
in branch '3.6':
bpo-33937: Catch ENOMEM error in test_socket (GH-9557)
https://github.com/python/cpython/commit/857b0028c0832c3159927489bc55f802bc5146cb


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset dac712d51667227ce3862fc61be6a8094b1066fa by Terry Jan Reedy in 
branch 'master':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (#9567)
https://github.com/python/cpython/commit/dac712d51667227ce3862fc61be6a8094b1066fa


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8971

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8972

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset ea718d377db3941ecfc86288a3465fce653cc682 by Terry Jan Reedy in 
branch 'master':
bpo-1529353: IDLE - Squeezer What's New for 3.7.1 (#9568)
https://github.com/python/cpython/commit/ea718d377db3941ecfc86288a3465fce653cc682


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8973

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 98c8236cc75529407e305f26de95d9e72a72a0eb by Miss Islington (bot) 
in branch '3.6':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (GH-9567)
https://github.com/python/cpython/commit/98c8236cc75529407e305f26de95d9e72a72a0eb


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 92ad2612bef198f2e3f8f09bf552189e27afcc4e by Miss Islington (bot) 
in branch '3.7':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (GH-9567)
https://github.com/python/cpython/commit/92ad2612bef198f2e3f8f09bf552189e27afcc4e


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset 3637e68d7c92eda0b80e6ab3f58610e1cfb4f1d8 by Miss Islington (bot) 
in branch '3.7':
bpo-1529353: IDLE - Squeezer What's New for 3.7.1 (GH-9568)
https://github.com/python/cpython/commit/3637e68d7c92eda0b80e6ab3f58610e1cfb4f1d8


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8974

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8975
stage: needs patch -> patch review

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

See my 3.6/3.7 patches for how I now handle new-in-maintenance-release 
user-visible features in What's New.  Note that there are similar entries for 
Python at the bottom of the file.

If I were not rushing, I would have mentioned user colors in text view.  But 
that is minor and I will add one entry for colors and font sizes in both text 
and help views when done.

--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset fdcb5ae25c0b5c82a32955617d253810ef110cac by Terry Jan Reedy in 
branch 'master':
bpo-1529353: IDLE - Squeezer What's New for 3.8 (#9572)
https://github.com/python/cpython/commit/fdcb5ae25c0b5c82a32955617d253810ef110cac


--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-25 Thread Tim Peters


Tim Peters  added the comment:

> Suppose that there is a hash collision, say hash((3, 3)) ==
> hash((-3, -3)) and you change the hashing algorithm to fix
> this collision.

There are _two_ hash functions at play in that collision:  the tuple hash 
function, and the integer hash function.  Regardless of whether the _tuple_ 
hash function does

t ^= t << shift;
or
t += t >> shift;

or anything else involving just `t`, that only directly affects the result of 
the _int_ hash function.  Whose low order bits cannot be improved in general - 
they're already optimally spread out in the most important cases.

> If that change does NOT affect the lower N bits,
> then you still have a collision hash((3, 3)) % 2**N ==
> hash((-3, -3)) % 2**N. This is relevant because the dict
> implementation starts by taking the lower bits first. So
> ideally we want to avoid hash collisions in the lower
> bits too.

Which the int hash on its own already does a superb job of doing in the most 
important cases.  If you feel you just have to mess with low-order bits, do it 
instead on the _tuple_ hash intermediate results, not on its inputs.  Like

x += x >> 16;

after t is folded in to x.  It's x you care about directly, not t.  Damaging 
desirable properties in t to _indirectly_ gain something in x is too clever by 
half.

Mucking with t to avoid the nested-tuple catastrophes is worth it, but I prefer 
to do that with as little damage to t's desirable properties as reasonably 
possible.

> This may also be a reason to avoid the standard FNV
> multipliers: the 64-bit FNV multiplier was chosen with
> the full 64-bit hash range in mind. It was never meant
> to work well when truncated to some lower N bits.

Do you believe any other multiplier would work better toward that end?  For any 
odd multiplier M, the last k bits of i*M are determined solely by the last k 
bits of i, and

[(last k bits of i*M) for i in range(anything, anything + 2**k)]

is a permutation of range(2**k).  The high order bits of i have nothing to do 
with it, and any odd multiplier permutes the lower k bits over any stretch of 
2**k consecutive multiplicands.

Extracting low-order bits is intended to be done by "xor folding" in FNV, and I 
_expect_ the same would be prudent for any other multiplier:

https://tools.ietf.org/html/draft-eastlake-fnv-15#page-7

The dict and set lookup functions already do something stronger than xor 
folding to bring high bits into play, but do so incrementally as the probe 
sequence unfolds.

--

___
Python tracker 

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



[issue12806] argparse: Hybrid help text formatter

2018-09-25 Thread Perette Barella


Perette Barella  added the comment:

I would find this a useful feature.

--
nosy: +perette

___
Python tracker 

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread STINNER Victor


STINNER Victor  added the comment:

The issue should now be fixed. Reopen it if it is not the case.

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



[issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout() failed on Travis CI with: [Errno 12] Cannot allocate memory

2018-09-25 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the review Pablo.

--

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report Nicolas. I looked into the code and it seems that pprint 
for a dictionary now doesn't really take compact into account. List, sets, 
tuple and dequeue use _format_items [0] that honors value of compact but 
dictionary formatting uses _format_dict_items [1] that doesn't without using 
compact value. Unfortunately, I don't have any links over why dictionary 
doesn't take compact into account. I would suggest python-ideas [3] to get more 
feedback about formatting and implementation along with backwards compatibility 
so that you can proceed further. Your suggestion seems reasonable to me but I 
don't know if some program is using compact=True for a dictionary without 
knowing the internals in mind that might break for them. I would wait for 
others thoughts on this and I think this can be done only on 3.8 and not 3.7 
which is in bug fix mode.

[0] 
https://github.com/python/cpython/blob/fdcb5ae25c0b5c82a32955617d253810ef110cac/Lib/pprint.py#L350
[1] 
https://github.com/python/cpython/blob/fdcb5ae25c0b5c82a32955617d253810ef110cac/Lib/pprint.py#L333
[2] https://mail.python.org/pipermail/python-ideas/

Hope this helps!

--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 22ef31d0b4b497eda5e356528c3e1d29584d6757 by Terry Jan Reedy in 
branch 'master':
bpo-34162: idlelib/NEWS.txt entry for squeezer (GH-9573)
https://github.com/python/cpython/commit/22ef31d0b4b497eda5e356528c3e1d29584d6757


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8976

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8977

___
Python tracker 

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



[issue34800] email.contentmanager raises error when policy.max_line_length==None or 0

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset b2ae5502981ae7e8fc080f5155060235696afe22 by Miss Islington (bot) 
in branch '3.7':
bpo-34162: idlelib/NEWS.txt entry for squeezer (GH-9573)
https://github.com/python/cpython/commit/b2ae5502981ae7e8fc080f5155060235696afe22


--

___
Python tracker 

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



[issue34801] codecs.getreader() splits lines containing control characters

2018-09-25 Thread Neil Schemenauer


New submission from Neil Schemenauer :

This seems to be a bug in codecs.getreader().  io.TextIOWrapper(fp, encoding) 
works correctly.

--
files: codecs_bug.py
messages: 326382
nosy: nascheme
priority: low
severity: normal
status: open
title: codecs.getreader() splits lines containing control characters
type: behavior
Added file: https://bugs.python.org/file47823/codecs_bug.py

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-25 Thread miss-islington


miss-islington  added the comment:


New changeset dc335ae77dfc1fb6a500eb1cd0baf23fcda45434 by Miss Islington (bot) 
in branch '3.6':
bpo-34162: idlelib/NEWS.txt entry for squeezer (GH-9573)
https://github.com/python/cpython/commit/dc335ae77dfc1fb6a500eb1cd0baf23fcda45434


--

___
Python tracker 

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



[issue34800] email.contentmanager raises error when policy.max_line_length==None or 0

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks silane for the report and script. The case where max_line_length=0 
causing ValueError was introduced with b938c8c25316b69f1d5df2c7880a9f6b87e7c2fa 
and the code at [0] has some comments regarding the minimum value to be 4 
characters. There was another case where policy can have max_line_length=0 but 
it's with respect to folding issue33524. Maybe this behavior can be documented 
better for set_content method with respect to the minimum value ? 

[0] 
https://github.com/tirkarthi/cpython/blob/f6c8007a29b95b3ea3ca687a9b4924769a696328/Lib/email/quoprimime.py#L171


"""
Each line will be wrapped at, at most, maxlinelen characters before the
eol string (maxlinelen defaults to 76 characters, the maximum value
permitted by RFC 2045).  Long lines will have the 'soft line break'
quoted-printable character "=" appended to them, so the decoded text will
be identical to the original text.

The minimum maxlinelen is 4 to have room for a quoted character ("=XX")
followed by a soft line break.  Smaller values will generate a
ValueError.
"""

Hope this helps!

--

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug


Change by Nicolas Hug :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug


Nicolas Hug  added the comment:

Thank you for the feedback!

I'll try the python-ideas mail list. I posted a message on Python-list [1] a 
few weeks ago but it didn't get much traction.

I'm not sure about what the final solution could be (if any), but I had to hack 
pprint myself [2] for the scikit-learn project, and what I did was simply copy 
pasting _format_items into _format_dict_items, with some minimal changes.


[1] https://mail.python.org/pipermail/python-list/2018-September/737082.html
[2]

--

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug


Nicolas Hug  added the comment:

Sorry:

[2] 
https://github.com/scikit-learn/scikit-learn/pull/11705/files#diff-f83e8d9362766b385472f1be7fed9482R96

--

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is on purpose. See issue19132.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-25 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +8978

___
Python tracker 

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



[issue34766] BaseProxy cache should be cleaned when Manager client is reconnected

2018-09-25 Thread Yongnan Wu


New submission from Yongnan Wu :

BaseProxy class in multiprocessing has an internal cache _address_to_local that 
is only cleaned when Manager server gets shutdown. If a Manager is used as 
client, the cache should to be cleaned when a new connection is created by 
Manager.

--

___
Python tracker 

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



  1   2   >