[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2017-02-02 Thread Christian H

Changes by Christian H :


--
nosy: +Christian H

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-02 Thread Xiang Zhang

Xiang Zhang added the comment:

This seems not related to #27931.

The problem is that the receiver's content is only CFWS. It's just like it's 
empty and for the default policy, it checks `value[0] == '"'` in `get_word`.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-02 Thread Jim DeLaHunt

New submission from Jim DeLaHunt:

I just had a problem with doctests. It manifested as an error that occurred 
when I did
>>> import StringIO
in my doctest. 

After some investigation, I realised that my actual problem was that the 
doctest library documentation https://docs.python.org/3/library/doctest.html 
left me unclear about three aspects of multi-line doctest fixtures.

1. There is no example of a multiple-line doctest fixture: specifically, a 
fixture which involves at least one line to set up state, and another line to 
be the example that tested.  I suggest adding such an example as a new section, 
"26.3.2. Usage: multi-line tests".  Note that the example in 26.3.3.2 doesn't 
count: that is a Compound Statement, and I'm talking about a test consisting of 
multiple interactive statements.

2. Section "26.3.3.2. How are Docstring Examples Recognized?" does not talk 
about when to use a PS1 prefix (>>>) and when to use a PS2 prefix (...). It 
should say to use the PS1 at the start of each Python "interactive statement", 
that is, a statement list ending with a newline, or a Compound Statement. And, 
to use the PS2 to prefix each continuing line within a Compound Statement. 

3. Section "26.3.3.3. What’s the Execution Context?" is not clear about the 
crucial difference between state that accumulates within a single docstring 
from Example to Example, and that is reset from one docstring to another. The 
phrase "so that one test in M can’t leave behind crumbs that accidentally allow 
another test to work" can be interpreted as applying within a single docstring. 
The phrase "names defined earlier in the docstring being run" is easy to miss.

A StackOverflow Question and Answer describing my problem and my insight about 
what the library documentation didn't tell me is at 
http://stackoverflow.com/questions/41070547/why-is-importing-a-module-breaking-my-doctest-python-2-7
 . A blog post of mine, a source for documentation improvements, is at 
http://blog.jdlh.com/en/2017/01/31/multi-line-doctests/ .

I actually encountered this problem in a Python 2.7 context, with 
https://docs.python.org/2/library/doctest.html . But it also applies to Python 
3.6 https://docs.python.org/3/library/doctest.html and to the current dev 
https://docs.python.org/dev/library/doctest.html . In the spirit of fixing the 
new stuff first, I am filing this issue against Python 3.7. 

Unless someone tells me otherwise, I'll get around to filing similar issues 
against Python 3.6 and Python 2.7.
Then it's my intention to write improvements to the documentation for Python 
3.7, 3.6, and 2.7, and submit each of those. It looks like they will be pretty 
similar, because the library documentation is pretty similar in each version.

I'm new to Python issue filing and doc fixing, so I would appreciate correction 
if (when?) I start to blunder.

--
assignee: docs@python
components: Documentation
messages: 286843
nosy: JDLH, docs@python
priority: normal
severity: normal
status: open
title: Doctest documentation unclear about multi-line fixtures
type: enhancement
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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread spencera

spencera added the comment:

Interesting. So, out of curiosity, what has changed from 3.5.2 to 3.6.0 that 
causes this new behavior? Was an instance associated with an instance method 
that was passed to submit not implicitly pickled before 3.6.0? Is it from the 
changes to the pickle module in 3.6? Something else?

--

___
Python tracker 

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



[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-02-02 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Martin,

I reviewed the patch (rm-finite.patch) and ran the tests. The patch no longer 
applies cleanly to the default branch, but otherwise looks good. 

Assigning this back to you as per Raymond's suggestion.

Thanks :)

--
assignee: Mariatta -> martin.panter

___
Python tracker 

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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Looks like the problem here is that pickling self._consume implicitly pickles 
self, and after the first submission, self._futures contains Future objects. 
Those are probably what have the RLock in them (to synchronize between reading 
and populating threads), and it's correct not to pickle them; they're only 
meaningful in the parent process, and sending them to the workers would break, 
badly.

Given you don't seem to be using self for anything, you could either make 
_consume a staticmethod (if you need state from self, pass that specific state 
in as arguments) so it's not implicitly pickling and transmitting self, or 
failing that, define custom pickling functions that explicitly exclude 
self._futures from the set of attributes to pickle.

There is nothing to fix behaviorally on Python's side that wouldn't lead to 
confusion/breakage in other code. It would be nice if Python could give more 
detail on pickle chain that led to the unpicklable object (so you know it's 
self._consume->self->self._futures->some future object->future._rlock or 
whatever), but I'm not sure the pickling protocol design can preserve that sort 
of chain for error reporting...

--
nosy: +josh.r

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a7dc69b8956ad223ff6c239299896dd5195ce430 by Vinay Sajip in branch 
'master':
Fixes #29213: regularised EOLs of venv scripts.
https://github.com/python/cpython/commit/a7dc69b8956ad223ff6c239299896dd5195ce430

New changeset 1b105fac40b341980b290729a7ed403c73f5cf61 by Vinay Sajip in branch 
'master':
Fixes #29213: merged fix from 3.5.
https://github.com/python/cpython/commit/1b105fac40b341980b290729a7ed403c73f5cf61


--

___
Python tracker 

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



[issue28972] Document all "python -m" utilities

2017-02-02 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi,

I've just watched the old David Beazley video about the packaging system in 
python and got me thinking about this issue.

I'm throwing the idea, please critize it!

If we were to make a "hook" for the .rst files of the modules to go and scan 
the __main__.py file for the comments, generating the 'index' of all those 
options from the comments inside the file (__main__.py).  That would be in my 
opinion a solution to make sure they are kept to date and would also insure 
someone knows minimally what he's doing as he's playing inside the main of a 
package.  The idea is similar to the autodoc module of sphinx that scan a 
module for the doc, but would apply to the __main__.py only.  However, I've 
just started with .rst files and I'm not sure how we could 'implement' that and 
even less if it's possible at all.

(BTW, I would only enable the .rst "hook" option generation on the __main__.py 
file as to keep sort of a standardisation but not obligation)

P.S. I know I initially seems skeptical, but I have started to see the use 
thanks to you :)  The example was good (msg283470).  
Regards,
Eric Lafontaine

