[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched

2018-03-31 Thread Arcadiy Ivanov

New submission from Arcadiy Ivanov :

While working on GH gevent/gevent#993 I've encountered a stall trying to read 
from an mp.Queue passed to mp.Process's target as an argument. Trying to print 
out the lock state in child process I encountered as SEGV in Lock's __repr__. I 
originally thought it was due to gevent/greenlet stack magic, but it wasn't. 

This happens when `fork` context Queue (default) is used with `spawn` context 
Process (obvious stupidity on my part, alas shouldn't crash).

Python 3.6.4 from PyEnv
Fedora 27

```
$ python test_lock_sigsegv.py 
Parent r_q: , , 

-11
```

```
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __new_sem_getvalue (sem=0x7fc877f54000, sval=sval@entry=0x7fffb130db9c) at 
sem_getvalue.c:38
38*sval = atomic_load_relaxed (>data) & SEM_VALUE_MASK;
...
#0  __new_sem_getvalue (sem=0x7fc877f54000, sval=sval@entry=0x7fffb130db9c) at 
sem_getvalue.c:38
#1  0x7f1116aeb202 in semlock_getvalue (self=) at 
/tmp/python-build.20171219170845.6548/Python-3.6.4/Modules/_multiprocessing/semaphore.c:531
```

At a minimum I think there should be a check trying to reduce arguments via 
incompatible context's process to prevent a SEGV.

Test attached.

--
components: Library (Lib)
files: test_lock_sigsegv.py
messages: 314762
nosy: arcivanov
priority: normal
severity: normal
status: open
title: SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file47510/test_lock_sigsegv.py

___
Python tracker 

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



[issue33195] PyArg_Parse* should deprecate 'u' and 'z' family.

2018-03-31 Thread INADA Naoki

Change by INADA Naoki :


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

___
Python tracker 

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



[issue33195] PyArg_Parse* should deprecate 'u' and 'z' family.

2018-03-31 Thread INADA Naoki

New submission from INADA Naoki :

https://docs.python.org/3/c-api/arg.html

Py_UNICODE usage is not deprecated in this document.
Before thinking about raising warning, deprecate it in document first.

But... from when?  Can I backport the "deprecated" doc to 3.6 or 3.5?

--
assignee: docs@python
components: Documentation
messages: 314761
nosy: docs@python, inada.naoki
priority: normal
severity: normal
status: open
title: PyArg_Parse* should deprecate 'u' and 'z' family.
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-31 Thread Nick Coghlan

Nick Coghlan  added the comment:

It turns out pydoc's CLI is looking specifically for '' in sys.path, but *not* 
looking for "os.getcwd()".

The resulting sys.path manipulation then goes completely wrong for "python -m 
pydoc", since it ends up removing "scriptdir" from sys.path, and that's the 
directory containing "pydoc" and the rest of the standard library.

It surprised me that you were getting the misbehaviour for the direct pydoc 
command though, as for me, that's a separate script living in `*/bin`, so the 
misbehaviour doesn't happen (only the bin directory gets removed from sys.path, 
which is the desired behaviour).

It turns out that behaviour is due to a difference between venv and virtualenv, 
where the latter defines a shell alias to hide the filesystem level pydoc 
scripts installed system wide:

```
$ which pydoc   

pydoc ()


{   


python -m pydoc "$@"


}
```

and hence will encounter the problem.

So I think there are two changes needed here:

1. Update pydoc.cli() to search sys.path for "os.getcwd()" in addition to 
searching for the empty string.
2. Rewording the note in the porting guide to explicitly call out checks for 
"'' in sys.path" in start-up code as potentially requiring updates

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-31 Thread Nick Coghlan

Nick Coghlan  added the comment:

I guess this confirms our suspicion from issue 33053 that making "-m" no longer 
track the current working directory had the potential to pose some non-trivial 
compatibility risks :(

I can reproduce the issue in a 3.7 checkout without a virtual environment:

```
$ ./python -m pydoc itertools
No module named 'ast'
```

There's an odd discrepancy between the behaviour when running pydoc and the 
behaviour when running runpy, though:

```
$ ./python -im runpy
No module specified for execution
>>> import sys; print(len(sys.path)); print(sys.path)
5
['/home/ncoghlan/devel/py37', '/usr/local/lib/python37.zip', 
'/home/ncoghlan/devel/py37/Lib', 
'/home/ncoghlan/devel/py37/build/lib.linux-x86_64-3.7', 
'/home/ncoghlan/.local/lib/python3.7/site-packages']
>>>

$ ./python -im pydoc itertools
No module named 'ast'

>>> import sys; print(len(sys.path)); print(sys.path)
5
['.', '/home/ncoghlan/devel/py37', '/usr/local/lib/python37.zip', 
'/home/ncoghlan/devel/py37/build/lib.linux-x86_64-3.7', 
'/home/ncoghlan/.local/lib/python3.7/site-packages']
>>>
```

The path in the `runpy` case is correct, while the path in the `pydoc` case is 
missing the expected `Lib` directory (and hence can't import standard library 
modules), and has had a `.` inserted at the start of `sys.path`.

--

___
Python tracker 

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



[issue33194] Path-file objects does not have method to delete itself if its a file

2018-03-31 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

You're looking for 'Path.unlink'. Agreed though that the name makes it hard to 
find. (I guess it makes sense to old-school Unix greybeards, but Python does 
generally try to be useful for more people than just them...) There was some 
discussion on python-dev a few weeks ago about smoothing over some of these 
rough edges in the Path API, but it kinda fizzled out without anyone 
volunteering to do the work of going through and curating a good list of 
changes and writing down a case for each of them.

--
nosy: +njs

___
Python tracker 

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



Unified async/sync interface

2018-03-31 Thread Demian Brecht
I might be entirely off my face, but figured I'd ask anyways given I
haven't figured out a clean solution to this problem myself yet:

I'm trying to write a REST API client that supports both async and
synchronous HTTP transports (initially requests and aiohttp). So far,
I've tried a few approaches with `async def` but, of course, you always
run into the issue with the top level API that should either be async
or not, but can't be redefined on the fly (AFAICT). I'm also trying to
limit code duplication. I know I could write async and sync versions of
each method and then instantiate through composition based on the
transport layer but I'd like to avoid that if possible. As an
simplified example of what I'm after:

import requests
import aiohttp

class SyncTransport:
  def get(self, url):
 return requests.get(url)

class AsyncTransport:
  def __init__(self, loop=None):
self.loop = loop

  async def get(self, url):
[...preamble...]
return await response.text()

class MyAPIClient:
  def __init__(self, transport=SyncTransport):
self.transport = transport()

  # biggest issue here atm, not being able to dynamically swap the
  # method definition to async
  def get_something(self):
if isinstance(self.transport, AsyncTransport):
  data = await self.transport.get('https://example.com')
else:
  data = self.transport.get('https://example.com')
return json.loads(data)

# intended synchronous usage
client = MyAPIClient()
data = client.get_something()

# intended async usage
import asyncio
client =
MyAPIClient(transport=AysncTransport(loop=asyncio.get_event_loop())

async def get_something():
  data = await client.get_something()

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


Is this perhaps possible through asyncio.coroutine decorators
(admittedly, I haven't looked yet, I've had async/await blinders on)?
Are there any projects that anyone's aware of that does anything
similar that I could use as an example?

The overall point of what I'm trying to achieve here is to write a
client that's supported from 2.7 to 3.x and supports /either/
synchronous or asynchronous transports (not both at the same time).

TIA
Demian

signature.asc
Description: This is a digitally signed message part
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32419] Add unittest support for pyc projects

2018-03-31 Thread Bassem Girgis

Bassem Girgis  added the comment:

I Robert,

One use scenario is to run deployment tests for sourceless packages and to
ensure the integrity of the production environment. Very useful in
container environments!

In regards to the looking for the __init__ file, it is obvious that the
logic you mentioned is the reason behind that. However, if the unittest
code used a standard way to figure out "loadable" packages, whatever that
is, it would have captured the fact that python3 can indeed function with
all pyc files.

I would say the fix in here is a dirty one. A better way to solve it is to
call a standard utility which can detect if a package is loadable. This
would resolve this issue and help with any future changes in the standard
as well.

Best regards,
Bassem

Bassem Girgis, PhD

Email: brgir...@gmail.com

On Sat, Mar 31, 2018 at 8:52 PM, Robert Collins 
wrote:

>
> Robert Collins  added the comment:
>
> Oh, and why look for __init__ - in part, because it predates namespace
> packages, but also because unlike regular imports unittest will do negative
> things like reading the entire filesystem otherwise.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



Beta release of pip version 10

2018-03-31 Thread Mikhail V
MRAB writes:


> > UnicodeEncodeError: 'charmap' codec can't encode character
> >
> > when it meets a non-ascii char.
> >
> > e.g. tried this:
> > pip search pygame > a.txt
> >
> Well, _I_ didn't get an error!
>
> One of the lines is:
>
> kundalini (0.4)- LրVE-like PyGame API
>
> So it's down to what system encoding (active code page) is in use.

Dunno, it gives me error regardless of active codepage,
my default is 866, i've set to 1252 or 65001, same error.

The output itself is fine - I see correct glyphs, so the error
only appears when I redirect to file.
if I try some python script e.g. "a.py":
print ("абв")

and run:
py a.py > a.txt

I get some gibberish in the file.
So it is probably a global issue. Nothing works in this life :)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33194] Path-file objects does not have method to delete itself if its a file

