[issue31725] Turtle/tkinter: NameError crashes ipython with "Tcl_AsyncDelete: async handler deleted by the wrong thread"

2017-10-08 Thread Rick J. Pelleg

New submission from Rick J. Pelleg :

On Windows 10 Education, ran:
ipython
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

After "from turtle import *" and several simple turtle commands:

In [36]: fill()
---
NameError Traceback (most recent call last)
 in ()
> 1 fill()

NameError: name 'fill' is not defined

Tcl_AsyncDelete: async handler deleted by the wrong thread
Exception ignored in: >
Traceback (most recent call last):
  File 
"d:\users\yuval\appdata\local\programs\python\python36-32\lib\tkinter\__init__.py",
 line 3501, in __del__
self.tk.call('image', 'delete', self.name)

--
components: Tkinter
messages: 303898
nosy: Rick J. Pelleg
priority: normal
severity: normal
status: open
title: Turtle/tkinter: NameError crashes ipython with "Tcl_AsyncDelete: async 
handler deleted by the wrong thread"
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



[issue31271] an assertion failure in io.TextIOWrapper.write

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

You are right. But in any case the test should be fixed for 2.7.

--

___
Python tracker 

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



[issue31642] None value in sys.modules no longer blocks import

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset f07e2b64df6304a36fb5e29397d3c77a7ba17704 by Serhiy Storchaka in 
branch 'master':
bpo-31642: Restore blocking "from" import by setting None in sys.modules. 
(#3834)
https://github.com/python/cpython/commit/f07e2b64df6304a36fb5e29397d3c77a7ba17704


--

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread Franck Pommereau

New submission from Franck Pommereau :

Module token does not have constant COMMENT. But tokenize produces it and it 
appears in tok_name.

--
components: Library (Lib)
messages: 303901
nosy: fpom
priority: normal
severity: normal
status: open
title: Missing token.COMMENT
type: enhancement
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue31642] None value in sys.modules no longer blocks import

2017-10-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +3896

___
Python tracker 

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



[issue28280] Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 0ccc0f6c7495be9043300e22d8f38e6d65e8884f by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() 
always return a list (#3840)
https://github.com/python/cpython/commit/0ccc0f6c7495be9043300e22d8f38e6d65e8884f


--

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread Franck Pommereau

Franck Pommereau  added the comment:

Actually, comparing with the content of tok_name, all the following constants 
are missing:

COMMENT = 54
NL = 55
BACKQUOTE = 56
ATEQUAL = 57

--

___
Python tracker 

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



[issue31642] None value in sys.modules no longer blocks import

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 6f059ab80a351a7dd85cc57c5ca240f817a79c5d by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31642: Restore blocking "from" import by setting None in sys.modules. 
(GH-3834). (#3923)
https://github.com/python/cpython/commit/6f059ab80a351a7dd85cc57c5ca240f817a79c5d


--

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4d3f084c035ad3dfd9f8479886c41b1b1823ace2 by Serhiy Storchaka in 
branch 'master':
bpo-27867: Add a porting guide for PySlice_GetIndicesEx(). (#1973)
https://github.com/python/cpython/commit/4d3f084c035ad3dfd9f8479886c41b1b1823ace2


--

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-10-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue31642] None value in sys.modules no longer blocks import

2017-10-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31725] Turtle/tkinter: NameError crashes ipython with "Tcl_AsyncDelete: async handler deleted by the wrong thread"

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Can you reproduce the issue without IPython?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16516] argparse types (and actions) must be hashable

2017-10-08 Thread Joel Nothman

Joel Nothman  added the comment:

Clearly this is not in high demand

--

___
Python tracker 

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



[issue16516] argparse types (and actions) must be hashable

2017-10-08 Thread Mark Lawrence

Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In 2.7 "%U" is not recognized in the format string.

>>> class Name(Structure):
... _fields_ = []
... _anonymous_ = ["x"]
... x = 42
... 
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: '%U' is specified in _anonymous_ but not in _fields_

--
status: closed -> open

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread R. David Murray

R. David Murray  added the comment:

This is fixed in python3.  Do you have a use case for 2.7 or are you just 
noticing?

--
nosy: +r.david.murray
versions:  -Python 3.4

___
Python tracker 

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



[issue31725] Turtle/tkinter: NameError crashes ipython with "Tcl_AsyncDelete: async handler deleted by the wrong thread"

2017-10-08 Thread Rick J. Pelleg

Rick J. Pelleg  added the comment:

Mmm... right now I cannot reproduce at all, both in iPython and in python.
Will continue to try.