--

___
Python tracker 

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



[issue29426] Using pywin32 on Python3 on linux

2017-02-02 Thread Eryk Sun

Eryk Sun added the comment:

I'm closing this as a third-party issue that's unrelated to the development of 
CPython.

PyWin32 is a package of extension modules for accessing Windows C and COM APIs 
in Windows Python. You can't install it in Linux Python. You should be able to 
access SQL Server on Linux via django-pyodbc, using pyodbc and the FreeTDS 
driver.

--
nosy: +eryksun
resolution:  -> third party
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



[issue29427] Option to skip padding for base64 urlsafe encoding/decoding

2017-02-02 Thread Brian Thorne

New submission from Brian Thorne:

Suggest changing base64 module to better handle encoding schemes that don't use 
padding. 
Because RFC4648 [1] allows other RFCs that implement RFC4648-compliant 
base64url encoding to explicitly stipulate that there is no padding. Dropping 
the padding is lossless when we know the length [2].
Various standard specifications require this - often crypto related (e.g., JWS 
[3] or named hashes [4]).

RFC4648 specifically makes an exemption for this and it should be better 
supported in Python's standard library. There is a related closed issue [5] 
asking for the padding to be removed or altered which wouldn't comply with the 
spec. This request is different with a view to better support the wider 
specification.

Proposed behaviour adapted from resolution that ruby discussion on same topic 
[6]:

- base64.urlsafe_b64encode(s) should continue to produce padded output, but 
have an additional argument, padding, which defaults to True.
- base64.urlsafe_b64decode(s) should accept both padded and unpadded inputs. It 
can still reject incorrectly-padded input.


If that sounds sensible I'd like to put a patch/PR together.

>From wikipedia [7]:

> Some variants allow or require omitting the padding '=' signs to avoid them 
> being confused with field separators, or require that any such padding be 
> percent-encoded. Some libraries will encode '=' to '.'.

- [1] https://tools.ietf.org/html/rfc4648#page-4
- [2] 
http://stackoverflow.com/questions/4080988/why-does-base64-encoding-requires-padding-if-the-input-length-is-not-divisible-b
- [3] https://tools.ietf.org/html/rfc7515
- [4] https://tools.ietf.org/html/rfc6920#section-3
- [5] http://bugs.python.org/issue1661108 
- [6] https://bugs.ruby-lang.org/issues/10740
- [7] https://en.wikipedia.org/wiki/Base64#Output_Padding

--
components: Library (Lib)
messages: 286837
nosy: Thorney, georg.brandl, lemburg, loewis
priority: normal
severity: normal
status: open
title: Option to skip padding for base64 urlsafe encoding/decoding
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue29426] Using pywin32 on Python3 on linux

2017-02-02 Thread Mark Tischler

