[issue26585] Use html.escape to replace _quote_html in http.server

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

I left a couple notes on minor style nits (which I can fix when I commit this). 
But perhaps we should fix the business with tempdir_name and absolute URL paths 
(Issue 26609) first.

--
dependencies: +Wrong request target in test_httpservers.py

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b29edd0108ee by Martin Panter in branch '3.5':
Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric Price
https://hg.python.org/cpython/rev/b29edd0108ee

New changeset 41c2f8742bfe by Martin Panter in branch 'default':
Issue #23735: Merge Readline resize handling from 3.5
https://hg.python.org/cpython/rev/41c2f8742bfe

New changeset 9f237e81cd15 by Martin Panter in branch '2.7':
Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric Price
https://hg.python.org/cpython/rev/9f237e81cd15

--
nosy: +python-dev

___
Python tracker 

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



[issue25951] SSLSocket.sendall() does not return None on success like socket.sendall()

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

I made some simple tweaks to avoid long lines.

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



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

I didn’t touch 2.7 because that doesn’t have the same header parsing code as 
Python 3.

--
resolution:  -> fixed
stage: commit 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



[issue25951] SSLSocket.sendall() does not return None on success like socket.sendall()

2016-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 92947704321c by Martin Panter in branch 'default':
Issue #25951: Fix SSLSocket.sendall() to return None, by Aviv Palivoda
https://hg.python.org/cpython/rev/92947704321c

--
nosy: +python-dev

___
Python tracker 

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



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f5247195238f by Martin Panter in branch '3.5':
Issue #26586: Handle excessive header fields in http.server, by Xiang Zhang
https://hg.python.org/cpython/rev/f5247195238f

New changeset e8edddb4f74b by Martin Panter in branch 'default':
Issue #26586: Merge excessive HTTP header handling from 3.5
https://hg.python.org/cpython/rev/e8edddb4f74b

New changeset 1b696c744559 by Martin Panter in branch 'default':
Issue #26586: Simple enhancements to BaseHTTPRequestHandler by Xiang Zhang
https://hg.python.org/cpython/rev/1b696c744559

--
nosy: +python-dev

___
Python tracker 

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



[issue26689] Add `has_flag` method to `distutils.CCompiler`

2016-04-02 Thread Sylvain Corlay

Sylvain Corlay added the comment:

I attached a patch for ccompiler.py adding the new `has_flag` method.

--
keywords: +patch
Added file: http://bugs.python.org/file42358/has_flag.diff

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

I’m not super familiar with argparse, but to get a Path or FilePath object, 
can’t you use that directly instead of argparse’s FileType class?

The proposal would conflict with escaping a literal tilde (~) in the shell. It 
would make it harder for the end user to specify a real file name that starts 
with a tilde.

--
status: open -> closed

___
Python tracker 

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



[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

Regarding the trailing slash: this is certainly inconsistent, but one call site 
of translate_path() appears to depend on this being a forward slash. There 
seems to be confusion about whether the output is an OS path or a URL. I think 
this is just more thing to look at in a hypothetical future overhaul of path 
and URL handling (e.g. see Zhang’s links above).

--

___
Python tracker 

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



[issue26689] Add `has_flag` method to `distutils.CCompiler`

2016-04-02 Thread Sylvain Corlay

New submission from Sylvain Corlay:

I would be very useful to have a `has_flag` method in `distutils.CCompiler` 
similar to `has_function`, allowing to check if the compiler supports certain 
flags.

Cmake has a `CHECK_CXX_COMPILER_FLAG` macro for that purpose, which checks if a 
simple C++ file compiles with the said flag.

--
components: Distutils
messages: 262805
nosy: dstufft, eric.araujo, sylvain.corlay
priority: normal
severity: normal
status: open
title: Add `has_flag` method to `distutils.CCompiler`
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, 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



[issue26678] Incorrect linking to elements in datetime package

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

That’s good news. I did not expect it, but I seem to have fixed the problem 
anyway.

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



[issue26609] Wrong request target in test_httpservers.py

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

Perhaps tempdir_name could get the slash prefixed in setUp() rather than in 
every test. There is one case that creates index.html which could probably be 
changed to use self.tempdir, and then the rest could be renamed to say 
self.base_url.

Rejecting requests that do not start with a slash could be a compatibility 
problem. Do you think potential security benefits (i.e. having unexpected 
variations on the format of the URL) outweigh that?

Either way, it would be good to retain a test without a slash.

--
stage:  -> patch review

___
Python tracker 

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



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

I propose to commit the “Too many headers” handler as a bug fix, and the other 
changes to only 3.6. Currently when more than 100 header fields are sent, the 
connection is killed and the server logs an unhandled exception.

--
stage: patch review -> commit review
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue1346874] httplib simply ignores CONTINUE

2016-04-02 Thread Martin Panter

Martin Panter added the comment:

