Recent Spam problem

2017-07-24 Thread Rustom Mody
Of late there has been an explosion of spam
Thought it was only a google-groups (USENET?) issue and would be barred from 
the mailing list.

But then find its there in the mailing list archives as well
Typical example: 
https://mail.python.org/pipermail/python-list/2017-July/724085.html

What gives??

On a different note this problem seems to be peculiar to comp.lang.python
via google-groups and is absent on ½ dozen other google groups I see.

Since spammers are unlikely to be choosy about whom they spam:
Tentative conclusion: Something about the USENET-ML gateway is more leaky
out here than elsewhere
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 removes name binding from outer scope

2017-07-24 Thread Rustom Mody
On Tuesday, July 25, 2017 at 7:12:44 AM UTC+5:30, Ben Finney quoted Thomas 
Jefferson's :

> The cost of education is trivial compared to the cost of ignorance.


An interesting standard of “trivial”… given…

UK has risen to more than £100 billion for the first time

https://www.theguardian.com/money/2017/jun/15/uk-student-loan-debt-soars-to-more-than-100bn

coupled with politicians center-staging and flip-flopping on the issue 
[yesterday's news]

http://www.independent.co.uk/news/uk/politics/jeremy-corbyn-labour-student-loans-debt-manifesto-pledge-amnesty-cancel-tuition-fees-a7856161.html

While US student debt now stands at $1.3 trillion
https://www.forbes.com/sites/zackfriedman/2017/02/21/student-loan-debt-statistics-2017/#2d2db52d5dab

-- 
https://mail.python.org/mailman/listinfo/python-list


how to group by function if one of the group has relationship with another one in the group?

2017-07-24 Thread Ho Yeung Lee
from itertools import groupby

testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
def isneighborlocation(lo1, lo2):
if abs(lo1[0] - lo2[0]) == 1  or lo1[1] == lo2[1]:
return 1
elif abs(lo1[1] - lo2[1]) == 1  or lo1[0] == lo2[0]:
return 1
else:
return 0

groupda = groupby(testing1, isneighborlocation)
for key, group1 in groupda:
print key
for thing in group1:
print thing

expect output 3 group
group1 [(1,1)]
group2 [(2,3),(2,4]
group3 [(3,5),(3,6),(4,6)]
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue11129] logging: allow multiple entries in qualname config

2017-07-24 Thread Craig McQueen

Changes by Craig McQueen :


--
nosy: +cmcqueen1975

___
Python tracker 

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



Re: Python 3 removes name binding from outer scope

2017-07-24 Thread Steve D'Aprano
On Tue, 25 Jul 2017 11:41 am, Ben Finney wrote:

> Howdy all,
> 
> How can I stop Python from deleting a name binding, when that name is
> used for binding the exception that is caught? When did this change in
> behaviour come into Python?
> 
> 
> I am writing code to run on both Python 2 and Python 3::
> 
> exc = None
> try:
> 1/0
> text_template = "All fine!"
> except ZeroDivisionError as exc:
> text_template = "Got exception: {exc.__class__.__name__}"
> 
> print(text_template.format(exc=exc))
> 
> Notice that `exc` is explicitly bound before the exception handling, so
> Python knows it is a name in the outer scope.

Ethan has already answered your direct question, but I'd like to make an
observation: there's no "outer scope" here, as the try...except statement
doesn't introduce a new scope. All your code above runs in a single scope with
a single namespace. It isn't that the except block is in a different scope, but
that the except statement now explicitly calls "del" on the exception name when
the block ends.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31023] Git Bootcamp and Cheat Sheet - Section 32.10 - Creating a Pull request needs an additional step

2017-07-24 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi, the issue tracker for the Dev guide is at https://github.com/python/DevGuide

Can you file this issue there?
Thanks.

--
nosy: +Mariatta
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31023] Git Bootcamp and Cheat Sheet - Section 32.10 - Creating a Pull request needs an additional step

2017-07-24 Thread svelankar

New submission from svelankar:

Section 32.10 - Creating a Pull Request

Step 2 should be changed to Step 3 and so on. And a new step i.e. step 2 as 
"Press new pull request button"

--
assignee: docs@python
components: Documentation
messages: 299039
nosy: docs@python, svelankar
priority: normal
severity: normal
status: open
title: Git Bootcamp and Cheat Sheet  - Section 32.10 - Creating a Pull request 
needs an additional step

___
Python tracker 

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



Re: Python 3 removes name binding from outer scope

2017-07-24 Thread Ethan Furman

On 07/24/2017 06:41 PM, Ben Finney wrote:


How can I stop Python from deleting a name binding, when that name is
used for binding the exception that is caught? When did this change in
behaviour come into Python?


I am writing code to run on both Python 2 and Python 3::

 exc = None
 try:
 1/0
 text_template = "All fine!"
 except ZeroDivisionError as exc:
 text_template = "Got exception: {exc.__class__.__name__}"

 print(text_template.format(exc=exc))



Something like:

try:

except ZeroDivisionError as dead_exc:
exc = dead_exc


