[issue34884] Python may load incorrect libraries when embedding the macOS system python 2.7

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:

Ugh!  That's a messy one.  Just for the record, the problem of searching other 
than the system Python images is reproducible with other distributions of 
Python, including the python.org Python 2.7 - so it is not limited to Homebrew. 
 The key seems to be which "python" (or possibly "python2.7") is found first on 
$PATH.  It also appears to not be limited to framework builds of Python; a 
non-framework build of 2.7 inserted first on $PATH also caused a failure.  I 
took a quick look at how lldb apparently invokes python, following the link in 
the StackOverflow item referenced in the llvm bug tracker issue:

http://llvm.org/svn/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

and I'm not going to try to try to step through all that.

Much of the magic that's involved in initializing Python search paths is in 
Modules/getpath.c.  In it, you'll see that we do some magic using long 
deprecated macOS dyld APIs, namely NSModuleForSymbol, NSLookupAndBindSymbol, 
and NSLibraryNameForModule.  It's quite possible that the behavior seen is due 
to how they search for symbols.  One could try to track them down in the dyld 
sources found in https://opensource.apple.com.

But now that I think of it, we have had an open issue (Issue15498) for a long 
time to avoid the use of those deprecated APIs and, lo and behold, one of the 
comments under it (msg173828) might very well be the key to what's going on 
here:

"Apple seems to have switched to using dlopen in their version of getpath.c 
(see 
,
 this is the version in OSX 10.8.2)

This causes a problem for some people, as noticed on the pythonmac mailing 
list. This is something we should test before applying my patch to avoid 
regressions. [...]"

If so, the problem may have to be fixed by Apple in the system Python.

Ronald undoubtedly has better insight into this.

--
components:  -Library (Lib)
title: Python loads incorrect libraries on MacOS, 2.7 -> Python may load 
incorrect libraries when embedding the macOS system python 2.7

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +9124
stage: needs patch -> patch review

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Tim,

I understand. It's just my experience, I have seen a lot of new comers (in my 
python trainings), they just copy the examples and don't read the total 
explanation. sometimes, because english is not their native language and in 
this case, they try to find an example, copy/paste and run it and when there is 
an exception, they will try to read the doc.

so, I have pushed a PR, I just changed sentences, I am waiting for your 
suggestions.

Thank you for your explanation.

--

___
Python tracker 

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



[issue34912] Update overflow checks in resize_buffer

2018-10-05 Thread Windson Yang

New submission from Windson Yang :