Patrick, can you elaborate on the problem with Apache and renegotiation? How 
does the 100-continue request, or anticipating the 100 response, help? Perhaps 
Issue 25919 is relevant in this case, where we want the client to receive an 
error response before the request data is completely sent.

--

___
Python tracker 

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



[issue25987] collections.abc.Reversible

2016-04-02 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I was not sure whether Andrew is still interested. I made a simple-minded patch 
following his proposal. I also added tests and changed docs accordingly. Note 
that I also changed the expected MRO for MutableSequence in one of the 
functools tests according to the new hierarchy (otherwise test_functools fails).

Please review.

PS: Some tests was skipped on my machine, here is the list:
test_bz2 test_curses test_dbm_gnu test_dbm_ndbm test_devpoll
test_idle test_kqueue test_lzma test_msilib test_ossaudiodev
test_smtpnet test_socketserver test_ssl test_startfile test_tcl
test_timeout test_tix test_tk test_ttk_guionly test_ttk_textonly
test_urllib2net test_urllibnet test_winreg test_winsound
test_xmlrpc_net test_zipfile64

--
keywords: +patch
Added file: http://bugs.python.org/file42357/reversible.patch

___
Python tracker 

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



[issue22757] TclStackFree: incorrect freePtr. Call out of sequence?

2016-04-02 Thread Thomas Caswell

Thomas Caswell added the comment:

I do not think this got reported to mpl, is a year and a half old, and has no 
example, probably can be closed.

--
nosy: +tcaswell

___
Python tracker 

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



[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-02 Thread Steve Dower

Steve Dower added the comment:

Windows-only tests are fine, and certainly better than adding a new parameter 
just for testing.

Forward slashes are valid path segment separators on Windows 99% of the time, 
so that'll be why nobody has complained. Personally I prefer consistency, but 
not strongly enough to force a change here.

--

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-02 Thread wysaard

wysaard added the comment:

For some reason the freshly downloaded files have this problem too. If I remove 
my config-main.def and let my package manager get a new one it breaks again. I 
don't really know the implications of this; is this just a problem with my 
particular setup or does this mean that maybe the file in the package is 
invalid?

--

___
Python tracker 

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



[issue17436] hashlib: add a method to hash the content of a file

2016-04-02 Thread Aviv Palivoda

Aviv Palivoda added the comment:

> * hashobj.readfile(filename: str)
> * hashobj.readfileobj(file) where file is an object with a read() method 
> which returns bytes strings

I changed the API to the one Victor suggested.

> For readfile() it might make more sense to implement it directly in C and let 
> OpenSSL's BIO layer handle IO internally. It's more efficient and you can 
> release the GIL around the whole operation.

The readfile method use the openSSL BIO and releases the GIL around the all 
operation.

> I suggest to look at copyfile() and copyfileobj() functions of the shutil 
> module. For example, copyfileobj() has an optional parameter for the buffer 
> size. You should probably uses that to avoid complex heuristic to guess the 
> optimal buffer size.

Added a block_size optional argument to the readfileobj().

> In readfile(), you know that it's a regular file which exists on the file 
> system. So you can directly uses _Py_fstat() to get st_blksize

Currently using constant block size in readfile(). From the discussion in issue 
26488 I am not sure if this should be changed.

--
Added file: http://bugs.python.org/file42356/17436-2.patch

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-02 Thread Andy Maier

Andy Maier added the comment:

Martin,
I just noticed that your fix must already be active. My link to tzinfo now 
lands on the long description. So maybe it was not a user error of mine that 
resolved the problem with the two methods (I was pretty sure I had tried the 
same syntax I use now), but whatever did the trick in your change.

Anyway, thanks much for this quick turnaround!!

Andy

--

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-02 Thread Andy Maier

Andy Maier added the comment:

Martin, I can now link to the two methods e.g. via 
:meth:`py:datetime.tzinfo.utcoffset`, and it resolves nicely.

See here (linking to Python 2): 
https://pywbem.readthedocs.org/en/latest/#pywbem.MinutesFromUTC

Don't know why it now works, probably user error I would say.

Your change is still appreciated, and it would be great if it could also go 
into Python 2.7 :-) Hope I'm not asking for too much.

On Python build: hg config problem sounds like a good path. Thanks!

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-04-02 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Adding new patch after CR changes.

--
Added file: 
http://bugs.python.org/file42355/hashlib-script-mod-md5sum-style-5.patch

___
Python tracker 

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



[issue23371] mimetypes initialization fails on Windows because of TypeError

2016-04-02 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 22028 (fixed in 2.7 in 7c4c4e43c452).

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Python 3.4.1 Installer ended prematurely (Windows msi)

___
Python tracker 

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



[issue13952] mimetypes doesn't recognize .csv

2016-04-02 Thread Berker Peksag

Berker Peksag added the comment:

I will commit issue13952.patch this weekend to 2.7, 3.5 and default.

--
nosy: +berker.peksag
stage: needs patch -> patch review
versions:  -Python 3.2, 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