New submission from Mark Tischler:

I downloaded pywin32 build 220 from 
https://sourceforge.net/projects/pywin32/files/pywin32/, and tried to install 
it using 'python3 setup.py install' as well as 'python3 pywin32_postinstall.py 
-install' ("python3" = python 3.6.0), and the former gave me a syntax error 
about 'print' needing parentheses, and the latter gave me a syntax error about 
an 'except' statement having a syntax error, both of which tell me that this 
pywin32 package is not compatible with Python 3.  So, I went searching and 
found https://pypi.python.org/pypi/pypiwin32.  This is the same build number -- 
220.  Given that it is a full year newer than the other (it's odd that its 
build number is the same), I thought that this might have changes in it to 
support Python3.  However, given that I'm installing on a Linux platform, I 
don't think I can deal with wheel files.  These downloadable files appear to be 
for Windows installations only.

I'm attempting to have an app, which is installed on a RedHat Linux machine, 
use SQL Server as its database, so my understanding is that I need the 
django-mssql package (I have version 1.8 ready to go) and that is dependent 
upon pywin32.  So, I'm wondering if there is a version of pywin32 that is 
compatible with Python 3.6.0 and that is installable on Red Hat Linux.

I am not using 'pip' to install packages, because my installation is not in the 
normal system area.  I have a library of multiple Python installations, so that 
the various apps installed on that machine can be pointed to one of several 
different versions of Python.

Note, I am somewhat new to Python and Python installations.  Any help would be 
appreciated.

--
components: Installation
messages: 286836
nosy: mtischler
priority: normal
severity: normal
status: open
title: Using pywin32 on Python3 on linux
type: behavior
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



[issue29425] File-altering aspects of pathlib should return new pathlib objects

2017-02-02 Thread Walter Szeliga

New submission from Walter Szeliga:

Methods on pathlib.PosixPath() and other objects that alter files on the file 
system should return new object instances with new information. For example, if 
there exists a file on the system called 'bar', then

bar_var = pathlib.PosixPath('bar')
bar_var.rename('foo')

will rename the file 'bar' to 'foo' on the system and leave 'bar' as a 
still-valid object that no longer points to a system file. Changing the return 
type of .rename() to return a new pathlib.PosixPath() object with path 'foo' 
could help reduce confusion about the behavior. For example:

bar_var = pathlib.PosixPath('bar')
foo_var = bar_var.rename('foo')

and foo_var would then be a pathlib.PosixPath() object pointing to 'foo'.

--
components: Library (Lib)
messages: 286835
nosy: Walter Szeliga
priority: normal
severity: normal
status: open
title: File-altering aspects of pathlib should return new pathlib objects
type: enhancement
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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

cache_struct-2.patch LGTM.

--

___
Python tracker 

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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-02-02 Thread INADA Naoki

Changes by INADA Naoki :


--
dependencies:  -Add tp_fastcall to PyTypeObject: support FASTCALL calling 
convention for all callable objects
resolution:  -> fixed
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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 48bde5d2cc5b9e98f55cd23ee57f3996d81caeb5 by INADA Naoki in branch 
'master':
Issue #29263: LOAD_METHOD support for C methods
https://github.com/python/cpython/commit/48bde5d2cc5b9e98f55cd23ee57f3996d81caeb5


--

___
Python tracker 

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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 135a9a0c09f9 by INADA Naoki in branch 'default':
Issue #29263: LOAD_METHOD support for C methods
https://hg.python.org/cpython/rev/135a9a0c09f9

--

___
Python tracker 

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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread R. David Murray

R. David Murray added the comment:

Oops, didn't mean to assign this to terry :(

--
assignee: terry.reedy -> 

___
Python tracker 

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



[issue22385] Define a binary output formatting mini-language for *.hex()

2017-02-02 Thread Christian H

Changes by Christian H :


--
nosy: +Christian H

___
Python tracker 

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



[issue29107] traceback module incorrectly formats args-less syntax errors

2017-02-02 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue2771] Test issue

2017-02-02 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage:  -> resolved
status:  -> closed

___
Python tracker 

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



[issue2771] Test issue

2017-02-02 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution: fixed -> 
stage: resolved -> 
status: closed -> 

___
Python tracker 

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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread R. David Murray

R. David Murray added the comment:

The fact that RLock's *appeared* to be picklable was a bug in previous versions 
of python (see issue 22995).

If you had code that worked before actually using the locks then perhaps there 
is a deeper error, though, so I'm nosying Serhiy to take a look at this (I 
don't use concurrent.futures so I'm not qualified to evaluate your example for 
validity).