print(text_template.format(exc=exc)


Why is the ‘exc’ binding deleted from the outer scope?


Help prevent memory leaks and  allow resources to be cleaned up sooner.


How are we meant
to reliably preserve the name binding to use it *after* the ‘except’
clause?


Reassign to something else, like my example above.


When did this change come into Python, where is it documented?


Documented at:  
https://docs.python.org/3/reference/compound_stmts.html#the-try-statement [1]

Don't recall exactly when changed.


Would I be right to report this as a bug in Python 3?


No.

--
~Ethan~


[1] Thanks to https://stackoverflow.com/q/29268892/208880
--
https://mail.python.org/mailman/listinfo/python-list


[issue30732] json.dumps() lacks information about RecursionError related to default function

2017-07-24 Thread svelankar

Changes by svelankar :


--
pull_requests: +2908

___
Python tracker 

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



[issue30732] json.dumps() lacks information about RecursionError related to default function

2017-07-24 Thread svelankar

Changes by svelankar :


--
pull_requests: +2907

___
Python tracker 

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



Python 3 removes name binding from outer scope

2017-07-24 Thread Ben Finney
Howdy all,

How can I stop Python from deleting a name binding, when that name is
used for binding the exception that is caught? When did this change in
behaviour come into Python?


I am writing code to run on both Python 2 and Python 3::

exc = None
try:
1/0
text_template = "All fine!"
except ZeroDivisionError as exc:
text_template = "Got exception: {exc.__class__.__name__}"

print(text_template.format(exc=exc))

Notice that `exc` is explicitly bound before the exception handling, so
Python knows it is a name in the outer scope.


On Python 2.7, this runs fine and the ‘exc’ name survives to be used in
the ‘format’ call::

Got exception: ZeroDivisionError

Great, this is exactly what I want: The ‘except’ clause binds the name
and I can use that name in the rest of the function to refer to the
exception object.


On Python 3.5, the ‘format’ call fails because apparently the ‘exc’
binding is *deleted*::

Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'exc' is not defined

Why is the ‘exc’ binding deleted from the outer scope? How are we meant
to reliably preserve the name binding to use it *after* the ‘except’
clause?

When did this change come into Python, where is it documented?

Would I be right to report this as a bug in Python 3?

-- 
 \   “The cost of education is trivial compared to the cost of |
  `\ ignorance.” —Thomas Jefferson |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I've given this some more thought, and I think that a "key" argument 
would make sense for a general selection function.

The general selection problem is: given a set of items A, and a number k 
between 1 and the number of items, return the k-th item. In Python 
terms, we would use a list, and 0 <= k < len(A) instead.

https://www.cs.rochester.edu/~gildea/csc282/slides/C09-median.pdf

I've had the idea of adding a select(A, k) function to statistics for a 
while now. Then the median_low would be equivalent to select(A, 
len(A)//2) and median_high would be select(A, len(A)//2 + 1). I'd leave 
the median_* functions as they are, and possibly include a key function 
in select.

I don't think it makes sense to add key arguments to mode, mean, 
variance etc. I'm having trouble thinking of what that would even mean 
(no pun intented): it's unlikely that the mean will actually a data 
value (except by accident, or by careful construction of the data). 
Variance has the wrong units (it is the units of your data, squared) and 
the stdev is conceptually a difference between data values, not a data 
value itself, so it doesn't even make sense to apply a key function and 
return one of the data points.

And mode counts objects, so it already applies to non-numeric data. 
It's even documented as applying to nominal data.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I pushed 3 changes. Only one test still has a minor issue:

test.test_multiprocessing_spawn.WithProcessesTestPool.test_context

The bpo-31019 fixes it.

Later, we will be able to modify ManagerMixin.tearDownClass() to emit a warning 
immediately if a manager leaks a process, and not have this kind loop to sleep 
until all processes completed.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b4c52966c810b5c5e088fceff403247f610b7d13 by Victor Stinner in 
branch 'master':
bpo-26762: test_multiprocessing close more queues (#2855)
https://github.com/python/cpython/commit/b4c52966c810b5c5e088fceff403247f610b7d13


--

___
Python tracker 

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



[issue31022] ERROR: testRegularFile (test.test_socket.SendfileUsingSendTest) random failure on AppVeyor

2017-07-24 Thread STINNER Victor

New submission from STINNER Victor:

https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.4809

(...)
testNonRegularFile (test.test_socket.SendfileUsingSendTest) ... ok
testOffset (test.test_socket.SendfileUsingSendTest) ... ok
testRegularFile (test.test_socket.SendfileUsingSendTest) ... ERROR
testWithTimeout (test.test_socket.SendfileUsingSendTest) ... ok
testWithTimeoutTriggeredSend (test.test_socket.SendfileUsingSendTest) ... ok
(...)
==
ERROR: testRegularFile (test.test_socket.SendfileUsingSendTest)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_socket.py", line 5225, in 
testRegularFile
data = self.recv_data(conn)
  File "C:\projects\cpython\lib\test\test_socket.py", line 5201, in recv_data
chunk = conn.recv(self.BUFSIZE)
socket.timeout: timed out
--

--
components: Tests
messages: 299035
nosy: haypo
priority: normal
severity: normal
status: open
title: ERROR: testRegularFile (test.test_socket.SendfileUsingSendTest) random 
failure on AppVeyor
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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ffb49408f0780ae80a553208aa133bc5bb3ba129 by Victor Stinner in 
branch 'master':
test_multiprocessing detects dangling per test case (#2841)
https://github.com/python/cpython/commit/ffb49408f0780ae80a553208aa133bc5bb3ba129


--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2906

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

> test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback

Oh, this test only "leaks" dangling processes and threads because PR 2841 was 
too strict. The problem is that multiprocessing.Pool has thread attributes 
which hold references to the pool: reference cycle. I don't see any easy way to 
break these cycles; since I don't understand if a poll is still supposed to be 
usable after terminate() or not.

Anyway, my intent here was to do a first cleanup. So I modified my PR 2841 to 
call support.gc_collect() to break reference cycles.

If someone wants to break reference cycles, please open a new issue. IMHO this 
issue already became enough complex :-)

--

___
Python tracker 

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



[issue30985] Set closing variable in asyncore at close

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

"Fixing closing attribute will allow fixing the races during asyncore.poll() 
and asyncore.poll2(), see https://github.com/python/cpython/pull/2764;

Aha, *slowly* I understand that asyncore is vulnerable to multiple race 
conditions, and it seems lile we require to set a new closing attribute to fix 
it.

--

___
Python tracker 

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



[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

asyncore is now deprecated and I prefer to restrict changes to minimum to avoid 
regressions. While the change makes sense, it only looks like a very cheap 
micro-optimization. I don't think that it's worth it.

--

___
Python tracker 

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



[issue30931] Race condition in asyncore may access the wrong dispatcher

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

On my PR 2854, Nir added these comments (extract):

"And now we try to read from close dispatcher. I think we should wait for #2804 
(...)"

Sorry, I don't understand. My PR fixes described the bug that you described in 
msg298682:

"If a dispatchers is closed and and a new dispatcher is created, the new 
dispatcher may get the same file descriptor. If the file descriptor was in the 
ready list returned from poll()/select(), asyncore may try to invoke one of the 
callbacks (e.g. handle_write) on the new dispatcher."

About reading from closed dispatcher: sorry, I don't know the asyncore 
concurrency model, but I know the asyncio concurrency model. In asyncio, I 
don't see why a "dispatcher" would affect any "unrelated" dispatcher. Said 
differently: if a dispatcher A closes the dispatcher B and dispatcher B is 
"readable", the read event will be handled anyway. The "close event" will be 
handled at the next loop iteration. The oversimplified asyncio model is "each 
iteration is atomic".

Closing a dispatcher calls its del_channel() which removes its file descriptor 
from the asyncore map.

--

If I understand correctly, the *current behaviour* depends on the file 
descriptor order, since select.select() and select.poll.poll() returns ordered 
file descriptors (smallest to largest). If a dispatcher A is called and closes 
a dispatcher B, the dispatcher B is called or not depending on the file 
descriptor. If A.fileno() < B.fileno(), B is not called. If A.fileno() > 
B.fileno(), B was already called. Am I right?

What is the use case of a dispatcher closing another one? What is the 
consequence on my PR? Does the dispatcher B expects to not be called to read if 
it was already closed?

I see that close() also immediately closes the underlying socket. Does it mean 
that my PR can triggered OSError since we try recv() on a closed socket?

--
nosy: +haypo

___
Python tracker 

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



[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-24 Thread Nir Soffer

Nir Soffer added the comment:

The advantage is avoiding wasteful copy on each iteration.

--
nosy: +Nir Soffer

___
Python tracker 

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



[issue30985] Set closing variable in asyncore at close

2017-07-24 Thread Nir Soffer

Nir Soffer added the comment:

I agree that this change alone is may not be important enough to fix in 
asyncore today - but this enables easy detection of closed sockets needed for 
https://github.com/python/cpython/pull/2764 or the alternative 
https://github.com/python/cpython/pull/2854. Unless you suggest a better way to 
detect closed dispatchers.

Introducing new failures modes in asyncore is extremely risky, error handling 
in asyncore is the weakest point.

--

___
Python tracker 

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



[issue30801] shoutdown process error with python 3.4 and pyqt/PySide

2017-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

You must demonstrate that there is a problem with 3.6 or 3.7 and then write a 
patch that fixes the problem in those versions.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue30985] Set closing variable in asyncore at close

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Proposed change looks more like an enhancement like a bug fix.

I consider that features are not welcome anyone in the asyncore module, since 
it's now deprecated, replaced with selectors and asyncio.

I would prefer to reject this issue.

Giampaolo, Serhiy, Guido: what do you think?


> Every user has to implement the closing once logic in dispatcher subclasses.

Even if it's painful, I consider that it's an acceptable compromise.

--
nosy: +giampaolo.rodola, gvanrossum, serhiy.storchaka

___
Python tracker 

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



[issue27099] IDLE: turn builting extensions into regular modules

2017-07-24 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I don't think a clean break is possible as there's only one set of config files 
on the system.  So, if someone runs Idle 3.7 (this version) and Idle 2.7, they 
would probably want their settings to be the same for both since that's how it 
would currently work.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d7e64d9934d86aa6173229de5af5fe908662a33a by Victor Stinner in 
branch 'master':
test_multiprocessing: Fix dangling process/thread (#2850)
https://github.com/python/cpython/commit/d7e64d9934d86aa6173229de5af5fe908662a33a


--

___
Python tracker 

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



[issue30931] Race condition in asyncore may access the wrong dispatcher

2017-07-24 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2905

___
Python tracker 

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



[issue31021] Clarify programming faq.

2017-07-24 Thread Ashok Bakthavathsalam

Changes by Ashok Bakthavathsalam :


--
pull_requests: +2904

___
Python tracker 

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



[issue31021] Clarify programming faq.

2017-07-24 Thread Terry J. Reedy

New submission from Terry J. Reedy:

https://docs.python.org/3/faq/programming.html#why-does-22-10-return-3
"Why does -22 // 10 return -3?
It’s primarily driven by the desire that i % j have the same sign as j. If you 
want that, and also want:

i == (i // j) * j + (i % j)

then integer division has to return the floor. C also requires that identity to 
hold, and then compilers that truncate i // j need to make i % j have the same 
sign as i.

There are few real use cases for i % j when j is negative. When j is positive, 
there are many, and in virtually all of them it’s more useful for i % j to be 
>= 0. If the clock says 10 now, what did it say 200 hours ago? -190 % 12 == 2 
is useful; -190 % 12 == -10 is a bug waiting to bite."

A user noticed that '-190 % 12 == -10' is False, but would be True is '-' were 
inserted before '12', and posted https://github.com/python/cpython/pull/2768 to 
correct the presumed typo.

It is not a typo, and I will close the issue, but the text as is is confusing.  
I propose replace "-190 % 12 == -10 is" with "if -190 % 12 were the 
mathematically equivalent -10, it would be" [a bug waiting to bite].  I don't 
like the 'bug' part because it would not be a bug, exactly, but it would be bug 
bait.  I am not sure how to improve it though.

--
assignee: docs@python
components: Documentation
messages: 299023
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Clarify programming faq.
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue26415] Excessive peak memory consumption by the Python parser

2017-07-24 Thread A. Skrobov

A. Skrobov added the comment:

To bump this year-old issue, I have delivered a talk at EuroPython 2017, 
explaining what my patch does, how it does what it does, and why it's a good 
thing to do.

You can watch my talk at https://www.youtube.com/watch?v=dyRDmcsTwhE=1h52m38s

--

___
Python tracker 

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



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for your fix Nir Soffer!

--

___
Python tracker 

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



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c648a93ae342ac28d2abbb100161eae4f907d001 by Victor Stinner (Nir 
Soffer) in branch 'master':
bpo-30980: Fix double close in asyncore.file_wrapper (#2789)
https://github.com/python/cpython/commit/c648a93ae342ac28d2abbb100161eae4f907d001


--

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

I also opened https://github.com/python/devguide/issues/241 : "Document how to 
add a new file or a new directory". It's not the first time that we make such 
mistake.

--

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy on PR 2851:
> I forget to include directories with new test files in the list of the 
> library directories. This caused that these test files were not installed.

Oh, too bad that Zach's "x86 Gentoo Installed with X 3.6" buildbot is offline.

--

___
Python tracker 

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



[issue31020] Add support for custom compressor in tarfile

2017-07-24 Thread insomniacslk

New submission from insomniacslk:

Tarfile would benefit from exposing custom compressors. At the moment the only 
way to use something that is not gzip/bzip/lzma is to separate the archiving 
and compression steps.

A possible approach is to pass a custom compression function to 
`tarfile.TarFile.open`. However the current interface is not clean enough to be 
exposed. I have made a very conservative change via a pull request on GitHub, 
see https://github.com/python/cpython/pull/2734 . Some additional 
considerations can be found there.

A further step could require a simplified interface that only involves file 
name, file-like object and compression level, and returns a file-like object to 
read the compressed data from. For example:

def my_compressor(name, fileobj=None, compresslevel=9):
# compression happens here
return filelike_object


This further step is not captured in the pull request, but I can iterate and 
update the diff.

--
components: Library (Lib)
messages: 299017
nosy: insomniacslk
priority: normal
pull_requests: 2903
severity: normal
status: open
title: Add support for custom compressor in tarfile
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-07-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Naturally up to the release managers.  If I were one, I'd consider it just 
because not addressing the failure one way or another will lead to people 
finding us and asking a question about why it is failing.  Adding a SkipTest 
when the relevant library version is found counts as addressing _that_ level of 
problem. :)

--

___
Python tracker 

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



[issue27099] IDLE: turn builting extensions into regular modules

2017-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

'Clean break' is easy to say. I won't decide yet.  Other opinions? I think I 
will post to idle-dev also.  Even if no one responds, there will have been the 
chance.

--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am going to continue with the tests.

--

___
Python tracker 

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



[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread gerion

gerion added the comment:

The position might be useful, if you have a second list with some side data 
stored in it, and not a list of tuples :).

I had the idea to file a bug, when I had a list of coordinates and wanted to 
use the point with the median of the x-coordinates as "representation" for the 
dataset. With max() and min() in mind, I used median_low() with key argument 
and get the error that key is not a valid argument (my solution was to use 
dicts then).

So I thought this would be a similar use case as max() and min() and in fact 
more consistent. But I fully understand your concerns, that this breaks 
consistence with the other statistic functions.

This is not a killer feature, but in my opinion nice to have, because it 
changes nothing on the default (expected) behaviour, but provides with less 
code very high flexibility.

I cannot say something about other languages.

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2902

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-24 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I would like to work on this, but I don't think I'd be able to have something 
ready for a few days, so I don't want to hold you up if you would like it 
sooner.

--

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2901

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2900

___
Python tracker 

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



[issue27099] IDLE: turn builting extensions into regular modules

2017-07-24 Thread Charles Wohlganger

Charles Wohlganger added the comment:

The patch moves all config variables to config-main, config-highlight (for 
highlight colors), and config-keys (for keys). Keys and highlights are 
configurable in their respective tabs. Parens and Code Context options are in 
the Highlighting tab, Format Paragraph configurables are in the General tab. 
The sections in the main.def file where the options are saved are respective to 
their tab.

If you want, I can change the modules so they also load from their old location 
if an overriding option isn't found in main.def . However, I would recommend 
cleanly breaking from the old extensions, with a notice somewhere of where the 
new options are.

Changing the behavior of the extensions Tab / System is a separate issue that I 
think would be best handled after this, as this patch already makes a lot of 
changes.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Using PR 2841, I wrote a tool to run each test in subprocess to check if a test 
method leaks. I found these methods:

 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestBarrier.test_thousand
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestCondition.test_notify
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestEvent.test_event
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestProcess.test_close
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestQueue.test_fork
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestQueue.test_qsize
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestQueue.test_queue_feeder_donot_stop_onexc
 ./python -m test --fail-env-changed test_multiprocessing_spawn -v --match 
test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

PR 2850 + PR 2849 (of bpo-31019) fix most dangling process/thread, but one 
specific test still leaks:

test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback

I will try to fix it once other bugs are fixed.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

I rewrote PR 2841 to detect more bugs.

--

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This would be not easy. Since the BROWSER environment variable should be 
patched before the first use the webbrowser module, the test should import 
webbrowser in a separate process (you can use the 
test.support.script_helper.assert_python_ok() helper).

_synthesize() is used in two places with different arguments: in 
register_standard_browsers() and in get().

--

___
Python tracker 

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2017-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since Mike has not responded in more that a week, please go ahead.  Just put 
"“Original patch by Mike Short."  in the commit comments (if you can, otherwise 
add a separate comment).  Please add News blurb (see devguide) if you know how, 
with at least a title line.  Mike has signed the CLA, though it would not 
matter here since his patch is taken from my message and could be classed as 
trivial.

--

___
Python tracker 

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



cx_Oracle 6.0rc2

2017-07-24 Thread Anthony Tuininga
What is cx_Oracle?

cx_Oracle is a Python extension module that enables access to Oracle
Database for Python 3.x and 2.x and conforms to the Python database API 2.0
specifications with a number of enhancements.


Where do I get it?
https://oracle.github.io/python-cx_Oracle

The easiest method to install cx_Oracle 6.0rc1 is via pip as in

python -m pip install cx_Oracle --upgrade --pre

Note that the --pre option is required since this is a prerelease.


What's new?

This release continues to focus on correcting issues discovered over the
past month and polishing items in preparation for a production release. The
full release notes can be read here:

http://cx-oracle.readthedocs.io/en/latest/releasenotes.html#version-6-0-rc-2-july-2017

Please provide any feedback via GitHub issues (https://github.com/oracle/
python-cx_Oracle/issues).
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2899

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-24 Thread Ned Deily

Ned Deily added the comment:

> Which Git revisions are you testing? On master, do you have my latest commit 
> e72b1359f81d1dd42bd8a5c5cc2b3928b74f8023 ?

Yes, this is with current top of trunk of both branches.  Perhaps I wasn't 
clear about "installed location".  The test does not fail if you run it 
directly from the build directory like with "make test".  It fails when you do 
a "make install" and then run the test using the newly installed Python.  Tests 
need to work both ways.

--

___
Python tracker 

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



[issue31019] multiprocessing.Pool should join "dead" processes

2017-07-24 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2898

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

I just created bpo-31019 "multiprocessing.Pool should join "dead" processes" to 
fix dangling processes related to pool, like 
test.test_multiprocessing_spawn.WithProcessesTestPool.test_context.

--

___
Python tracker 

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2017-07-24 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Aditya:

The guideline for converting a patch to the PR is documented here:
https://devguide.python.org/pullrequest/#converting-an-existing-patch-from-the-b-p-o-to-github

--
nosy: +Mariatta

___
Python tracker 

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



[issue31018] _tracemalloc frame_t packing optimization not working in Windows x64

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2897

___
Python tracker 

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



[issue31019] multiprocessing.Pool should join "dead" processes

2017-07-24 Thread STINNER Victor

New submission from STINNER Victor:

With debug patches for bpo-26762, I noticed that some unit tests of 
test_multiprocessing_spawn leaks "dangling" processes:
---
haypo@selma$ ./python -m test --fail-env-changed test_multiprocessing_spawn -v 
--match test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
== CPython 3.7.0a0 (heads/master:b364d9f, Jul 24 2017, 11:06:33) [GCC 6.3.1 
20161221 (Red Hat 6.3.1-1)]
== Linux-4.11.9-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five little-endian
== hash algorithm: siphash24 64bit
== cwd: /home/haypo/prog/python/master/build/test_python_20982
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 load avg: 0.16 [1/1] test_multiprocessing_spawn
test_context (test.test_multiprocessing_spawn.WithProcessesTestPool) ... ok
Warning -- Dangling processes: {}
Dangling processes: {}

--
Ran 1 test in 1.342s

OK
test_multiprocessing_spawn failed (env changed)

1 test altered the execution environment:
test_multiprocessing_spawn

Total duration: 1 sec
Tests result: ENV CHANGED
---

multiprocessing.Pool.terminate() doesn't call the join() method of a Process 
object if its is_alive() method returns false. But in practice, avoid the 
join() creates "dangling" processes.

Attached pull request fixes the warning: Pool.terminate() now calls join() on 
all processes including "dead" processes.

--
components: Library (Lib)
messages: 299002
nosy: haypo
priority: normal
severity: normal
status: open
title: multiprocessing.Pool should join "dead" processes
type: resource usage
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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2017-07-24 Thread Aditya Hase

Aditya Hase added the comment:

Should I create a Github PR with given patch? If so, how do I give credit to 
the original author?

--
nosy: +adityahase

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread John Still

John Still added the comment:

Ok I understand what you mean.

I think the only conditions for test failure are (A) $BROWSER is set and (B) 
$BROWSER is set to an actual executable that should be caught by 
``register_standard_browsers`` prior to execution reaching the last if clause 
of ``register_standard_browsers`` (``if 'BROWSER' in os.environ:``) - those two 
conditions should be sufficient for execution to reach the offending line of 
code.

I'll see if I can cook up a test for that.  I think the right way to do this is 
to monkeypatch ``os.environ`` and ``shutil.which``, am I right?

--

___
Python tracker 

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



[issue31018] _tracemalloc frame_t packing optimization not working in Windows x64

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests:  -2896

___
Python tracker 

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



[issue31018] _tracemalloc frame_t packing optimization not working in Windows x64

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2896

___
Python tracker 

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



[issue31018] _tracemalloc frame_t packing optimization not working in Windows x64

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2895

___
Python tracker 

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



[issue31018] _tracemalloc frame_t packing optimization not working in Windows x64

2017-07-24 Thread Segev Finer

New submission from Segev Finer:

..\Modules\_tracemalloc.c(88): warning C4359: '': Alignment 
specifier is less than actual alignment (8), and will be ignored.

For this to actually work we simply need to use #pragma pack instead.

--
components: Extension Modules, Windows
messages: 298999
nosy: Segev Finer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: _tracemalloc frame_t packing optimization not working in Windows x64
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Aditya Hase

Aditya Hase added the comment:

I've fixed that.

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



[issue30916] Pre-build OpenSSL and Tcl/Tk for Windows

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2894

___
Python tracker 

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



[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-07-24 Thread Charalampos Stratakis

Changes by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue31017] gcc 7 fallthrough warnings

2017-07-24 Thread Zachary Ware

Zachary Ware added the comment:

This is a duplicate of bpo-30923.

--
nosy: +zach.ware
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add -Wimplicit-fallthrough=0 to Makefile ?

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Aditya Hase

Changes by Aditya Hase :


--
pull_requests: +2893

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Serhiy.

Aditya, your PR was made against the master branch. Can you make the change 
against the 2.7 branch?

Thanks.

--
nosy: +Mariatta

___
Python tracker 

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



[issue31017] gcc 7 fallthrough warnings

2017-07-24 Thread Charalampos Stratakis

New submission from Charalampos Stratakis:

On gcc 7 the new -Wimplicit-fallthrough option was introduced which produces 
warnings about switch cases that can fall through.

The easiest way to silence these warnings is to add the comment /* Falls 
through. */ for those cases. More information here [0]

Attaching the stderr output from compilation from the master branch.

[0] 
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

--
files: fallthrough36
messages: 298996
nosy: cstratak
priority: normal
severity: normal
status: open
title: gcc 7 fallthrough warnings
versions: Python 3.7
Added file: http://bugs.python.org/file47039/fallthrough36

___
Python tracker 

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



[issue30714] test_ssl fails with openssl 1.1.0f: test_alpn_protocols()

2017-07-24 Thread R. David Murray

R. David Murray added the comment:

Well, the reason one *might* consider a test failure as a release blocker (and 
I'm not saying you should, I'm just explaining the possible logic) is that 
distros would understandably like the test suite to pass before they include a 
release in their distribution.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is related only to 2.7. All correct in 3.x.

--
nosy: +serhiy.storchaka
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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Thanks for explaining your use-case.

Although the median_* functions don't perform arithmetic on their data, 
they are still conceptually mathematical functions that operate on 
numbers and I'm reluctant to support arbitrary objects with a key 
function without a solid reason. In your example, I think there are 
existing ways to get the result you want:

(1) Use a dict:

data = dict([(1, ['Anna']), (3, ['Paul', 'Henry']), (4, ['Kate'])])
people = data[median_low(data)]

(2) Use a custom numeric type with associated data:

class MyNum(int):
def __new__(cls, num, data):
instance = super().__new__(cls, num)
instance.data = data
return instance

data = [MyNum(1, ['Anna']), MyNum(3, ['Paul', 'Henry']), 
MyNum(4, ['Kate'])]

people = median_low(data).data

As for your second example, do you have a use-case for wanting to know 
the position of the median in the original, unsorted list? When would 
that be useful?

One other reason for my reluctance: although median_low and median_high 
guarantee to only return an actual data point, that's a fairly special 
case. There are other order statistics (such as quartiles, quantiles, 
etc) which are conceptually related to median but don't necessarily 
return a data value. Indeed, the regular median() function doesn't 
always do so. I would be reluctant for median() and median_low() to have 
different signatures without an excellent reason.

I'm not completely ruling this out. One thing which might sway me is if 
there are other languages or statistics libraries which offer this 
feature. (I say *might*, not that it definitely will.)

--

___
Python tracker 

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



Re: Script to replace contents inside the files

2017-07-24 Thread Peter Otten
Kunal Jamdade wrote:

> I have thousands of html files inside a folder. I want to replace the
> filename present inside another files. Say for ex:- fileName :-
> 'abcd1234.html' is found inside another file say file2.html. Then I want
> to remove the last 4 digits of the fileName i.e,. 'abcd1234.html' =>
> 'abcd.htm'.
> 
> I have tried a script .

Does your script work? If not post the parts that do not and ask specific 
questions.

> But your suggestions upon the script are welcomed.

Your problem exposition looks simpler than your implementation, but it's 
impossible for anyone but you to tell apart necessary complications from 
implementation artifacts.

Heed the advice given on http://sscce.org/ and you will likely get better 
answers.


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Aditya Hase

Aditya Hase added the comment:

Hi, I'm new to python development community.
I've created a GitHub PR that fixes this issue.

--
nosy: +adityahase

___
Python tracker 

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



[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-07-24 Thread Aditya Hase

Changes by Aditya Hase :


--
pull_requests: +2891

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These tests are not failing on our buildbots and developer's computers. Seems 
they are failing only in special environment. This path of execution is not 
tested in more common environments, therefore possible regression couldn't be 
caught until somebody run tests in similar special environment. New test should 
test this path of execution in common environments.

--

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Antoine Pitrou: "I'm not able to reproduce.  Can you try again with latest 
master?"

Oh, maybe I found why... There is a tearDownModule() function which hides bugs. 
Try following change:

diff --git a/Lib/test/_test_multiprocessing.py 
b/Lib/test/_test_multiprocessing.py
index 88e2eb3..ae77468 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4432,8 +4432,8 @@ def install_tests_in_module_dict(remote_globs, 
start_method):
 def tearDownModule():
 multiprocessing.set_start_method(old_start_method[0], force=True)
 # pause a bit so we don't get warning about dangling threads/processes
-time.sleep(0.5)
-multiprocessing.process._cleanup()
+# time.sleep(0.5)
+# multiprocessing.process._cleanup()
 gc.collect()
 tmp = set(multiprocessing.process._dangling) - set(dangling[0])
 if tmp:

--

___
Python tracker 

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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread Charalampos Stratakis

Changes by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread John Still

John Still added the comment:

What would a new test be testing? I only found this behaviour because two 
existing tests were failing (with the PR they pass, of course). I'm happy to 
write a test, I'm just not sure what the test should be testing that the 
existing tests don't already test.

--

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is it possible to write a test?

--
nosy: +daves, ncoghlan, serhiy.storchaka

___
Python tracker 

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



[issue30728] IDLE: Modernize configdialog code.

2017-07-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies:  -test_bsddb3 crash on x86 Windows XP 2.7

___
Python tracker 

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



[issue30188] test_nntplib: random EOFError in setUpClass()

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 5b4feb7e86ecb813b2c56560f86cda2fd46b9579 by Victor Stinner in 
branch 'master':
bpo-30188: test_nntplib catch also ssl.SSLEOFError (#2843)
https://github.com/python/cpython/commit/5b4feb7e86ecb813b2c56560f86cda2fd46b9579


--

___
Python tracker 

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



[issue30908] test_os.TestSendfile.test_keywords() leaks dangling threads

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 157b6ad677b7b330d30b2bb5ffbb2edac77b78cb by Victor Stinner in 
branch '3.5':
bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2845)
https://github.com/python/cpython/commit/157b6ad677b7b330d30b2bb5ffbb2edac77b78cb


--

___
Python tracker 

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



[issue30908] test_os.TestSendfile.test_keywords() leaks dangling threads

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset bb33ccfc5a216eff753b10a8dc59ec0277f1e1fb by Victor Stinner in 
branch '3.6':
bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2844)
https://github.com/python/cpython/commit/bb33ccfc5a216eff753b10a8dc59ec0277f1e1fb


--

___
Python tracker 

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



[issue27099] IDLE: turn builting extensions into regular modules

2017-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am still thinking about how to handle user customization of key defs and 
values.

The current extensions tab does not enable custom key defs, so that would be a 
new feature, and hence could be handled separately, and normally.  I have not 
yet looked at the patch to see if it does anything in this regard.

I would like to move custom values to config-main.  But if we do that, existing 
customizations would be ignored and new customization will not be seen by older 
versions.  A second possibility is to write changes to both config-main and 
config-extensions, but reading them from both places would be a nuisance.  A 
third is to keep those options on config-extensions and ignore the enable 
fields even though idleConf would continue to read them. Whatever we do, we 
will need additions to config help and a 'see help' message.

Complicating the decision is that the extension tab was first added, two years 
ago I think, as a separate dialog with a separate system for handling user 
changes.  When we moved it to a new tab, we did *not* convert it to using the 
existing system.  Another existing deficiency is that there is no validity 
check on entries.

Fortunately, the decision of where to display is separate from where to store.  
But if displays are moved, the machinery for extension display will have to be 
changed to ignore values displayed elsewhere.

--

___
Python tracker 

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



[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-07-24 Thread Марк Коренберг

Марк Коренберг added the comment:

Triggered almost the same error. Minimal proof:

Documentation did not say that .drain() can't be called simultaneously.

===
async def do_nothing(client_reader, client_writer):
await asyncio.sleep(1)

mb = b'*' * (4096*4)
async def write_cmd(writer):
writer.write(mb)
await writer.drain()

async def amain():
srv = await asyncio.start_unix_server(do_nothing, b'\x00qwe')
(reader, writer) = await asyncio.open_unix_connection(b'\x00qwe')
await asyncio.gather(*(write_cmd(writer) for i in range(200)))

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

--
nosy: +socketpair

___
Python tracker 

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



[issue31016] [Regression] sphinx shows an EOF error when using python2.7 from the trunk

2017-07-24 Thread Matthias Klose

New submission from Matthias Klose:

[forwarded from https://bugs.debian.org/869098 and]

sphinx shows an EOF error when using python2.7 from the trunk. Last successful 
build was with the 2.7.13 release.

It looks like this is triggered only when using the parallel mode in sphinx.  I 
haven't yet worked on this issue, Sphinx is v1.4.9.

sphinx-build -b html -d _build/doctrees  -n -j 4 . _build/html
Running Sphinx v1.4.9
making output directory...
loading pickled environment... not yet created
loading intersphinx inventory from https://docs.python.org/2/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 91 source files that are out of date
updating environment: 91 added, 0 changed, 0 removed
reading sources... [100%] test-repositories .. writing-tests
  
waiting for workers...

Exception occurred:
  File "/usr/lib/python2.7/dist-packages/sphinx/util/parallel.py", line 97, in 
_join_one
exc, result = pipe.recv()
EOFError

--
components: Library (Lib)
messages: 298980
nosy: doko
priority: normal
severity: normal
status: open
title: [Regression] sphinx shows an EOF error when using python2.7 from the 
trunk
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



[issue1644818] Allow built-in packages and submodules as well as top-level modules

2017-07-24 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue31015] PyErr_WriteUnraisable should be more verbose in Python 2.7

2017-07-24 Thread Christian Aguilera

New submission from Christian Aguilera:

When an exception is raised in a __del__ method or a finalizer (i.e. a
weakref callback), only the exception name is printed out.

Unfortunately, arbitrarily complex code can be involved which makes
debugging quite tedious. It would be nice to display the full traceback,
so that these errors are easier to diagnose.

The same bug was reported in the past, but it was fixed for Python 3.3 onwards.

Since it is trivial to get this fix in Python 2.7, I'm adding the patch for it 
here.

--
components: Library (Lib)
files: PyErr_WriteUnraisable.patch
keywords: patch
messages: 298979
nosy: christian.aguil...@foundry.com
priority: normal
severity: normal
status: open
title: PyErr_WriteUnraisable should be more verbose in Python 2.7
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file47038/PyErr_WriteUnraisable.patch

___
Python tracker 

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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

> malloc(((argc + 1) * sizeof(char *)) ? ((argc + 1) * sizeof(char *)) : 1)) ) 
> );

Ah ok, the "(n)?" expression is "((argc + 1) * sizeof(char *)) ? " and yes it 
contains "*".

--

___
Python tracker 

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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread Gabriel Somlo

Gabriel Somlo added the comment:

output of "gcc -E -Wall -I/usr/include/python2.7 -c netnsmodule.c > foo.c"

I think gcc7 is a bit more paranoid about whether some expression evaluating to 
an int can/should in itself be used as a Boolean (i.e., without being compared 
to 0).

--
Added file: http://bugs.python.org/file47037/foo.c

___
Python tracker 

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



[issue31014] webbrowser._synthesize uses outdated calling signature for webbrowser.register

2017-07-24 Thread John Still

New submission from John Still:

The function `register` of the `webbrowser` module was updated a little while 
back to use the newish keyword-only argument syntax; however, the function 
`_synthesize` (also in `webbrowser`) is still using the outdated positional 
arguments only calling convention; leading a pair of tests in 
`Lib/tests/test_webbrowser.py` to fail.  I've issued a PR that fixes the 
function call to use the more modern calling convention.

--
components: Library (Lib)
messages: 298976
nosy: jmsdvl
priority: normal
pull_requests: 2890
severity: normal
status: open
title: webbrowser._synthesize uses outdated calling signature for 
webbrowser.register
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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

> /usr/include/python2.7/pymem.h:97:30: error: '*' in boolean context, suggest 
> '&&' instead [-Werror=int-in-bool-context]

I don't understand this error. I would be curious to see the output of the 
preprocessor. Try maybe to use gcc -E?

--

___
Python tracker 

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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread Gabriel Somlo

Gabriel Somlo added the comment:

This attachment illustrates how the problem is triggered. The file is part of 
the CORE network emulator (github.com/coreemu/core). Compile with "gcc -Wall 
-I/usr/include/python2.7 -c netnsmodule.c".

--
Added file: http://bugs.python.org/file47036/netnsmodule.c

___
Python tracker 

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



[issue31013] gcc7 throws warning when pymem.h development header is used

2017-07-24 Thread Gabriel Somlo

New submission from Gabriel Somlo:

C programs using PyMem_MALLOC in pymem.h generate a warning when 
-Wint-in-bool-context is enabled (typically through -Wall). In places where 
-Werror is enabled (such as RPM build), this causes the build to fail with an 
error that looks like:

...
In file included from /usr/include/python2.7/Python.h:78:0,
 from netnsmodule.c:16:
netnsmodule.c: In function 'netns_nsexecvp':
/usr/include/python2.7/pymem.h:97:30: error: '*' in boolean context, suggest 
'&&' instead [-Werror=int-in-bool-context]
  ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
  ^
/usr/include/python2.7/pymem.h:75:15: note: in definition of macro 
'PyMem_MALLOC'
 : malloc((n) ? (n) : 1))
   ^
netnsmodule.c:61:10: note: in expansion of macro 'PyMem_NEW'
   argv = PyMem_NEW(char *, argc + 1);
  ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
...

I'm attaching a patch that fixes the issue, please consider applying!

Thanks,
--Gabriel

--
files: Python-2.7.13-pymem-gcc7.patch
keywords: patch
messages: 298973
nosy: Gabriel Somlo
priority: normal
severity: normal
status: open
title: gcc7 throws warning when pymem.h development header is used
versions: Python 2.7
Added file: http://bugs.python.org/file47035/Python-2.7.13-pymem-gcc7.patch

___
Python tracker 

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



  1   2   >