In 
[resize_buffer](https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/_io/stringio.c#L85)

/* For simplicity, stay in the range of the signed type. Anyway, Python
   doesn't allow strings to be longer than this. */
if (size > PY_SSIZE_T_MAX)
goto overflow;
...

IMO, we should check the overflow with

if (size > PY_SSIZE_T_MAX/sizeof(Py_UCS4))

Or we can just delete this code because we will check later at 
[alloc_check](https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/_io/stringio.c#L107)

BTW, I found we only use PY_SIZE_MAX here in CPython, I wonder why we do not 
use PY_SSIZE_T_MAX instead?

--
components: IO
messages: 327223
nosy: Windson Yang
priority: normal
severity: normal
status: open
title: Update overflow checks in resize_buffer
versions: Python 3.4, Python 3.5, 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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I'm sure that this would break the code which sends bytes objects and expects 
to receive bytes objects.

s.send(struct.pack('!I', x))
q, w, e = struct.unpack('!IHQ', s.recv(4))

--

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Tim Peters


Tim Peters  added the comment:

Stephane, it's not deep.  People who need to write doctests that work across N 
versions of Python shouldn't need to read N versions of the documentation.  
This is hardly unique to doctest.  We routinely add "Changed in version m.n" 
blurbs all over the place.

Ways that were _necessary_ for robust dict testing continue to work fine in 3.6 
and 3.7, so it doesn't harm anything if people mindlessly copy an example that 
_could_ be spelled some other way under 3.6+.  It's not like there's even 
anything slightly obscure about, e.g.,

>>> foo() == {"Hermione": "hippogryph", "Harry": "broomstick"}
True

--

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Raymond,

Ok, if you agree with Tim, I just created a PR. 

Have a nice day,

--
keywords:  -patch
stage: patch review -> needs patch

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +9123
stage: needs patch -> patch review

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, set objects are still unordered, so they too require sorting for a 
reproducible doctest.

--

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Raymond, what do you think?

I concur with Tim.

--

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Terry,

You say we need to keep this illustration with a section 'before 3.6' but in 
think it's a bad thing.

1. when you read a documentation, you just copy the example, and sometimes you 
don't read the requirements.
2. why do we need to keep an illustration for a previous version of Python? 
since >= 3.6 we keep the order (officially in 3.7), in this case, the example 
is useless, because you read the documentation of >= 3.7.

I would prefer to remove this example for >= 3.6 and keep the illustration for 
the previous version.

I am really interested by the feedback of Tim, Cheryl and Raymond.

--
nosy: +matrixise

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

git bisect start
# bad: [1596fea0a329e1f5e4cce0135724881ca5f1d341] bpo-34899: Fix a possible 
assertion failure due to int_from_bytes_impl() (GH-9705)
git bisect bad 1596fea0a329e1f5e4cce0135724881ca5f1d341
# good: [84b0129b5e0a0e22aad22ae8db2e3833a228aa57] _Py_CoerceLegacyLocale() 
restores LC_CTYPE on fail (GH-9044) (GH-9046)
git bisect good 84b0129b5e0a0e22aad22ae8db2e3833a228aa57
# good: [470a435f3b42c9be5fdb7f7b04f3df5663ba7305] bpo-34623: Use 
XML_SetHashSalt in _elementtree (GH-9146)
git bisect good 470a435f3b42c9be5fdb7f7b04f3df5663ba7305
# bad: [92ad2612bef198f2e3f8f09bf552189e27afcc4e] bpo-1529353: IDLE: Squeezer 
What's New for 3.6.7 (GH-9567)
git bisect bad 92ad2612bef198f2e3f8f09bf552189e27afcc4e
# good: [e5fde1f992e94f166415ab96d874ed1d2e0c8004] bpo-34537: Fix 
test_gdb:test_strings with LC_ALL=C (GH-9483)
git bisect good e5fde1f992e94f166415ab96d874ed1d2e0c8004
# bad: [394e55a9279d17240ef6fe85d3b4ea3fe7b6dff5] [3.7] bpo-17239: Disable 
external entities in SAX parser (GH-9217) (GH-9511)
git bisect bad 394e55a9279d17240ef6fe85d3b4ea3fe7b6dff5
# bad: [44989bc2696320cf55ae6f329aaf58edd49d792a] bpo-34472: Add data 
descriptor signature to zipfile (GH-8871) (GH-9399)
git bisect bad 44989bc2696320cf55ae6f329aaf58edd49d792a
# good: [c00f7037df3607c89323e68db3ab996b7df394de] bpo-34759: Fix error 
handling in ssl 'unwrap()' (GH-9468)
git bisect good c00f7037df3607c89323e68db3ab996b7df394de
# bad: [0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3] [3.7] bpo-29577: Enum: mixin 
classes don't mix well with already mixed Enums (GH-9328) (GH-9486)
git bisect bad 0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3
# first bad commit: [0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3] [3.7] bpo-29577: 
Enum: mixin classes don't mix well with already mixed Enums (GH-9328) (GH-9486)

--

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Ethan,

the issue appears with your patch 

0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3 is the first bad commit
commit 0c076caaa82a9c6596e1fe1dbe6384d53f30a1a3
Author: Ethan Furman 
Date:   Fri Sep 21 22:26:32 2018 -0700

[3.7] bpo-29577: Enum: mixin classes don't mix well with already mixed 
Enums (GH-9328) (GH-9486)

* bpo-29577: allow multiple mixin classes


(found with git bisect and your test)

--
nosy: +matrixise

___
Python tracker 

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



Re: asyncio await different coroutines on the same socket?

2018-10-05 Thread Russell Owen
On Oct 3, 2018, Ian Kelly wrote
(in 
article):

> On Wed, Oct 3, 2018 at 7:47 AM Russell Owen  wrote:
> > Using asyncio I am looking for a simple way to await multiple events where
> > notification comes over the same socket (or other serial stream) in
> > arbitrary
> > order. For example, suppose I am communicating with a remote device that can
> > run different commands simultaneously and I don't know which command will
> > finish first. I want to do this:
> >
> > coro1 = start(command1)
> > coro2 = start(command2)
> > asyncio.gather(coro1, coro2)
> >
> > where either command may finish first. I’m hoping for a simple and
> > idiomatic way to read the socket and tell each coroutine it is done. So far
> > everything I have come up with is ugly, using multiple layers of "async
> > def”, keeping a record of Tasks that are waiting and calling "set_result"
> > on those Tasks when finished. Also Task isn’t even documented to have the
> > set_result method (though "future" is)
>
> Because Tasks are used to wrap coroutines, and the result of the Task
> should be determined by the coroutine, not externally.
>
> Instead of tracking tasks (that's what the event loop is for) I would
> suggest tracking futures instead. Have start(command1) return a future
> (or create a future that it will await on itself) that is not a task.
> Whenever a response from the socket is parsed, that code would then
> look up the corresponding future and call set_result on it. It might
> look something like this:
>
> class Client:
> async def open(self, host, port):
> self.reader, self.writer = await asyncio.open_connection(host, port)
> asyncio.create_task(self.read_loop())
>
> async def read_loop(self):
> while not self.reader.at_eof():
> response = self.reader.read()
> id = get_response_id(response)
> self._futures.pop(id).set_result(response)
>
> def start(self, command):
> future = asyncio.Future()
> self._futures[get_command_id(command)] = future
> self.writer.write(command)
> return future
>
> In this case start() is not a coroutine but its result is a future and
> can be awaited.

That is exactly what I was looking for. Thank you very much!

-- Russell

(My apologies for double posting -- I asked this question again today because 
I did not think my original question -- this one -- had gone through).


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


Re: Python indentation (3 spaces)

2018-10-05 Thread Ryan Johnson
The point that OP is trying to make is that a fixed standard that is
distinguishable from the even-spacing Tab-length convention in code and
text editors will establish a level of trust between the end developer and
upstream developers or co-developers who may not have the same development
environment. For example, the first Python library I ever tried to use was
poorly maintained and had spaces on one line with tabs on the next, and the
author mixed naming conventions and syntax from Python 2 and 3 in his code.
That type of experience doesn’t exactly instill trust in the coding
language’s standards, when a noob tries to use a library they found and
ends up having to debug weird errors with weirder error messages on the
first project they do.

Flexibility is great until the learning curve comes into play. That said,
there is an easy fix for tab misuse: in Visual Studio Code, you can replace
all Tabs with Spaces by highlighting the entire code block, hitting Tab
once and Shift-Tab after.

Peace
Ryan
On Fri, Oct 5, 2018 at 4:51 PM Terry Reedy  wrote:

> On 10/5/2018 4:48 PM, ts9...@gmail.com wrote:
> > I am new to Python programming but have significant SQL and C
> experience. My simple question is,"Why not standardize Python indentations
> to 3 spaces instead of 4 in order to avoid potential programming errors
> associated with using "TAB" instead of 4 spaces?"
>
> IDLE (and other modern editors and IDEs) turns a typed TAB into a
> user-settable n spaces, where n defaults to 4 (minimum 2, maximum 16).
>
> --
> Terry Jan Reedy
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
Ryan Johnson
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34282] Enum._convert shadows members named _convert

2018-10-05 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 22e86fbbca04d251233fc07515885d2b67945094 by Ethan Furman (Miss 
Islington (bot)) in branch '3.6':
[3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert 
(GH-9034) (GH-9229)
https://github.com/python/cpython/commit/22e86fbbca04d251233fc07515885d2b67945094


--

___
Python tracker 

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



[issue34840] dlopen() error with no error message from dlerror()

2018-10-05 Thread Eryk Sun


Eryk Sun  added the comment:

> FWIW, the method does not exist on Windows

In Windows it's FreeLibrary, for which the implementation in NT calls loader 
and runtime library functions such as LdrUnloadDll and RtlImageNtHeaderEx. 
These OS functions internally use structured exception handling (SEH) to retun 
status codes such as STATUS_DLL_NOT_FOUND and STATUS_INVALID_IMAGE_FORMAT 
instead of crashing the process when passed an invalid module handle (i.e. 
module base address).

For POSIX, I don't see what can be done to avoid a crash when dlclose is passed 
a bad handle (i.e. module address). We can check for NULL, the obvious case, 
but otherwise AFAIK we can only detect an invalid address by trying to access 
it, which triggers a segfault. This is the reason that dlclose is only 
available in the private _ctypes module, and ctypes itself never even calls it.

--
nosy: +eryksun

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:

What's the status of this issue for 3.7 and for 3.6?  Is everyone OK with what 
is currently in 3.7, i.e. no revert needed or has it already been reverted 
elsewhere?  Also, there is the open PR for 3.6.

--
nosy: +ned.deily

___
Python tracker 

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:


New changeset 0991b9bb94036e0f271d223c8db7d81980c76736 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-34158: Documentation UTC offset update (GH-8377) (GH-9732)
https://github.com/python/cpython/commit/0991b9bb94036e0f271d223c8db7d81980c76736


--
nosy: +ned.deily

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:

> I just finished the fix and am currently running the tests locally.

Great. Thanks!

> Is it okay to have the PR directly against 3.7 instead of doing 3.8 first and 
> backporting?

If you want but it's probably easier to do it the normal way and let the bot do 
the backport, assuming master and 3.7 are still similar in that area.

--

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman


Ethan Furman  added the comment:

It really is.  I got a message from Michal Arbet from OpenStack about it.

I just finished the fix and am currently running the tests locally.  Is it okay 
to have the PR directly against 3.7 instead of doing 3.8 first and backporting?

--
stage: test needed -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue34565] Launcher does not validate major versions

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:


New changeset 28dd737c46d50f4952c61651426c69cc43991bfa by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-34565: Change a PC/launcher.c comment to accurately describe valid major 
versions. (GH-9037) (GH-9065)
https://github.com/python/cpython/commit/28dd737c46d50f4952c61651426c69cc43991bfa


--
nosy: +ned.deily

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ned Deily


Ned Deily  added the comment:

Ethan, do you an ETA of a fix for this? 3.7.1 final is scheduled for fewer than 
24 hours from now but if it's truly a release blocker I will hold for a fix and 
probably do a rc2 instead.

--

___
Python tracker 

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



How to await multiple replies in arbitrary order (one coroutine per reply)?

2018-10-05 Thread Russell Owen


I am using asyncio and am fairly new to it. I have a stream to which I write 
commands and from which I read replies. (In this case the stream is custom 
wrapper around DDS written in C++ and pybind11). Multiple commands can run at 
the same time and I cannot predict which will finish first. I need aa 
different coroutine (or asyncio.Task or other awaitable object) for each 
command that is running.

Is there a simple way to handle this in asyncio? So far the best I have come 
up is the following (greatly simplified), which works but has some 
misfeatures:

import asyncio
from iolib import read_reply, write_command, TIMED_OUT

class RemoteCommand:
def __init__(self):
self._tasks = dict()

def start(self, cmd, timeout):
"""Start a command"""
cmd_id = write_command(cmd)
task = asyncio.ensure_future(self._wait_for_command(cmd_id=cmd_id, 
timeout=timeout))
self._tasks[cmd_id] = task
if len(self._tasks) == 1:
asyncio.ensure_future(self._handle_replies())
return task

async def _wait_for_command(self, cmd_id, timeout):
"""Wait for a command to finish"""
await asyncio.sleep(timeout)
if cmd_id in self._tasks:
del self._tasks[cmd_id]
return TIMED_OUT # our standard end code for timeouts

async def _handle_replies(self):
while True:
cmd_id, end_code = read_reply()
if cmd_id in self._tasks:
task = self._tasks.pop(cmd_id)
task.set_result(end_code)
if not self._tasks:
return
await asyncio.sleep(0.1)

Misfeatures include:
- asyncio.Task is not documented to have a "set_result" method. The 
documentation says that Task is "A Future-like object that runs a Python 
coroutine" and Future does have such a method.
- When "_handle_replies" calls "task.set_result(data)" this does not seem to 
cancel the "await asyncio.sleep(timeout)" in the task, resulting in scary 
messages to stdout. I have tried saving *that* as another task and canceling 
it, but it seems clumsy and I still see scary messages.

I think what I'm looking for is a task-like thing I can create that I can end 
when *I* say it's time to end, and if I'm not quick enough then it will time 
out gracefully. But maybe there's a simpler way to do this. It doesn't seem 
like it should be difficult, but I'm stumped. Any advice would be 
appreciated.

-- Russell


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


[issue33173] GzipFile's .seekable() returns True even if underlying buffer is not seekable

2018-10-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Allowing for non seekable files was added in issue1675951.  And under that 
issue in msg117131, the author of the change wrote:
"The patch creates another problem with is not yet fixed: The implementation of 
.seekable() is becoming wrong. As one can now use non seekable files the 
implementation should check if the file object used for reading is really 
seekable."

issue23529 made significant changes to the code and seekable() is again 
mentioned in msg239245 and subsequent comments.

Nosying the devs who worked on those issues.

--
nosy: +cheryl.sabella, martin.panter, pitrou
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

OK, if it gets truncated beyond a reasonable length I remove my objection.

--

___
Python tracker 

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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34908] netrc parsing is overly strict

2018-10-05 Thread Ian Remmel


Change by Ian Remmel :


--
title: netrc parding is overly strict -> netrc parsing is overly strict

___
Python tracker 

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



[issue34908] netrc parding is overly strict

2018-10-05 Thread Ian Remmel


Ian Remmel  added the comment:

Yea, somehow, I suspected it was because there's no formal spec :)

I guess technically it's an enhancement, but given that configuration dictated 
by third-parties can break the environment, it does feel like a bug. 

For example, I can't use a python app to authenticate to github via netrc 
because of how heroku says I have to configure my netrc.

Also, there are probably two subtly different issues:
1. a machine with a password but no login breaks parsing
2. a machine with an unrecognized key breaks parsing

--

___
Python tracker 

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



[issue34906] Fix typo in the documentation

2018-10-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I just created a new PR where I fix typos in the Misc directory (mainly).

--

___
Python tracker 

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



[issue34906] Fix typo in the documentation

2018-10-05 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +9122

___
Python tracker 

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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+0 This would help with debugging and would compensate for the lack of a 
docstring.  FWIW, I've found the new longer repr's for regex match objects to 
be helpful, and this would be another step in the right direction.

Terry's suggestion to truncate a long repr makes sense.  The repr's for long 
lists and dicts are different in that they are expected to round-trip, but 
there is no such expectation for lambdas.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34908] netrc parding is overly strict