--
assignee:  -> terry.reedy
nosy: +r.david.murray, serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue29424] Multiple vulnerabilities in BaseHTTPRequestHandler enable HTTP response splitting attacks

2017-02-02 Thread Meitar Moscovitz

Meitar Moscovitz added the comment:

A separate patch for Python 2.7+ that handles the issue described in the same 
way as the 3.4+ patch.

--
Added file: http://bugs.python.org/file46498/python-2.7.13.patch

___
Python tracker 

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



[issue29424] Multiple vulnerabilities in BaseHTTPRequestHandler enable HTTP response splitting attacks

2017-02-02 Thread Meitar Moscovitz

New submission from Meitar Moscovitz:

SUMMARY:

In the Python standard library, the BaseHTTPRequestHandler class’s 
send_header() method[0] does not correctly construct HTTP/1.1 message headers 
as described by Section 4.2 of RFC 2616[1] when it is given maliciously-crafted 
input, leaving applications that rely on it vulnerable to HTTP response 
splitting[2] if they do not take extra precautions, themselves. A similar 
vulnerability affects the BaseHTTPRequestHandler class’s send_response_only() 
method, as well, although this is not likely to be as exploitable in the wild. 
This second vulnerability can result in HTTP response splitting due to 
incorrect construction of the Reason-Phrase portion of an HTTP Status-Line.[3]

Since these APIs are designed to handle user-supplied input, it is reasonable 
to assume that developers will expect the standard library to consume arbitrary 
input safely. Unfortunately, the library fails to do that in these cases. 
According to a simple GitHub code search, slightly more than 100,000 
repositories are directly using BaseHTTPRequestHandler,[4] so it is possible 
that a significant percentage of those applications are affected by this 
vulnerability.

PYTHON VERSIONS AFFECTED:

* Current development tip at time of writing: 
https://hg.python.org/cpython/file/tip/Lib/http/server.py#l511
* Current stable version 3.6 release 
(https://hg.python.org/cpython/file/3.6/Lib/http/server.py#l508)
* Current stable version 2.7.13 release 
(https://hg.python.org/cpython/file/2.7/Lib/BaseHTTPServer.py#l412)

DETAILS:

According to the HTTP specification, an HTTP message header field content *MUST 
NOT* contain the sequence CRLF (carriage return, line feed). The RFC defines a 
message header as:

message-header = field-name ":" [ field-value ]
field-name = token
field-value= *( field-content | LWS )
field-content  = 


The RFC defines *TEXT to be the same as defined in RFC 822 section 3.3:[5]

text=   atoms, specials,
   CR & bare LF, but NOT   ;  comments and
   including CRLF> ;  quoted-strings are
   ;  NOT recognized.


However, the send_header() method does not perform any checking to ensure that 
a message header field-name nor field-content contains no CRLF sequences. The 
vulnerable Python 3.x code is in Lib/http/server.py on lines 507 and 508:

   self._headers_buffer.append(
   ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))

An impacted application is one that passes user-provided input into the 
send_header() method, such as is common for setting HTTP Cookies. An example of 
an affected application may run Python code such as:

def do_POST(self):
   # receive user-supplied data from a POST’ed HTTP request
   form_input = parse.unquote_plus(
   
self.rfile.read(int(self.headers.get('content-length'))).decode('utf8')
   ).split('=')
   username = form_input[1] # extract a user-supplied value
   self.send_header('Set-Cookie', 'user={}'.format(username)) # use that value, 
assuming library will provide safety!
   self.end_headers()
   # ... send HTTP response body ...


Assuming the code above, this HTTP POST request…

POST https://victim.example/ HTTP/1.1
Host: victim.example
Content-Type: application/x-www-form-urlencoded
Content-Length: 10

user=alice

…would produce something like this (safe) HTTP response:

HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.4.5
Date: Thu, 19 Jan 2017 22:58:44 GMT
Set-Cookie: user=alice

...HTTP RESPONSE BODY...

However, if an attacker supplies the following, maliciously-crafted HTTP POST 
payload…

POST https://victim.example/ HTTP/1.1
Host: victim.example
Content-Type: application/x-www-form-urlencoded
Content-Length: 46

user=%0d%0aContent-Length: 6%0d%0a%0d%0aHACKED

…then the application would serve a page that simply read “HACKED” as its 
output:

HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.4.5
Date: Thu, 19 Jan 2017 22:58:44 GMT
Set-Cookie: user=
Content-Length: 6

HACKED


The remainder of the application’s original, intended HTTP response would be 
ignored by the client. This allows the attacker to submit arbitrary data to 
clients, including hijacking complete pages and executing XSS attacks.

SOLUTION:

To fix this issue, ensure that CRLF sequences in the relevant user-supplied 
values are replaced with a single SPACE character, as the RFC instructs.[1] For 
example, Python code referencing

value

should become

value.replace("\r\n", ' ')


Similar replacements should be made to the other relevant arguments in the 
affected methods.

Two patches are attached to this email, one for each associated affected 
version of Python. Apply each patch with:

cd Python-$VERSION
patch -p1 < python-$VERSION.patch


where $VERSION is the version of Python to be patched. The patch for Python 
3.6.0 applies cleanly to the current development tip, as well.

EXTERNAL REFERENCES:

[0] 

[issue2771] Test issue

2017-02-02 Thread Ezio Melotti

Ezio Melotti added the comment:

test

--

___
Python tracker 

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



[issue29339] Interactive: Move to same indentation level as previousline

2017-02-02 Thread 12345 67890

12345 67890 added the comment:

The user is going to have to outdent anyway if we return them to the previous 
indentation level. Essentially it would be this:


[ENTER]

set_cursor_to_previous_indentation_level()

if first_char_in_is_space:
erase_first_char_in()
reset_cursor_to_zero_indentation()
type_first_char()
else:
pass


So if we have this line:

some_line

[ENTER]

some_line
^

[BACKSPACEX4]

some_line
^
< cursor direction

The other case is

some_line

[ENTER]

some_line
^

[SPACEX4]

some_line
^
> cursor direction

Does that make sense?

--

___
Python tracker 

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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread spencera

New submission from spencera:

I'm unable to use concurrent.futures.ProcessPoolExecutor within a class in 3.6 
the way I can in 3.5.x. I get the following in 3.6 (python3.6 test.py):

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/multiprocessing/queues.py", line 241, in _feed
obj = _ForkingPickler.dumps(obj)
  File "/usr/local/lib/python3.6/multiprocessing/reduction.py", line 51, in 
dumps
cls(buf, protocol).dump(obj)
TypeError: can't pickle _thread.RLock objects

-

No issues in 3.5.x:
0
1
2
3
4
5
6
7
8
9
0
...

--
components: Library (Lib)
files: test.py
messages: 286825
nosy: spencera
priority: normal
severity: normal
status: open
title: using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: 
can't pickle _thread.RLock objects' in 3.6, but not 3.5
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46496/test.py

___
Python tracker 

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset fca720360f87f6dd2cd2030f7f98f689809c45d9 by Vinay Sajip in branch 
'3.5':
Fixes #24875: pip can now be installed in a venv with --system-site-packages.
https://github.com/python/cpython/commit/fca720360f87f6dd2cd2030f7f98f689809c45d9


--

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a7dc69b8956ad223ff6c239299896dd5195ce430 by Vinay Sajip in branch 
'3.6':
Fixes #29213: regularised EOLs of venv scripts.
https://github.com/python/cpython/commit/a7dc69b8956ad223ff6c239299896dd5195ce430

New changeset 1b105fac40b341980b290729a7ed403c73f5cf61 by Vinay Sajip in branch 
'3.6':
Fixes #29213: merged fix from 3.5.
https://github.com/python/cpython/commit/1b105fac40b341980b290729a7ed403c73f5cf61


--

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a7dc69b8956ad223ff6c239299896dd5195ce430 by Vinay Sajip in branch 
'3.5':
Fixes #29213: regularised EOLs of venv scripts.
https://github.com/python/cpython/commit/a7dc69b8956ad223ff6c239299896dd5195ce430


--

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset fca720360f87f6dd2cd2030f7f98f689809c45d9 by Vinay Sajip in branch 
'3.6':
Fixes #24875: pip can now be installed in a venv with --system-site-packages.
https://github.com/python/cpython/commit/fca720360f87f6dd2cd2030f7f98f689809c45d9

New changeset e3b461cf4327bc933b2421121daa5f938d929db3 by Vinay Sajip in branch 
'3.6':
Fixes #24875: Merged fix from 3.5.
https://github.com/python/cpython/commit/e3b461cf4327bc933b2421121daa5f938d929db3


--

___
Python tracker 

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 12b49507177368204085bd6e2b464f45e3b569e2 by Mark Dickinson in 
branch '2.7':
Issue #14376: sys.exit now accepts longs as well as ints. Thanks Gareth Rees.
https://github.com/python/cpython/commit/12b49507177368204085bd6e2b464f45e3b569e2


--

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset fca720360f87f6dd2cd2030f7f98f689809c45d9 by Vinay Sajip in branch 
'master':
Fixes #24875: pip can now be installed in a venv with --system-site-packages.
https://github.com/python/cpython/commit/fca720360f87f6dd2cd2030f7f98f689809c45d9

New changeset e3b461cf4327bc933b2421121daa5f938d929db3 by Vinay Sajip in branch 
'master':
Fixes #24875: Merged fix from 3.5.
https://github.com/python/cpython/commit/e3b461cf4327bc933b2421121daa5f938d929db3

New changeset 2a2f5a741c509381ea8d0da09944aafdfc40b670 by Vinay Sajip in branch 
'master':
Closes #24875: Merged fix from 3.6.
https://github.com/python/cpython/commit/2a2f5a741c509381ea8d0da09944aafdfc40b670


--

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset ef0264af4d1a1844c2feb32714870d636e583b3a by Vinay Sajip in branch 
'master':
Closes #29213: Merged fix from 3.6.
https://github.com/python/cpython/commit/ef0264af4d1a1844c2feb32714870d636e583b3a


--

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch for the gc module is synchronized with current sources and 
addresses Martin's comments.

The only problem with this patch is that it exposes the default value for 
gc.collect() argument as constant 2 in Python instead of actual 
NUM_GENERATIONS-1. The latter value can't be exposed in Python.

On other side it is 2 in the documentation, and it is not so easy to change the 
value of NUM_GENERATIONS.

--
Added file: http://bugs.python.org/file46495/clinic_gc_v5.patch

___
Python tracker 

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Gareth Rees

Gareth Rees added the comment:

Thank you, Mark (and everyone else who helped).

--

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c23224ebc9e5 by Vinay Sajip in branch 'default':
Closes #29213: Merged fix from 3.6.
https://hg.python.org/cpython/rev/c23224ebc9e5

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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson
resolution:  -> fixed
stage: test needed -> 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



[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 14682d00b09a by Mark Dickinson in branch '2.7':
Issue #14376: sys.exit now accepts longs as well as ints. Thanks Gareth Rees.
https://hg.python.org/cpython/rev/14682d00b09a

--
nosy: +python-dev

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b9e5cbdb0b1 by Vinay Sajip in branch '3.5':
Fixes #29213: regularised EOLs of venv scripts.
https://hg.python.org/cpython/rev/2b9e5cbdb0b1

New changeset 0f3ebeb389fe by Vinay Sajip in branch '3.6':
Fixes #29213: merged fix from 3.5.
https://hg.python.org/cpython/rev/0f3ebeb389fe

--
nosy: +python-dev

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1bf1d36463b4 by Vinay Sajip in branch '3.5':
Fixes #24875: pip can now be installed in a venv with --system-site-packages.
https://hg.python.org/cpython/rev/1bf1d36463b4

New changeset 7d4701b4210f by Vinay Sajip in branch '3.6':
Fixes #24875: Merged fix from 3.5.
https://hg.python.org/cpython/rev/7d4701b4210f

New changeset 7fd931727764 by Vinay Sajip in branch 'default':
Closes #24875: Merged fix from 3.6.
https://hg.python.org/cpython/rev/7fd931727764

--
nosy: +python-dev
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



[issue28749] Fixed the documentation of the mapping codec APIs

2017-02-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> serhiy.storchaka

___
Python tracker 

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



[issue29347] Python 2.7.8 is crashing while creating weakref for a given object.

2017-02-02 Thread Saida Dhanavath

Changes by Saida Dhanavath :


--
versions: +Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-02-02 Thread jan matejek

jan matejek added the comment:

the attached patch fixes the test for me

--
keywords: +patch
Added file: http://bugs.python.org/file46494/test_socket_aead_kernel49.patch

___
Python tracker 

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



[issue29404] "TypeError: 'int' does not have the buffer interface" on memoryview over bytearray

2017-02-02 Thread Brett Cannon

Brett Cannon added the comment:

As Serhiy and Stefan pointed out, it's too late to change Python 2.7 semantics. 
Closing as "not a bug".

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

loadmethod-methoddescr-2.patch LGTM.

--

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-02-02 Thread jan matejek

jan matejek added the comment:

The "'0' * taglen" part is now considered part of plaintext. Which makes a lot 
of sense :) 
Removing the "empty taglen" fixes the encryption part of the tests for me. 
Similarly, for the decryption test, we must only read and check the message 
without the tag.

--
nosy: +matejcik

___
Python tracker 

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



[issue29422] add socket independent timeout to httplib/http.client read

2017-02-02 Thread Patrick Michaud

New submission from Patrick Michaud:

Using python's httplib, there is no way to set a timeout for the full request 
cycle.  A timeout can be given, which will apply to the connection attempt and 
each blocking socket operation.  However, a malicious (or poorly performing) 
server can keep a connection open for an indefinite amount of time by slowly 
sending data.  Consider this server process:

https://gist.github.com/vegitron/bc883ddc88fe9253adc3e0bccea6445e

and this client:

https://gist.github.com/vegitron/4ee269b6492ff80d350e108363689d5c

With a timeout of 0.5, the client takes 0.501363039017 seconds.  With a timeout 
of 2.5, it takes 10.0041370392 seconds.

This is explained in the documentation, but it's a problem.  A commonly 
suggested solution is to use SIGALRM to set a timeout, but that doesn't work in 
a multi-threaded environment.  Moving to multi-process introduces big slow 
downs as I can't use connection pools, and data needs to be serialized and 
deserialized for the parent process.

I would like to propose an addition to httplib that would add a hook to 
httplib.HTTPResponse._read_chunked (python 2) and 
http.client.HTTPResponse._readall_chunked (python 3) that would either:

1) support an overall read timeout, by tracking a per-response start time and 
raising a timeout exception if that chunk read finishes after the given timeout
2) support a per-chunk callback function, so a client of httplib/http.client 
could define that logic for themselves.