2018-03-31 Thread Marco Rougeth

New submission from Marco Rougeth :

Path has the method `.rmdir()` for removing the directory, but it doesn't have 
anything if it correspond to a file.

The `os.remove` could be used here, but I think it should have a more 
appropriate/explicit  name like `.rmfile()`.

If it make  sense, I'd be glad to work on it.

--
messages: 314756
nosy: rougeth
priority: normal
severity: normal
status: open
title: Path-file objects does not have method to delete itself if its a file
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33193] Cannot create a venv on Windows when directory path contains dollar character

2018-03-31 Thread Stuart Cuthbertson

New submission from Stuart Cuthbertson :

I should clarify first that I haven't reproduced the following bug specifically 
with venv. I was asked to raise this here after raising an identical issue 
about virtualenv (https://github.com/pypa/virtualenv/issues/1154); a GitHub 
user told me this would also apply to venv. 

The bug with virtualenv is that it errors if passed a directory that contains a 
$ (dollar symbol). $ is a valid character for Windows directory names, 
filenames, and usernames. So running something simple like `python3 -m venv` 
(presumably) can fail in some valid Windows directories. 

The full error traceback for virtualenv is available at the above GitHub URL. A 
commenter in the virtualenv project (see 
https://github.com/pypa/virtualenv/issues/457#issuecomment-377159868) suggested 
that this happens because the directory path is passed as-is (with $) to 
distutils, and distutils is seeing the text following the $ as a placeholder 
and trying to replace it with a variable, which isn't found.

--
components: Windows
messages: 314755
nosy: Stuart Cuthbertson, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot create a venv on Windows when directory path contains dollar 
character
type: crash
versions: Python 3.6

___
Python tracker 

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



Re: GPG signatures invisible in new PyPI (was: Re: new Python Package Index is now in beta at pypi.org)

2018-03-31 Thread Sumana Harihareswara
On 03/31/2018 06:26 PM, Dominik George wrote:
> Hi,
> 
> On Sat, Mar 31, 2018 at 06:16:51PM -0400, Sumana Harihareswara wrote:
>> The new Python Package Index at https://pypi.org is now in beta.
> 
> Yep!
> 
> I read that the new Warehouse does not offer GPG signature files for
> download.
> 
> Why not?  How can I still get them (append .asc to the source downlaod?),
> and how do I find out whether an upload is signed?
> 
> I am asking mainly as a Debian developer relying on upstream signatures.
> 
> -nik

Thanks for your question, Nik.

Once the legacy site shuts down, GPG/PGP signatures for packages will no
longer be visible in PyPI's web UI. But signatures still appear in the
Simple Project API
https://warehouse.readthedocs.io/api-reference/legacy/#simple-project-api
per PEP 503 https://www.python.org/dev/peps/pep-0503/ .

Donald Stufft, who started Warehouse and is one of its core maintainers,
has made no secret of his opinion that "package signing is not the Holy
Grail"
https://caremad.io/posts/2013/07/packaging-signing-not-holy-grail/ , and
current discussion on the distutils-sig mailing list leans towards
further removing signing features from another part of the Python
packaging ecology (the wheel library)
https://mail.python.org/pipermail/distutils-sig/2018-March/032066.html .
There's other relevant discussion in
https://mail.python.org/pipermail/distutils-sig/2016-May/028933.html and
https://github.com/pypa/warehouse/issues/1439  and I believe
https://github.com/pypa/warehouse/pull/2172 .

This is a policy discussion that probably belongs on distutils-sig
and/or in the "packaging problems" issues repository, like in
https://github.com/pypa/packaging-problems/issues/15 . The people
working on Python packaging and distribution tools want to hear from you
and figure out a way forward that works for everyone, if possible.

I've been trying to reach out to the Debian Python community via IRC,
personal connections, tickets, and mailing lists to ensure a smooth
transition; I see now that a post I tried to get onto the debian-python
list a few weeks ago did not get posted there, so I've re-sent it. I'm
sorry that this is (I infer) the first you're hearing about this change.

-- 
Sumana Harihareswara
Warehouse project manager
Changeset Consulting
https://changeset.nyc
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beta release of pip version 10

2018-03-31 Thread MRAB

On 2018-04-01 02:50, Mikhail V wrote:

Steven D'Aprano writes:



PS: was looking forward to PIP improvements on Windows, on 9.0.3 still
some issues. E.g. trying to redirect output from 'pip search ... >
a.txt' gives a wall of errors. it's on Windows 10.




Don't be shy, tell us what those errors are.



You meant - don't be lazy to figure out how to reproduce it.

UnicodeEncodeError: 'charmap' codec can't encode character

when it meets a non-ascii char.

e.g. tried this:
pip search pygame > a.txt


Well, _I_ didn't get an error!

One of the lines is:

kundalini (0.4)- LրVE-like PyGame API

So it's down to what system encoding (active code page) is in use.
--
https://mail.python.org/mailman/listinfo/python-list


[issue32419] Add unittest support for pyc projects

2018-03-31 Thread Robert Collins

Robert Collins  added the comment:

Whats the use for *unittest* - a tool to help folk develop - to run a test 
which is only present in sourceless form?

--

___
Python tracker 

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



Beta release of pip version 10

2018-03-31 Thread Mikhail V
Steven D'Aprano writes:

>>
>> PS: was looking forward to PIP improvements on Windows, on 9.0.3 still
>> some issues. E.g. trying to redirect output from 'pip search ... >
>> a.txt' gives a wall of errors. it's on Windows 10.
>
>
>
> Don't be shy, tell us what those errors are.


You meant - don't be lazy to figure out how to reproduce it.

UnicodeEncodeError: 'charmap' codec can't encode character

when it meets a non-ascii char.

e.g. tried this:
pip search pygame > a.txt
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32419] Add unittest support for pyc projects

2018-03-31 Thread Robert Collins

Robert Collins  added the comment:

Oh, and why look for __init__ - in part, because it predates namespace 
packages, but also because unlike regular imports unittest will do negative 
things like reading the entire filesystem otherwise.

--

___
Python tracker 

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



Re: Beta release of pip version 10

2018-03-31 Thread Steven D'Aprano
On Sun, 01 Apr 2018 03:17:51 +0300, Mikhail V wrote:

> PS: was looking forward to PIP improvements on Windows, on 9.0.3 still
> some issues. E.g. trying to redirect output from 'pip search ... >
> a.txt' gives a wall of errors. it's on Windows 10.


Don't be shy, tell us what those errors are.


-- 
Steve

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Steven D'Aprano
On Sat, 31 Mar 2018 14:07:37 -0400, Terry Reedy wrote:

> On 3/31/2018 11:58 AM, Etienne Robillard wrote:
> 
>> Do you really think people in Somalia can afford theses things like in
>> the US?
> 
> No, many cannot afford $600 Caddilac-style phones to take 10 megapixel
> pictures and watch UTube videos.  Instead they buy $100 VWBug-style
> phones that let them get competitive prices for their crops and other
> goods instead of accepting low-ball bids from whoever wanders by their
> village.
> 
> Africans are ahead of at least the US in using phone minutes as a benign
> practical digital currency.  This, not destructive and useless bitcoins,
> are the real revolution.

What Terry said.

Personally, I dislike smartphones, but I have to say that they way they 
are used in villages across India, Africa and other developing places has 
been far more of a benign revolution than what smartphones are doing to 
the West.


None of this has anything to do with Python though. Python is not 
primarily a device for development on mobile devices, it is not dropping 
support for laptops, desktops and servers, and Etienne's questions are 
based on utterly false premises.


-- 
Steve

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Steven D'Aprano
On Sat, 31 Mar 2018 10:58:51 -0400, Etienne Robillard wrote:

> Hi,
> 
> I was just wondering, could the fact that the Python community is
> willing to discontinue using and developing Python 2 softwares, does
> that mean we are stopping to support standard computers and laptops as
> well?

That seems to be a strange question to ask, when servers and desktops are 
the primary focus of Python 3.


> Furthermore, does it bother you to develop code primarly oriented
> towards mobile devices in Python 3 while most of the world still cannot
> afford theses expensive products?

It doesn't bother me one bit, because I don't do it. Nor is Python mainly 
oriented towards mobile devices. In fact, getting Python working on 
mobile devices is still a bit of a challenge.



-- 
Steve

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


Beta release of pip version 10

2018-03-31 Thread Mikhail V
Paul Moore writes :

If you discover any bugs while testing the new release, please report
> them at https://github.com/pypa/pip/issues.


Link not working (on pipermail archive -- remove the period on the end)
https://github.com/pypa/pip/issues

PS: was looking forward to PIP improvements on Windows,
on 9.0.3 still some issues. E.g. trying to redirect output
from 'pip search ... > a.txt' gives a wall of errors.
it's on Windows 10.

(logging to file is needed because there is no advanced
search, so need some filtering to restrict the output to
packages only, since it searches in description too and
that may be a lng list of packages).



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


[issue24978] Contributing to Python 2x and 3x Documentation. Translation to Russian.

2018-03-31 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Adding a reference to PEP 545 for contributing documentation translations.

--
nosy: +csabella

___
Python tracker 

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



[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset e80a232f2cfdab584133d9779c83885c5f9f1ba6 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-33096: Fix ttk.Treeview.insert. (GH-6228) (GH-6326)
https://github.com/python/cpython/commit/e80a232f2cfdab584133d9779c83885c5f9f1ba6


--

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread miss-islington

miss-islington  added the comment:


New changeset 9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9 by Miss Islington (bot) 
in branch '3.7':
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
https://github.com/python/cpython/commit/9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9


--

___
Python tracker 

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



GPG signatures invisible in new PyPI (was: Re: new Python Package Index is now in beta at pypi.org)

2018-03-31 Thread Dominik George
Hi,

On Sat, Mar 31, 2018 at 06:16:51PM -0400, Sumana Harihareswara wrote:
> The new Python Package Index at https://pypi.org is now in beta.

Yep!

I read that the new Warehouse does not offer GPG signature files for
download.

Why not?  How can I still get them (append .asc to the source downlaod?),
and how do I find out whether an upload is signed?

I am asking mainly as a Debian developer relying on upstream signatures.

-nik

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Phone: +49 228 92934581 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V. · Debian Developer

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33192] asyncio should use signal.set_wakeup_fd on Windows

2018-03-31 Thread Nathaniel Smith

New submission from Nathaniel Smith :

I thought there was already a bug for this, but it came up in conversation 
again and I can't find one, so, here you go...

It looks like originally there was this bug for making control-C wake up the 
asyncio event loop in Windows: https://github.com/python/asyncio/issues/191

This required some changes to signal.set_wakeup_fd to work on Windows, which 
was done in bpo-22018.

But I guess the last step got lost in the shuffle: right now 
signal.set_wakeup_fd works fine on Windows, but asyncio doesn't actually use 
it. This means that on Windows you can't wake up this program using control-C:

>>> import asyncio
>>> asyncio.run(asyncio.sleep(1))

Both of the Windows event loops should register a wakeup socket with 
signal.set_wakeup_fd, and arrange for the loop to wake up when data arrives on 
that socket, and read from it until it's empty again. (And once the loop is 
awake, Python's normal control-C handling will kick in.) That will make 
control-C on Windows work similarly to how it does on Unix.

--
messages: 314749
nosy: asvetlov, giampaolo.rodola, njs, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio should use signal.set_wakeup_fd on Windows
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-03-31 Thread Jakub Wilk

Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6041

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset aa8e51f5ebb2a71c76059f050de01fc3c985376a by Serhiy Storchaka in 
branch 'master':
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
https://github.com/python/cpython/commit/aa8e51f5ebb2a71c76059f050de01fc3c985376a


--

___
Python tracker 

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



[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6040

___
Python tracker 

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



[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-03-31 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 25c869edd665cba7187910c5b151a0016fec4754 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-33132: Fix reference counting issues in the compiler. (GH-6209). 
(GH-6321)
https://github.com/python/cpython/commit/25c869edd665cba7187910c5b151a0016fec4754


--

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6039

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6038

___
Python tracker 

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



[issue33132] Possible refcount issues in the compiler

2018-03-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6037

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Rick Johnson
Grant Edwards wrote:
> Etienne Robillard wrote:
> 
> > Do you understand that a modern mobile device typically
> > require a Internet subscription and an additional
> > subscription for the smart phone?
> 
> Huh?  What is "an internet subscription"?  Why would you
> need two of them if all you have is a smartphone?

Most american cell providers these days offer an unlimited
"0talk and text" plan and then add an additional fee for smart
phones (aka: "Data Plan").
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32419] Add unittest support for pyc projects

2018-03-31 Thread Bassem Girgis

Bassem Girgis  added the comment:

Please let me know what I need to do in order to close this issue and finally 
merge the code.

--

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Terry Reedy

On 3/31/2018 11:58 AM, Etienne Robillard wrote:

Do you really think people in Somalia can afford theses things like in 
the US?


No, many cannot afford $600 Caddilac-style phones to take 10 megapixel 
pictures and watch UTube videos.  Instead they buy $100 VWBug-style 
phones that let them get competitive prices for their crops and other 
goods instead of accepting low-ball bids from whoever wanders by their 
village.


Africans are ahead of at least the US in using phone minutes as a benign 
practical digital currency.  This, not destructive and useless bitcoins, 
are the real revolution.


--
Terry Jan Reedy

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


[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-31 Thread Brett Cannon

Brett Cannon  added the comment:

OK, I will update importlib.machinery.PathFinder.invalidate_caches() to also 
drop None from sys.path_importer_cache (objects that are not None and do not 
define invalidate_caches() will be left alone just like they are today). I 
should hopefully be able to get to this before b4.

--
assignee:  -> brett.cannon
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



[issue28053] parameterize what serialization is used in multiprocessing

2018-03-31 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'd like to know if the work here will be completed soon :-) This currently 
lacks documentation but also tests.

In particular, looking at the code (and that is supported by Will S' comment 
above), I feel the API isn't working as intended (i.e. setting the "reducer" 
property won't actually change the underlying parameters since the "reduction" 
module is imported eagerly).

--
nosy: +pitrou

___
Python tracker 

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2018-03-31 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Please note the PR here has some review comments that need addressing.
Also, it needs its conflicts with git master resolved.

I'm cc'ing Thomas Moreau, who has done a lot of work recently on the 
concurrent.futures internals.

--
assignee: davin -> 
nosy: +tomMoral
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



[issue14119] Ability to adjust queue size in Executors

2018-03-31 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Issue 29595 has a more complete PR, so closing this issue as duplicate.

--
nosy: +pitrou
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Expose max_queue_size in ThreadPoolExecutor

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Grant Edwards
On 2018-03-31, Etienne Robillard  wrote:

> Are you trolling? Do you understand that a modern mobile device 
> typically require a Internet subscription and an additional subscription 
> for the smart phone?

Huh?  What is "an internet subscription"?

Why would you need two of them if all you have is a smartphone?

> Do you really think people in Somalia can afford theses things like in 
> the US?

I think you'll find that smartphones are far more widespread in both
rich and poor countries than are traditional computers and laptops.

-- 
Grant




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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Michael Torrie
On Mar 31, 2018 09:58, "Etienne Robillard"  wrote:



Le 2018-03-31 à 11:40, Michael Torrie a écrit :

> On 03/31/2018 08:58 AM, Etienne Robillard wrote:
>
>> I was just wondering, could the fact that the Python community is
>> willing to discontinue using and developing Python 2 softwares, does
>>   that mean we are stopping to support standard computers and laptops
>> as well?
>>
> I've tried several times but I can't make sense of that paragraph.
>
Please give me a break. That was just a simple question. Besides, I really
don't understand why the Python development community is dropping support
for Python 2 unless for stopping to support standard computers altogether...

Why would dropping support for python 2 indicate an abandonment of
conventional desktop computers and operating systems?  Python3 is not a
mobile language. Why do you think it is?



> Furthermore, does it bother you to develop code primarly oriented
>> towards mobile devices in Python 3 while most of the world still
>> cannot afford theses expensive products?
>>
> Or this one.  What are you talking about?
>

Are you trolling? Do you understand that a modern mobile device typically
require a Internet subscription and an additional subscription for the
smart phone?


I'm not trolling. I genuinely don't understand where you're coming from.
What does python3 have to do with mobile development? I know of very little
mobile development happening with any version of python.


Do you really think people in Somalia can afford theses things like in the
US?


I can assure you that smart phones have made waves even in Somalia. As far
as it goes, I'm quite sure a smart phone is way cheaper than a desktop or
laptop.

But again I don't understand why you're talking about mobile as if python
is somehow abandoning desktop. You're coming from a false premise with that
one.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Anders Wegge Keller
På Sat, 31 Mar 2018 11:58:39 -0400
Etienne Robillard  skrev:

> Are you trolling? Do you understand that a modern mobile device 
> typically require a Internet subscription and an additional subscription 
> for the smart phone?

 I think the question is why you equate python3 with the need for internet
connected tablets. That's quite the non sequitur. 

Consider this my +1 the the request of you to clarify what you mean.

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread bartc

On 31/03/2018 16:58, Etienne Robillard wrote:



Le 2018-03-31 à 11:40, Michael Torrie a écrit :

On 03/31/2018 08:58 AM, Etienne Robillard wrote:

I was just wondering, could the fact that the Python community is
willing to discontinue using and developing Python 2 softwares, does
  that mean we are stopping to support standard computers and laptops
as well?

I've tried several times but I can't make sense of that paragraph.
Please give me a break. That was just a simple question. Besides, I 
really don't understand why the Python development community is dropping 
support for Python 2 unless for stopping to support standard computers 
altogether...



Furthermore, does it bother you to develop code primarly oriented
towards mobile devices in Python 3 while most of the world still
cannot afford theses expensive products?

Or this one.  What are you talking about?


Are you trolling? Do you understand that a modern mobile device 
typically require a Internet subscription and an additional subscription 
for the smart phone?


AIUI, a smartphone or tablet will still work as a small computer without 
an internet or phone connection (ie. without any of WiFi/GSM/3G/4G).


But a temporary WiFi link (eg. a free one at McDonald's) can be useful 
to download extra free apps then they can be used off-line.


Of source it might not be very popular without access to social media if 
that's the main purpose of the device.


--
bartc

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Chris Angelico
On Sun, Apr 1, 2018 at 2:58 AM, Etienne Robillard  wrote:
>
>
> Le 2018-03-31 à 11:40, Michael Torrie a écrit :
>>
>> On 03/31/2018 08:58 AM, Etienne Robillard wrote:
>>>
>>> I was just wondering, could the fact that the Python community is
>>> willing to discontinue using and developing Python 2 softwares, does
>>>   that mean we are stopping to support standard computers and laptops
>>> as well?
>>
>> I've tried several times but I can't make sense of that paragraph.
>
> Please give me a break. That was just a simple question. Besides, I really
> don't understand why the Python development community is dropping support
> for Python 2 unless for stopping to support standard computers altogether...

How are they related? What does the termination of support for a
ten-year-old version of Python have to do with forcing everyone to
mobile devices that they don't own?

You might as well ask if after 2020 there will be no further support
for OSX, or no further support for compilers other than gcc, or no
further support for 64-bit computers.

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Etienne Robillard



Le 2018-03-31 à 11:40, Michael Torrie a écrit :

On 03/31/2018 08:58 AM, Etienne Robillard wrote:

I was just wondering, could the fact that the Python community is
willing to discontinue using and developing Python 2 softwares, does
  that mean we are stopping to support standard computers and laptops
as well?

I've tried several times but I can't make sense of that paragraph.
Please give me a break. That was just a simple question. Besides, I 
really don't understand why the Python development community is dropping 
support for Python 2 unless for stopping to support standard computers 
altogether...



Furthermore, does it bother you to develop code primarly oriented
towards mobile devices in Python 3 while most of the world still
cannot afford theses expensive products?

Or this one.  What are you talking about?


Are you trolling? Do you understand that a modern mobile device 
typically require a Internet subscription and an additional subscription 
for the smart phone?


Do you really think people in Somalia can afford theses things like in 
the US?



Etienne

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Michael Torrie
On 03/31/2018 08:58 AM, Etienne Robillard wrote:
> I was just wondering, could the fact that the Python community is 
> willing to discontinue using and developing Python 2 softwares, does
>  that mean we are stopping to support standard computers and laptops
> as well?

I've tried several times but I can't make sense of that paragraph.

> Furthermore, does it bother you to develop code primarly oriented 
> towards mobile devices in Python 3 while most of the world still
> cannot afford theses expensive products?

Or this one.  What are you talking about?

Regarding mobile development, I'd love to write mobile apps with
Python3.  At present, though, that's not very practical.  Python isn't
geared at all towards mobile space, and Apple and Google don't have any
interest in supporting much besides Obj C/Swift or a Java-based language
as a first class development language.

Just as an aside, many more people in the world can afford a smart phone
now than a "standard computer" or laptop. Probably an order of
magnitude.  Just saying.  I've seen smart phones all over the developing
world.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Etienne Robillard

Hi,

I was just wondering, could the fact that the Python community is 
willing to discontinue using and developing Python 2 softwares, does 
that mean we are stopping to support standard computers and laptops as well?


Furthermore, does it bother you to develop code primarly oriented 
towards mobile devices in Python 3 while most of the world still cannot 
afford theses expensive products?


Etienne

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Gene Heskett
On Saturday 31 March 2018 10:16:13 Ian Kelly wrote:

> On Sat, Mar 31, 2018 at 6:29 AM, Rick Johnson
>
>  wrote:
> > On Friday, March 30, 2018 at 8:59:16 PM UTC-5, Chris Angelico wrote:
> >> Wanna provide some competing information showing that other
> >> languages are more used?
> >
> > Chris, here is how debate works:
> >
> > PersonA asserts X.
> >
> > PersonB demands evidence for X.
> >
> > PersonA either provides evidence for X, or X is rejected as
> > hooey.
>
> PersonB provides evidence fox X.
>
> PersonA asserts that that evidence doesn't count because "it's
> nothin' but hype".
>
> PersonC provides a different source of numbers supporting X.
>
> PersonA asserts that those numbers don't count either because most
> of them are trolls or sock puppets.
>
> PersonD asks if PersonA has any of their own evidence to provide.
>
> PersonA snarkily responds that they don't need to provide evidence
> because they didn't make the assertion, apparently oblivious to the
> fact that they've actually made several assertions of their own over
> the course of this.
>
> Do I have this right? This is how I understand debate works from
> following this thread. I see the same pattern on the Flat-Earth
> threads, so I think I have it right.

Close enough for the girls I go with. 


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Ian Kelly
On Sat, Mar 31, 2018 at 6:29 AM, Rick Johnson
 wrote:
> On Friday, March 30, 2018 at 8:59:16 PM UTC-5, Chris Angelico wrote:
>> Wanna provide some competing information showing that other
>> languages are more used?
>
> Chris, here is how debate works:
>
> PersonA asserts X.
>
> PersonB demands evidence for X.
>
> PersonA either provides evidence for X, or X is rejected as
> hooey.

PersonB provides evidence fox X.

PersonA asserts that that evidence doesn't count because "it's
nothin' but hype".

PersonC provides a different source of numbers supporting X.

PersonA asserts that those numbers don't count either because most
of them are trolls or sock puppets.

PersonD asks if PersonA has any of their own evidence to provide.

PersonA snarkily responds that they don't need to provide evidence
because they didn't make the assertion, apparently oblivious to the
fact that they've actually made several assertions of their own over
the course of this.

Do I have this right? This is how I understand debate works from
following this thread. I see the same pattern on the Flat-Earth
threads, so I think I have it right.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: please test the new PyPI (now in beta)

2018-03-31 Thread Sumana Harihareswara
Quick note: we've implemented the fix Terry Jan Reedy suggested
regarding window width and filters to fix
https://github.com/pypa/warehouse/issues/3454 , so thank you to everyone
who helped us nail this down.

The next IRC/Twitter livechat hour with PyPI maintainers is Tuesday,
April 3rd at 15:00 UTC
https://pyfound.blogspot.com/2018/03/warehouse-all-new-pypi-is-now-in-beta.html#livechat
, and if any of you are going to be at PyCon North America in Cleveland
in May, consider joining us for the packaging sprints:
https://wiki.python.org/psf/PackagingSprints

And:

On 03/30/2018 11:03 AM, Paul Moore wrote:
> On 30 March 2018 at 14:38, William Ray Wing  wrote:
>> Sumana, I want to be sure we aren’t just talking past each other.  I notice 
>> that the URL you seem to always reference is:
>>
>> https://pypi.org/search/
>>
>> and if I go there, I get the filter list immediately.  The place I don’t see 
>> it is the home page:
>>
>> https://pypi.org/
>>
>> where I’m invited to “Search” or “Browse”, but where there is no filter 
>> list.  The filter list only appears after I’ve performed my first search.
>>
>> Thanks,
>> Bill
> 
> That's the same behaviour as the existing PyPI. There's a "search" box
> on the main page, and a "Browse" link on that page that takes you to a
> separate page that lets you select packages by category. I don't see
> this as a problem with the new PyPI - far from it, I wouldn't want the
> main page cluttered with category filters, if I need then I'll go to
> the dedicated browse page.
> 
> Just my 2p worth...
> Paul

Thanks for clarifying, Bill! Yes, I thought you were talking about the
dedicated search page, and now I see what you mean. And thanks for your
thoughts on this, Paul. I wonder whether some lookahead search that
includes suggested facets (specifically, classifiers) springing up as
you type would help? I've updated
https://github.com/pypa/warehouse/issues/3462 accordingly.

-- 
Sumana Harihareswara
Warehouse project manager
Changeset Consulting
https://changeset.nyc
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-31 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6036

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Chris Angelico
On Sat, Mar 31, 2018 at 11:29 PM, Rick Johnson
 wrote:
> Under no circumstance is PersonB required to prove PersonA'a
> assertions. The onerous is on PersonA.

Assertion: Rick doesn't know what "onerous" means.

Under no circumstance is Rick required to prove me right. But he
obliged anyway. Very kind of him.

This has nothing to do with any sort of debate; I just thought it interesting.

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Rick Johnson
On Friday, March 30, 2018 at 8:59:16 PM UTC-5, Chris Angelico wrote:
[...]
> You can pooh-pooh any statistic. 

Yeah, except the ones supported by actual _facts_.

> So far, though, you have provided NO statistics of your
> own, just your own gut feeling. 

Uh huh. And what do you call drawing naive conclusions from
statistical data? I'd call it confirmation bias!

> Wanna provide some competing information showing that other
> languages are more used?

Chris, here is how debate works:

PersonA asserts X.

PersonB demands evidence for X.

PersonA either provides evidence for X, or X is rejected as
hooey.

Under no circumstance is PersonB required to prove PersonA'a
assertions. The onerous is on PersonA.

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


[issue31544] gettext.Catalog title is not flagged as a class

2018-03-31 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
Removed message: https://bugs.python.org/msg314739

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

New changeset c498cd8bf81fc47acf2f1f702e8b3bc9bd4aed65 by Serhiy Storchaka 
(scoder) in branch '2.7':
bpo-31544: Fix a reference leak to 'self' after the previous target error 
handling fixes. (GH-6318)
https://github.com/python/cpython/commit/c498cd8bf81fc47acf2f1f702e8b3bc9bd4aed65

--

___
Python tracker 

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



[issue31544] gettext.Catalog title is not flagged as a class

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The correct issue for 0694b6a651ba2a53f6323ffb3b23358f43885815 and 
c498cd8bf81fc47acf2f1f702e8b3bc9bd4aed65 is issue31455.

--

___
Python tracker 

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



[issue31544] gettext.Catalog title is not flagged as a class

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c498cd8bf81fc47acf2f1f702e8b3bc9bd4aed65 by Serhiy Storchaka 
(scoder) in branch '2.7':
bpo-31544: Fix a reference leak to 'self' after the previous target error 
handling fixes. (GH-6318)
https://github.com/python/cpython/commit/c498cd8bf81fc47acf2f1f702e8b3bc9bd4aed65


--

___
Python tracker 

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



[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-31 Thread Eric V. Smith

Eric V. Smith  added the comment:

Yeah, no need to change the API. I was over-generalizing.

--

___
Python tracker 

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



[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-31 Thread Matt Eaton

Matt Eaton  added the comment:

Adding some core team members to the nosy list to get their take on this as 
well.

--
nosy: +berker.peksag, eric.smith

___
Python tracker 

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



[RELEASE] Python 3.7.0b3 is now available for testing

2018-03-31 Thread Ned Deily
On behalf of the Python development community and the Python 3.7 release
team, I'm happy to announce the availability of Python 3.7.0b3.  b3 is
the third of four planned beta releases of Python 3.7, the next major
release of Python, and marks the end of the feature development phase
for 3.7.  You can find Python 3.7.0b3 here:

https://www.python.org/downloads/release/python-370b3/

Among the new major new features in Python 3.7 are:

* PEP 538, Coercing the legacy C locale to a UTF-8 based locale
* PEP 539, A New C-API for Thread-Local Storage in CPython
* PEP 540, UTF-8 mode
* PEP 552, Deterministic pyc
* PEP 553, Built-in breakpoint()
* PEP 557, Data Classes
* PEP 560, Core support for typing module and generic types
* PEP 562, Module __getattr__ and __dir__
* PEP 563, Postponed Evaluation of Annotations
* PEP 564, Time functions with nanosecond resolution
* PEP 565, Show DeprecationWarning in __main__
* PEP 567, Context Variables

Please see "What’s New In Python 3.7" for more information.
Additional documentation for these features and for other changes
will be provided during the beta phase.

https://docs.python.org/3.7/whatsnew/3.7.html

Beta releases are intended to give you the opportunity to test new
features and bug fixes and to prepare their projects to support the
new feature release. We strongly encourage you to test your projects
with 3.7 during the beta phase and report issues found to
https://bugs.python.org as soon as possible.

While the release is feature complete entering the beta phase, it is
possible that features may be modified or, in rare cases, deleted up
until the start of the release candidate phase (2018-05-21). Our goal
is have no ABI changes after beta 3 and no code changes after rc1.
To achieve that, it will be extremely important to get as much exposure
for 3.7 as possible during the beta phase.

Attention macOS users: there is a new installer variant for
macOS 10.9+ that includes a built-in version of Tcl/Tk 8.6. This
variant is expected to become the default version when 3.7.0 releases.
Check it out! We welcome your feedback.  As of 3.7.0b3, the legacy
10.6+ installer also includes a built-in Tcl/Tk 8.6.

Please keep in mind that this is a preview release and its use is
not recommended for production environments.

The next planned release of Python 3.7 will be 3.7.0b4, currently
scheduled for 2018-04-30. More information about the release schedule
can be found here:

https://www.python.org/dev/peps/pep-0537/

--
  Ned Deily
  n...@python.org -- []

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

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


Beta release of pip version 10

2018-03-31 Thread Paul Moore
On behalf of the PyPA, I am pleased to announce that a beta release
10.0.0b1 of pip has just been released for testing by the community.
We're planning on a final release in 2 weeks' time, over the weekend
of 14/15 April.

To install pip 10.0.0.b1, you can run

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

(obviously, you should not do this in a production environment!)

We would be grateful for all testing that users could do, to ensure
that when pip 10 is released it's as solid as we can make it.

Highlights of the new release:

* Python 2.6 is no longer supported - if you need pip on Python 2.6,
you should stay on pip 9, which is the last version to support Python
2.6.
* Support for PEP 518, which allows projects to specify what packages
they require in order to build from source. (PEP 518 support is
currently limited, with full support coming in future versions - see
the documentation for details).
* Significant improvements in Unicode handling for non-ASCII locales on Windows.
* A new "pip config" command.
* The default upgrade strategy has become "only-if-needed"
* Many bug fixes and minor improvements.

In addition, the previously announced reorganisation of pip's
internals has now taken place. Unless you are the author of code that
imports the pip module (or a user of such code), this change will not
affect you. If you are, please report the issue to the author of the
affected code (refer them to
https://mail.python.org/pipermail/distutils-sig/2017-October/031642.html
for the details of the announcement).

Please note that there is a minor issue with the NEWS file for this
release - the new features in 10.0.0b1 are reported as being for
"9.0.3 (2018-03-31)".

If you discover any bugs while testing the new release, please report
them at https://github.com/pypa/pip/issues.

Thanks to everyone who put so much effort into the new release. Many
of the contributions came from community members, whether in the form
of code, participation in design discussions, or bug reports. The pip
development team is extremely grateful to everyone in the community
for their contributions.

Thanks,
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to fill in a dictionary with key and value from a string?

2018-03-31 Thread bartc

On 30/03/2018 21:13, C W wrote:

Hello all,

I want to create a dictionary.

The keys are 26 lowercase letters. The values are 26 uppercase letters.

The output should look like:
{'a': 'A', 'b': 'B',...,'z':'Z' }



I know I can use string.ascii_lowercase and string.ascii_uppercase, but how
do I use it exactly?
I have tried the following to create the keys:
myDict = {}
 for e in string.ascii_lowercase:
 myDict[e]=0


If the input string S is "cat" and the desired output is {'c':'C', 
'a':'A', 't':'T'}, then the loop might look like this:


   D = {}
   for c in S:
   D[c] = c.upper()

   print (D)

Output:

{'c': 'C', 'a': 'A', 't': 'T'}


But, how to fill in the values? Can I do myDict[0]='A', myDict[1]='B', and
so on?


Yes, but the result will be {0:'A', 1:'B',...} for which you don't need 
a dict; a list will do.


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


[issue33186] Memory corruption with urllib.parse

2018-03-31 Thread Ivan Zakharyaschev

Ivan Zakharyaschev  added the comment:

Actually, Alexey shared this problem with me orally first, and then asked to 
have a look at his report, and I felt that just describing the technical 
details about what is going on is not enough, and suggested to include a brief 
sentence which would state what kind of assumptions seemed to be broken to 
Alexey. And it was:

> a list contains elements that have never been appended.

And this statement actually appeared quite helpful for me: in a few hours after 
this statement was made, I got an idea that this statement might actually be 
not true in this case. And this quickly lead me to the demonstration what 
really happens here, and that it was correct Python behavior.

Without this brief formal statement of the broken assumptions, I had simply had 
no ideas (because I supposed that something was going wrong according to 
Alexey's words, and didn't question whether it is really wrong or we might 
expect these results under some conditions as correct results).

(Actually, I'm a fan of type-checking, and what is more, of languages with 
expressive types like Agda or Idris where the programmer is to make provable 
statements of the expected properties written down as types; sometimes, they 
can be derived automatically, but nevertheless my point is the attitude to 
programming, even without formal tools: think how the expected properties would 
be proved, how they would be decomposed into simpler statements during the 
proof. Well, this is offtopic here, so, Alexey, let's not continue this 
discussion here.)

--

___
Python tracker 

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



[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-31 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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

___
Python tracker 

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



Re: Curious case of UnboundLocalError

2018-03-31 Thread Peter Otten
Johannes Bauer wrote:

> On 30.03.2018 13:25, Johannes Bauer wrote:
> 
>>> This mention of collections refers to ...
>>>
 }
 for (_, collections) in z.items():
>>>
>>> ... this local variable.
>> 
>> Yup, but why? I mean, at the point of definition of "z", the only
>> definition of "collections" that would be visible to the code would be
>> the globally imported module, would it not? How can the code know of the
>> local declaration that only comes *after*?
> 
> Now that I understand what's going on, this is a much clearer example:
> 
> import collections
> def foo():
> print(collections)
> collections = "BAR"
> foo()
> 
> I would have thought that during the "print", collections (because
> locally undefined) would expand the scope to global scope and refer to
> the module and only after the definition overwrites the binding with the
> local scope, collections would be "BAR".
> 
> But that's not the case. Huh! I wonder if I'm the last one to notice
> that -- it's never come up before for me, I think :-)

While you're at it -- the body of a class behaves the way you expected from 
a function:

>>> x = "outer"
>>> class A:
... print(x)
... x = "inner"
... print(x)
... 
outer
inner

And here's an odd application for exec():

>>> x = "outer"
>>> def f():
... exec("print(x)")
... x = "inner"
... exec("print(x)")
... 
>>> f()
outer
inner

Also:

$ cat tmp.py
x = "outer"
def f():
print(x)
exec("x = 'inner'")
print(x)
f()
$ python2 tmp.py
outer
inner
$ python3 tmp.py
outer
outer


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


[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel

Stefan Behnel  added the comment:

PR 6318 fixes the reference leak for Py2.7.

--

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel

Change by Stefan Behnel :


--
pull_requests: +6034
stage: resolved -> patch review

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Steven D'Aprano
On Sat, 31 Mar 2018 12:39:48 +0300, Marko Rauhamaa wrote:

> Paul Rubin :
>> All the scripts that say #!/usr/bin/python at the top will still use
>> python2.
> 
> Which is how it should be till the end of times.

Don't be silly -- they should use Python 1, of course, as nature 
intended. In 20 years time, when we're using Python 5.2 and Python 3 is a 
distant memory, typing "python" at the command prompt should try to 
launch Python1.x.

If you think that's ludicrous, consider that replacing 1.x with 2.x 
doesn't make it any less ludicrous.


> Unfortunately, ArchLinux decided otherwise, which has caused quite a bit
> of grief in the office, where a coworker uses it.
> 
> We thought we could get around the problem by specifying
> 
>#!/usr/bin/env python2
> 
> in all of our scripts, but, regrettably,
> 
>(1) Not all of our python tools are written by us

Nevertheless, they're text files on your server which can easily have a 
tiny sed script run over them as part of the deployment process, or a 
thin wrapper in bash, or your tech staff could add an alias to their bash 
login script (or equivalent).

Or just get the Archlinux guy to add an alias to his logic script.



>(2) MacOS doesn't have a python2 alias for Python2

o_O

Um... is your tech team made up of actual techs or do you ask your 
grandma[1] to administrate your system? How hard is it to add a python2 
alias on MacOS?

That's a rhetorical question -- the answer is, "not hard at all".




[1] For all I know, Marko's grandma could have invented Unix. If that's 
the case, substitute my grandma, who certain did not.



-- 
Steve

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Steven D'Aprano
On Sat, 31 Mar 2018 12:32:31 +0300, Marko Rauhamaa wrote:

> Paul Rubin :
> 
>> Marko Rauhamaa  writes:
>>> Yes, RHEL, CentOS and OracleLinux still only support Python2. It may
>>> be another year before Python3 becomes available on them.
>>
>> Debian's default Python is also Python2. I don't say it *only* supports
>> python2 since you can optionally install python3,
> 
> That option is not available for RHEL et al.

Python 3.3 was available for RHEL 6:

https://access.redhat.com/solutions/123273

I would be shocked if RedHat 7 didn't support 3.3, at the very least.



-- 
Steve

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


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Marko Rauhamaa
Paul Rubin :
> All the scripts that say #!/usr/bin/python at the top will still use
> python2.

Which is how it should be till the end of times.

Unfortunately, ArchLinux decided otherwise, which has caused quite a bit
of grief in the office, where a coworker uses it.

We thought we could get around the problem by specifying

   #!/usr/bin/env python2

in all of our scripts, but, regrettably,

   (1) Not all of our python tools are written by us

   (2) MacOS doesn't have a python2 alias for Python2

> Typing "python" or "python xyz.py" at the shell will also use python2.
> Python3 will have really taken over when it's the other way around and
> python2 is the optional install.

I disagree. It is enough for the oldest supported Linux and MacOS distro
to support Python3 out of the box.


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


Re: Curious case of UnboundLocalError

2018-03-31 Thread Johannes Bauer
On 30.03.2018 16:46, Ben Bacarisse wrote:

>> Yup, but why? I mean, at the point of definition of "z", the only
>> definition of "collections" that would be visible to the code would be
>> the globally imported module, would it not? How can the code know of the
>> local declaration that only comes *after*?
> 
> Why questions can be hard.  The language definition says what's supposed
> to happen.  Is that enough of an answer to why?

Absolutely. Don't get me wrong, I dont't doubt either the correctness of
your answer nor question the design choice. I just found it surprising
and cool.

Thanks for clearing it up.

Cheers,
Joe



-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Marko Rauhamaa
Paul Rubin :

> Marko Rauhamaa  writes:
>> Yes, RHEL, CentOS and OracleLinux still only support Python2. It may
>> be another year before Python3 becomes available on them.
>
> Debian's default Python is also Python2. I don't say it *only*
> supports python2 since you can optionally install python3,

That option is not available for RHEL et al. It is expected that RHEL 8
will include Python3, but nobody knows when RHEL 8 will come out.


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


[issue32823] Regression in test -j behavior and time in 3.7.0b1

2018-03-31 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

python -m test -j0

--

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel

Stefan Behnel  added the comment:

Right, Zachary, thanks for noticing. Py2.7 is actually way more different than 
I thought, and I hadn't paid enough attention to that. Py3 does all of this in 
"__init__", whereas Py2 essentially implements "__new__" in C, which requires 
more cleanup.

BTW, the implementation in Py3 would also benefit from refactoring the error 
handling code and moving it all in one place. But it shouldn't suffer from the 
same kind of problem, at least.

--

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-03-31 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

posix_spawn() is not documented, it contains reference leaks (issue33191) and 
can cause crashes. It's style doesn't conform PEP 7.

The simplest fix requires changing the undocumented interface.

--
dependencies: +Refleak in posix_spawn
nosy: +serhiy.storchaka
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Steven D'Aprano
On Fri, 30 Mar 2018 20:51:22 -0600, Ian Kelly wrote:

> On Fri, Mar 30, 2018 at 8:43 PM, Ian Kelly 
> wrote:
>> You really think that 90% of the active users are trolls? And yet the
>> subreddit remains usable despite that allegedly terrible
>> signal-to-noise ratio.
> 
> I'm now laughing at the image of a large community of trolls sitting
> around trolling each other and not realizing that they're all being
> trolled.


/TheDonald ?



*ducks and hides*



-- 
Steve

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