--

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread Franck Pommereau

Franck Pommereau  added the comment:

I have the problem still exists in 3.4.3 at least:

Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import token
>>> token.COMMENT
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'COMMENT'

About the use case: I often use tokenize to build recursive descendant parsers 
for domain-specific languages. Not having all the token constants can be worked 
around with code below, but it would be so better to have a complete module...  
:)

import token
_tok = next(tokenize.tokenize(io.BytesIO(b"").readline))
token.tok_name[_tok.type] = "BACKQUOTE"
for number, name in token.tok_name.items() :
if not hasattr(token, name) :
setattr(token, name, number)

--

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

COMMENT and NL are added by the tokenize module. BACKQUOTE already is set, but 
to 25 instead of 56. ATEQUAL shouldn't be occurred in Python earlier than 3.5. 
How did you get your results?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread Franck Pommereau

Franck Pommereau  added the comment:

I've just launched ipython3 (installed with pip):

$ ipython3
Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import token, tokenize, io

In [2]: token.BACKQUOTE
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 token.BACKQUOTE

AttributeError: 'module' object has no attribute 'BACKQUOTE'

In [3]: _tok = next(tokenize.tokenize(io.BytesIO(b"").readline))

In [4]: token.tok_name[_tok.type] = "BACKQUOTE"

In [5]: for number, name in token.tok_name.items() :
   ...: if not hasattr(token, name) :
   ...: print(name, "=", number)
   ...: 
COMMENT = 54
NL = 55
BACKQUOTE = 56
ATEQUAL = 57
COMMENT = 58

If instead I use python3 as provided by my Linux Mint, the result is different 
indeed:

$ python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import token, tokenize, io
>>> token.BACKQUOTE
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'BACKQUOTE'
>>> _tok = next(tokenize.tokenize(io.BytesIO(b"").readline))
>>> token.tok_name[_tok.type] = "BACKQUOTE"
>>> for number, name in token.tok_name.items() :
... if not hasattr(token, name) :
... print(name, "=", number)
... 
COMMENT = 54
NL = 55
BACKQUOTE = 56

--

___
Python tracker 

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



[issue31727] FTP_TLS errors when

2017-10-08 Thread Jonathan

New submission from Jonathan :

Using Python 3.6.3.

The below issue only happens with FTP_TLS. It works fine via a plain FTP 
connection.

I am connecting to an FTP to using `ftplib` via FTP_TLS.

ftps = ftplib.FTP_TLS('example.com', timeout=5)

# TLS is more secure than SSL
ftps.ssl_version = ssl.PROTOCOL_TLS

# login before securing control channel
ftps.login('usern...@example.com', 'password')

# switch to secure data connection
ftps.prot_p()

# Explicitly set Passive mode
ftps.set_pasv(True)

This all works. I can send `ftps.mkd('mydir')` (make directory) and 
`ftps.cwd('mydir')` (change working dir), and both work fine.

But if I send **any** of these (they're all basically synonyms as far as I can 
tell):

ftps.dir()
ftps.nlst()
ftps.retrlines('LIST')
ftps.retrlines('MLSD')

Then I get back an exception (below also includes all ftplib debug info as 
well; generally matches up with what FileZilla shows too):

*cmd* 'AUTH TLS'
*put* 'AUTH TLS\r\n'
*get* '234 AUTH TLS OK.\n'
*resp* '234 AUTH TLS OK.'
*cmd* 'USER usern...@example.com'
*put* 'USER usern...@example.com\r\n'
*get* '331 User usern...@example.com OK. Password required\n'
*resp* '331 User usern...@example.com OK. Password required'
*cmd* 'PASS **'
*put* 'PASS **\r\n'
*get* '230 OK. Current restricted directory is /\n'
*resp* '230 OK. Current restricted directory is /'
*cmd* 'PBSZ 0'
*put* 'PBSZ 0\r\n'
*get* '200 PBSZ=0\n'
*resp* '200 PBSZ=0'
*cmd* 'PROT P'
*put* 'PROT P\r\n'
*get* '200 Data protection level set to "private"\n'
*resp* '200 Data protection level set to "private"'
*cmd* 'MKD mydir'
*put* 'MKD mydir\r\n'
*get* '257 "mydir" : The directory was successfully created\n'
*resp* '257 "mydir" : The directory was successfully created'
*cmd* 'CWD mydir'
*put* 'CWD mydir\r\n'
*get* '250 OK. Current directory is /mydir\n'
*resp* '250 OK. Current directory is /mydir'
*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 TYPE is now ASCII\n'
*resp* '200 TYPE is now ASCII'
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (8,8,8,8,8,8)\n'
*resp* '227 Entering Passive Mode (8,8,8,8,8,8)'
*cmd* 'MLSD'
*put* 'MLSD\r\n'
*get* '150 Accepted data connection\n'
*resp* '150 Accepted data connection'
Traceback (most recent call last):
  File "c:\my_script.py", line 384, in run_ftps