Current possible timeouts, and where they can happen:

  connect  | read chunk | read chunk | read chunk
[ timeout ] [ timeout ]  [ timeout ]  [ timeout ]

Proposed addition:

  connect  | read chunk | read chunk | read chunk
[ timeout ] [ timeout ]  [ timeout ]  [ timeout ]
[total read time out]

--
messages: 286807
nosy: Patrick Michaud
priority: normal
severity: normal
status: open
title: add socket independent timeout to httplib/http.client read
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-02-02 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file46493/loadmethod-methoddescr-2.patch

___
Python tracker 

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



[issue29079] pathlib.resolve() causes infinite loop on Windows

2017-02-02 Thread Steve Dower

Steve Dower added the comment:

At the point this code is running, it doesn't matter. The path doesn't exist, 
so trimming irrelevant segments from it will just cause a few extra iterations 
through resolve until we clear out enough of the absent segments to find 
something that does exist.

abspath just prepends the current working directory unless the path is rooted, 
so we essentially have unbounded concatenation of "\.." in that case.

--

___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

3 empty notifications from Roundup Robot :-/

--

___
Python tracker 

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



[issue29420] Python 3.6 change in dict iteration when inserting keys

2017-02-02 Thread Matthew Brett

Matthew Brett added the comment:

To clarify from comments on issue 19332:

"""
* The normal rule (not just for Python) is that a data structures have 
undefined behavior for mutating while iterating, unless there is a specific 
guarantee
"""

The change in Python 3.6 is just a different undefined behavior.

--

___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset f0c1bbce09dc21d82965f1706b30b69e285ca4d3 by Serhiy Storchaka in 
branch 'master':
Issue #29421: Make int.to_bytes() and int.from_bytes() slightly faster
https://github.com/python/cpython/commit/f0c1bbce09dc21d82965f1706b30b69e285ca4d3


--

___
Python tracker 

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



[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I tried this optimization few years ago. But with slow 
PyArg_ParseTupleAndKeywords() the effect was smaller and without 
_PyUnicode_EqualToASCIIId() the code was more cumbersome.

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52c5a7c6 by Serhiy Storchaka in branch 'default':
Issue #29421: Make int.to_bytes() and int.from_bytes() slightly faster
https://hg.python.org/cpython/rev/52c5a7c6

--
nosy: +python-dev

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "Dear Roundup Robot, please don't close issues."

For what it's worth, I reported issues of this robot to python-dev:

https://mail.python.org/pipermail/python-dev/2017-February/147317.html

https://mail.python.org/pipermail/python-dev/2017-February/147325.html

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Dear Roundup Robot, please don't close issues.

--
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open
Added file: http://bugs.python.org/file46492/cache_struct-2.patch

___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Ah yes, I began with the exact same change when I experimented optimizing 
to_bytes():
http://bugs.python.org/issue29300#msg286781

I was going to suggest you the same, but the speedup was low compared to the 
cost of parsing arguments.

Anyway, int-to_bytes-from_bytes.patch is safe, LGTM, and the speedup is 
significant.

--

___
Python tracker 

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



[issue29420] Python 3.6 change in dict iteration when inserting keys

2017-02-02 Thread R. David Murray

R. David Murray added the comment:

This "bug" has always existed, its just that its manifestation has changed.  
See issue 19332 for background.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Guard against changing dict during iteration

___
Python tracker 

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



[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

2017-02-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes int.to_bytes() and int.from_bytes() slightly faster.

$ ./python -m perf timeit '1 .to_bytes(4, "little")' --compare-to 
"`pwd`/python0"
Median +- std dev: [python0] 1.28 us +- 0.07 us -> [python] 1.17 us +- 0.07 us: 
1.09x faster (-8%)

$ ./python -m perf timeit '1 .to_bytes(4, "big")' --compare-to "`pwd`/python0"
Median +- std dev: [python0] 1.30 us +- 0.07 us -> [python] 1.19 us +- 0.05 us: 
1.10x faster (-9%)

$ ./python -m perf timeit 'int.from_bytes(b"\1\0\0\0", "little")' --compare-to 
"`pwd`/python0"
Median +- std dev: [python0] 1.70 us +- 0.13 us -> [python] 1.41 us +- 0.06 us: 
1.20x faster (-17%)

$ ./python -m perf timeit 'int.from_bytes(b"\0\0\0\1", "big")' --compare-to 
"`pwd`/python0"
Median +- std dev: [python0] 1.71 us +- 0.15 us -> [python] 1.40 us +- 0.05 us: 
1.22x faster (-18%)

--
components: Interpreter Core
files: int-to_bytes-from_bytes.patch
keywords: patch
messages: 286796
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Make int.to_bytes() and int.from_bytes() slightly faster
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file46491/int-to_bytes-from_bytes.patch

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Stefan Krah: "PyBUF_SIMPLE implies C-contiguous for a conforming buffer 
provider."

Oh ok, thanks for the confirmation. So my change didn't add new checks and my 
commit message is wrong :-) Only non-conforming objects are impacted, but in 
such case, it's more a bug in the object than a bug in struct. I guess that 
non-conforming non-contiguous objects are very rare in the wild ;-)