2018-10-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. There is no spec for .netrc files and the closest I can 
find is [0]. The error is present in master also. Could this be considered as 
an enhancement?

[0] 
https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html

Thanks

--

___
Python tracker 

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



[issue34911] Allow Cookies for Secure WebSockets

2018-10-05 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34903] strptime %d handling of single digit day of month

2018-10-05 Thread Brett Cannon


Brett Cannon  added the comment:

So the documentation reads that way because it was originally written for 
strftime and has been repurposed to represent both. If the code does the right 
thing then adding a note that strptime supports single digits accurately would 
probably be a welcome pull request!

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34911] Allow Cookies for Secure WebSockets

2018-10-05 Thread Paul Bailey


New submission from Paul Bailey :

http.cookiejar.DefaultCookiePolicy should support the secure websocket protocol 
wss. WebSockets start off as HTTP requests and then get upgraded but have a 
different protocol of `wss` instead of `https`. This means secure cookies are 
not passed through by default.

--
components: Library (Lib)
messages: 327199
nosy: Paul Bailey
priority: normal
severity: normal
status: open
title: Allow Cookies for Secure WebSockets
type: enhancement

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Please find attached the fixer I wrote. 

Wouldn't this break programs that had already run encode() on the input (as 
they were already supposed to be doing, and as they would be doing for code 
that runs under both Python2 and Python3)?

