[issue20203] ArgumentClinic: support middle optional argument

2014-01-09 Thread Ryan Smith-Roberts

New submission from Ryan Smith-Roberts:

socket.sendto is apparently even weirder than addch or range: the optional 
argument is in the *middle*. Attempting this configuration gets me:

Function sendto has an unsupported group configuration. (Unexpected state 5)

An expected unexpected configuration? :)

--
components: Build
messages: 207731
nosy: larry, rmsr
priority: normal
severity: normal
status: open
title: ArgumentClinic: support middle optional argument
type: enhancement
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



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

2014-01-09 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, this is my second attempt. I want to get METH_VARGS but I always get 
METH_O for positional parameters. Is there any way to circumvent this? The 
documentation does not cover this.

--
Added file: http://bugs.python.org/file33374/clinic_sha1module_v2.patch

___
Python tracker 

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



[issue20159] Derby #7: Convert 51 sites to Argument Clinic across 3 files -> Derby: Convert the ElementTree module to use Argument Clinic

2014-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> eli.bendersky
dependencies: +Add docstrings for ElementTree module
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



[issue20204] pydocs fails for some C implemented classes

2014-01-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In 3.4 pydoc fails for the TkappType and TkttType names in the _tkinter module.

$ ./python -m pydoc _tkinter.TkappType
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 189, in _run_module_as_main
"__main__", mod_spec)
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2593, in 
cli()
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2558, in cli
help.help(arg)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1840, in help
elif request: doc(request, 'Help on %s:', output=self._output)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1578, in doc
pager(render_doc(thing, title, forceload))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1555, in render_doc
module = inspect.getmodule(object)
  File "/home/serhiy/py/cpython/Lib/inspect.py", line 610, in getmodule
file = getabsfile(object, _filename)
  File "/home/serhiy/py/cpython/Lib/inspect.py", line 593, in getabsfile
_filename = getsourcefile(object) or getfile(object)
  File "/home/serhiy/py/cpython/Lib/inspect.py", line 569, in getsourcefile
filename = getfile(object)
  File "/home/serhiy/py/cpython/Lib/inspect.py", line 519, in getfile
object = sys.modules.get(object.__module__)
AttributeError: __module__

And same for _tkinter.TkttType.

This issue can be easy fixed for the _tkinter module, but general solution is 
needed, because pydoc in 3.4 still can be broken for third-party code.

--
files: tkinter_typespecs.patch
keywords: 3.4regression, patch
messages: 207733
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: pydocs fails for some C implemented classes
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file33375/tkinter_typespecs.patch

___
Python tracker 

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



[issue20204] pydocs fails for some C implemented classes

2014-01-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon, eric.snow, ncoghlan
priority: normal -> high

___
Python tracker 

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



[issue20165] unittest TestResult wasSuccessful returns True when there are unexpected successes

2014-01-09 Thread Stefano Lattarini

Stefano Lattarini added the comment:

Since I too was bitten by this issue, I'd like to support Gregory's
request, and report my rationale for changing the current behaviour.

With the current behaviour, we could see (and I *have* seen) scenarios
like this:

  1. A test exposing a known bug is written, and the test is marked
 as "expected failure".

  2. Some refactoring and code improvements follow.

  3. They improve the overall behaviour/correctness of the program
 or library under test, to the point of fixing the bug "behind
 the scenes".

  4. The developer doesn't notice the fix though, since the testing
 framework doesn't warn him "strongly enough" of the fact that the
 test marked as expected failure has begun to pass. (To reiterate,
 the current behaviour of just printing a warning saying "some test
 passed unexpectedly" on the standard output is not good enough of
 a warning; it's easy to miss, and worse, it's *certain* that it
 will be missed if the tests are run by some CI systems or a similar
 wrapper system -- those would only report failures due to non-zero
 exit statuses.)
  
  5. Without noticing that the issue has been fixed, the developer does
 some further changes, which again re-introduce the bug, or a
 similar one that the test still marked as "expected failure" could
 easily catch.
  
  6. That test starts to fail again; but since it has remained marked
 as "expected failure" all along, the fact is not reported to the
 developer in any way.  So the bug has managed to sneak back in,
 unnoticed.

