[issue21308] PEP 466: backport ssl changes

2014-07-24 Thread Alex Gaynor

Alex Gaynor added the comment:

The attached patch (drafted by myself, and David Reid) backports all of the SSL 
module (and tests!!!) to Python 2.7. All tests pass on my machine (OS X 10.9), 
I haven't tested against other platforms.

I /suspect/ the best way to review this patch will be by looking at the diff 
between this patch, and the master branch, in the Lib/ssl.py, 
Doc/Library/ssl.html, and Modules/_ssl.c files, but of course feel free to 
review however you like :-)

You can see the complete branch history at: 
https://github.com/alex/cpython/commits/backport-ssl

For this to work you must apply the patch from 
http://bugs.python.org/issue22023 first.

--
components: +Extension Modules, Library (Lib)
keywords: +needs review, patch, security_issue
Added file: http://bugs.python.org/file36075/ssl-backport.diff

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



[issue17483] Can not tell urlopen not to check the hostname for https connections.

2014-07-24 Thread Alecz

Alecz added the comment:

If this request was rejected shouldn't the Resolution be something such as 
Rejected, Not a Bug, or Wont fix?

At the first glance, I believe it is very misleading to see this as fixed.
I even installed the latest version and was surprised to see that the fix did 
not work as expected.

--

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread STINNER Victor

STINNER Victor added the comment:

 Sorry, why restrict it to sockets on Windows?
 If someone wants to pass e.g. a pipe, why prevent it?

Pipes cannot be configured in non-blocking mode on Windows. It sounds dangerous 
to call a blocking syscall in a signal handler.

In fact, it works to write the signal number into a pipe on Windows, but I'm 
worried about the blocking behaviour.

--

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



[issue21308] PEP 466: backport ssl changes

2014-07-24 Thread Ian Cordasco

Changes by Ian Cordasco graffatcolmin...@gmail.com:


--
nosy: +icordasc

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



[issue13533] Would like Py_Initialize to play friendly with host app

2014-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +ncoghlan

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 In fact, it works to write the signal number into a pipe on Windows, but I'm 
 worried about the blocking behaviour.

It wasn't different before, so I'm not sure why we should start to worry about 
it?

--

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



[issue22061] turtledemo doesn't launch due to changes in tkinter

2014-07-24 Thread Lita Cho

New submission from Lita Cho:

I updated my source code, and it looks like turtledemo doesn't launch anymore. 
I get the following error:

Traceback (most recent call last):
  File /Users/litacho/Development/cpython/Lib/runpy.py, line 170, in 
_run_module_as_main
__main__, mod_spec)
  File /Users/litacho/Development/cpython/Lib/runpy.py, line 85, in _run_code
exec(code, run_globals)
  File /Users/litacho/Development/cpython/Lib/turtledemo/__main__.py, line 
328, in module
main()
  File /Users/litacho/Development/cpython/Lib/turtledemo/__main__.py, line 
324, in main
demo = DemoWindow()
  File /Users/litacho/Development/cpython/Lib/turtledemo/__main__.py, line 
124, in __init__
self.mBar.tk_menuBar(self.ExamplesBtn, self.OptionsBtn)
AttributeError: 'Frame' object has no attribute 'tk_menuBar'

I dug into it and it looks like tk_menuBar was removed due to a fix in 
issue4350. If tk_menuBar needs to be removed, what method does turtledemo need 
to call instead to propagate its panels?

--
messages: 223899
nosy: Lita.Cho, jesstess, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: turtledemo doesn't launch due to changes in tkinter
type: crash
versions: Python 3.4, Python 3.5

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



[issue9882] abspath from directory

2014-07-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Posted today on python-ideas with the mistaken title os.path.argparse - 
optional startdir argument by Wolfgang Maier (wolma). (He corrected in a 
second post, but too late.)  Juancarlo Añez pointed to pathlib.Path.resolve as 
a better alternative. Path joins and resolve combines the functions of 
os.path.abspath and os.path.normpath with a nicer syntax, and with OS awareness.

 p.Path('../../../Python27/lib', 'ast.py').resolve()
WindowsPath('C:/Programs/Python27/Lib/ast.py')

If one starts with a base Path, one can use '/' to join.

 base = p.Path('.')
 (base / '../../../Python27/lib' / 'ast.py').resolve()
WindowsPath('C:/Programs/Python27/Lib/ast.py')

In light of the above, I agree with Serhiy that this issue should be closed 
unless there is a surge of approval for the proposal.

--
nosy: +terry.reedy
status: pending - open
versions: +Python 3.5 -Python 3.2

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