--
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue34910] PyObject_Print() doesn't always return -1 on error

2018-10-05 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue34910] PyObject_Print() doesn't always return -1 on error

2018-10-05 Thread Zackery Spytz


New submission from Zackery Spytz :

PyObject_Print() returns 0 if PyUnicode_AsEncodedString() fails.

--
components: Interpreter Core
messages: 327197
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: PyObject_Print() doesn't always return -1 on error
type: behavior
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



[issue34158] Documentation of datetime '%z' format code is odd

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9118

___
Python tracker 

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-10-05 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:


New changeset 92878829c31ab2fc71c60555ce87a5f6cbc876f0 by Alexander Belopolsky 
(Christophe Nanteuil) in branch 'master':
bpo-34158: Documentation UTC offset update (GH-8377)
https://github.com/python/cpython/commit/92878829c31ab2fc71c60555ce87a5f6cbc876f0


--
nosy: +belopolsky

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sure, thanks for the details and fix.

--

___
Python tracker 

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



[issue34876] Python3.8 changes how decorators are traced

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Seems PR 9731 fixes this issue. I'll add tests later.

--

___
Python tracker 

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



[issue34876] Python3.8 changes how decorators are traced

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9117
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: Python indentation (3 spaces)

2018-10-05 Thread Terry Reedy