ftps.retrlines('MLSD')
  File "c:\libs\Python36\lib\ftplib.py", line 485, in retrlines
conn.unwrap()
  File "C:\libs\Python36\lib\ssl.py", line 1051, in unwrap
s = self._sslobj.unwrap()
  File "C:\libs\Python36\lib\ssl.py", line 698, in unwrap
return self._sslobj.shutdown()
OSError: [Errno 0] Error

The same FTP command (LIST) works fine via filezilla.

The closest thing I can find with googling is this: 
https://bugs.python.org/msg253161 - and I'm not sure if it's related or 
relevant.

Short version: What does "OSError: [Errno 0] Error" actually mean, and how do I 
list my directory contents?

--
messages: 303914
nosy: jonathan-lp
priority: normal
severity: normal
status: open
title: FTP_TLS errors when
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



[issue31727] FTP_TLS errors when

2017-10-08 Thread Ned Deily

Change by Ned Deily :


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

___
Python tracker 

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



[issue31726] Missing token.COMMENT

2017-10-08 Thread R. David Murray

R. David Murray  added the comment:

3.4 and 3.5 are in security maintenance mode only, and this is not a security 
bug.  This was fixed in master (3.7) as a result of issue 25324.  The decision 
there was made to not backport it because no one had complained about the 
problem previously.  Now we have a complaint, so perhaps that decision should 
be revisited?

There's also Serhiy's issue 30455.  I'm not sure if he's thinking about 
backporting that one or not.

And then there is the 2.7 question.  I'm not sure this is strong enough 
motivation to fix it there, though I wouldn't object (consistency is good).

--

___
Python tracker 

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



[issue31092] delicate behaviour of shared (managed) multiprocessing Queues

2017-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

@Prof Plum

> When I call pool.apply_async() I expect it only to return when the worker 
> process has been started and finished it's initialization process

Well... it's called *async* for a reason, so I'm not sure why the behaviour 
would be partially synchronous.

@Oren

> Should we fix this?

I'm not sure how.  In mp.Pool we don't want to keep references to input objects 
longer than necessary.

> Or is it the responsibility of the user to not destroy shared objects too 
> soon?  (In that case, maybe we should mention it in the docs?)

Yes to both questions, IMO.

(note: changing title to better reflect issue)

--
title: multiprocessing.Manager() race condition -> delicate behaviour of shared 
(managed) multiprocessing Queues

___
Python tracker 

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



[issue31728] crashes in _elementtree due to unsafe decrefs of Element.text and Element.tail

2017-10-08 Thread Oren Milman

New submission from Oren Milman :

The following code causes the interpreter to crash:
import xml.etree.ElementTree
class X:
def __del__(self):
elem.clear()
elem = xml.etree.ElementTree.Element('elem')
elem.text = X()
elem.clear()

This is because _elementtree_Element_clear_impl() decrefs self->text in an
unsafe manner.
For the same reason, but for self->tail, a crash would happen if we replaced
'elem.text = X()' with 'elem.tail = X()'.


Similarly, the following code also causes the interpreter to crash:
import xml.etree.ElementTree
class X:
def __del__(self):
elem.clear()
elem = xml.etree.ElementTree.Element('elem')
elem.text = X()
elem.text = X()

This is because element_text_setter() decrefs self->text in an unsafe manner.
element_tail_setter() does the same for self->tail, so again, if we replaced
'elem.text = X()' with 'elem.tail = X()', we would also get a crash.

--
components: XML
messages: 303917
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crashes in _elementtree due to unsafe decrefs of Element.text and 
Element.tail
type: crash
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



[issue31729] multiprocesssing.Pool.map_async() undocumented

2017-10-08 Thread g...@nlc.co.nz

New submission from g...@nlc.co.nz :

To monitor how much of my multiprocess.Pool is completed I am forced to use 
undocumented features which I fear mat changed in the future. Especially 
result._number_left which looks like a private variable. Can you please 
document the result from Pool.map_async() and make the _number_left a proper 
method, e.g result.number_completed()