[issue22061] turtledemo doesn't launch due to changes in tkinter

2014-07-24 Thread Lita Cho

Lita Cho added the comment:

Looks like this method was not doing anything. I removed it and the demo is 
working just fine. Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file36076/tk_menubar_fix.patch

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2014-07-24 Thread Terry J. Reedy

New submission from Terry J. Reedy:

1. The pattern argument for .(r)glob must be relative. I think the docstrings 
and doc should say so. /pattern/relative pattern/

For rglob: '''This is like calling glob() with “**” added in front of the given 
pattern:'''

2. Currently glob() links to the glob module, which does not recognize '**'. 
It should link to back up to the Pathlib.glob entry, where the effect of '**' 
is defined. (I don't currently know the markup for that.)

3. I interpret '''“**” added in front of the given pattern:''' to mean '**' + 
pattern, so that '*.py' would become '***.py'. It actually becomes the 
equivalent of '**/*.p'. So I think '**' should be either '**/' or 'a ** 
component'.

--
messages: 223902
nosy: pitrou, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Fix pathlib.Path.(r)glob doc glitches.
type: behavior
versions: Python 3.4, Python 3.5

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2014-07-24 Thread R. David Murray

R. David Murray added the comment:

Do non-relative patterns even make sense?  I was surprised to get a 
NotImplementedError instead of a ValueError.

--
nosy: +r.david.murray

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



[issue13533] Would like Py_Initialize to play friendly with host app

2014-07-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Changing this isn't really feasible with the current design of the 
initialisation code - we call Py_FatalError in various places because we don't 
have the infrastructure set up to do anything else.

PEP 432 should help (and the basic design there still seems sound), since we'll 
have the core interpreter up and running much earlier, and hence be able to 
make use of the non-fatal exception machinery. However, it would still mean 
carefully reviewing everywhere we call Py_FatalError and ensuring there's an 
error returning path back up to the embedding application.

Unfortunately, I don't know when I'm going to find time to get back to that, 
and the startup process is sufficiently arcane that it wouldn't be a quick 
process for someone else to come up to speed on the current state of the draft 
implementation :(

--

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-24 Thread Lita Cho

Lita Cho added the comment:

Here is an updated version of the patch now that Terry submitted the changes 
from issue21597.

--
Added file: http://bugs.python.org/file36077/window_pane_font_size_v3.patch

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread STINNER Victor

STINNER Victor added the comment:

 In fact, it works to write the signal number into a pipe on Windows, but I'm 
 worried about the blocking behaviour.

 It wasn't different before, so I'm not sure why we should start to worry 
 about it?

Does you have an idea if set_wakeup_fd() is used on Windows? It's not possible 
to use it with select.select() because on Windows this function only accepts 
sockets. I don't know if it's possible to watch a pipe using IOCP. Is 
set_wakeup_fd() used by Twisted, Tornado or another project on Windows?

I would like to modify signal.set_wakeup_fd() to make the file descriptor (or 
socket) non-blocking: see issue #22042. I proposed this change to protect the 
user against misuse of the API, and to make the API more convinient. asyncore 
and asyncio modules also make files and sockets non-blocking: 
asyncore.dispatcher(sock) and asyncio.BaseEventLoop.connect_read_pipe() for 
example.

Oh, by the way, sock_xxx() methods of asyncio.BaseEventLoop don't make the 
socket non-blocking, and the documentation doesn't require that sockets are 
already set to non-blocking mode. It looks like a bug (at least in the 
documentation).

--

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



[issue22003] BytesIO copy-on-write

2014-07-24 Thread David Wilson

David Wilson added the comment:

This new patch abandons the buffer interface and specializes for Bytes per the 
comments on this issue.

Anyone care to glance at least at the general structure?

Tests could probably use a little more work.

Microbenchmark seems fine, at least for construction. It doesn't seem likely 
this patch would introduce severe performance troubles elsewhere, but I'd like 
to trying it out with some example heavy BytesIO consumers (any suggestions? 
Some popular template engine?)

cpython] ./python.exe -m timeit -s 'import i' 'i.readlines()'
lines: 54471
100 loops, best of 3: 13.3 msec per loop

[23:52:55 eldil!58 cpython] ./python-nocow -m timeit -s 'import i' 
'i.readlines()'
lines: 54471
10 loops, best of 3: 19.6 msec per loop

[23:52:59 eldil!59 cpython] cat i.py
import io
word = b'word'
line = (word * int(79/len(word))) + b'\n'
ar = line * int((4 * 1048576) / len(line))
def readlines():
return len(list(io.BytesIO(ar)))
print('lines: %s' % (readlines(),))

--
Added file: http://bugs.python.org/file36078/cow5.patch

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5ce01ee2a8f4 by Victor Stinner in branch 'default':
Issue #22018: Fix test_set_wakeup_fd_result(), use assertEqual() not
http://hg.python.org/cpython/rev/5ce01ee2a8f4

--

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



[issue22063] asyncio: sock_xxx() methods of event loops should make the socket non-blocking

2014-07-24 Thread STINNER Victor

New submission from STINNER Victor:

The sock_xxx() methods of asyncio.BaseEventLoop don't make the socket 
non-blocking, and the documentation doesn't require that sockets are already 
set to non-blocking mode.

It looks like a bug, at least in the documentation.

If these methods should make the sockets non-blocking, should they also restore 
the previous timeout (blocking mode) at exit? 
ssl.SSLSocket.do_handshake(block=True) makes temporary the socket blocking, and 
then restore the previous timeout.

--
components: asyncio
messages: 223909
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: sock_xxx() methods of event loops should make the socket 
non-blocking
versions: Python 3.4, Python 3.5

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



[issue22041] http POST request with python 3.3 through web proxy

2014-07-24 Thread Demian Brecht

Demian Brecht added the comment:

Attached a new patch with with a simple test.

--
Added file: http://bugs.python.org/file36079/issue22041_1.patch

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread STINNER Victor

STINNER Victor added the comment:

 Does you have an idea if set_wakeup_fd() is used on Windows? It's not 
 possible to use it with select.select() because on Windows this function only 
 accepts sockets. I don't know if it's possible to watch a pipe using IOCP. Is 
 set_wakeup_fd() used by Twisted, Tornado or another project on Windows?

I checked Twisted: signal.set_wakeup_fd() is only used on POSIX, as
expected (since it doesn't work with select on Windows). But Twisted
sets a signal handler for SIGINT, SIGTERM and SIGBREAK.

--

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



[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2014-07-24 Thread wjssz

wjssz added the comment:

Feel free to modify this patch.

--
Added file: http://bugs.python.org/file36080/nonbmp_except_check.patch

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



[issue17172] Add turtledemo to IDLE menu

2014-07-24 Thread Lita Cho

Lita Cho added the comment:

Here is a new patch where it checks to see if turtledemo exists first before 
loading it onto the bindings.

--
Added file: http://bugs.python.org/file36081/turtle_demo_v2.patch

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



[issue22063] asyncio: sock_xxx() methods of event loops should make the socket non-blocking

2014-07-24 Thread Guido van Rossum

Guido van Rossum added the comment:

PEP 3156 is clear: The socket argument has to be a non-blocking socket.  So 
it's a documentation issue.

--

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



[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2014-07-24 Thread wjssz

wjssz added the comment:

nonbmp_except_check_v2.patch changes character numbers to 0-based, same as IDLE.

Quote from www.tkdocs.com :
for historical conventions related to how programmers normally refer to lines 
and characters, line numbers are 1-based, and character numbers are 0-based.

--
Added file: http://bugs.python.org/file36082/nonbmp_except_check_v2.patch

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



[issue22049] argparse: type=callable doesn't honor nargs 1

2014-07-24 Thread paul j3

paul j3 added the comment:

Note that 

'-t 1 2 3'.split()

becomes

['-t', '1', '2', '3']

Your 'type' function sees those 3 strings individually.  Try printing 'string' 
the first thing in your function to see what we mean.

--
nosy: +paul.j3

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



[issue22047] argparse improperly prints mutually exclusive options when they are in a group

2014-07-24 Thread paul j3

paul j3 added the comment:

That's an artifact of how the group usage is formatted (which isn't very 
robust).  It's not designed to handle nested groups.  

Mutually exclusive groups aren't meant to nest inside other mutually exclusive 
groups.  While it possible, it doesn't help you.  Effectively the arguments 
combined into one larger group.

See http://bugs.python.org/issue11588 for discussion on how nested groups might 
be implemented, and the difficulties in properly formatting their usage.

http://bugs.python.org/issue10984 has a more robust mutually exclusive group 
formatter, but even that is not designed for nesting.

--
nosy: +paul.j3

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



[issue22061] turtledemo doesn't launch due to changes in tkinter

2014-07-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed, unlike to other removed methods which raised an exception, removing 
this doing nothing method can break existing code. We should restore it and add 
deprecation warning.

Of course the use of obsolete method should be removed from turtledemo.

--
components: +Tkinter
stage:  - patch review
type: crash - behavior
Added file: http://bugs.python.org/file36083/tkinter_restore_empty_methods.patch

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



<    1   2