In addition to this rationale, another (weaker) reason to change the
existing behaviour would be the "principle of least surprise".  Among
other widely used testing framework (for python, or language-agnostic)
many of those which support the concept of "expected failure" will
throw hard errors by default when a test marked as expected failure
starts to pass; among these are:

  * Python libs:
- py.test (http://pytest.org)
- Nose (https://pypi.python.org/pypi/nose/1.3.0)

  * Language-agnostic protocols/frameworks:
- the TAP protocol (the standard in the Perl world)
  (http://en.wikipedia.org/wiki/Test_Anything_Protocol)
- the Automake "Simple Tests" framework
  (http://www.gnu.org/software/automake/manual/html_node/Tests.html)

--
nosy: +slattarini

___
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 Roundup Robot

Roundup Robot added the comment:

New changeset 0cf1defd5ac4 by Serhiy Storchaka in branch '3.3':
Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
http://hg.python.org/cpython/rev/0cf1defd5ac4

New changeset 79ea4ce431b1 by Serhiy Storchaka in branch 'default':
Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
http://hg.python.org/cpython/rev/79ea4ce431b1

--
nosy: +python-dev

___
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 Stefan Müller

New submission from Stefan Müller:

Following situation

* python 2.7.6

* module loaded via a PEP302 loader.

* the loader has get_source(fullname)

* assigns a dummy string as a file: module.__file__ == ""

Then

inspect.getsource(module)

throws

IOError: could not get source code

I tired to track this down, and it seems to be caused by  
linecache.updatecache(..) with has

if not filename or (filename.startswith('<') and filename.endswith('>')):
return []

at the beginning.

This seems too restrictive me. Without the 'if' it would try to read the file 
from disk, and if that fails check if there is a loader, without a loader it 
returns [], so there would not be any behaviour change for non-loader modules 
if the 'if' was removed, only an additional disk access.

I suggest to remove the 'if'.

Workaround: Don't use '<>' for the dummy file name, but I've read somewhere 
that those '<>' are a convention for such use-cases.

--
components: Library (Lib)
messages: 207736
nosy: stefan.mueller
priority: normal
severity: normal
status: open
title: inspect.getsource(), P302 loader and '<..>' filenames
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



[issue20206] email quoted-printable encoding issue

2014-01-09 Thread Andras Timar

New submission from Andras Timar:

Try this sample script:

# coding=utf-8
import email
import email.charset
import email.message

c = email.charset.Charset('utf-8')
c.body_encoding = email.charset.QP
m = email.message.Message()
m.set_payload("This is a Greek letter upsilon: υ", c)
print(m.as_string())

Actual result: "This is a Greek letter upsilon: =CF" 
Expected result: "This is a Greek letter upsilon: =CF=85"

--
components: Library (Lib)
messages: 207737
nosy: timar
priority: normal
severity: normal
status: open
title: email quoted-printable encoding issue
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue20206] email quoted-printable encoding issue

2014-01-09 Thread Milap Bhojak

Milap Bhojak added the comment:

hope it will fix that issue

--
nosy: +milap.py
versions: +Python 2.7 -Python 3.3
Added file: http://bugs.python.org/file33376/email.py

___
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 Martin Häcker

Martin Häcker added the comment:

Sorry, I got the title wrong on the first try. (Already corrected).

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.

Now of course it makes no sense to check if a dict (not washable because it's 
mutable) is a key in a dictionary - but, the fact that keys() returns something 
else than a list is surprising and shouldn't be so. (I suspect it's a 
performance enhancement).

Why this shouldn't be so? I think it's because of composeability. If I expect 
something list like from an API I want to be able to hand it around in my 
application to everywhere where a list is allowed, and I certainly don't want 
to check beforehand if something I want to check is included in that list is 
hasheable for a specific subset of those lists.

Thats why I think it's a really bad idea to change the behavior of dict.keys() 
_not_ to return a list or something that at least behaves the same way as a 
list.

Should this have been done for performance reasons, it would be easy to say in 
that list that anything that is not hasheable cannot be in that list and 
therefore to return False in that case. Contract fulfilled.

--

___
Python tracker 

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



[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

2014-01-09 Thread Meador Inge

Meador Inge added the comment:

I will pick this one up.

--
assignee:  -> meador.inge
nosy: +meador.inge

___
Python tracker 

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



[issue19346] Build fails when there are no shared extensions to be built

2014-01-09 Thread Alan Hourihane

Alan Hourihane added the comment:

Anyone ?

--
resolution:  -> remind

___
Python tracker 

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



[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.

2014-01-09 Thread Alan Hourihane

Changes by Alan Hourihane :


--
resolution:  -> remind

___
Python tracker 

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



[issue19348] Building _testcapimodule as a builtin results in compile error

2014-01-09 Thread Alan Hourihane

Alan Hourihane added the comment:

Anyone ?

--
resolution:  -> remind

___
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

Changes by R. David Murray :


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



[issue20206] email quoted-printable encoding issue

2014-01-09 Thread R. David Murray

R. David Murray added the comment:

This is a bug in quoprimime.body_encode.  If you put a newline on the end of 
your string, it will work as expected.

The patch in issue 5803 does not have the bug, so I'll probably just apply that 
to both 3.3 and 3.4.

--
components: +email
dependencies: +email/quoprimime: encode and decode are very slow on large 
messages
nosy: +barry, r.david.murray
versions: +Python 3.3, Python 3.4 -Python 2.7

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

Thanks, this is working here for the parameters. Is there a way to
specify the return annotation manually in the docstring?

--

___
Python tracker 

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



[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.

2014-01-09 Thread Stefan Krah

Stefan Krah added the comment:

The patch looks correct to me. locale.h is at least C99 (I don't have the 
earlier standards).

--
nosy: +skrah

___
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 STINNER Victor

STINNER Victor added the comment:

dict.keys() has been changed 5 years ago, when Python 3 was created.

dict.keys() is now a nice read-only view of dictionary keys. When the
dictionary is updated, the view is also updated. See the
documentation:
http://docs.python.org/3/library/stdtypes.html#dict-views

The view is not a sequence: isinstance({}.keys(),
collections.Sequence) is False.

If you want a list, you must write list(dict.keys())

> Now of course it makes no sense to check if a dict (not washable because it's 
> mutable) is a key in a dictionary

I still don't understand your problem. What is your usecase?

Yes, Python 3 is a new language. It's a better language in my opinion,
because it now has the good behaviour.

> Should this have been done for performance reasons,

Yes, avoiding a temporary list is more efficient in "for k in dict:
..." and "for k, v in dict.items(): ...".

--

___
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 1bdcaf6c0eb5 by Serhiy Storchaka in branch '3.3':
Issue #18960: Fix bugs with Python source code encoding in the second line.
http://hg.python.org/cpython/rev/1bdcaf6c0eb5

New changeset 04c05e408cbd by Serhiy Storchaka in branch 'default':
Issue #18960: Fix bugs with Python source code encoding in the second line.
http://hg.python.org/cpython/rev/04c05e408cbd

--
nosy: +python-dev

___
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 Alex Gaynor

New submission from Alex Gaynor:

SSLv2 has numerous security issues, and thus is in limited use on the web. 
Continuing to allow SSLv2 handshakes only serves to limit security.

--
components: Library (Lib)
messages: 207748
nosy: alex
priority: normal
severity: normal
status: open
title: Disable SSLv2 in Python 2.x
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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Donald Stufft

Donald Stufft added the comment:

+1

--
nosy: +dstufft

___
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 Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

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

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

--
keywords: +patch
Added file: http://bugs.python.org/file33377/no_sslv2.patch

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

Note that this probably would have to be applied to 3.x too, for consistency.

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

Alex Gaynor added the comment:

Yes, OP_NO_SSLv2 should be used by default.

--

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

(by trying, I mean at least "./python -m test.regrtest -unetwork -v test_ssl")

--

___
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 Alex Gaynor

Alex Gaynor added the comment:

I can confirm the tests pass on OS X and it's possible to open a connection to 
howsmyssl.com

--

___
Python tracker 

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



[issue20208] Clarify some things in porting HOWTO

2014-01-09 Thread Brett Cannon

New submission from Brett Cannon:

Reported on my G+ share of the latest reworking:

"""
The only part I found confusing is when you first introduce "from _future_ 
import unicode_literals" --- it looks like you forgot to explain what it does. 
It turns out that you explain it somewhat two paragraphs below it, so maybe you 
can just move this down a bit?

Maybe "bytes literals" section should be called "Bytes and unicode literals" or 
something and move the "unicode_literals" line in there.
"""

"""
The only issue I noticed is that "Eliminate -3 Warnings" section still mentions 
2to3 before it's even introduced.
"""

--
assignee: brett.cannon
components: Documentation
messages: 207756
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Clarify some things in porting HOWTO
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



[issue18960] First line can be executed twice

2014-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now traceback test is failed.

http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.3/builds/1358/steps/test/logs/stdio
==
FAIL: test_encoded_file (test.test_traceback.SyntaxTracebackCases)
--
Traceback (most recent call last):
  File "/opt/python/3.3.langa-ubuntu/build/Lib/test/test_traceback.py", line 
146, in test_encoded_file
text, charset, 4)
  File "/opt/python/3.3.langa-ubuntu/build/Lib/test/test_traceback.py", line 
129, in do_test
stdout[1], lineno))
AssertionError: 'line 4' not found in '  File "@test_6376_tmp", line 3, in 
' : Invalid line number: '  File "@test_6376_tmp", line 3, in ' 
instead of 4

--

--

___
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

Changes by Brian Morrow :


--
nosy: +bmorrow92

___
Python tracker 

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



[issue20208] Clarify some things in porting HOWTO

2014-01-09 Thread Dmitry Shachnev

Changes by Dmitry Shachnev :


--
nosy: +mitya57

___
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 Larry Hastings

Larry Hastings added the comment:

Yes, it's just Python syntax, so you'd use "->".  However, you are not 
permitted to according to PEP 8:

"The Python standard library will not use function annotations as that would 
result in a premature commitment to a particular annotation style."

--

___
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 Alex Gaynor

Alex Gaynor added the comment:

I'm not sure this is needed on Python 3, it already has: 
http://hg.python.org/cpython/file/default/Lib/ssl.py#l388

--

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

> I'm not sure this is needed on Python 3, it already has:
> http://hg.python.org/cpython/file/default/Lib/ssl.py#l388

It doesn't get executed when you create a SSLContext directly, though.

--

___
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

New submission from Antoine Pitrou:

It sounds like we may deprecate PROTOCOL_SSLv2 in 3.5.

--
components: Library (Lib)
messages: 207762
nosy: christian.heimes, giampaolo.rodola, janssen, pitrou
priority: low
severity: normal
status: open
title: Deprecate PROTOCOL_SSLv2
type: behavior
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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I’m +1 too since supporting it serves no other purpose then enabling downgrade 
attacks. Shipping a client with SSL 2 on is nothing short a security bug.

--
nosy: +hynek

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

Please qualify the request a bit: do you mean something should be done in the 
ssl module? One solution is to add OP_NO_SSLv2 when the user asks for a 
PROTOCOL_SSLv23 socket. Is it what you mean?

--
nosy: +pitrou
type:  -> behavior

___
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 STINNER Victor

STINNER Victor added the comment:

See also issue #20207.

--
nosy: +haypo

___
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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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



[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



[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



[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



[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



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

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:

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

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:

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



[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



[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



[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



[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



[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

[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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

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



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

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



[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



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


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 :


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



  1   2   >