On 10/5/2018 4:48 PM, ts9...@gmail.com wrote:

I am new to Python programming but have significant SQL and C experience. My simple question 
is,"Why not standardize Python indentations to 3 spaces instead of 4 in order to avoid 
potential programming errors associated with using "TAB" instead of 4 spaces?"


IDLE (and other modern editors and IDEs) turns a typed TAB into a 
user-settable n spaces, where n defaults to 4 (minimum 2, maximum 16).


--
Terry Jan Reedy

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


Re: Python indentation (3 spaces)

2018-10-05 Thread Chris Angelico
On Sat, Oct 6, 2018 at 7:25 AM Serhiy Storchaka  wrote:
>
> 05.10.18 23:53, Chris Angelico пише:
> > I don't understand how three spaces would prevent errors in a way that
> > four wouldn't.
> In many editors and on terminal
>
> for a in x:
>  if a:
>  b()
> <-tab-->c()
>
> looks indistinguishable from
>
> for a in x:
>  if a:
>  b()
>  c()
>
> but the former is a syntax error in Python 3.

Considering that 8-space tabs are at least as common as 4-space, and
that tabs measured in millimeters are also entirely viable, I don't
think there's any way to define this perfectly consistently. It
depends entirely on the particular setup that you have, and therefore
is perfect for a per-project style guide.

But hey. It's an instant syntax error. It's not exactly hard to fix.
Some editors (including the one I use - SciTE) will highlight
mismatched indentation right there as you type.

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