result = pool.map_async(process_employee, gen_emps, chunksize=1)
while not result.ready():
   left = result._number_left

It is not possible to pass Pipes, Queues or Shared memory to Pool workers in 
order for them to signal back to the master when them have completed a job.

--
components: Library (Lib)
messages: 303918
nosy: g...@nlc.co.nz
priority: normal
severity: normal
status: open
title: multiprocesssing.Pool.map_async() undocumented
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue31730] list unhashable, can not be use as key to dict

2017-10-08 Thread g...@nlc.co.nz

New submission from g...@nlc.co.nz :

A list can no be used as the key to a dict, apparently because it is 
"unhashable": TypeError: unhashable type: 'list'.

The code must exist to hash object like this a tuple is hashable and can be 
constructed from a list.

--
components: Interpreter Core
messages: 303919
nosy: g...@nlc.co.nz
priority: normal
severity: normal
status: open
title: list unhashable, can not be use as key to dict
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue31730] list unhashable, can not be use as key to dict

2017-10-08 Thread Ned Deily

Ned Deily  added the comment:

As documented, a dict key must be hashable and, because lists are not 
immutable, they are not hashable and thus can't be used as keys.  See the 
Python Glossary for more info.  https://docs.python.org/2/glossary.html

--
nosy: +ned.deily
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31729] multiprocesssing.Pool.map_async() undocumented

2017-10-08 Thread Ned Deily

Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue31728] crashes in _elementtree due to unsafe decrefs of Element.text and Element.tail

2017-10-08 Thread Oren Milman

Change by Oren Milman :


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

___
Python tracker 

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



[issue31092] delicate behaviour of shared (managed) multiprocessing Queues

2017-10-08 Thread Prof Plum

Prof Plum  added the comment:

@Antoine Pitrou

>Well... it's called *async* for a reason, so I'm not sure why the behaviour 
>would be partially synchronous.

To a avoid race condition

>I'm not sure how.  In mp.Pool we don't want to keep references to input 
>objects longer than necessary.

Like I said you could just add some sort of "safe" flag to the apply_async() 
call safe=True would mean the initialization of the worker is done 
synchronously safe=False would be the normal behavior. Even if you decide it's 
the user's responsibility to not delete the queue if the user's code is exiting 
a function that would basically amount to them calling sleep() for some guessed 
amount of time. With a safe flag they wouldn't have to guess the time or call 
sleep which is kinda ugly IMO. Also if someone see's that apply_async() has a 
safe flag they are more likely to look up what it does than they are to read 
the full docs to apply_async().

--

___
Python tracker 

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



[issue31729] multiprocesssing.pool.AsyncResult undocumented field

2017-10-08 Thread g...@nlc.co.nz

Change by g...@nlc.co.nz :


--
title: multiprocesssing.Pool.map_async() undocumented -> 
multiprocesssing.pool.AsyncResult undocumented field

___
Python tracker 

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



[issue31537] Bug in readline module documentation example

2017-10-08 Thread Bradley Smith

Change by Bradley Smith :


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

___
Python tracker 

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



[issue31537] Bug in readline module documentation example

2017-10-08 Thread Bradley Smith

Bradley Smith  added the comment:

I ran into the same bug in the documentation recently. I've opened a pull 
request here that fixes it:

https://github.com/python/cpython/pull/3925

As I was trying to figure out why the example was broken, I wrote up a little 
more context to explain the current behavior and the fix:

https://docs.python.org/3.7/library/readline.html#example
https://docs.python.org/3.6/library/readline.html#example

In the "Example" section, the second example that "supports concurrent 
interactive sessions, by only appending the new history" will actually *never* 
write any lines to a custom history file. This is conveniently masked by the 
fact that the file path used in the example code also happens to be the default 
path that readline automatically writes history to, but if you specify *any* 
other file path, you will see that the new file is created but never has any 
content written to it.

The problem in this example is the use of `get_history_length` to get 
"previous" and "current" history lengths for determining how many lines to 
append to the file. Both calls to `get_history_length` always return `-1` here. 
Thus, when `append_history_file` is called, it always receives a first argument 
of `0` (because `-1 - -1 == 0`), resulting in zero lines written to the file.

Instead of `get_history_length`, the example code *should* call 
`get_current_history_length`. Swapping that function call makes the example 
behave as expected, appending new lines to the file.

--
nosy: +infinitewarp

___
Python tracker 

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



[issue31698] Add REQ_NAME to the node.h API

2017-10-08 Thread Jelle Zijlstra

Change by Jelle Zijlstra :


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

___
Python tracker 

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