[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the patch for sha256. It got the same issue as sha1. After being 
clinic-ed, the constructor accepts None value happily.

--
Added file: http://bugs.python.org/file33401/clinic_sha256module.patch

___
Python tracker 

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



[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-09 Thread Ethan Furman

Ethan Furman added the comment:

Could somebody explain this?
===
ethan@media:~/source/python/issue19995_depr$ ./python -W error
Python 3.4.0b1 (default:2f81f0e331f6+, Jan  9 2014, 20:30:18) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '%x' % 3.14
oxX
no __index__
depracation is fatal
oxX
no __index__
depracation is fatal
Traceback (most recent call last):
  File "", line 1, in 
DeprecationWarning: automatic int conversions have been deprecated
>>> 
===
ethan@media:~/source/python/issue19995_depr$ ./python -W message
Invalid -W option ignored: invalid action: 'message'
Python 3.4.0b1 (default:2f81f0e331f6+, Jan  9 2014, 20:30:18) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '%x' % 3.14
oxX
no __index__
depracation not fatal, attempting __int__ conversion
conversion with __int__ successful
'3'
>>> 
===
ethan@media:~/source/python/issue19995_depr$ ./python -W once
Python 3.4.0b1 (default:2f81f0e331f6+, Jan  9 2014, 20:30:18) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '%x' % 3.14
oxX
no __index__
sys:1: DeprecationWarning: automatic int conversions have been deprecated
depracation not fatal, attempting __int__ conversion
conversion with __int__ successful
'3'
>>> 
===

As you can see, with the -W error option it seems to go through the routine 
twice; does that mean the the '1' in 'line 1' is being specified as a float?

--

___
Python tracker 

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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks, Larry.  Conversion proceeds apace in winreg.c, but I have a couple 
questions.

1) Since the comment above CConverter.format_unit says all custom converters 
should use 'O&' instead of defining format_unit, there must be another way to 
do this:

/*[python input]
class REGSAM_converter(CConverter):
type = 'REGSAM'
format_unit = 'i'
default = 0

def converter_init(self, *, key_name=""):
if key_name == "":
raise ValueError('must provide the key name')
self.doc_default = self.py_default = self.c_default = key_name
[python start generated code]*/

(see http://hg.python.org/sandbox/zware/rev/f0662bf33e65)

I don't know what the 'other way' is though :).  The above works, but I don't 
understand it completely and thus don't like it.  Also, it causes 
help(winreg.CreateKeyEx) to show "access='KEY_WRITE'" in the signature, when it 
should have no quotes (being a name).

2) Is there an easy way to give a function multiple names?  OpenKey and 
OpenKeyEx are the same function, OpenKeyEx has been just defined by an extra 
methoddef pointing at OpenKey; for now I've just modified that line to make 
things work.

Neither of these is blocking progress, so not a huge deal other than getting a 
little bit of review done early.

--

___
Python tracker 

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



[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

>Rule 1: Argument Clinic handles all argument parsing for you.  Your "impl" 
>function should never call PyArg_ParseTuple or PyArg_ParseTupleAndKeywords.

Ah, got it. Here is the third patch. Everything works fine except for the issue 
whether sha1 constructor should accept None value or not. Right now, after 
clinic, it accepts it. So _sha1.sha1() is same as _sha1.sha1(string=None).

--
Added file: http://bugs.python.org/file33400/clinic_sha1module_v3.patch

___
Python tracker 

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



[issue20200] Argument Clinic howto: custom self_converter example broken

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a8301002f5a by Zachary Ware in branch 'default':
Closes #20200: Argument Clinic custom converter example should be in a
http://hg.python.org/cpython/rev/5a8301002f5a

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

This is the current behaviour of sha1 constructor. It rejects None value.

>>> import _sha1
>>> _sha1.sha1()
<_sha1.sha1 object at 0x7f7fa7f0dea0>
>>> _sha1.sha1(None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object supporting the buffer API required
>>> _sha1.sha1(string=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object supporting the buffer API required

Then when I clinic it, what about the doc? This doesn't seem right.

+PyDoc_STRVAR(_sha1_SHA1_sha1__doc__,
+"sha1(string=None)\n"
 "Return a new SHA1 hash object; optionally initialized with a string.");

--

___
Python tracker 

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



[issue20216] Misleading docs for sha1, sha256, sha512, md5 modules

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Added md5 module to this ticket.

--
title: Misleading docs for sha1, sha256, sha512 modules -> Misleading docs for 
sha1, sha256, sha512, md5 modules
Added file: http://bugs.python.org/file33399/fix_doc_sha_module_v2.patch

___
Python tracker 

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



[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Right, it doesn't work because you left the PyArg_ParseTuple call in your impl 
function.  Remove that and it should work.

Rule 1: Argument Clinic handles all argument parsing for you.  Your "impl" 
function should never call PyArg_ParseTuple or PyArg_ParseTupleAndKeywords.
Rule 2: Never modify the output of Argument Clinic by hand.

--

___
Python tracker 

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



[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

But METH_O makes the update method does not work.

>>> _sha1.sha1().update(b'a')
Traceback (most recent call last):
  File "", line 1, in 
SystemError: new style getargs format but argument is not a tuple

But if you change METH_O to METH_VARARGS, it works again. I'll chip Christian 
Heimes. Maybe he has something to say about this.

Other than that, I need to update my patch because currently with my patch, the 
sha1 constructor accepts None value. The default behaviour is to reject None 
value. So I need to use advanced feature of clinic for this purpose.

I think I can convert all sha modules (including md5) in this weekend. However, 
_codecsmodule is totally different beast. 43 sites >.<

--
nosy: +christian.heimes

___
Python tracker 

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



[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I think the problem is that the API of dict.keys() is surprising.
> One gets back something that behaves like a list, the name 'keys'
> suggests that it is a list and for lists there is no requirement 
> that their containing items need to be hasheable.

The keys() method returns a view with set-like behavior (it supports union, 
intersection, difference, fast membership testing using hashed lookups, and 
iteration).

Guido modeled this behavior from a well established API in Java.

FWIW, it is hard for us to do anything about comments like "I was surprised 
..."   The language behaviors are documented but that doesn't help if the docs 
aren't read.  If you expected a list-like object but received a set-like 
object, then you would get surprised.  There is not much that can be done about 
that.

--
nosy: +rhettinger

___
Python tracker 

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



[issue20175] Derby #6: Convert 50 sites to Argument Clinic across 8 files

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Go for it!

That's weird.  Why can't I assign it to you?  Have you not signed and submitted 
a Python contributor agreement?

--
assignee:  -> kbk
nosy: +kbk

___
Python tracker 

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



[issue20175] Derby #6: Convert 50 sites to Argument Clinic across 8 files

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Oops, sorry kbk.

--
assignee: kbk -> 
nosy:  -kbk

___
Python tracker 

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



[issue20215] Python2.7 socketserver can not listen IPv6 address

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

The *default* is AF_INET.  If you are requesting a more convenient API than 
subclassing (which for IPV6 support I think would be a reasonable request), 
that would be a new feature.

--
nosy: +r.david.murray
type: behavior -> enhancement
versions: +Python 3.5 -Python 2.7

___
Python tracker 

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



[issue20216] Misleading docs for sha1, sha256, sha512 modules

2014-01-09 Thread Vajrasky Kok

New submission from Vajrasky Kok:

Misleading doc number 1:

>>> import _sha1
>>> _sha1.sha1.__doc__
'Return a new SHA1 hash object; optionally initialized with a string.'
>>> _sha1.sha1('cutecat')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Unicode-objects must be encoded before hashing
>>> _sha1.sha1(b'cutecat')
<_sha1.sha1 object at 0x7f800f669e00>
>>> _sha1.sha1(string=b'cutecat')
<_sha1.sha1 object at 0x7f800f669e00>

I don't think we can change the unfortunate keyword 'string'. But at least we 
must fix the doc.

Misleading doc number 2:

>>> import _sha1
>>> cutecat = _sha1.sha1(b'cutecat')
>>> cutecat.update.__doc__
"Update this hash object's state with the provided string."
>>> cutecat.update('bonobo')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Unicode-objects must be encoded before hashing
>>> cutecat.update(b'bonobo')

Misleading doc number 3:

>>> cutecat.hexdigest()
'a5fbd19140a72992224b2469c4f4d8d6d4aff3e7'
>>> cutecat.hexdigest.__doc__
'Return the digest value as a string of hexadecimal digits.'
>>> cutecat.digest()
b'\xa5\xfb\xd1\x91@\xa7)\x92"K$i\xc4\xf4\xd8\xd6\xd4\xaf\xf3\xe7'
>>> cutecat.digest.__doc__
'Return the digest value as a string of binary data.'

"a string of binary data" in my mind is something like this: 
'\xa5\xfb\xd1\x91@\xa7)\x92"K$i\xc4\xf4\xd8\xd6\xd4\xaf\xf3\xe7' not 
b'\xa5\xfb\xd1\x91@\xa7)\x92"K$i\xc4\xf4\xd8\xd6\xd4\xaf\xf3\xe7'.

Provided the patch to fix the doc.

--
components: Extension Modules
files: fix_doc_sha_module.patch
keywords: patch
messages: 207822
nosy: christian.heimes, vajrasky
priority: normal
severity: normal
status: open
title: Misleading docs for sha1, sha256, sha512 modules
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33398/fix_doc_sha_module.patch

___
Python tracker 

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



[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

That METH_O is working perfectly.  You seem to be confused by it.

The original code was kind of dumb.  The function only takes two parameters: 
self, and a second "obj" parameter which can be any kind of object.  CPython 
has special support for exactly this kind of function, which is METH_O.  This 
will actually be slightly faster.  In any case, that part of your conversion 
was correct.  Don't sweat it.

http://docs.python.org/3.4/c-api/structures.html?highlight=meth_o#METH_O

--

___
Python tracker 

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



[issue7883] CallTips.py _find_constructor does not work

2014-01-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The 3.x changes will not affect 2.7, which currently still uses 
_find_constructor. I suspect the .__func__ is needed for old-style classes, but 
I will try to check.

--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue16630] IDLE: Calltip fails if __getattr__ raises exception

2014-01-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Get_entity already has try-except to block exceptions propagating from eval 
failure, so wrapping it is redundant. We only need worry about get_argspec.

I presume the failure is in get_argspec in the remote process:
if hasattr(ob, '__call__'):
This can be replaced by callable(ob) as it converts exceptions to False. The 
appropriate return for non-callables is the current default, '', which results 
in no tip.

There are, however, other attribute accesses that could fail. I am reluctant to 
wrap get_argspec in its entirety, as that would mask bugs in Idle code as well 
as in user snippets. So I think each access should be protected. Since users 
will expect a tip for something that is a callable, I think a message might be 
appropriate. I checked that getattr(ob, name, default) does not convert 
exception to default.

Their are rpc calls in several places in Idle code. Unless failure can be 
triggered here in particular by user error, I do not think we should add 
specific protection here.

--

___
Python tracker 

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



[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

While it's dandy to add docstrings, your patch doesn't have any Argument Clinic 
stuff in it.  I don't mind if you add docstrings as part of the process of 
converting to Argument Clinic, but I'm not interested in this patch as it 
stands.

--

___
Python tracker 

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



[issue20215] Python2.7 socketserver can not listen IPv6 address

2014-01-09 Thread dzyu

New submission from dzyu:

I see, in python 2.7, in SocketServer.py the TCPServer implementation is 
hard-coded to use ipv4, can not handle IPv6 case. it hard-coded set 
address_family as socket.AF_INET. so when binding IPv6 host, it will throw 
"gaierror: [Errno -9] Address family for hostname not supported".

The code should to judge the provided host is IPv4 or IPv6, and base on the 
host type to set address_family as socket.AF_INET or  socket.AF_INET6

--
components: Library (Lib)
messages: 207818
nosy: dazhaoyu
priority: normal
severity: normal
status: open
title: Python2.7 socketserver can not listen IPv6 address
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



[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2014-01-09 Thread Larry Hastings

Changes by Larry Hastings :


--
assignee:  -> larry
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20196] Argument Clinic generates invalid code for optional parameter

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Here's a fix.  Works for me, let me know if it works for you.

--
Added file: 
http://bugs.python.org/file33397/larry.zero.positional.parameters.patch.1.txt

___
Python tracker 

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



[issue20196] Argument Clinic generates invalid code for optional parameter

2014-01-09 Thread Larry Hastings

Changes by Larry Hastings :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue20122] Move CallTips tests to idle_tests

2014-01-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The existing tests in CallTips.py, half of which I wrote based on the ones that 
existed, have one or two deficiencies that are copied in the patch.

First, they are not proper unittests. They test get_argspec indirectly by 
calling .fetch_tip and get_entity. This lead to the new private parameter, 
which will not be needed for the existing tests when get_argspec is called 
directly with objects.

Adding more tests for get_entity, beyond the one in test_calltips.py already, 
is a different issue. The function is mostly a wrapper for eval(), which we may 
assume works correctly.

Second, the doubling resulting from putting expected output in docstrings seems 
a bit flakey. It certainly does not test cases with no docstring or 
multiple-line docstrings.

I am working on a revised patch. (Also, the unittest call was added with 
test_calltip.py and I want it left.)

In 2.7. get_argspec is get_arg_text, with a different implementation. 
Backporting to 2.7 will require some adjustments.

--

___
Python tracker 

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



[issue20203] ArgumentClinic: support middle optional argument

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Oh .

socket.sendto can't currently be converted to Argument Clinic.  There's legacy, 
and then there's the cruelty that only 1993-style argument parsing can inflict. 
 (socket.sendto's argument parsing was checked in in revision ac3c80abbf43 from 
1993 by Guido.)

I'll keep it in mind for the future, but it's really pretty twisted.

--
status: open -> closed

___
Python tracker 

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



[issue20202] ArgumentClinic howto: document change in Py_buffer lifecycle management

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

I've got a bunch of doc improvements in the rollup patch in #20214.  I invite 
you to give it a review.  If that looks suitable please close this issue.

As for a verb, I've been using "convert".  "zlibmodule has already been 
converted to work with Argument Clinic".

--

___
Python tracker 

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



[issue20201] Argument Clinic: rwbuffer support broken

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

LGTM.  To be honest I don't understand what the hell 'w*' is for.

--

___
Python tracker 

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



[issue20200] Argument Clinic howto: custom self_converter example broken

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

LGTM.  Check it in please!

--

___
Python tracker 

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



[issue20214] Argument Clinic rollup fixes

2014-01-09 Thread Larry Hastings

New submission from Larry Hastings:

Miscellaneous Argument Clinic fixes:
  * Added default value type verification for almost all return converters.
  * Added return converters for float, dobule, unsigned long,
unsigned int, short, and unsigned short.
  * Py_buffer converter improvements:
  * Now allow exactly one value as a default value: None.
  * The default value in C only needs two fields initialized.
  * The cleanup call to PyBuffer_Release should be based on
".obj", not ".buf".
As well as a bunch of documentation fixes.

I'd love a review, but I'm pretty confident it's all okay so I may just check 
it in.  (The only code changes are in clinic.py so it's not going to break the 
world.)

--
assignee: larry
files: larry.argument.clinic.misc.fixes.patch.1.txt
messages: 207811
nosy: larry
priority: normal
severity: normal
stage: patch review
status: open
title: Argument Clinic rollup fixes
type: behavior
versions: Python 3.4
Added file: 
http://bugs.python.org/file33396/larry.argument.clinic.misc.fixes.patch.1.txt

___
Python tracker 

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



[issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths

2014-01-09 Thread Alexander Boyd

Alexander Boyd added the comment:

Then perhaps the docstring of relative_to could note this (like relpath does), 
or a separate method that's explicitly not symlink safe created.

Or better yet, what about a function that does (or at least tries to) give the 
correct answer in the face of symlinks?

--

___
Python tracker 

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



[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-01-09 Thread Brett Cannon

Brett Cannon added the comment:

Now it's:

Modules/cmathmodule.c: 8 sites
Modules/cjkcodecs/multibytecodec.c: 8 sites
Modules/arraymodule.c: 8 sites
Modules/pyexpat.c: 7 sites
Modules/fcntlmodule.c: 7 sites
Modules/pwdmodule.c: 2 sites
Modules/spwdmodule.c: 1 sites
Modules/grpmodule.c: 1 sites

--

___
Python tracker 

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



[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-01-09 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: larry -> 

___
Python tracker 

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



[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1f3242fb0c9c by Brett Cannon in branch 'default':
Issue #20152: import.c now uses Argument Clinic.
http://hg.python.org/cpython/rev/1f3242fb0c9c

--
nosy: +python-dev

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2014-01-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: pending -> closed

___
Python tracker 

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



[issue20213] Change the install location of _sysconfigdata.py

2014-01-09 Thread Thomas Petazzoni

New submission from Thomas Petazzoni:

The _sysconfigdata.py module contains definitions that are needed when building 
Python modules. In cross-compilation mode, when building Python extensions for 
the target, we need to use the _sysconfigdata.py of the target Python while 
executing the host Python.

However until now, the _sysconfigdata.py module was installed in 
build/lib.- directory, together with a number of 
architecture-specific shared objects, which cannot be used with the host Python.

To solve this problem, this patch moves _sysconfigdata.py to a separate 
location, build/sysconfigdata.-/, and only this directory gets 
added to the PYTHONPATH of the host Python interpreter when building Python 
modules for the target.

--
components: Cross-Build
files: 0003-Change-the-install-location-of-_sysconfigdata.py.patch
keywords: patch
messages: 207807
nosy: thomas-petazzoni
priority: normal
severity: normal
status: open
title: Change the install location of _sysconfigdata.py
type: compile error
versions: Python 3.4
Added file: 
http://bugs.python.org/file33395/0003-Change-the-install-location-of-_sysconfigdata.py.patch

___
Python tracker 

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



[issue20212] distutils: fix build_ext check to find whether we're building Python or not

2014-01-09 Thread Thomas Petazzoni

New submission from Thomas Petazzoni:

The build_ext logic uses 
sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")) to determine 
whether we're building a third-party Python extension, or a built-in Python 
extension. However, this check is wrong in cross-compilation mode, because the 
host Python interpreter might very well be installed in its prefix, when it is 
used to cross-compile the target modules and extensions. The current check 
would mis-detect this as we're building third-party Python modules, while we 
are in fact building the internal Python modules of the target Python.

Therefore, use the existing sysconfig.python_build variable, which provides the 
information of whether we're building Python itself or not in a correct way.

--
components: Cross-Build
files: 0002-distutils-fix-build_ext-check-to-find-whether-we-re-.patch
keywords: patch
messages: 207806
nosy: thomas-petazzoni
priority: normal
severity: normal
status: open
title: distutils: fix build_ext check to find whether we're building Python or 
not
type: compile error
versions: Python 3.4
Added file: 
http://bugs.python.org/file33394/0002-distutils-fix-build_ext-check-to-find-whether-we-re-.patch

___
Python tracker 

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



[issue20211] setup.py: do not add invalid header locations

2014-01-09 Thread Thomas Petazzoni

New submission from Thomas Petazzoni:

In the cross-compilation case, setup.py incorrectly adds /usr/include to 
self.compiler.include_dirs, and results in the following invalid compilation 
line:

/home/thomas/projets/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc
  -fPIC -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g
  -O3 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
  -D_FILE_OFFSET_BITS=64 -pipe -Os
  -I./Include -I/usr/include -I. -IInclude
  
-I/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include
  -I/home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Include
  -I/home/thomas/projets/buildroot/output/build/python3-3.4.0b1
  -c 
/home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Modules/_struct.c
  -o 
build/temp.linux-arm-3.4/home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Modules/_struct.o
cc1: warning: include location "/usr/include" is unsafe for cross-compilation 
[-Wpoison-system-directories]

The -I/usr/include is wrong when cross compiling, so we disable adding 
INCLUDEDIR and LIBDIR from the host when cross compiling.

--
components: Cross-Build
files: 0001-setup.py-do-not-add-invalid-header-locations.patch
keywords: patch
messages: 207805
nosy: thomas-petazzoni
priority: normal
severity: normal
status: open
title: setup.py: do not add invalid header locations
type: compile error
versions: Python 3.4
Added file: 
http://bugs.python.org/file33393/0001-setup.py-do-not-add-invalid-header-locations.patch

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a working patch for the finalize-based approach.

--
Added file: http://bugs.python.org/file33392/tempdir_finalize.patch

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note the finalize-based patch can only work on 3.4.

--
nosy: +pitrou

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33390/0011-Add-an-option-to-disable-unicodedata.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33388/0009-Add-an-option-to-disable-CJK-codecs.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33391/0012-Add-an-option-to-disable-IDLE.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33386/0007-Add-an-option-to-disable-the-curses-module.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33389/0010-Add-an-option-to-disable-NIS.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33387/0008-Add-an-option-to-disable-expat.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33385/0006-Add-an-option-to-disable-the-tk-module.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33384/0005-Add-option-to-disable-the-sqlite3-module.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33381/0002-Add-an-option-to-disable-installation-of-test-module.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33382/0003-Add-an-option-to-disable-pydoc.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


Added file: 
http://bugs.python.org/file33383/0004-Add-an-option-to-disable-lib2to3.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


--
keywords: +patch
Added file: 
http://bugs.python.org/file33380/0001-Add-infrastructure-to-disable-the-build-of-certain-e.patch

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

Changes by Thomas Petazzoni :


--
type:  -> enhancement

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-01-09 Thread Thomas Petazzoni

New submission from Thomas Petazzoni:

In the context of space-constrained embedded Linux systems, installing the 
entire set of Python modules and extensions is not necessarily desirable. For 
example, all the test modules, as well as certain extensions requiring 
third-parties libraries are often unnecessary, and uselessly consume precious 
storage on the embedded Linux system.

While we could certainly remove these undesired modules and extensions 
manually, it is much more convenient to have configuration options to 
selectively enable and disable them. Another very strong benefit of having 
configuration options is that we can actually *disable* the build of these 
unneeded modules and extensions, therefore saving a lot of build time, which is 
very nice when you're repeatedly cross-compiling an entire embedded Linux 
system.

The proposed set of patches add several --enable-/--disable- options 
to enable/disable certain Python modules and extensions. These patches have 
been part of Buildroot, an embedded Linux build system (used for example by 
Google, and many embedded processor vendors, as well as a huge number of 
embedded system makers) for a while, and are useful to all our users using 
Python on their embedded Linux systems. Instead of carrying them around, we 
would like to have them merged in upstream Python.

Of course, we are definitely open to discussion on the approach to take to 
implement this configurability, and I'm ready to rework the patches according 
to the comments received here.

Thanks!

--
components: Build
messages: 207802
nosy: thomas-petazzoni
priority: normal
severity: normal
status: open
title: Provide configure options to enable/disable Python modules and extensions
versions: Python 3.5

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which implements Richard's suggestion. test_del_on_shutdown and 
test_warnings_on_cleanup are failed, but perhaps they are wrong.

--
Added file: 
http://bugs.python.org/file33379/tempfile_tempdir_cleanup_weakref_finalize.patch

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

On Thu, 09 Jan 2014 20:29:15 +, Adam Tomjack  wrote:
> This issue is not an enhancement, it's a bug.  One might argue that
> fixing it will break existing code, but it won't.  Any affected code
> is already broken.  It's depending on a promised level of safety, and
> this bug is breaking that promise.  It's better to fail noisily and
> consistently than to usually work, but sometimes silently corrupt
> data.

That's not how our backward compatibility policy works.  If a program
runs correctly, a change in a maintenance release should not cause
that program to fail, *even if the change is a bug fix*.

Now, that said, silent data corruption can change that calculus, but
in this case there are many many working programs out there that
don't experience data corruption, so breaking them in a maintenance
release is just not acceptable.

It is possible that there are specific things that can be fixed without
breaking backward compatibility, but they will have to be argued individually.

> In general, it's a code-smell to inspect the SQL that's being executed
> before sending it to the database.  The only reason I can think of to

There are reasons why the sqlite module was designed the way it was,
having to do with an intersection between how sqlite works and the DB
API 2 specification.  I'm not saying the design (and implementation of
that design) has no bugs, but there *are* reasons why the choices made
were made, including the concurrency issue mentioned by Mike (which if I
understand correctly was even more problematic in earlier versions of
sqlite.)

> inspect SQL is to work around brokenness in the underlying database.
> Suppose, for example, that SQLite implicitly committed when it got
> DDL.  (I don't know what it actually does.  Just suppose.)  In that

By default, SQLite starts a transaction when any command that changes
the database is executed (the docs say, "basically, anything other than
a SELECT), and "automatically started transactions are committed when
the last query finishes".  I'm not sure exactly what that means.
Note that there is no way in sqlite to turn auto-transaction behavior 
off.

> case, it would be necessary to check for DDL and raise an exception
> before passing the statement to the database.  If the database

Like I said, this would need to be a new feature, due to our backward
compatibility policy.

> correctly errors in such a situation, then the python wrapper should
> just pass the DDL to the database and deal with the resulting error.
> That's way easier that trying to correctly detect what the statement
> type is.  Parsing SQL correctly is hard.

If you want full control of transactions while using the sqlite module,
you can set the isolation_level to None (sqlite's default autocommit
mode) and then carefully control when you issue what kinds of statements,
including BEGIN statements.  Any exceptions produced by the database
will in that situation be propagated to the application.  That loses
the (admittedly somewhat limited) DB-interoperability benefits of using
the DB API 2, though.

> As evidence of that, note that the existing statement detection code
> is broken: it doesn't strip comments first!  A simple SELECT statement
> preceeded by a comment will implicitly commit!  But commenting is
> good.

Yes, the fact that statement detection (and what statements are
detected) is buggy is the essence of this issue.

But note that in Python code it would be much more natural to
put the comment in the python code, not the sql string.

> Anything that causes the underlying database to implicitly commit must
> be avoided (yet the python module goes out of it's way to add *MORE*
> such buggy behavior!)  Fixing brokenness in the underlying database is
> the only reason to inspect SQL as it passes through this module.  If

Yep.

> there are other ways to avoid such problems, they will likely be
> better than inspecting SQL.

Do you have a better way to suggest?

> Anything which causes implicit rollbacks in the underlying database is
> a similar issue, but easier to handle without parsing SQL.  It's not

There are no implicit rollbacks at issue anywhere here, that I can see.
Do you have an example where the module does an implicit rollback?

> Here is an example demonstrating that a SELECT can trigger an implicit
> commit.

Yes, the comment issue should be fixed.  That's a different bug, though, 
and should be addressed in a separate issue.  Unfortunately, since
some people seem to be *depending* on the fact that putting in a comment
disables statement detection, that, too will need to be a new feature.

I'm sorry about that, but Python has a strong commitment to backward
compatibility.

--
type: behavior -> enhancement
versions: +Python 3.5 -Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

___
___

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

An alternative with weakref.finalize() looks very attractive, but unfortunately 
tests are failed with it.

--

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch to tip.

--
Added file: http://bugs.python.org/file33378/tempfile_tempdir_cleanup.patch

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file31848/tempfile_tempdir_cleanup.patch

___
Python tracker 

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



[issue13107] Text width in optparse.py can become negative

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Adam for your report. Thank you Elazar for your patch.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-01-09 Thread mike bayer

mike bayer added the comment:

well Adam, you might also be surprised to see pysqlite not doing very well on 
the *other* side of the equation either; that is, when it *begins* the 
transaction.  Issue http://bugs.python.org/issue9924 refers to this and like 
this one, hasn't seen any activity since 2011.  You might be interested in the 
rationale on that one, which is that python apps may wish to have some degree 
of concurrency against a sqlite file for an application that is doing all 
SELECTs.  

I am certainly in favor of a pure pep-249 approach that emits BEGIN on the 
first execute() call period, and never implicitly rolls back or commits.  

However, I disagree this should be enabled by default nor that there should not 
be any option for the old behavior.  I also think the "delayed BEGIN" feature 
should still be available to counteract SQLite's particular difficulty with 
concurrency.

If there is code that relies upon a bug in order to function, which would then 
fail to function in that way if the bug is fixed, then by definition fixing 
that bug is a backwards-incompatible change.   Python std lib can't afford to 
roll out a change that blatantly backwards-incompatible.   The issue regarding 
comments not being parsed unfortunately should also be a separate issue that 
needs to be fixed, as nasty as it is that pysqlite tries to parse SQL.

I disagree that most users are expecting SQLite's DDL to be transactional; 
transactional DDL is a luxury feature to many, including the vast numbers of 
developers that use MySQL, not to mention Oracle, neither of which have any 
transactional DDL capabilities.

--

___
Python tracker 

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



[issue13107] Text width in optparse.py can become negative

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 779de7b4909b by Serhiy Storchaka in branch '2.7':
Issue #13107: argparse and optparse no longer raises an exception when output
http://hg.python.org/cpython/rev/779de7b4909b

New changeset c6c30b682e14 by Serhiy Storchaka in branch '3.3':
Issue #13107: argparse and optparse no longer raises an exception when output
http://hg.python.org/cpython/rev/c6c30b682e14

New changeset 48bcd03cd29f by Serhiy Storchaka in branch 'default':
Issue #13107: argparse and optparse no longer raises an exception when output
http://hg.python.org/cpython/rev/48bcd03cd29f

--
nosy: +python-dev

___
Python tracker 

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



[issue10388] spwd returning different value depending on privileges

2014-01-09 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Looking back at this: considering we may get errors != EACCESS I think we 
better be as generic as possible as in:

--- a/Modules/spwdmodule.c
+++ b/Modules/spwdmodule.c
@@ -153,6 +153,8 @@
 if ((d = PyList_New(0)) == NULL)
 return NULL;
 setspent();
+if (errno != 0)
+return PyErr_SetFromErrno(PyExc_OSError);
 while ((p = getspent()) != NULL) {
 PyObject *v = mkspent(p);
 if (v == NULL || PyList_Append(d, v) != 0) {


As for 2.7 and 3.3 I have a little concern in terms of backward compatibility 
as the user will suddenly receive an exception instead of [] but I think that 
for the sake of correctness the cost is justified.

--

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2014-01-09 Thread mike bayer

mike bayer added the comment:

see also http://bugs.python.org/issue10740, which also relates to pysqlite 
attempting to make guesses as to when transactions should begin and end.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
versions: +Python 3.4

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Okay, you have my permission to mark it pending deprecated.

> What I'm proposing is to remove it after we deprecate it.

I understand the deprecation process.  Like I said, I was just trying to get a 
sense of how many people would be affected.

--

___
Python tracker 

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



[issue18787] Misleading error from getspnam function of spwd module

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue10388] spwd returning different value depending on privileges

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, could you please make a decision or delegate this issue to Mark, 
Terry, Andrew or me?

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> If we removed it completely (which I'm *not* proposing, just gathering
> data) how many people would it affect?

What I'm proposing is to remove it after we deprecate it.
I don't think it would affect many people, if any, but we still should
have a deprecation period.

> Is there any legitimate reason why some people would want SSLv2?  Like
> "we aren't allowed to upgrade this server" or something.

The only reason I could think about is some embedded equipment or device
with a built-in SSL-based server.

--

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2014-01-09 Thread Adam Tomjack

Adam Tomjack added the comment:

The proposed patches don't fix the problem.  They may well allow DDL in 
transactions, but that's not the real problem.

A database library must *NEVER* implicitly commit or rollback.  That's 
completely insane.

>>> import this
...
Explicit is better than implicit.

If a statement can't be executed in a transaction, then trying to execute such 
a statement in a transaction is an error.  Period.  An exception *MUST* be 
raised.  It is wrong to guess that the user really wanted to commit first.

>>> import this
...
Errors should never pass silently.
...
In the face of ambiguity, refuse the temptation to guess.

If such an exception is raised, you'll run into the problem exactly once before 
figuring out that you need to commit or rollback first.  You can then change 
your code to safely and explicitly account for that limitation.

This issue is not an enhancement, it's a bug.  One might argue that fixing it 
will break existing code, but it won't.  Any affected code is already broken.  
It's depending on a promised level of safety, and this bug is breaking that 
promise.  It's better to fail noisily and consistently than to usually work, 
but sometimes silently corrupt data.

As is, it's pretty much guaranteed that there is existing code that does DDL 
expecting to be in a transaction when it isn't.  Even a well-tested schema 
upgrade can fail in production if the data is slightly different that in a 
testing database.  Unique constraints can fail, etc.  I frequently use the 
psycopg2 module and psql command, which get this issue right.  They've saved me 
several times.

The current behavior is buggy and should be changed to be correct.  There 
should not merely be an option to enable the correct behavior.  There should 
also be no option to enable the old buggy behavior.  It's too dangerous.

In general, it's a code-smell to inspect the SQL that's being executed before 
sending it to the database.  The only reason I can think of to inspect SQL is 
to work around brokenness in the underlying database.  Suppose, for example, 
that SQLite implicitly committed when it got DDL.  (I don't know what it 
actually does.  Just suppose.)  In that case, it would be necessary to check 
for DDL and raise an exception before passing the statement to the database.  
If the database correctly errors in such a situation, then the python wrapper 
should just pass the DDL to the database and deal with the resulting error.  
That's way easier that trying to correctly detect what the statement type is.  
Parsing SQL correctly is hard.

As evidence of that, note that the existing statement detection code is broken: 
it doesn't strip comments first!  A simple SELECT statement preceeded by a 
comment will implicitly commit!  But commenting is good.

>>> import this
...
Readability counts.

So it's not even just an issue of DDL or PRAGMAs!

Anything that causes the underlying database to implicitly commit must be 
avoided (yet the python module goes out of it's way to add *MORE* such buggy 
behavior!)  Fixing brokenness in the underlying database is the only reason to 
inspect SQL as it passes through this module.  If there are other ways to avoid 
such problems, they will likely be better than inspecting SQL.

Anything which causes implicit rollbacks in the underlying database is a 
similar issue, but easier to handle without parsing SQL.  It's not safe to 
implicitly rollback, even if a new transaction is begun.  For example, you 
might be doing foreign key validation outside the database.  If one INSERT were 
implicitly rolled back and a new transaction begun, a second INSERT may then 
succeed and be committed.  Now you have a constraint violation, even though you 
correctly checked it before.

If there is anything that triggers an implicit rollback in the underlying 
database connection, those rollbacks must be dectected all subsequent 
statements or actions on the python wrapper *should* raise exceptions until an 
explicit rollback is performed, except for commit() which *must* raise.

For example:

con.isolation_level = 'DEFERRED'
try:
# Nothing in here can implicitly commit or rollback safely.  
# Doing so risks data corruption.

cur.execute("INSERT INTO foo ...")

try:
con.somehow_trigger_implicit_rollback() # must raise
except:
# Throw away the exception.
pass

try:
# This *should* raise too, but isn't strictly necessary,
# as long as commit() is implemented correctly.
cur.execute("INSERT INTO bar ...")
except:
pass

# The underlying database rolled back our transaction.
# A successful commit here would not match reality.
# This commit() must raise.
con.commit()
except:
# This rollback() can succeed, because it puts the 
# "con" object back i

[issue15303] Minor revision to the method in Tkinter

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> patch review
versions: +Python 3.4

___
Python tracker 

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



[issue1776674] glob.glob inconsistent

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue19279] UTF-7 to UTF-8 decoding crash

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Georg, is this issue wort to be fixed in 3.2? If yes, use the patch against 2.7.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

If we removed it completely (which I'm *not* proposing, just gathering data) 
how many people would it affect?

Is there any legitimate reason why some people would want SSLv2?  Like "we 
aren't allowed to upgrade this server" or something.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(FTR, Alex's comment mixes up the default settings used by urlopen() with what 
the ssl module allows to do when invoked directly)

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> If #20207 happens for 3.4, would it still be possible to use SSLv2?

#20207 has already happened for 3.4 and, yes, it's still possible to use SSLv2 
(except that many distros also disable SSLv2 in their OpenSSL build).

The commit message is quite clear about that: """Issue #20207: Always disable 
SSLv2 except when PROTOCOL_SSLv2 is explicitly asked for."""

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

I don't have a lot of context for this.  It sounds like #20207 proposes to 
remove the ability to use SSLv2 at all.  And in the comments Alex Gaynor seems 
to say that SSLv2 is already disabled in Python 3.

If #20207 happens for 3.4, would it still be possible to use SSLv2?

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Is there any way to use SSLv2 in 3.4?

Yes, by using PROTOCOL_SSLv2.
(you're asking strange questions)

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Is there any way to use SSLv2 in 3.4?

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The ssl module has an attribute named PROTOCOL_SSLv2 that I'm proposing to 
deprecate.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Okay, then, can you educate me on what you're proposing here?

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Larry Hastings

Larry Hastings added the comment:

Would the patch be about as simple as the patch for 2.7 in #20207?

Also, #20207 is also marked for 3.4.  Either unmark 3.4/3.5 in #20207, or close 
this bug as a duplicate.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Those bugs are orthogonal, Larry.

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This should be ok now. Let's hope no buildbots will complain...

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 613b403ca9f1 by Antoine Pitrou in branch '3.3':
Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly 
asked for.
http://hg.python.org/cpython/rev/613b403ca9f1

New changeset e02288de43ed by Antoine Pitrou in branch 'default':
Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly 
asked for.
http://hg.python.org/cpython/rev/e02288de43ed

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

I don't see why a deprecation would be late, since we haven't hit RC yet.  A 
deprecation doesn't change the API.  But yes, it is Larry's call.

--

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It sounds a bit too late, although that would be Larry's call.

--
nosy: +larry

___
Python tracker 

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



[issue20209] Deprecate PROTOCOL_SSLv2

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

Why not in 3.4?

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



[issue20205] inspect.getsource(), P302 loader and '<..>' filenames

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

Maybe the logic needs to be reordered: look for a loader first, before looking 
for a file on disk.  It seems to me the current lookup order might itself be a 
bug.

Note that the code is the same in python3, so the issue exists there as well.

--
nosy: +brett.cannon, eric.snow
versions: +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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 163c09041280 by Antoine Pitrou in branch '2.7':
Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly 
asked for.
http://hg.python.org/cpython/rev/163c09041280

--
nosy: +python-dev

___
Python tracker 

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



[issue19804] test_uuid.TestUUID.test_find_mac() fails

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps it would be better just use other executable (it is not ran in this 
test, just checked that it exists). Bohuslav, what is a content of your /sbin 
and /usr/sbin?

--

___
Python tracker 

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



[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-09 Thread Stefan Krah

Stefan Krah added the comment:

> Yes, it's just Python syntax, so you'd use "->".

I tried that, but it didn't filter through to inspect.signature().

> However, you are not permitted to according to PEP 8:

Ah, too bad. Return annotations are nice.

--

___
Python tracker 

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread STINNER Victor

STINNER Victor added the comment:

> Here is a patch. Can someone try it with a non-patched OpenSSL? (e.g. OS X)

How can I test that SSLv2 is disabled?

--

___
Python tracker 

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue20078] zipfile - ZipExtFile.read goes into 100% CPU infinite loop on maliciously binary edited zips

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nandiya for your report.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20205] inspect.getsource(), P302 loader and '<..>' filenames

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There would be behavior change if file '' exists.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18960] First line can be executed twice

2014-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 875a514671dd by Serhiy Storchaka in branch '3.3':
Do not reset the line number because we already set file position to correct
http://hg.python.org/cpython/rev/875a514671dd

New changeset 2af308f79727 by Serhiy Storchaka in branch 'default':
Do not reset the line number because we already set file position to correct
http://hg.python.org/cpython/rev/2af308f79727

--

___
Python tracker 

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



[issue20175] Derby #6: Convert 50 sites to Argument Clinic across 8 files

2014-01-09 Thread Brian Morrow

Brian Morrow added the comment:

I'll gladly take this bundle.

--

___
Python tracker 

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



  1   2   >