[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I would be happy to change this. I will submit a PR ASAP.

--
nosy: +lys.nikolaou

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-05 Thread Karsten Hilbert
On Sat, Oct 06, 2018 at 12:23:49AM +0300, Serhiy Storchaka wrote:

> > I don't understand how three spaces would prevent errors in a way that
> > four wouldn't.
> In many editors and on terminal
> 
> for a in x:
> if a:
> b()
> <-tab-->c()
> 
> looks indistinguishable from
> 
> for a in x:
> if a:
> b()
> c()
> 
> but the former is a syntax error in Python 3.
> 
> If use 3-space indentation this error is more visible:
> 
> for a in x:
>if a:
>   b()
> <-tab-->c()

That is only incidental because the "width" of a tab stop is
what you define it to be. On my system it might just be 3
spaces which would turn your argument on its head.

Karsten
-- 
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am posting this on core-mentorship. If you want to do this, post here and 
submit the PR within a day.  I will do the merge is no-one else does.

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-05 Thread miss-islington


miss-islington  added the comment:


New changeset 1596fea0a329e1f5e4cce0135724881ca5f1d341 by Miss Islington (bot) 
in branch '3.7':
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() 
(GH-9705)
https://github.com/python/cpython/commit/1596fea0a329e1f5e4cce0135724881ca5f1d341


--

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-05 Thread Serhiy Storchaka

05.10.18 23:53, Chris Angelico пише:

I don't understand how three spaces would prevent errors in a way that
four wouldn't.

In many editors and on terminal

for a in x:
if a:
b()
<-tab-->c()

looks indistinguishable from

for a in x:
if a:
b()
c()

but the former is a syntax error in Python 3.

If use 3-space indentation this error is more visible:

for a in x:
   if a:
  b()
<-tab-->c()

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


[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-05 Thread miss-islington


miss-islington  added the comment:


New changeset 526929be39e139a7d89f4c363d79c28566f30d71 by Miss Islington (bot) 
in branch '3.6':
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() 
(GH-9705)
https://github.com/python/cpython/commit/526929be39e139a7d89f4c363d79c28566f30d71


--
nosy: +miss-islington

___
Python tracker 

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



[issue34870] Core dump when Python VSCode debugger is attached

2018-10-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks for the discussion.  I'll mark this as 'easy' for a first-time 
contribution.

--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9115

___
Python tracker 

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9116

___
Python tracker 

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() 
(GH-9705)
https://github.com/python/cpython/commit/7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34895] Mark optional stdlib modules in documentation

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Some modules are marked 'unix-only' or 'windows-only'.  The Windows installer 
includes all dependencies unless one asks that tcl/tk, tkinter, IDLE, (and 
turtle?) not be installed.  I believe the situation is now similar on Mac.  
Please give specific examples of doc you think is deficient.

--
nosy: +terry.reedy

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-05 Thread Chris Angelico
On Sat, Oct 6, 2018 at 6:51 AM  wrote:
>
>I am new to Python programming but have significant SQL and C experience. 
> My simple question is,"Why not standardize Python indentations to 3 spaces 
> instead of 4 in order to avoid potential programming errors associated with 
> using "TAB" instead of 4 spaces?"
> Thoughts?

I don't understand how three spaces would prevent errors in a way that
four wouldn't. But you're absolutely welcome to standardize all of
your own code on indenting with tabs instead of spaces, or two space
indents, or three, or four, or seventeen if you so desire.

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


[issue34876] Python3.8 changes how decorators are traced

2018-10-05 Thread Ned Batchelder


Ned Batchelder  added the comment:

This is the --trace output for some stacked decorators:

$ cat -n /tmp/decdec.py
 1  def decorator1(f):
 2  return f
 3
 4  def decorator2(f):
 5  return f
 6
 7  def decorator3(f):
 8  return f
 9
10  @decorator1
11  @decorator2
12  @decorator3
13  def func():
14  print("hello")
15
16  func()

$ python3.7 -m trace --trace /tmp/decdec.py
 --- modulename: decdec, funcname: 
decdec.py(1): def decorator1(f):
decdec.py(4): def decorator2(f):
decdec.py(7): def decorator3(f):
decdec.py(10): @decorator1
decdec.py(11): @decorator2
decdec.py(12): @decorator3
 --- modulename: decdec, funcname: decorator3
decdec.py(8): return f
 --- modulename: decdec, funcname: decorator2
decdec.py(5): return f
 --- modulename: decdec, funcname: decorator1
decdec.py(2): return f
decdec.py(16): func()
 --- modulename: decdec, funcname: func
decdec.py(14): print("hello")
hello

$ python3.8 -m trace --trace /tmp/decdec.py
 --- modulename: decdec, funcname: 
decdec.py(1): def decorator1(f):
decdec.py(4): def decorator2(f):
decdec.py(7): def decorator3(f):
decdec.py(10): @decorator1
decdec.py(11): @decorator2
decdec.py(12): @decorator3
decdec.py(10): @decorator1
 --- modulename: decdec, funcname: decorator3
decdec.py(8): return f
 --- modulename: decdec, funcname: decorator2
decdec.py(5): return f
 --- modulename: decdec, funcname: decorator1
decdec.py(2): return f
decdec.py(16): func()
 --- modulename: decdec, funcname: func
decdec.py(14): print("hello")
hello


In Python3.8, "@decorator1" appears twice, as both the first and the last 
decorator line traced.  There's no conceptual reason to show that line twice.

I'd like to consider the stacked decorator case separately from the multi-line 
function call case.  Yes, they are consequences of the same change.  One change 
can have good effects and bad effects.  We can do further work to eliminate the 
bad effects.

--

___
Python tracker 

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



Python indentation (3 spaces)

2018-10-05 Thread ts9564
   I am new to Python programming but have significant SQL and C experience. My 
simple question is,"Why not standardize Python indentations to 3 spaces instead 
of 4 in order to avoid potential programming errors associated with using "TAB" 
instead of 4 spaces?"
Thoughts?
Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34884] Python loads incorrect libraries on MacOS, 2.7

2018-10-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Python loads incorrect libraries -> Python loads incorrect libraries on 
MacOS, 2.7

___
Python tracker 

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



[issue34876] Python3.8 changes how decorators are traced

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have never looked at the trace of a decorated object before.  The 3.7 
behavior treating the inner decorator line as the first line of the decorated 
function definition looks wrong to me.  I actually expected the line pointer to 
move down to the def line, analogously to the following, at least until after 
MAKE_FUNCTION, but moving to the beginning of the statement for the rest would 
seem proper.

>>> dis.dis("""a = f(
f(
f(
3)))""")
  1   0 LOAD_NAME0 (f)

  2   2 LOAD_NAME0 (f)

  3   4 LOAD_NAME0 (f)

  4   6 LOAD_CONST   0 (3)
  8 CALL_FUNCTION1
 10 CALL_FUNCTION1
 12 CALL_FUNCTION1
 14 STORE_NAME   1 (a)
 16 LOAD_CONST   1 (None)
 18 RETURN_VALUE

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34870] Core dump when Python VSCode debugger is attached

2018-10-05 Thread Steve Dower


Steve Dower  added the comment:

Perhaps surprisingly, Brett is :)

This is best reported at https://github.com/Microsoft/ptvsd, so I'd suggest 
just taking it over there. If it turns out to be a Python issue, we'll bring it 
back.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

However, this is a compatibility liability. People routinely use various
formatting options to truncate long strings, since experience shows those
are common. But few people expect the repr() of a function/lambda object to
be unwieldy.

--

___
Python tracker 

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



[issue34909] StrEnum subclasses cannot be created

2018-10-05 Thread Ethan Furman


New submission from Ethan Furman :

from enum import Enum, unique

class StrEnum(str, Enum):
def __new__(cls, *args, **kwargs):
for a in args:
if not isinstance(a, str):
raise TypeError("Enumeration '%s' (%s) is not"
" a string" % (a, type(a).__name__))
return super(StrEnum, cls).__new__(cls, *args, **kwargs)