The new code is more strict, so is safe in all corner cases.

--

___
Python tracker 

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



[issue29420] Python 3.6 change in dict iteration when inserting keys

2017-02-02 Thread Matthew Brett

New submission from Matthew Brett:

The behavior of dict iteration has changed in Python 3.6, in that inserting 
keys during iteration has a different and unpredictable affect.  For this code:

d = {'foo': 1}
for key in d:
   print(key)
   d.pop(key)
   d[key] = 1

Python 3.5 prints a single 'foo' (one pass through the loop).  Python 3.6 
generates five lines of 'foo' (five passes through the loop).  Of course this 
code is pathological, but I found this behavior from a bug in code where the 
pathology was a lot less obvious - see https://github.com/nipy/nipy/issues/420

--
messages: 286794
nosy: matthew.brett
priority: normal
severity: normal
status: open
title: Python 3.6 change in dict iteration when inserting keys
type: behavior
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



[issue29404] "TypeError: 'int' does not have the buffer interface" on memoryview over bytearray

2017-02-02 Thread Stefan Krah

Stefan Krah added the comment:

I agree it's too late to change 2.7, and 3.x cannot (and should not) be changed 
at this stage.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Stefan Krah

Stefan Krah added the comment:

PyBUF_SIMPLE implies C-contiguous for a conforming buffer provider.

--
nosy: +skrah

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a88eb4fa9e7fdf1a1050786223044c6bb7949784 by Victor Stinner in 
branch '3.6':
Issue #29300: test_struct tests unpack_from() with keywords
https://github.com/python/cpython/commit/a88eb4fa9e7fdf1a1050786223044c6bb7949784


--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


--
resolution:  -> fixed

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a88eb4fa9e7fdf1a1050786223044c6bb7949784 by Victor Stinner in 
branch '3.5':
Issue #29300: test_struct tests unpack_from() with keywords
https://github.com/python/cpython/commit/a88eb4fa9e7fdf1a1050786223044c6bb7949784


--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a88eb4fa9e7fdf1a1050786223044c6bb7949784 by Victor Stinner in 
branch 'master':
Issue #29300: test_struct tests unpack_from() with keywords
https://github.com/python/cpython/commit/a88eb4fa9e7fdf1a1050786223044c6bb7949784

New changeset dcd4b1af2c59b0aae33cbac00d9f6fb47782ac57 by Victor Stinner in 
branch 'master':
Rename struct.unpack() 2nd parameter to "buffer"
https://github.com/python/cpython/commit/dcd4b1af2c59b0aae33cbac00d9f6fb47782ac57


--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Roundup Robot

Changes by Roundup Robot :


--
status: open -> closed

___
Python tracker 

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



  1   2   >