[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Adding Guido and Antoine, who committed the security fix as 9e765e65e5cb in 2.7 
and 5cfe74a9bfa4 in 3.2. Perhaps you are able to help decide if the proposal 
here would affect the original security report. Basically this issue (as well 
as #22758 and #22983) are complaining that 3.2’s cookie parsing became too 
strict. People would like to parse subsequent cookie “morsels” if an earlier 
one is considered invalid, rather than aborting the parse completely.

All I can find out about the security report is from 
 and 
, but that doesn’t explain the test cases 
with square brackets in the cookie names.

RFC 6265 says double quotes (") are not meant to be sent by the server, but the 
client should tolerate them without any special handling (different to Python’s 
handling and earlier specs, which parse a special double-quoted string syntax). 
One potential problem that comes to mind is that the current patch blindly 
searches for the next semicolon “;”, which would not be valid inside a 
double-quoted string, e.g. name="some;value".

Python behaviour:

* Before the 3.2 security fix, square brackets and double quotes caused 
truncation of the cookie value, but subsequent cookies were still parsed in 
most cases

* The security fix prevents parsing of subsequent cookies (either on purpose or 
as a side effect)

* The HttpOnly and Secure support in 3.3+ (Issue 16611) prevents parsing of the 
cookie morsel with the offending square bracket or double quote. This is 
proposed for 3.2 backport in Issue 22758.

* Square brackets are now allowed in 3.2+ thanks to Issue 22931. So 3.2 should 
truncate the original test case at the double quote, while 3.3+ drops the 
offending cookie.

The current patch proposed here appears to solve Issue 22983 (permissive 
parsing) in general. If the current cookie does not match the syntax, it is 
skipped, by falling back to a search for a semicolon “;”. So I am inclined to 
close Issue 22983 as a duplicate of this issue.

And Tim, I understand your main interest in Issue 22758 is that parsing aborts 
for things like "a=value1; HttpOnly; b=value2". If this patch were ported to 
3.2 it should also fix that for free.

Pathangi: did you see my review comment about unnecessary backslashes? I also 
left another comment today.

--
nosy: +gvanrossum, pitrou

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Strange bug. I can't attach any file.

--

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

WTF? Where is my patch?

--

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Yes, the Lib/test/decimaltestdata files do come from an external source. I 
don't see the harm in including them in the changes, but those changes will be 
overwritten when the files are next updated.

--

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

I should have said what that source is: it's http://speleotrove.com/decimal/

--

___
Python tracker 

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



[issue25526] (python2.7.10)ImportError: No module named _ssl

2015-10-31 Thread Zachary Ware

Zachary Ware added the comment:

Do "yum install openssl-devel", then rebuild Python. There are probably other 
modules that also didn't build, setup.py will report them at its end.

--
nosy: +zach.ware
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



[issue25509] PyImport_ImportModule inaccurately described

2015-10-31 Thread Memeplex

Memeplex added the comment:

Well it's like that since 2.1 so I guess the doc is wrong indeee.

--

___
Python tracker 

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



[issue25526] (python2.7.10)ImportError: No module named _ssl

2015-10-31 Thread nanxiu

New submission from nanxiu:

After I install python2.7.10
I run:import ssl,then I find this error:

Python 2.7.10 (default, Oct 29 2015, 04:13:03) 
[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/bae/nanxiu/software/Python-2.7.10/Lib/ssl.py", line 97, in 

import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>

--
components: Extension Modules
messages: 253820
nosy: a568953256
priority: normal
severity: normal
status: open
title: (python2.7.10)ImportError: No module named _ssl
type: behavior
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



[issue22121] IDLE should start with HOME as the initial working directory

2015-10-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I retract my previous statement "Splattering .py files in ~HOME is not 
tremendously better than doing the same in the executable directory." and agree 
that when started with the default Windows icon, IDLE should start in 
%USERPROFILE%. 

Discussion for #25450 clarified some of the practical issues.  Windows icons 
have a Shortcut tab with a Start-in field.  We should like to put %USERPROFILE% 
there, but this does not work -- msg253393.

Steve Dower suggested to instead add a new command line option to set the 
starting directory for code entered in the shell window.  (IDLE currently uses 
getopt with
  USAGE: idle  [-deins] [-t title] [file]*
 idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
I suggest adding option '-w path' (w for 'working directory' or 'workspace', d 
already being used).  Any better ideas?  Like d, s, t, c, and r, the new option 
would imply -i, open a shell window.

Shortcut tabs also have a 'target' field.  For 3.5, this is an editable command 
line.  I tested that adding "-t %USERPROFILE%" changes the Shell title 
accordingly.  Steve has already change the installed icon.  

Users could copy the icon and add a subdirectory, such as 'python', where they 
put python code.  I presume users on other systems could do the equivalent, so 
the benefit of this is not limited to Windows.

For prior Python versions, the Shortcut 'target' is a read-only grayed-out 
'Python x.y.z (nn bits)'.  I do not know how this is resolved to running IDLE 
with the specified binary, but it likely would not be easy to change to the 3.5 
editable field version (and not create other problems in the process). So I 
will not even ask MVL, the previous Windows installer maintainer, to do that.

idlelib/idle.bat was added to get around the inability to edit this field. (ADD 
DOC for this.)  So the new startup option could be used by Windows users to 
start older IDLEs in their home directory.

--
nosy: +steve.dower
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



[issue25509] PyImport_ImportModule inaccurately described

2015-10-31 Thread Memeplex

Memeplex added the comment:

Brett, I'm not sure about that, notice that the "import hook" as is mentioned 
in the docs is just the current __import__ in the builtins module (which could 
have been replaced and in this sense would be a "hook") but not proper import 
hooks. I think the original distinction between PyImport_ImportModule and 
PyImport_Import is still sensible today. Originally PyImport_ImportModule 
directly called the import machinery, while PyImport_Import called it 
indirectly through builtins.__import__ (which could have been replaced). Now, 
for some reason, for good or for bad, PyImport_ImportModule also goes through 
builtins.__import__. The documentation is wrong but what is the fix? Revert 
PyImport_ImportModule or redocument it?

--

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-10-31 Thread Cyd Haselton

Cyd Haselton added the comment:

Unfortunately, in spite of the other minor issues that resolved,I am still 
getting a bus error when the hash test runs.

Before I dive back into trying to get gdb working to debug this, is there any 
way to skip this test to see of the others run?

--

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Steve, I am adding you as nosy on #22121, which is now about adding a new 
startup option.

--

___
Python tracker 

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



[issue25439] Add type checks to urllib.request.Request

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

This illustrates my concern with the dict-of-bytes check:

>>> headers = {"Content-Length": "3"}
>>> byteslike_iterable = {memoryview(b"123"): None}
>>> urlopen(Request("http://python.org/";, headers=headers, 
>>> data=byteslike_iterable))

With the current patch I think this would become an error. But maybe I am being 
too nitpicky and paranoid. Ezio?

--

___
Python tracker 

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



[issue25439] Add type checks to urllib.request.Request

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

The bytes-like thing applies equally well to both the direct and iterable 
cases. Your first attempt hangs because the client only sends the four bytes in 
b"post", but the server is waiting for a total of 10 bytes.

The SSL problem doesn’t show up unless you use more obscure types like ctypes 
or array.array, where len() does not work as expected. Here is a demo:

>>> import ctypes
>>> byteslike = ctypes.c_char(b"x")
>>> urlopen("http://python.org/";, data=byteslike)  # Succeeds

>>> urlopen("https://python.org/";, data=byteslike)
  File "/usr/lib/python3.4/ssl.py", line 720, in sendall
amount = len(data)
TypeError: object of type 'c_char' has no len()

During handling of the above exception, another exception occurred:

TypeError: data should be a bytes-like object or an iterable, got 

--

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

I propose rejecting this one, in favour of the caller adding their own “Accept: 
*/*” (or more preferably, “Accept: application/json”) header. What do you 
think, Raymond or Senthil?

--

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, the "chained memoryviews" in ctypes are a hack and it will be eliminated. 
But this hack exposed possible weak point in memoryview.

--

___
Python tracker 

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



[issue25194] Opt-in motivations & affiliations page for core contributors

2015-10-31 Thread Nick Coghlan

Nick Coghlan added the comment:

One other note: I've only linked to OpenHub, and not GitHub, as I don't know 
how to get a "last 12 months" statistics link for GitHub, instead of either a 
fixed date range or the entire commit history.

--

___
Python tracker 

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



[issue25194] Opt-in motivations & affiliations page for core contributors

2015-10-31 Thread Nick Coghlan

Nick Coghlan added the comment:

New patch attached that revises the preamble to include an explicit goals 
section that links out to the issue tracker stats page that demonstrates that 
we have a problem with a lack of core reviewer time.

Much of the rest of that section has been moved up from its former location in 
the "Limitations" section, but some of it is new (in particular, the paragraph 
specifically encouraging people to look for ways to spend work time on 
mentoring new contributors).

The preamble is already really long (and I'm definitely open to suggestions for 
making it shorter), so I *didn't* try to include an explanation of how the 
inequitable distribution of free time means that getting more paid involvement 
in core development should also help improve the diversity of the core reviewer 
list. The gist is that as more opportunities exist to pursue CPython 
development as a paid activity (even if it's only one part of a larger job), 
then that helps remove "has lots of spare time for volunteer software 
development" as a gating criterion for becoming a core reviewer.

I'll ping the folks I was talking to off list to see if they'd like to comment 
here, or otherwise provide feedback on the new draft.

--
Added file: 
http://bugs.python.org/file40914/motivations-preamble-with-goals.diff

___
Python tracker 

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



[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread STINNER Victor

STINNER Victor added the comment:

"Victor, is there a reason this issue is still open?  Is it because of the 
warnings question?  Maybe that should be a new issue?"

I just merged from Github to CPython. I don't know if something remains to do 
in this issue.

--

___
Python tracker 

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



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread John Hagen

John Hagen added the comment:

First time trying to contribute to the Python standard library.

I attached a patch that is modeled off the deprecated imp module.  The 
DeprecationWarning message is taken from the Python docs: 
https://docs.python.org/3/library/optparse.html

--
keywords: +patch
Added file: http://bugs.python.org/file40913/optparse_deprecationwarning.patch

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Did you forget your patch? :)

--
nosy: +martin.panter

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Stefan Krah

Stefan Krah added the comment:

The "chained memoryviews" you refer to are a hack and simply
aren't supported. Please stop spreading FUD.

--

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-31 Thread Steve Dower

Changes by Steve Dower :


--
stage: needs patch -> 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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-31 Thread Steve Dower

Steve Dower added the comment:

I've fixed the shortcuts. Let me know if you add any extra command line options 
to Idle for setting a more useful start directory and I can add those to the 
shortcuts as well.

--
resolution:  -> fixed

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset df12c29882b1 by Steve Dower in branch '3.5':
Issue #25450: Updates shortcuts to start Python in installation directory.
https://hg.python.org/cpython/rev/df12c29882b1

--
nosy: +python-dev

___
Python tracker 

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



[issue25525] Deallocation scheme for memoryview is unsafe

2015-10-31 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Deallocation scheme for memoryview is complex and unsafe. It crashes with 
chained memoryviews (issue25498), but I suppose deallocating unchained 
memoryview can crash too if the memoryview itself had exported buffers 
(self->exports != 0).

Both memoryview and ManagedBuffer support garbage collector. If there is a 
reference to memoryview from reference loop, memoryview becomes a part of the 
reference loop.

refloop -> memoryview -> ManagedBuffer -> obj

First garbage collector calls tp_clear for all objects in the loop 
(memory_clear() for memoryview).
If self->exports != 0 for memoryview, _memory_release() fails and the 
_Py_MEMORYVIEW_RELEASED flag is not set. However following Py_CLEAR(self->mbuf) 
deallocates ManagedBuffer and set self->mbuf to NULL. Then memoryview's owner 
releases memoryview, and it is deallocated (memory_dealloc). _memory_release 
reads self->mbuf->exports, but self->mbuf is NULL. Segmentation fault.

Following patch makes deallocation scheme for memoryview simpler and more 
reliable.

1) memory_clear does nothing if self->exports != 0. The buffer will be released 
when memoryview's owner release the memoryview.

2) ManagedBuffer no longer supports garbage collector. This prevents buffer 
releasing before memoryview or its owner are cleared.

--
components: Interpreter Core
messages: 253803
nosy: serhiy.storchaka, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: Deallocation scheme for memoryview is unsafe
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25439] Add type checks to urllib.request.Request

2015-10-31 Thread Nan Wu

Nan Wu added the comment:

Martin: Sorry for missing that line.

Under https, byte iterable seems has not been supported:
>>> r = Request('https://www.python.org', {b'post': 'data'}, 
>>> {'Content-Length':10})
>>> urlopen(r)

... hanging here...

Meanwhile, I assumed bytearray works as expected.
>>> r = Request('https://www.python.org', bytearray('post=data', 'utf-8'))
>>> urlopen(r)


urllib.error.HTTPError: HTTP Error 403: FORBIDDEN

In *4.patch, I updated Request class doc to add these observations and fixed 
issues appeared in last patch.

--
Added file: 
http://bugs.python.org/file40912/urllib_request_param_type_check_4.patch

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I rather inclined to commit eryksun's patch.

--

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-10-31 Thread Cyd Haselton

Cyd Haselton added the comment:

UPDATE: Finslly rebuilding Python from github clone after having to factory 
reset my tablet for reasons (root access).  Hopefully build and tests will 
benefit from paving and starting over.

--

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-31 Thread desbma

desbma added the comment:

Here is an updated patch that takes into account Martin's suggestions, both 
here and in the code review.

--
Added file: http://bugs.python.org/file40911/issue25156_v3.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-31 Thread Stefan Krah

Stefan Krah added the comment:

Florin, thanks for the explanation.  I'd suggest to wait until
the mpx support is stable in gcc.

Some security features in gcc never take off (-ftrapv is broken,
libmudflap is deprecated, ...) so it would be nice to have some
reassurance.

--

___
Python tracker 

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



[issue13828] Further improve casefold documentation

2015-10-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> In addition to lowercasing, this function also expands ligatures, for 
> example, "fi" becomes "fi".

+1 I would have found that sentence to be helpful.

--
nosy: +rhettinger

___
Python tracker 

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



[issue15994] memoryview to freed memory can cause segfault

2015-10-31 Thread Stefan Krah

Stefan Krah added the comment:

> But I think there should be some way of guaranteeing that a memoryview will 
> not try to access memory which has already been freed.

Unless the "buffered *self" parameter in _buffered_raw_read() is
made a full PEP-3118 exporter, I'm not sure how it would be possible
to prevent all examples of this kind.

--
nosy: +skrah

___
Python tracker 

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



[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

Ah, I thought Victor was saying he'd done the unit test; I guess he just meant 
he'd done the merge.

--
stage:  -> needs patch

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

Yes, those deletions are intentional, they make the English read better (to me 
as a native speaker, at least :)  As Emanuel said, the SMTP thing comes from 
reading it as an acronym, which is how I generally do it, and I suppose most 
people do.  Given how thorough Martin has been here, I'm guessing this was the 
one place that an wasn't used :)

This all looks good to me, except that I would rewrite

  and an isfile and isdir check on it

as

  and isfile and isdir checks on it

Agree with Serhiy's caveat about decimaltestdata.  Adding Mark to nosy to 
double check, but I don't think that file should be changed.

--

___
Python tracker 

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



[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread Guido van Rossum

Guido van Rossum added the comment:

Well, the warning points to a deeper issue -- the fix doesn't work for TLS
connections. Also, the upstream issue (
https://github.com/python/asyncio/issues/251) is still open because there's
no test for this behavior.

--

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Emanuel Barry

Emanuel Barry added the comment:

> In Doc/library/smtplib.rst "a" is replaced to "an" before a word starting 
> with consonant: SMTP. Is it correct?

One of the peculiriarities of the English language is that, in front of 
acronyms, you have two different ways to decided which to use between "a" and 
"an" - first (and probably what you thought), is to think of what the acronym 
means (or which letter it begins with). The other way, which Martin probably 
used, is to use what would sound be if it was said out loud, and "An 
ess-emm-tee-pee" sounds better overall.

In other words, both work, and it's down to personal preference. However, if we 
decide to use "an" here for this reason, it should (IMO) remain consistent 
across all of the documentation. I've only briefly looked over the patch as I 
have to head out soon, but I wanted to make this point anyway.

--
nosy: +ebarry

___
Python tracker 

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



[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

Well, asyncio was still provisional, so annoyances like this were bound to 
happen occasionally.

Victor, is there a reason this issue is still open?  Is it because of the 
warnings question?  Maybe that should be a new issue?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

I'm not at all sure this is worth the maintenance burden at this point in time. 
 So let's say I'm -0.5.  I agree that a review and opinion by someone more 
familiar with the API would be best.  I'm adding gps as nosy since this feels 
like the kind of performance improvement he might find interesting, so if he 
thinks it is worth it I'll change my vote :)

--
nosy: +gps

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-31 Thread Stefan Krah

Stefan Krah added the comment:

The current hack isn't necessary. I didn't review eryksun's patch
in depth, but on the surface it looks good.

I don't think the other issues you mentioned are closely related:
The cause here is that the obj fields of both the second memoryview
and the second mbuf are manually set to the address of the first
memoryview, which plays havoc with the rather complex deallocation
scheme.

I've opened #25524 in order to make it easier to create views
with detailed request flags.



As a practical matter, I think we should just revert the ctypes
change for 3.4 and 3.5 (after verifying a second time that
PyObject_AsWriteBuffer() is exactly the same as in 3.4.0).


Then we use the new function from #25524 for 3.6, which should
alleviate concerns about writablility (not all extension writers
read the docs:) etc.

--

___
Python tracker 

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



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

Whether someone decided not to do it originally or not, it is probably a good 
idea to do it (as a DeprecationWarning, IMO), if someone wants to propose a 
patch.  The module isn't receiving maintenance any longer.  (Not that it 
couldn't, but no one is motivated to do so.)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25524] Add PyMemoryView_FromObjectWithFlags()

2015-10-31 Thread Stefan Krah

Changes by Stefan Krah :


--
assignee:  -> skrah

___
Python tracker 

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



[issue25524] Add PyMemoryView_FromObjectWithFlags()

2015-10-31 Thread Stefan Krah

New submission from Stefan Krah:

See for example #25498.

--
messages: 253787
nosy: skrah
priority: normal
severity: normal
status: open
title: Add PyMemoryView_FromObjectWithFlags()
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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I suppose that changes was generated by a script. But some changes looks not 
satisfying a simple rule.

In Doc/library/multiprocessing.rst, Doc/library/socket.rst, 
Doc/whatsnew/3.2.rst, Misc/HISTORY, Modules/_hashopenssl.c "a" is just deleted. 
Is it deliberately?

In Doc/library/smtplib.rst "a" is replaced to "an" before a word starting with 
consonant: SMTP. Is it correct?

Aren't files in Lib/test/decimaltestdata/ imported from external source? Then 
we shouldn't change them.

The rest of changes LGTM, but I'm not sure about mentioned above.

--
nosy: +r.david.murray, serhiy.storchaka

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Rebased so it should be reviewable

--
Added file: http://bugs.python.org/file40910/a-an.patch

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Martin Panter

Changes by Martin Panter :


Removed file: http://bugs.python.org/file40909/a-an.patch

___
Python tracker 

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



[issue25523] Correct "a" article to "an" article

2015-10-31 Thread Martin Panter

New submission from Martin Panter:

This patch generally changes “a” to “an” where appropriate in the main 
documentation, doc strings, source code comments, and a couple error messages 
in the test suite. Since it touches so many files, I thought it would be good 
to get a quick review.

--
assignee: docs@python
components: Documentation
files: a-an.patch
keywords: patch
messages: 253784
nosy: docs@python, martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Correct "a" article to "an" article
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40909/a-an.patch

___
Python tracker 

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



[issue25415] I can create instances of io.IOBase

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

If existing subclasses like FileIO call the base, that is an implementation 
detail. But custom subclasses of the Raw, Buffered, and Text base classes 
should not be prohibited from chain calling the base’s __init__() method, nor 
should they have to override __init__() if there is no special initialization 
to be done. For IOBase itself, I don’t see a strong argument either way, but it 
makes sense to keep it consistent with the other three base classes.

I propose this patch, which changes “There is no public constructor” to “The 
constructor accepts no arguments”. In my mind this blesses making custom 
subclasses, which already seems to be tested and used in practice.

--
keywords: +patch
stage:  -> patch review
versions: +Python 2.7, Python 3.4, Python 3.6
Added file: http://bugs.python.org/file40908/no-args.patch

___
Python tracker 

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



[issue24539] StreamReaderProtocol.eof_received() should return True to keep the transport open

2015-10-31 Thread Aymeric Augustin

Aymeric Augustin added the comment:

This change appears to have caused a non-obvious regression in `websockets`: 
https://github.com/aaugustin/websockets/issues/76

Perhaps I was relying on an implementation detail but that's annoying 
nonetheless.

--
nosy: +aymeric.augustin

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Also, man pages for Free BSD and OS X (where writing to a disk file is not 
supported) say it raises:

* ENOTSUP if “the ‘fd’ argument does not refer to a regular file”
* EBADF if “the ‘s’ argument is not a valid socket descriptor”
* ENOTSOCK if “the ‘s’ argument is not a socket”
* EOPNOTSUPP if “the file system for descriptor fd does not support sendfile()”

It is not clear what the priority of these errors is, so it might be safest to 
catch them all. But I wouldn’t catch any arbitrary OSError, because you may end 
up doing weird double copying or something for an out-of-space error.

--

___
Python tracker 

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



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Under  it 
says “Importing optparse will issue a PendingDeprecationWarning” (not 
DeprecationWarning!), however even this does not appear to be the case. Maybe 
somebody forgot to do this, or maybe somebody decided not to do this; I dunno.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

I left a few comments. But it might be good if someone more familiar with the 
APIs could review this.

Have you seen the socket.sendfile() implementation? It’s a bit of a mess, and 
the circumstances are slightly different, but it may offer partial inspiration. 
It seems a shame to have two separate high-level sendfile() wrappers, but I 
guess the use cases are just a little too far apart to be worth sharing much 
code.

For the test case, it may be worth skipping the test if you run out of disk 
space. Similar to test_mmap and test_largefile.

--

___
Python tracker 

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