@unique
class Decision(StrEnum):
"""Decision results/strategy enumeration."""
REVERT = "REVERT"
REVERT_ALL = "REVERT_ALL"
RETRY = "RETRY"

---

Traceback (most recent call last):
  File "test", line 14, in 
class Decision(StrEnum):
  File ".../cpython/Lib/enum.py", line 222, in __new__
enum_member._value_ = member_type(*args)
  File ".../cpython/Lib/enum.py", line 309, in __call__
return cls.__new__(cls, value)
  File ".../cpython/Lib/enum.py", line 545, in __new__
return cls._missing_(value)
  File ".../cpython/Lib/enum.py", line 558, in _missing_
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'REVERT' is not a valid StrEnum

--
assignee: ethan.furman
keywords: 3.7regression
messages: 327182
nosy: ethan.furman, ned.deily
priority: release blocker
severity: normal
stage: test needed
status: open
title: StrEnum subclasses cannot be created
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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

People write also long strings, lists, dicts, but they are not truncated. In 
contrary to the above types which usually are created programmically and can be 
very large, lambdas are written manually and rarely exceed the size of a single 
line. We should discourage writing long lambdas. Local named functions are more 
appropriate for this. Although some people can use very long function names...

Actually the repr of lambda can be very long now: . at 0x7fa2d9e04338>.

--

___
Python tracker 

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



[issue34870] Core dump when Python VSCode debugger is attached

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, are you responsible for VSCode and Python?

--
nosy: +steve.dower, terry.reedy

___
Python tracker 

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



[issue34856] Make the repr of lambda contain signature and body expression.

2018-10-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Make the repr of lambda containing the signature and body expression. -> 
Make the repr of lambda contain signature and body expression.

___
Python tracker 

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



[issue34856] Make the repr of lambda containing the signature and body expression.

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Right.  Like printing an ascii text version of the Mandelbrot set in one 
20-line lambda + call expression statement.  Let's truncate to, say, 40 chars.  
This should cover a large majority of lambda expressions.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Steve Dower


Steve Dower  added the comment:

Sounds like what happened is they *fixed* the error message when you use an 
invalid VMname. Previously it was falling back to the default, which happened 
to be the one we thought we were asking for.

I've asked for a more public feed of impactful changes, so hopefully we'll get 
that organised.

--

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset dd0670f12b159eff5336d6011f046e1ccac495e1 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) (GH-9728)
https://github.com/python/cpython/commit/dd0670f12b159eff5336d6011f046e1ccac495e1


--

___
Python tracker 

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



[issue34846] Runtime failure with Failed to import site module

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Unless this is seen as a possible security issue, this will not be fixed in 
3.5.  If possible test in later versions.

By 'was running for a long time without issue', do you mean 'ran many times 
before this run'?  (As opposed to 'a long time in this run'?)

Did you try deleting Lib/__cache__/_collections_abc.cpython-35.pyc (or whatever 
the name is on ubuntu)?

If this fixes the issue, is corruption and failure in any sense deterministic?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d02490a9a9c238ed7ded1120877fdfdce16364a3 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725) (GH-9727)
https://github.com/python/cpython/commit/d02490a9a9c238ed7ded1120877fdfdce16364a3


--

___
Python tracker 

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



[issue34840] dlopen() error with no error message from dlerror()

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

FWIW, the method does not exist on Windows

>>> _ctypes.dlclose(3)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module '_ctypes' has no attribute 'dlclose'

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Tim Peters


Tim Peters  added the comment:

Add a comment along the lines you (Terry) suggested.  Some people need to write 
doctests that run under many versions of Python, so the info is still supremely 
relevant to them.

--
nosy: +tim.peters

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d9212200fe8ddb55d73b8231869cfbb32635ba92 by Serhiy Storchaka in 
branch '3.7':
[3.7] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726)
https://github.com/python/cpython/commit/d9212200fe8ddb55d73b8231869cfbb32635ba92


--

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9113

___
Python tracker 

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



[issue34839] doctest: Change example under warnings section

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To me, the question is whether to delete the dict example, or qualify it with 
"Before 3.7 (or 3.6 for CPython)" but leave the illustration of workarounds. 
Raymond, what do you thing?

--
nosy: +rhettinger, terry.reedy

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9112

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6bffe50f5fff8e8a40ae32c3e9c408622a15caf6 by Serhiy Storchaka in 
branch '3.7':
Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725)
https://github.com/python/cpython/commit/6bffe50f5fff8e8a40ae32c3e9c408622a15caf6


--

___
Python tracker 

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



[issue34837] Multiprocessing.pool API Extension - Pass Data to Workers w/o Globals

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

New features only go in next version.

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



[issue34837] Multiprocessing.pool API Extension - Pass Data to Workers w/o Globals

2018-10-05 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Quoting the PR:

Proposing a new kwarg in the __init__() method of multiprocessing.Pool named 
expect_initret.

This kwarg defaults to False. When set to True, the return value of the 
initializer function is passed to the function we are applying (i.e. func in 
Pool.map(func, ls)), as a kwarg named initret.

This PR includes thorough test coverage, and provides backwards compatibility 
(at least in Python3.x).

See blog post
https://thelaziestprogrammer.com/python/multiprocessing-pool-expect-initret-proposal
for example use cases, as well as an initial defense for why this makes the 
multiprocessing.Pool API more approachable, to more Python end-users, and 
augments the library.

