[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

Change by Qichao Chu :


--
pull_requests:  -4664

___
Python tracker 

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



[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

Change by Qichao Chu :


--
pull_requests:  -4665

___
Python tracker 

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



[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

Change by Qichao Chu :


--
pull_requests: +4666

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-12-08 Thread Berker Peksag

Berker Peksag  added the comment:

This has been fixed in all active branches (2.7, 3.6 and master) so I think we 
can close it as 'fixed'. Thanks, Nir!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> 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



[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

Change by Qichao Chu :


--
pull_requests: +4665

___
Python tracker 

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



[issue32208] Improve semaphore documentation

2017-12-08 Thread Berker Peksag

Berker Peksag  added the comment:

According to the discussion at 
https://github.com/python/cpython/pull/4709#issuecomment-350055732 it was 
decided to not backport this to 2.7. Closing this as 'fixed'. Thank you, all!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2017-12-08 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +steve.dower

___
Python tracker 

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



[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

Change by Qichao Chu :


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

___
Python tracker 

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



[issue32237] test_xml_etree leaked [1, 1, 1] references, sum=3

2017-12-08 Thread Berker Peksag

Berker Peksag  added the comment:

I can confirm that Neil's PR (11cc289490b7b275fc0a033e2b376a8d4c780d9b) fixed 
the regression:

$ ./python -m test -R 3:3 test_xml_etree
Run tests sequentially
0:00:00 load avg: 0.66 [1/1] test_xml_etree
beginning 6 repetitions
123456
..
1 test OK.

Total duration: 4 sec
Tests result: SUCCESS

test_ensurepip, test_hashlib and test_importlib passed too.

Closing this one as fixed. Thanks!

--
components: +Tests
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> 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



[issue32257] Support Disabling Renegotiation for SSLContext

2017-12-08 Thread Qichao Chu

New submission from Qichao Chu :

Adding a new method in SSLContext so that we can disable renegotiation easier.
This resolves CVE-2009-3555 and attack demoed by thc-ssl-dos

--
assignee: christian.heimes
components: SSL
messages: 307879
nosy: christian.heimes, chuq
priority: normal
severity: normal
status: open
title: Support Disabling Renegotiation for SSLContext
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



[issue32247] shutil-copytree: Create dst folder only if it doesn't exist

2017-12-08 Thread Martin Panter

Change by Martin Panter :


--
superseder:  -> add exist_ok to shutil.copytree

___
Python tracker 

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



[issue28185] Tabs in C source code

2017-12-08 Thread Martin Panter

Martin Panter  added the comment:

Similar changes were made in Issue 32150 and PR 3892 (tabs) and Mercurial 
revision 98d1788c905c (trailing space and indentation). All the other tabs in 
these patches appear to have been removed with other work: #29524, #31891, 
#30747, #31373, PR 4275, #25658, #27867, #30406, #31370, #30070, #29585, 
#31338, PR 1723, #30279.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Expand tabs to spaces in C files

___
Python tracker 

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



[issue8722] Documentation for __getattr__

2017-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The behavior and doc for __setattr__ and __delattr__ should also be checked.

--

___
Python tracker 

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



[issue32256] Make patchcheck.py work for out-of-tree builds

2017-12-08 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

Despite some steps made in issue 9860 make patchcheck still doesn't work for 
out-of-tree builds because it runs git and hg in the current directory instead 
of the source directory (msg169465).

--
messages: 307875
nosy: izbyshev
priority: normal
severity: normal
status: open
title: Make patchcheck.py work for out-of-tree builds
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



[issue26340] modal dialog with transient method; parent window fails to iconify

2017-12-08 Thread Vladimir Semenenko

Vladimir Semenenko  added the comment:

After they marked the issue as "resolved" earlier this year I tested a
subsequent 3.x release in Windows 7 and Vista (I don't have 10). The issue
was still there.

I don't have a workaround. I am forced to stay with 2.7.3.

On Dec 8, 2017 9:32 AM, "jarb"  wrote:

jarb  added the comment:

I am having the exactly same issue. Was this issue resolved for Windows 10?
This does not happen in Linux. Any workaround for Windows 10?

--
nosy: +jarb

___
Python tracker 

___

--
nosy: +Vladimir Semenenko

___
Python tracker 

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



[issue8722] Documentation for __getattr__

2017-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Before testing, let alone documenting, the status quo, I would like to be sure 
that suppressing the exception is truly the intended behavior.  Is there a way 
to get an annotated listing from git (given which patch, and therefore which 
person, is responsible for each line)?  I will try asking on pydev.

Calling __getattr__ on property failure is a behavior of __getattribute__, not 
of the property, and I would expect object.__getattribute__ to be tested 
wherever object is, but I have not found such tests.  If we do add a test, the 
best model in test_desc.py looks like `def test_module_subclasses(self):`.  The 
test class would only need __getattr__ and the faulty property.

class Foo(object):
def __getattr__(self, name):
print(f'Getattr {name}')
return True
@property
def bing(self):
print('Property bing')
raise AttributeError("blarg")

f = Foo()
print(f.bing)

#prints (which would be the log list in a test)
Property bing
Getattr bing
True

--

___
Python tracker 

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



[issue32256] Make patchcheck.py work for out-of-tree builds

2017-12-08 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue20285] Improve object.__doc__ and help(object) output

2017-12-08 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +4662
stage: test needed -> patch review

___
Python tracker 

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



[issue20285] Improve object.__doc__ and help(object) output

2017-12-08 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue29572] Upgrade installers to OpenSSL 1.0.2k

2017-12-08 Thread Larry Hastings

Larry Hastings  added the comment:


New changeset 092db6c3cb049052fbfca15efc85ad68093676e7 by larryhastings (Victor 
Stinner) in branch '3.4':
bpo-29572: Update Windows build to OpenSSL 1.0.2k (GH-443) (#3445)
https://github.com/python/cpython/commit/092db6c3cb049052fbfca15efc85ad68093676e7


--
nosy: +larry

___
Python tracker 

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



[issue32193] Convert asyncio to async/await

2017-12-08 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32193] Convert asyncio to async/await

2017-12-08 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 5f841b553814969220b096a2b4f959b7f6fcbaf6 by Andrew Svetlov in 
branch 'master':
bpo-32193: Convert asyncio to async/await usage (#4753)
https://github.com/python/cpython/commit/5f841b553814969220b096a2b4f959b7f6fcbaf6


--

___
Python tracker 

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



[issue29883] asyncio: Windows Proactor Event Loop UDP Support

2017-12-08 Thread Yury Selivanov

Change by Yury Selivanov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue32209] Crash in set_traverse Within the Garbage Collector's collect_generations()

2017-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I'm not sure what I can do to reproduce this because I don't even know what 
> line of code my program was running before it segfaulted. 

To do that you could enable the faulthandler module: 
https://docs.python.org/3/library/faulthandler.html

Also, it would be nice if you had a simple reproducer to share with us, though 
it may be difficult given the description you gave of your workload.

--
nosy: +pitrou

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-12-08 Thread Larry Hastings

Larry Hastings  added the comment:

Merged into 3.4 and 3.5.  Thanks for the patches!

Since I see 2.7 has already had the fix committed, and these are the only three 
versions affected, I'm marking as closed / resolved / fixed.

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-12-08 Thread Larry Hastings

Larry Hastings  added the comment:


New changeset 6c004b40f9d51872d848981ef1a18bb08c2dfc42 by larryhastings (Miro 
Hrončok) in branch '3.4':
bpo-30657: Fix CVE-2017-1000158 (#4758)
https://github.com/python/cpython/commit/6c004b40f9d51872d848981ef1a18bb08c2dfc42


--

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-12-08 Thread Larry Hastings

Larry Hastings  added the comment:


New changeset fd8614c5c5466a14a945db5b059c10c0fb8f76d9 by larryhastings (Miro 
Hrončok) in branch '3.5':
bpo-30657: Fix CVE-2017-1000158 (#4664)
https://github.com/python/cpython/commit/fd8614c5c5466a14a945db5b059c10c0fb8f76d9


--

___
Python tracker 

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



[issue13420] newer() function in dep_util.py discard changes in the same second

2017-12-08 Thread Jakub Wilk

Change by Jakub Wilk :


--
nosy:  -jwilk

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-12-08 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +4661

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2017-12-08 Thread Alberto Galera

Alberto Galera  added the comment:

I see that they have commented on the lib that I made a few years ago 
(python-wildcard).

The reason for the creation of that little fork started in this issue:

https://bugs.python.org/issue25734

--
nosy: +Alberto Galera

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-08 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
nosy: +gregory.p.smith, twouters

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-12-08 Thread Dustin Spicuzza

Dustin Spicuzza  added the comment:

Because of backwards compatibility (despite a statement saying it's not 
guaranteed for pathlib), I think the best approach would be to create a 
'globmatch' function for PurePath instead of modifying the match function, and 
document that the match function does a different kind of matching. 

This isn't a patch for cpython per se (ironically, don't have time for that 
this month...), but here's a MIT-licensed gist that patches pathlib2 and adds a 
globmatch function to it, plus associated tests extracted from pathlib2 and my 
own ** related tests. Works for me, feel free to do with it as you wish.

https://gist.github.com/virtuald/dd0373bf3f26ec0730adf1da0fb929bb

--

___
Python tracker 

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



[issue11594] 2to3 does not preserve line endings

2017-12-08 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

This issue affected me today. I'm editing a codebase that has mixed line 
endings in different files. I'd like to patch for Python 3 support without 
changing line endings. Even invoking a single fixer (print), the line endings 
mutate. Since I'm running on macOS, the files with CRLF get LF line endings.

Answers [in this 
question](https://stackoverflow.com/questions/39028517/2to3-how-to-keep-newline-characters-from-input-file)
 suggest the mutation can be suppressed by altering the _to_system_newlines 
function, but the proposed fix has no effect on the Python 3.6 version of this 
routine.

I thought I'd encountered this issue before, but I realized after searching 
that I was thinking of issue10639, which may present a model for retaining the 
newlines when refactoring the code.

I found I was able to work around the issue by putting lib2to3-clean.py in my 
current directory:

import lib2to3.refactor
import runpy
import functools


if __name__ == '__main__':
lib2to3.refactor._open_with_encoding = functools.partial(open, 
newline='')
runpy.run_module('lib2to3')


And invoking `python -m lib2to3-clean` instead of `-m lib2to3`. The addition of 
newline='' follows the [guidance in the 
docs](https://docs.python.org/release/3.2/library/functions.html#open) on how 
to avoid mutating newlines.

I've released this functionality in [jaraco.develop 
4.0](https://pypi.org/project/jaraco.develop) so others can readily invoke it 
with `rwt jaraco.develop -- -m jaraco.develop.lib2to3`.

--
nosy: +jason.coombs
versions: +Python 3.6 -Python 2.7, Python 3.2, Python 3.3

___
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-12-08 Thread Michał

Michał  added the comment:

I've got confused with the "TypeError: unhashable type: 'dict'" error creating 
a choose-from-dictionary argument in Python 3.6. I used lambda as a workaround, 
but IMO it would be great to have this patch merged.

--
nosy: +krassowski
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



[issue15045] Make textwrap.dedent() consistent with str.splitlines(True) and str.strip()

2017-12-08 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Ezra, can you please convert your patch to a Pull Request on Github?

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue26414] os.defpath too permissive

2017-12-08 Thread Guido van Rossum

Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue26414] os.defpath too permissive

2017-12-08 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-08 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Łukasz Langa

Łukasz Langa  added the comment:

+1 on the idea, I would use this.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue32216] Document PEP 557 Data Classes

2017-12-08 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Guido van Rossum

Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

New protocol may speed up not only `reader.readexactly()`.
Every `reader.feed_data()` appends a new chunk to existing buffer.
We can try to read into unused tail of the buffer instead.

--

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

`metadata` in setup.cfg is not supported directly by distutils.  Can you 
provide a setup.py script that shows the problem without setuptools?

--

___
Python tracker 

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



[issue32212] few discrepancy between source and docs in logging

2017-12-08 Thread Éric Araujo

Change by Éric Araujo :


--
keywords: +easy

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Do you think it's possible to fold BufferedProtocol into Protocol?

It would be a backwards incompatible change :(

Coincidentally, there might be protocols that already implement 'get_buffer()' 
and 'buffer_updated()' methods that do something completely different.


> This would allow StreamReader to implement readinto().

We can easily refactor StreamReader to use 'BufferedProtocol'.  Methods like 
'readexactly()' would benefit from that.

--

___
Python tracker 

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



[issue26340] modal dialog with transient method; parent window fails to iconify

2017-12-08 Thread jarb

jarb  added the comment:

I am having the exactly same issue. Was this issue resolved for Windows 10? 
This does not happen in Linux. Any workaround for Windows 10?

--
nosy: +jarb

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Do you think it's possible to fold BufferedProtocol into Protocol?
i.e., either `get_buffer()` returns None (the default) and `data_received()` is 
called with a bytes object, or `get_buffer()` returns a writable buffer and 
`buffer_updated()` is called with the number of bytes received into the buffer.

This would allow StreamReader to implement readinto().

--

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Yury Selivanov

Yury Selivanov  added the comment:

> 1. What happens if size of read data is greater than pre-allocated buffer?

Let's say we have 2Kb of data in the socket's network buffer, and we only 
preallocated 0.5Kb in our buffer.  We will the receive 0.5Kb in our buffer, 
'Protocol.buffer_updated()' will be called with nbytes=512, and 1.5Kb of data 
will be left in the network buffer.  So the loop will call 
get_buffer()/buffer_updated() again, and the cycle will continue until there's 
no data left.


> 2. Is flow control logic changed or not? If I understand correctly 
> pause_reading() / resume_reading() continue to work as earlier.

Flow control will continue working absolutely the same for BufferedProtocols.


> I have another question: what happens if there is a partial read?
> For example, let's says I return a 1024-bytes buffer in get_buffer(), but 
> recv_into() receives data in 512 chunks.  Is it:

It will be as follows:

1. Protocol.get_buffer() is called, returns 1024 bytes buffer
2. recv_into() receives 512 bytes, writes them in buf[0:512]
3. Protocol.buffer_updated() is called with nbytes=512

Now it's the responsibility of the Protocol to return a correct view over 
buffer the next time `get_buffer()` is called.

The general idea is to:

1. allocate a big buffer

2. keep track of how much data we have in that buffer, let's say we have a 
'length' integer for that.

3. when get_buffer() is called, return 'memoryview(big_buffer)[length:]'

4. when buffer_updated(nbytes) is called, do 'length += nbytes; 
parse_buffer_if_possible()'

I've implemented precisely this approach here: 
https://gist.github.com/1st1/1c606e5b83ef0e9c41faf21564d75ad7#file-get_buffer_bench-py-L27-L43

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-08 Thread STINNER Victor

STINNER Victor  added the comment:

> After running test_regrtest in the source tree on linux, the build/ 
> subdirectory (i.e. test.libregrtest.main.TEMPDIR) contains a new 
> test_python_* directory that contains a core file when the core file size is 
> unlimited.

Can you please explain how to reproduce the bug? (Which commands should I type?)

What is your /proc/sys/kernel/core_pattern?

On my Fedora 27, /proc/sys/kernel/core_pattern is 
"|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e".

--

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-12-08 Thread Dustin Spicuzza

Dustin Spicuzza  added the comment:

I just ran into this also. It seems like a very strange omission that match and 
glob don't support the same patterns (and I'm surprised that they don't share 
more code).

--
nosy: +virtuald

___
Python tracker 

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



[issue8722] Documentation for __getattr__

2017-12-08 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Terry,

Thanks for clarifying with this example.  I hadn't tried this when I was 
playing with the other example.  I guess __getattribute__ might be defined by a 
class, but generally wouldn't be called directly, so the use of __getattr__ and 
__getattribute__ and the raising of AttributeError is more for an 
`attributeref` 
(https://docs.python.org/3/reference/expressions.html#attribute-references) 
usage?

--
nosy: +csabella

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2017-12-08 Thread Vincas Dargis

Vincas Dargis  added the comment:

On 2017-12-06 20:28, paul j3 wrote:
> The default value is used *if the flag is not provided at all.*
> 
> "nargs='?'" provides a third option, assigning the 'const' value *if the flag 
> is used without an argument*.

This did a "click" in my head. It works now with `nargs='?'` and 
`const='MediaProfile000'` as expected, thanks!

I am really sorry for the noise, due to misunderstanding while reading 
(skipping-throuhg?) Python documentation.

--

___
Python tracker 

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



[issue32205] test.pythoninfo does not print the cross-built sysconfig data

2017-12-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution: wont fix -> not a bug

___
Python tracker 

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



[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-08 Thread Licht Takeuchi

New submission from Licht Takeuchi :

Inconsistent behavior while reading a single column CSV.
I have the patch and waiting for the CLA response.

# Case 1
## Input
```
import csv
fp = open('test.csv', 'w')
w = csv.writer(fp)
w.writerow([''])
w.writerow(['1'])
fp.close()
```
## Output
```
""
1
```

# Case 2
## Input
```
import csv
fp = open('test.csv', 'w')
w = csv.writer(fp)
w.writerow(['1'])
w.writerow([''])
fp.close()
```
## Output
```
1

```

--
components: IO
messages: 307851
nosy: licht-t
priority: normal
severity: normal
status: open
title: csv.writer converts None to '""\n' when it is first line, otherwise '\n'
type: behavior
versions: Python 2.7, 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



[issue32249] Document handler.cancelled()

2017-12-08 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Fixed in master, sorry

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-08 Thread R. David Murray

R. David Murray  added the comment:

Thanks, nitishch.  As I said, I'm not going to backport this unless someone 
advances an argument in favor that discusses the possible backward 
compatibility issue.  (I'm not sure there are any significant ones, but someone 
needs to research it and present the results.)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7 -Python 2.7

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-08 Thread R. David Murray

R. David Murray  added the comment:


New changeset ede157331b4f9e550334900b3b4de1c8590688de by R. David Murray 
(Nitish Chandra) in branch 'master':
bpo-22589 Changed MIME type of .bmp to "image/bmp" (#4756)
https://github.com/python/cpython/commit/ede157331b4f9e550334900b3b4de1c8590688de


--

___
Python tracker 

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



[issue29247] Document return value of epoll.poll

2017-12-08 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Hi Berker,

Are you interested in making a pull request for this patch?  Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2017-12-08 Thread Chirag Rathod

Change by Chirag Rathod :


--
pull_requests: +4660

___
Python tracker 

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



[issue32247] shutil-copytree: Create dst folder only if it doesn't exist

2017-12-08 Thread Radostin

Change by Radostin :


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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I have another question: what happens if there is a partial read?

For example, let's says I return a 1024-bytes buffer in get_buffer(), but 
recv_into() receives data in 512 chunks.  Is it:

1. getbuffer() is called, returns 1024 bytes buffer
2. recv_into() receives 512 bytes, writes them in buf[0:512]
3. recv_into() receives another 512 bytes, writes them in buf[512:1024]

or is it:

1. getbuffer() is called, returns 1024 bytes buffer
2. recv_into() receives 512 bytes, writes them in buf[0:512]
3. getbuffer() is called, returns another 1024 bytes buffer
4. recv_into() receives 512 bytes, writes them in newbuf[0:512]

--

___
Python tracker 

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



[issue32247] shutil-copytree: Create dst folder only if it doesn't exist

2017-12-08 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

This is documented:

>  The destination directory, named by dst, must not already exist

https://docs.python.org/3/library/shutil.html#shutil.copytree

I guess that avoids complications that might arise from merging a directory.

--
nosy: +takluyver

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-08 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-08 Thread Nitish

Change by Nitish :


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

___
Python tracker 

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



[issue32254] documentation builds (even local ones) refer to https://docs.python.org/

2017-12-08 Thread Matthias Klose

Matthias Klose  added the comment:

should *not* point to the same single-point-of-failure URL

--
versions: +Python 2.7, 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



[issue32246] test_regrtest alters the execution environment on Android

2017-12-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

I agree that test_crashed() should be skipped on Android anyway and I will 
create a PR to skip the test.

If I understand correctly, there may be another nasty bug that is revealed when 
test_regrstest fails with the environment altered:

How is it possible that the new file that alters the environment be a 
test_python_* directory (see my initial post) when all the tests are run inside 
a TEMPDIR/test_python_* directory. The 'files' environment is checked within a 
TEMPDIR/test_python_* and not within TEMPDIR, no ?

I found a new point that may help understand this problem:

* On Android TEMPDIR is built from tempfile.gettempdir() that uses the TMPDIR 
environment variable which is set by Android to /data/local/tmp. The tests are 
run in /data/local/tmp/python [1], this is also the value of $SYS_EXEC_PREFIX 
and thus where are installed Python machine-specific binaries.

* When TMPDIR is set to /data/local/tmp/python/tmp, which makes more sense 
here, test_regrstest is ok and does not change the environment.

[1] This is the only location where a shell user may have both write and exec 
permissions, the Android applications have those permissions here too and in 
their own dedicated locations on /data/data.

--

___
Python tracker 

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



[issue32254] documentation builds (even local ones) refer to https://docs.python.org/

2017-12-08 Thread Matthias Klose

New submission from Matthias Klose :

lintian (the Debian packaging checker) recently started flagging so-called 
"privacy-breach" issues:

https://lintian.debian.org/maintainer/d...@debian.org.html#python2.7

python2.7-doc
W privacy-breach-generic
usr/share/doc/python2.7/html/about.html (https://docs.python.org/2/about.html)
usr/share/doc/python2.7/html/bugs.html (https://docs.python.org/2/bugs.html)
usr/share/doc/python2.7/html/c-api/abstract.html 
(https://docs.python.org/2/c-api/abstract.html)
[...]
and 500 more.

that's because Doc/tools/templates/layout.html hardcodes an absolute URL and 
there is no configure way to change it.  I don't think that local builds should 
point to the same single-point-of-failure URL, but use local references instead.

--
components: Build
messages: 307842
nosy: doko
priority: normal
severity: normal
status: open
title: documentation builds (even local ones) refer to https://docs.python.org/

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-08 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Numbers are great!

Couple questions.

1. What happens if size of read data is greater than pre-allocated buffer?
2. Is flow control logic changed or not? If I understand correctly 
pause_reading() / resume_reading() continue to work as earlier.

--

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-12-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It seems to me that the code could be much simpler (and more bugfree) if 
support only a Connection instance as a target. It is easy to create a 
Connection instance in Python:

with sqlite3.connect(filename) as dest:
source.backup(dest)

But this would save around 50 lines of complex C code. And I'm not sure this 
code is correct.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-08 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
components: +Library (Lib)

___
Python tracker 

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



[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-08 Thread Andrew Svetlov

New submission from Andrew Svetlov :

Now constructions like

await lock  # "yield from lock" can be used as well
try:
...
finally:
lock.release()

and

with (yield from lock):
...

are supported. Let's deprecate them in favor of

async with lock:
...

--
components: asyncio
messages: 307839
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Deprecate old-style locking in asyncio/locks.py
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



[issue32246] test_regrtest alters the execution environment on Android

2017-12-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> The fact that the TEMP directory is not clean already happens when running 
> buildbottest natively with the standard Python Makefile (no one has noticed 
> it yet I guess) and the directory contains a core file.

I should have written "happens on linux" instead of "happens when running 
buildbottest natively with the standard Python Makefile". I have now created 
issue 32252 for that distinct problem.

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-08 Thread Xavier de Gaye

New submission from Xavier de Gaye :

After running test_regrtest in the source tree on linux, the build/ 
subdirectory (i.e. test.libregrtest.main.TEMPDIR) contains a new test_python_* 
directory that contains a core file when the core file size is unlimited.

I did not test on 3.6.

--
components: Tests
messages: 307837
nosy: vstinner, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: test_regrtest  leaves a test_python_* directory in TEMPDIR
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