--
nosy: +davin, pitrou, terry.reedy

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Steve Dower


Steve Dower  added the comment:

I didn't hear any public announcement, so perhaps not. I'll ask the team.

--

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread miss-islington


miss-islington  added the comment:


New changeset 467360eeb24525e330d653826f21f30f47481d08 by Miss Islington (bot) 
in branch '3.6':
bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)
https://github.com/python/cpython/commit/467360eeb24525e330d653826f21f30f47481d08


--

___
Python tracker 

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



[issue21880] IDLE: Ability to run 3rd party code checkers

2018-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This issue is specifically based on msg195711 of #18704.  Anyone working on 
this should read it.

Saimadhav's work was part of his Google Summer of Code (GSOC) project, which 
ended soon after V4 was submitted.  I recorded reviews of V1 and V2 above. I 
don't remember which tests and reviews, if any, I did with V3 and V4.

Some needed changes starting with v4:
 Checker.py should be checker.py.
 Implement it as a feature, not an extension.
 Access the in-memory config object for .idlrc/checker.cfg directly rather than 
through idleConf.  idleConf accesses the fixed defaults and mutable user 
overrides as if they are one config. I am a bit surprised that idleConf worked 
without an empty idlelib/config-checker.def.

The main blocker was and is keeping the GUI responsive while the 3rd party 
program is executing.  V1 & V2 used subprocess through a pipe.  V3 did not use 
subprocess.  V4 uses subprocess without a pipe.  It has this blocking polling 
loop:
while process.poll() is None:
continue

If a 3rd party program is expected to revise a file, the corresponding editor 
should be read-only for the duration.

I intended that any issue like this should start with a coherent specification 
separate from the code.  A doc patch is needed and that might be enough.

Since this issue was opened, it has been more firmly stated that the stdlib 
should not have any hard-coded dependencies on 3rd party code.  In April 2016, 
the proposal for a GSOC project to add a GUI front end for pip got no 
opposition and 2 overt approvals on pydev.  In August 2016, the result was 
rejected by the release manager and one of the additional approvers because it 
necessarily used the (public) pip (command-line) interface.

Not withstanding that, there could be a separate idle-checker repository 
containing a checker.cfg with entries for multiple checkers.  Such a file would 
be needed to do manual tests with multiple checkers.  This could include a 
typing annotation checker, like mypy, which is a new type of code checker added 
since this issue was created.

Tal, what do you think is the easiest way to turn a .diff on the tracker into a 
git master branch?

--

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9111

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread miss-islington


miss-islington  added the comment:


New changeset b57f800b351328a67b4a11a1864d39c6b9b8d39f by Miss Islington (bot) 
in branch '3.7':
bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)
https://github.com/python/cpython/commit/b57f800b351328a67b4a11a1864d39c6b9b8d39f


--
nosy: +miss-islington

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 by Serhiy Storchaka in 
branch 'master':
Fix a compiler warning added in bpo-34872. (GH-9722)
https://github.com/python/cpython/commit/addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3


--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9110

___
Python tracker 

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



[issue22232] str.splitlines splitting on non-\r\n characters

2018-10-05 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

> Why not simply add a new parameter, to make people who want ASCII linebreaks 
> continue to use .splitlines() ?

That could work but I think in nearly every case you don't want to use 
splitlines() without supplying the parameter.  So, it seems like a bit of trap 
for new users.  Worse, because in Python 2, str.splitlines() does what they 
want, they will do the simple thing which is likely wrong.

If we do stick with just splitlines(), perhaps it should get a 'newline' 
parameter that mostly matches io.open (i.e. it controls universal newline 
behavior).  So if you don't want to change behavior, 
str.splitlines(newline=None) would split as it currently does.  To make it 
split like io files do, you would have to do newline='\n'.

To me, it seems attractive that:
fp.readlines() == fp.read().iterlines()

You suggestion would make it something like:
fp.readlines() == fp.read().splitlines(newline='\n')

I guess I could live with that but it seems unnecessarily ugly and verbose for 
what is the most common usage.

--

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4642d5f59828e774585e9895b538b24d71b9df8e by Serhiy Storchaka in 
branch 'master':
Use assertEqual() instead of assertEquals(). (GH-9721)
https://github.com/python/cpython/commit/4642d5f59828e774585e9895b538b24d71b9df8e


--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4642d5f59828e774585e9895b538b24d71b9df8e by Serhiy Storchaka in 
branch 'master':
Use assertEqual() instead of assertEquals(). (GH-9721)
https://github.com/python/cpython/commit/4642d5f59828e774585e9895b538b24d71b9df8e


--

___
Python tracker 

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



[issue34603] ctypes on Windows: error calling C function that returns a struct containing 3 bools

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

assertEquals() is deprecated, use assertEqual() instead.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the fix Steve. I am just wondering if there is a public announcement 
regarding this image being removed since Google couldn't get me anything.

--

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9108

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset 4313a293dae579f3406aa94508ff3803a79b0344 by Steve Dower in branch 
'master':
bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)
https://github.com/python/cpython/commit/4313a293dae579f3406aa94508ff3803a79b0344


--

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9109

___
Python tracker 

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



  1   2   >