[issue18704] IDLE: PEP8 Style Check Integration

2013-08-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

-1 on giving PEP 8 any more weight than it already has.

Automated PEP 8 checker tools do away the human commen sense component (the 
foolish consistency quote is in PEP 8 for a reason).

Another downside is that rigid adherence to PEP 8 tends to focus beginners on 
the least important aspects of code quality.  We would be much better-off with 
integration of PyFlakes or a similar tool that focus on actual semantic errors 
in the code.

--
nosy: +rhettinger

___
Python tracker 

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



[issue18704] IDLE: PEP8 Style Check Integration

2013-08-13 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
versions:  -Python 2.7, Python 3.3

___
Python tracker 

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



[issue18724] Typo in docs.python.org: smtplib python2.7

2013-08-13 Thread Susan Tan

New submission from Susan Tan:

http://docs.python.org/2.7/library/smtplib.html#smtplib.SMTPException 

"exception smtplib.SMTPException
The base exception class for all the other excpetions provided by this module."

The word "exceptions" is spelled incorrectly in the in "other excpetions".

--
assignee: docs@python
components: Documentation
messages: 195049
nosy: Susan, docs@python
priority: normal
severity: normal
status: open
title: Typo in docs.python.org: smtplib python2.7
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Mark Dickinson

Mark Dickinson added the comment:

+1

--

___
Python tracker 

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



[issue18724] Typo in docs.python.org: smtplib python2.7

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bd030e70cecb by Ned Deily in branch '2.7':
Issue 18724: Fix typo noticed by Susan Tan.
http://hg.python.org/cpython/rev/bd030e70cecb

New changeset 76d71bc949b6 by Ned Deily in branch '3.3':
Issue 18724: Fix typo noticed by Susan Tan.
http://hg.python.org/cpython/rev/76d71bc949b6

New changeset 8dccd3b51711 by Ned Deily in branch 'default':
Issue 18724: Fix typo noticed by Susan Tan.
http://hg.python.org/cpython/rev/8dccd3b51711

--
nosy: +python-dev

___
Python tracker 

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



[issue18724] Typo in docs.python.org: smtplib python2.7

2013-08-13 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report!

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: enhancement -> 
versions: +Python 3.3, Python 3.4

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> have exactly the same size

Binaries contain paddings.

> although their md5 hashes differ

Timestamps.

I'm interesting if someone builds CPython with more simple compilers (i.e. PCC 
[1]).

[1] http://en.wikipedia.org/wiki/Portable_C_Compiler

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Serhiy Storchaka added the comment:
> 
> > have exactly the same size
> 
> Binaries contain paddings.

I used the "size" command, which gives you the exact size of the various 
sections
(rather than the physical file size).

--

___
Python tracker 

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



[issue15849] PEP 3121, 384 Refactoring applied to xx module

2013-08-13 Thread Robin Schreiber

Robin Schreiber added the comment:

Updated the patch, corrected multiple syntax errors and missing INCREFS. Also 
added the comments that include the members names. I am yet undecided regarding 
the NULL-check for FindModule.

Apart from that I have tried to build some tests that prove that loading and 
unloading the module do not cause any memory leaks. This has turned up several 
problems: For one, the only possibility to check for the leaks that PEP 3121 
tries to fix, is to run PyInit of the respective module multiple times. This is 
only possible if Py_finalize() has been called after the module has been 
imported beforehand. This means we can not test for these leaks from within 
Python, but need some C-Code that calls
Py_initialize(); ... import xx ... Py_finalize(); multiple times. The problem 
is that also the plain Py_initialize(); Py_finalize(); calls leak memory. 
Unfortunately the amount of objects that are leaked also seems to vary, so 
there is no constant factor that I can subtract to determine how much the 
imported module itself leaks.
So I am kind of on a dead end here. I could upload the tests scripts that I 
have written so far, if that helps.

--
keywords: +patch
Added file: http://bugs.python.org/file31272/xxmodule_pep3121-384_v1.patch

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-08-13 Thread Christian Heimes

Christian Heimes added the comment:

Thanks! The title now references the new CVE #.

--
title: SSL module fails to handle NULL bytes inside subjectAltNames general 
names (CVE-2013-4073) -> SSL module fails to handle NULL bytes inside 
subjectAltNames general names (CVE-2013-4238)

___
Python tracker 

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



[issue15849] PEP 3121, 384 Refactoring applied to xx module

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> In the example Martin gave in his PEP 3121, the PyInit does not perform any 
> INCREFs on
> the Variables that are referenced from inside the module state.
> He therefore left out m_free completely as there was nothing to DECREF within 
> the module
> state.
> Back when I did my GSoC together with Martin, we decided that the Module 
> state itself can 
> be considered a valid container object, an therefore has to INCREF and in the 
> end of its
> lifecycle (that is within m_free) also DECREF every object reference it 
> holds. I therefore 
> decided to include that into every module I refactored, and consequently also 
> the xxmodule.

I agree with that, but then PEP 3121's example code should be fixed.

> I am yet undecided regarding the NULL-check for FindModule.

Not checking for NULL makes it dangerous to implement unloading of extension 
modules: see issue18674.

If checking for NULL makes extension code too complicated, then please take a 
look at the helper API I've suggested in issue18710.

Also, it would be nice if you could also read the following python-dev thread, 
since it discusses concrete issues and possible solutions:
http://mail.python.org/pipermail/python-dev/2013-August/127862.html

> This means we can not test for these leaks from within Python, but need some 
> C-Code

You can use _testcapi.run_in_subinterp() to run custom code in a 
sub-interpreter.

Here is an example of a non-leaking extension module, and then a (presumably) 
leaking one:

$ ./python -Xshowrefcount
Python 3.4.0a1+ (default:9e61563edb67, Aug 12 2013, 14:52:25) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _testcapi
[64175 refs, 19937 blocks]
>>> _testcapi.run_in_subinterp("import resource")
0
[68839 refs, 20969 blocks]
>>> _testcapi.run_in_subinterp("import resource")
0
[68852 refs, 20980 blocks]
>>> _testcapi.run_in_subinterp("import resource")
0
[68850 refs, 20979 blocks]
>>> _testcapi.run_in_subinterp("import resource")
0
[68852 refs, 20980 blocks]
>>> _testcapi.run_in_subinterp("import resource")
0
[68850 refs, 20979 blocks]
>>> _testcapi.run_in_subinterp("import _socket")
0
[71840 refs, 22059 blocks]
>>> _testcapi.run_in_subinterp("import _socket")
0
[71911 refs, 22083 blocks]
>>> _testcapi.run_in_subinterp("import _socket")
0
[71981 refs, 22107 blocks]
>>> _testcapi.run_in_subinterp("import _socket")
0
[72051 refs, 22131 blocks]

--
nosy: +pitrou

___
Python tracker 

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



[issue17997] ssl.match_hostname(): sub string wildcard should not match IDNA prefix

2013-08-13 Thread Christian Heimes

Christian Heimes added the comment:

Affected versions:

- Python 3.2 (< 3.2.5)
- Python 3.3 (< 3.3.3)
- Python 3.4a1
- requests < 1.2.3
https://pypi.python.org/pypi/requests
- backports.ssl_match_hostname (<3.2a3)
https://pypi.python.org/pypi/backports.ssl_match_hostname/
- urllib3 < 1.6
https://github.com/shazow/urllib3
- bzr
- setuptools
- tornado
- pip

--

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Isn't that weird?

Agreed, this one is a bug. The stripping in shorten() should be smarter, i.e. 
it should not affect the placeholder's own spaces.
Do you want to write a patch?

--

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Correcting myself:

> i.e. it should not affect the placeholder's own spaces.

... except for leading whitespace in case the placeholder ends up alone in the 
result.
i.e. shorten("somethingtoolong") should return "(...)", not " (...)".

--

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2013-08-13 Thread Ezio Melotti

Ezio Melotti added the comment:

I left a review on rietveld.

FWIW I think string_tests and related files should undergo a (major?) 
refactoring.  I worked with them a few times and it's a bit of a mess with all 
those base classes and mixins.  I also found some tests that weren't running 
because they were accidentally overridden by one of the subclasses, or other 
tests that were duplicated.  This is especially true on Python 3, where bytes 
and str share a smaller subset of features.

--
nosy: +ezio.melotti
stage:  -> patch review
type:  -> enhancement
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue18687] Lib/test/leakers/test_ctypes.py still mentions the need to update Misc/build.sh

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 49edf4cbc453 by Ezio Melotti in branch '2.7':
#18687: remove obsolete comment.  Patch by Févry Thibault.
http://hg.python.org/cpython/rev/49edf4cbc453

New changeset 49fa63610c7f by Ezio Melotti in branch '3.3':
#18687: remove obsolete comment.  Patch by Févry Thibault.
http://hg.python.org/cpython/rev/49fa63610c7f

New changeset 1ea89e5f40cf by Ezio Melotti in branch 'default':
#18687: merge with 3.3.
http://hg.python.org/cpython/rev/1ea89e5f40cf

--
nosy: +python-dev

___
Python tracker 

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



[issue18687] Lib/test/leakers/test_ctypes.py still mentions the need to update Misc/build.sh

2013-08-13 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement
versions: +Python 2.7, Python 3.3

___
Python tracker 

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



[issue18712] Pure Python operator.index doesn't match the C version.

2013-08-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. Now the code of operator.index() becomes even more 
complicated. Perhaps you want suggest other wording for documentation?

Some code in stdlib (_pyio.py, bz2.py, connection.py) uses a.__index__() 
instead of type(a).__index__(a) (with replacing AttributeError to TypeError). 
Is it worth to change?

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file31273/operator_index.patch

___
Python tracker 

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



[issue18725] Multiline shortening

2013-08-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Functions in the textwrap module works with multiline text except a newly added 
(in issue18585) the shorten() function. Wrapping and shortening a multiline 
text using existing textwrap function is not a trivial job.

I propose to add two new parameters to the TextWrap class and wrap() and fill() 
functions: max_lines and placeholder. If the max_lines argument is specified 
then wrapped text truncated to max_lines and the last line shortened to the 
width argument.

>>>print(textwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
>>>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 
>>>width=40, max_lines=3))
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore (...)

The shorten() function then will be just a particular case of fill() with 
max_lines=1.

--
components: Library (Lib)
messages: 195065
nosy: barry, ezio.melotti, georg.brandl, pitrou, python-dev, r.david.murray, 
serhiy.storchaka, stevenjd, vajrasky
priority: normal
severity: normal
status: open
title: Multiline shortening
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18725] Multiline shortening

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sounds like a reasonable enhancement to me.

--

___
Python tracker 

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



[issue18725] Multiline shortening

2013-08-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

> Do you want to write a patch?
My pleasure.

Attached the second version of the patch to accomodate Pitrou's request.

--
Added file: 
http://bugs.python.org/file31274/fix_for_non_normalized_whitespaces_in_placeholder_v2.patch

___
Python tracker 

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



[issue18694] getxattr on Linux ZFS native filesystem happily returns partial values

2013-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2013-08-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The json module functions have too many positional parameters:

dump() -- 11
dumps() -- 10
load() -- 9
loads() -- 8

In most time only small part of these options is specified so users call these 
functions with keyword arguments for all parameters except mandatory ones.

Even worse, the simplejson module (an ancestor and an alternative to standard 
json module) have a very similar interface but with difference sequences of 
parameters (the second parameter of loads() and the ninth parameter of dumps() 
in simplejson is encoding). So in any case portable application should specify 
all but basic arguments as keyword arguments. If json will incorporate some 
features from simplejson in future positions of new parameters will be 
different.

I propose to deprecate specifying all but mandatory parameters of json 
functions as positional arguments in 3.4 and then forbid it in 3.5.

I.e. dumps() should be implemented in 3.4 as:

def dumps(obj, *args, **kwargs):
if args:
warnings.warn("The positional arguments are deprecated.",
 DeprecationWarning, stacklevel=2)
return _dumps(obj, *args, **kwargs)

def _dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
allow_nan=True, cls=None, indent=None, separators=None,
default=None, sort_keys=False, **kwargs):
...

and in 3.5 as:

def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
allow_nan=True, cls=None, indent=None, separators=None,
default=None, sort_keys=False, **kwargs):
...

--
components: Library (Lib)
messages: 195068
nosy: bob.ippolito, ezio.melotti, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: json functions have too many positional parameters
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-08-13 Thread Christian Heimes

Christian Heimes added the comment:

Python 3.1 is affected, too. 3.1 will recieve security fixes until June 2014.

--
versions: +Python 3.1

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2013-08-13 Thread R. David Murray

R. David Murray added the comment:

This is not what we use keyword only arguments for.  The standard practice in 
the stdlib is that arguments are arguments unless there is a good reason to 
make one keyword only.  So I'm -1 on this proposal.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2013-08-13 Thread Ezio Melotti

Ezio Melotti added the comment:

Serhiy has a point though, I wouldn't want to see something like 
json.dumps(someobj, True, False, True, False).

--

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2013-08-13 Thread R. David Murray

R. David Murray added the comment:

Ach.  I didn't read carefully enough (not awake yet, I guess).

Yes, boolean parameters are one of the things keyword only arguments are 
appropriate for.

--

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Attached more refined patch. Removed unnecessary test. Added more robust test. 
Added shorten in __all__.

--
Added file: 
http://bugs.python.org/file31275/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: 
http://bugs.python.org/file31275/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Added file: 
http://bugs.python.org/file31276/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch

___
Python tracker 

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



[issue18725] Multiline shortening

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

What about newline keyword argument?

Are we forcing the newline to be '\n'? Alternate newlines will be useful for 
Windows platform ('\r\n') and HTML platform ('').

--

___
Python tracker 

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



[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2013-08-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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



[issue18725] Multiline shortening

2013-08-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

fill(...) is just '\n'.join(wrap(...)). Directly use wrap() if you need 
nonstandard newlines.

--

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2013-08-13 Thread Gabi Davar

Changes by Gabi Davar :


--
nosy: +Gabi.Davar

___
Python tracker 

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



[issue6875] add os.close() suggestion to mkstemp documentation

2013-08-13 Thread Gabi Davar

Changes by Gabi Davar :


--
nosy: +Gabi.Davar

___
Python tracker 

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



[issue14012] Misc tarfile fixes

2013-08-13 Thread Éric Araujo

Éric Araujo added the comment:

Thanks, LGTM.

--

___
Python tracker 

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



[issue18707] the readme should also talk about how to build doc.

2013-08-13 Thread Éric Araujo

Éric Araujo added the comment:

Either one looks good to me.

--

___
Python tracker 

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



[issue18703] To change the doc of html/faq/gui.html

2013-08-13 Thread Éric Araujo

Éric Araujo added the comment:

Also, the GPLs allows commercial usage, so using “LGPL” and “commercial” to 
mean two different licensing cases is not quite right.

--

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

I missed this case:

>>> from textwrap import shorten
>>> shorten('hell', 4)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/sky/Code/python/programming_language/cpython/Lib/textwrap.py", 
line 386, in shorten
return w.shorten(text, placeholder=placeholder)
  File "/home/sky/Code/python/programming_language/cpython/Lib/textwrap.py", 
line 322, in shorten
raise ValueError("placeholder too large for max width")
ValueError: placeholder too large for max width

Also, in this patch, I removed the unnecessary stripping of the text part.

--
Added file: 
http://bugs.python.org/file31277/fix_for_non_normalized_whitespaces_in_placeholder_v4.patch

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2013-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I missed this case:
> 
> >>> from textwrap import shorten
> >>> shorten('hell', 4)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File
>   "/home/sky/Code/python/programming_language/cpython/Lib/textwrap.py",
>   line 386, in shorten
> return w.shorten(text, placeholder=placeholder)
>   File
>   "/home/sky/Code/python/programming_language/cpython/Lib/textwrap.py",
>   line 322, in shorten
> raise ValueError("placeholder too large for max width")
> ValueError: placeholder too large for max width

This is by design. Passing a placeholder larger than the width is a
programming error, regardless of whether the text is small enough.

--
title: shorten function of textwrap module is susceptible to non-normalized 
whitespaces -> shorten function of textwrap module is susceptible to
non-normalized whitespaces

___
Python tracker 

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



[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, attached the fifth version not to care about the case where text is 
smaller than the placeholder.

--
Added file: 
http://bugs.python.org/file31278/fix_for_non_normalized_whitespaces_in_placeholder_v5.patch

___
Python tracker 

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



[issue18579] Dereference after NULL check in listobject.c merge_hi()

2013-08-13 Thread Christian Heimes

Christian Heimes added the comment:

Thanks! Your analysis is plausible. I have closed the issue as "false positive".

--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18727] test for writing dictionary rows to CSV

2013-08-13 Thread Muhammad Jehanzeb

New submission from Muhammad Jehanzeb:

Test for writing dictionary rows to further enhance the test coverage of CSV 
lib.

--
components: Tests
messages: 195083
nosy: brett.cannon, mjehanzeb
priority: normal
severity: normal
status: open
title: test for writing dictionary rows to CSV
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue18727] test for writing dictionary rows to CSV

2013-08-13 Thread Muhammad Jehanzeb

Changes by Muhammad Jehanzeb :


--
keywords: +patch
Added file: http://bugs.python.org/file31279/issue18727.patch

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1  The era of "register" has passed.

--
nosy: +rhettinger

___
Python tracker 

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



[issue18728] Increased test coverage for test_filecmp

2013-08-13 Thread Alex Volkov

New submission from Alex Volkov:

I increased test coverage from 68% to 74% of filecmp.py by adding test cases in 
test_filecmp.py in functions phase2 & phase4 in dircmp class.

--
components: Tests
files: test_filecmp.patch
keywords: patch
messages: 195085
nosy: Alex.Volkov
priority: normal
severity: normal
status: open
title: Increased test coverage for test_filecmp
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31280/test_filecmp.patch

___
Python tracker 

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



[issue18715] Tests fail when run with coverage

2013-08-13 Thread Seydou Dia

Seydou Dia added the comment:

The test results have been uploaded.

I forgot to mention in my previous comment the version of Coverage.py used:

changeset:   1463:2c5fb3a8b81c
tag: tip
user:Ned Batchelder 
date:Sun Jun 09 19:10:28 2013 -0400
summary: Branch coverage improvement, fixes #90.  Bug #212 fixed on py2, 
but not py3

--
Added file: http://bugs.python.org/file31281/tests.out

___
Python tracker 

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



[issue18728] Increased test coverage for filecmp.py

2013-08-13 Thread Alex Volkov

Changes by Alex Volkov :


--
title: Increased test coverage for test_filecmp -> Increased test coverage for 
filecmp.py

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

Is PCC used by any Linux or BSD distro? BSD prefers Clang.

--

___
Python tracker 

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2013-08-13 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Added file: http://bugs.python.org/file31282/4fc7c72b1c5d.diff

___
Python tracker 

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2013-08-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I have added documentation now so I think it is ready to merge (except for a 
change to Makefile).

--

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e7f6cef7a4cc by Antoine Pitrou in branch 'default':
Issue #18722: Remove uses of the "register" keyword in C code.
http://hg.python.org/cpython/rev/e7f6cef7a4cc

--
nosy: +python-dev

___
Python tracker 

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



[issue18722] Remove uses of the register keyword

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Committed. I don't think clang or MSVC would bother more than gcc does.

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

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 00bcf202cc3f by Antoine Pitrou in branch '2.7':
Add NEWS entry for 0f17aed78168 (issue #16248)
http://hg.python.org/cpython/rev/00bcf202cc3f

--

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> That fix does work, but it should probably get a NEWS entry since it
> fixes a regression from 2.7.3 to 2.7.5.

Done, thank you?

> Also, I think the same fix should be backported to all three of 2.6,
> 3.1, and 3.2.

Benjamin and Barry will have to decide what to do for 2.6 and 3.2.

--

___
Python tracker 

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



[issue18729] In unittest.TestLoader.discover doc select the name of load_tests function

2013-08-13 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/unittest.html#unittest.TestLoader.discover
"If load_tests exists then discovery does not recurse into the package"

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 195092
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestLoader.discover doc select the name of load_tests 
function
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31283/issue.diff

___
Python tracker 

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



[issue18583] Idle: enhance FormatParagraph

2013-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Based on working with the #18226 patch, I now think that rewrapping partial 
lines is a bug. Although I removed some problematical tests, I think there is 
still one that verifies buggy behavior. The outline of steps (which necessarily 
omits some details) would then be:

1. Extract a list of complete lines (without \n) from the text widget. The only 
purpose of using selections rather than the cursor would be to get partial 
paragraphs or multiple paragraphs. (I had thought of deleting that idea, but if 
you have made it work, I will look at it.)

There are still details to work out. If the cursor is on a blank line, should 
we really search forward? Normally, sel.first would be moved back to the 
beginning of the line [you apparently have already done this] and sel.last to 
the end. But if a block selection ends at the beginning of a line, sel.last 
should not be moved.

2. Delete the common prefix from each line, including '#' for comment blocks. 
Do this and the following without the current repeating joining of and 
splitting into lines. It is all wasted motion.

3. Reformat into a new list of lines, now with \n.

4. Add back the common prefix (still a list of lines with \n).

5. Insert the lines (which already have \n) into the text widget, one at a time.

   One of the details I left out is consistently handling of \n for the last 
line, so that deletion from the text widget and inserting into the widget 
match. One of the 'features' of the current code is that it will handle 
paragraphs with a different indent on the first line. I am not sure it is 
needed, as it does not apply to comment and string blocks.

Steps 2,3,4 do not involve the text widget. I think that they should be 
performed in one or more non-widget functions so they can be separately tested. 
I would feel this way even if mock_tk.Text were complete enough to substitute 
for tkinter.Text in the method test. 

I have not looked at your patch much because I want to review and possibly edit 
and commit some of the other submitted test patches before working more on this.

--

___
Python tracker 

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



[issue18090] dict_contains first argument declared register, and shouldn't be

2013-08-13 Thread Larry Hastings

Larry Hastings added the comment:

Closed as this is a subset of #18722.

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

___
Python tracker 

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



[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2013-08-13 Thread Dan Loewenherz

New submission from Dan Loewenherz:

Basically, when creating a NamedTemporaryFile, passing a value to the "suffix" 
parameter has no effect unless it's prepended with a period.

IMO, there are three options here...

1. Add a note in the documentation that this parameter only accepts 
period-prepended values (not ideal but better than the status quo).
2. Change the behavior to throw an exception when a non-period prepended value 
is provided (probably bad since it would break stuff).
3. Strip invalid values from this input and silently fail if the resulting 
string is of length 0 (might also break stuff).

--
components: Library (Lib)
messages: 195097
nosy: dloewenherz
priority: normal
severity: normal
status: open
title: suffix parameter in NamedTemporaryFile silently fails when not 
prepending with a period
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue18718] datetime documentation contradictory on leap second support

2013-08-13 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

+1

:-)

--
nosy: +belopolsky

___
Python tracker 

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



[issue18731] Increased test coverage for uu and telnet

2013-08-13 Thread Alex Volkov

Changes by Alex Volkov :


--
components: Tests
files: telnet_uu_tests.patch
keywords: patch
nosy: Alex.Volkov
priority: normal
severity: normal
status: open
title: Increased test coverage for uu and telnet
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31284/telnet_uu_tests.patch

___
Python tracker 

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



[issue15787] PEP 3121, 384 Refactoring

2013-08-13 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I strongly believe that it is worthwhile to invest in fixing abitype.py.  It is 
much easier to review a patch to one python script than to review 50+ patches 
to C files.  There is no excuse for this tool not to work on all stdlib 
modules.  If there are any specific issues with the way individual modules are 
written that prevent automatic conversion, I would prefer to make a coding 
style change first and then include all modules in one automated PEP 384 
conversion.

--

___
Python tracker 

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



[issue18732] IdleHistory.History: eliminate unused parameter; other cleanup.

2013-08-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

idlelib.IdleHistory is only imported in PyShell.PyShell. History is only 
instantiated once, with output_sep defaulting to \n. This constant parameter 
and the consequence splitting and joining with \n in ._get_source and 
._put_source are useless. After the tests for this class are committed in 
#18425, I plan to eliminate the unneeded parameter, splits, joins, and methods 
and inline the remaining text.get and .insert in .fetch. I want to do a few 
other transparent modernizations in the .fetch code, such as replacing 4 of the 
lines with
 pointer += -1 if reverse else 1

--
assignee: terry.reedy
components: IDLE
messages: 195099
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IdleHistory.History: eliminate unused parameter; other cleanup.
type: performance
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue18732] IdleHistory.History: eliminate unused parameter; other cleanup.

2013-08-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +IDLE Unit test for IdleHistory.py

___
Python tracker 

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



[issue12939] Add new io.FileIO using the native Windows API

2013-08-13 Thread Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue1227748] subprocess: inheritance of std descriptors inconsistent

2013-08-13 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-08-13 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue18544] subprocess.Popen support for redirection of arbitrary file descriptors

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

Why not using the pass_fds parameter for your use case?

--
nosy: +haypo

___
Python tracker 

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



[issue18685] Restore re performance to pre-PEP393 level

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

Using #include "_sre.c" in _sre.c looks weird. Instead of huge sections 
delimited by "#ifdef SRE_RECURSIVE", I would prefer something similar to the 
stringlib. ".h" template files included more than once. I also expect shorter 
files: _sre.c is close to 4000 lines of C code :-(

If you move code from _sre.c to a new file, you should use "hg cp" to keep the 
history. For the review, it's maybe better to continue with your SRE_RECURSIVE 
hack :)

--

#define SRE_CHAR Py_UCS1
#define SIZEOF_SRE_CHAR 1
..
#define SRE_CHAR Py_UCS2
#define SIZEOF_SRE_CHAR 1
...
#define SRE_CHAR Py_UCS4
#define SIZEOF_SRE_CHAR 1

The value of SIZEOF_SRE_CHAR looks suspicious.

Does test_re have some non-ASCII tests? If not, we should probably start by 
adding such tests!

--

___
Python tracker 

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



[issue18609] test_ctypes failure on AIX in PyEval_CallObjectWithKeywords

2013-08-13 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

@koobs: The problem is in the Python test, not in FreeBSD. Can you upgrade the 
kernel to the last development version?

Attached patch should fix the test.

--
keywords: +patch
Added file: http://bugs.python.org/file31285/sendfile_trailers.patch

___
Python tracker 

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



[issue12015] possible characters in temporary file name is too few

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset de5077aca668 by Victor Stinner in branch 'default':
Close #12015: The tempfile module now uses a suffix of 8 random characters
http://hg.python.org/cpython/rev/de5077aca668

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

___
Python tracker 

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



[issue12015] possible characters in temporary file name is too few

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

With 8 lowercase characters, the entropy is 41.7 bits, whereas it is only 35.9 
bits for 6 characters with uppercase and lowercase letters.

>>> math.log(26+26+10+1, 2) * 6 # (a-zA-Z0-9_) x 6
35.8636795409995
>>> math.log(26+10+1, 2) * 6 # (a-z0-9_) x 6
31.256720193773702
>>> math.log(26+10+1, 2) * 8 # (a-z0-9_) x 8
41.6756269250316

My changeset improves the entropy, it is now higher than with the old charset.

I don't know if it is enough or not to be safe. systemd creates a temporary 
directory per service. Linux 3.11 will add a new O_TMPFILE to open() which 
allow to create a file with no name. Using the flag should help to workaround 
the race condition attack. See #18673 for O_TMPFILE.

--

___
Python tracker 

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



[issue18405] crypt.mksalt() result has unnecessarily low entropy

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e8a314fe248b by Victor Stinner in branch '3.3':
Issue #18405: Improve the entropy of crypt.mksalt().
http://hg.python.org/cpython/rev/e8a314fe248b

New changeset 122e074c56f7 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #18405: Improve the entropy of crypt.mksalt().
http://hg.python.org/cpython/rev/122e074c56f7

--
nosy: +python-dev

___
Python tracker 

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



[issue18405] crypt.mksalt() result has unnecessarily low entropy

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

With my change, any character can appear more than once. Example:

>>> crypt.mksalt()
'$6$idm7/asaywTgRf9V'
>>> sorted(_[3:])
['/', '7', '9', 'R', 'T', 'V', 'a', 'a', 'd', 'f', 'g', 'i', 'm', 's', 'w', 'y']

In this case, the 'a' letter occurs twice.

--

___
Python tracker 

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



[issue18405] crypt.mksalt() result has unnecessarily low entropy

2013-08-13 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue14131] test_threading failure on WIndows 7 3.x buildbot

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

This failure was not seen recently, let's close this issue.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue15581] curses: segfault in addstr()

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

"Seems the bug was fixed for 3.3 in issue12567."

"Sorry, but without a smaller example program, I cannot help you on this issue. 
Please try to write a smaller program to reproduce the crash."

Let say that the bug was fixed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0bb9346665e9 by Terry Jan Reedy in branch '3.3':
Issue #18425: Add docstrings to IdleHistory.py.  Remove redundant 'history_'
http://hg.python.org/cpython/rev/0bb9346665e9

New changeset 22d7c755163d by Terry Jan Reedy in branch '2.7':
Issue #18425: Add docstrings to IdleHistory.py.  Remove redundant 'history_'
http://hg.python.org/cpython/rev/22d7c755163d

--
nosy: +python-dev

___
Python tracker 

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



[issue18733] elementtree: stop the parser more quickly on error

2013-08-13 Thread STINNER Victor

New submission from STINNER Victor:

When a Python handler of a XML tag fails, the ElementTree parser continues to 
parse the whole document. It would be nice to stop the parser more quickly.

The pyexpat module unregisters all handlers to fail more quickly. ElementTree 
may do something similar.

Or does the expat library have a function or attribute to stop the XML parser?

See also the issue #18501 (_elementtree.c calls Python callbacks while a Python 
exception is set).

--
components: XML
messages: 195110
nosy: fdrake, haypo
priority: normal
severity: normal
status: open
title: elementtree: stop the parser more quickly on error
type: performance
versions: Python 3.4

___
Python tracker 

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



[issue18501] _elementtree.c calls Python callbacks while a Python exception is set

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

> Instead of having to check if an exception is set in each Python
> callback, it would be better to "stop" the XML parser.

I created the issue #18733 to track this optimization.

The initial issue is fixed, so I'm closing it.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

"""
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/98/steps/test/logs/stdio

FAIL: test_finalize_runnning_thread (test.test_threading.ThreadTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_threading.py",
 line 298, in test_finalize_runnning_thread
self.assertEqual(rc, 42)
AssertionError: -6 != 42
"""

Oh, this error is not a regression introduced by this issue: it was already 
present in the oldest build of this buildbot:
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/5/steps/test/logs/stdio

--

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

TODO:

- review and integrate frame_fasttolocals.patch
- #18507: import_init() should not use Py_FatalError() but return an error
- #18509: CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error
- fix tests hang when an exception occurs in a thread

Most bugs have been fixed.

--

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2013-08-13 Thread STINNER Victor

STINNER Victor added the comment:

What is "an NTFS junction point"? Is it possible to delete it in cmd.exe with 
the del command?

--
nosy: +haypo

___
Python tracker 

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



[issue18606] Add statistics module to standard library

2013-08-13 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Attached is a patch containing the statistics reference implementation, after 
considering feedback given here and on python-ideas, and tests.

--
keywords: +patch
Added file: http://bugs.python.org/file31286/statistics.patch

___
Python tracker 

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



[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8f9bc9283400 by Raymond Hettinger in branch '3.3':
Issue 18719: Remove a false optimization
http://hg.python.org/cpython/rev/8f9bc9283400

--
nosy: +python-dev

___
Python tracker 

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



[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac2f59a6637f by Raymond Hettinger in branch '2.7':
Issue 18719: Remove a false optimization
http://hg.python.org/cpython/rev/ac2f59a6637f

--

___
Python tracker 

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



[issue18719] Remove false optimization for equality comparison of hashed strings

2013-08-13 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> fixed
status: open -> closed
title: Remove false optimizaton for equality comparison of hashed strings -> 
Remove false optimization for equality comparison of hashed strings

___
Python tracker 

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



[issue18583] Idle: enhance FormatParagraph

2013-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Note to myself. The current test suite has one test commented out because it 
worked with EditorWindow but not the mock. It is possible that it is a 
mark-gravity issue. (I ran into this with the mock for IdleHistory.).

--

___
Python tracker 

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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

IdleHistory.py is identical in 2.7 and 3.3. It is only imported in PyShell.py 
(within class PyShell, line 852 in 3.3). History is only initialized once, with 
the default output_sep. See #18732 for deleting the unneeded parameter and 
associated cruft.

The pushed patch adds docstrings and a couple of comments and removes most of 
the redundant prefixes. It does not change any logic.

The attached patch started as JK's patch with names changed and Ezio's changes. 
All test methods pass. There are three chunks of History.fetch that are not 
covered. Two require cyclic=False. The other requires special situations with 
text or cursor changes after one call to fetch but before the next. I will add 
these soon and push.

--

___
Python tracker 

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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


Added file: http://bugs.python.org/file31287/test_idlehistory3.diff

___
Python tracker 

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



[issue18734] Berkeley DB versions 4.4-4.9 are not discovered by setup.py

2013-08-13 Thread Eddie Stanley

New submission from Eddie Stanley:

Support for Berkeley DB up to 5.3 was introduced in Python 2.7.4 (see issue 
#17477) however I'm having problems with the detection code in setup.py.

I'm working on RHEL4, I've got Berkeley DB 4.7.25 installed in /opt/db-4.7.25

When I try and "make" Python, it can't build _bsddb because no suitable version 
of db.h was found. 

The function gen_db_minor_ver_nums(major) looks as though it's supposed to spit 
out all the minor versions for a given major, however it doesn't appear to work 
properly for 4.x - surely 4.3, 4.4, 4.5 ... all the way to 4.9 (or whatever) 
should be generated. 

It only generates minor version "3" though. The end result is that 4.3 is the 
only working version in the 4.x series.

--
components: Build
messages: 195120
nosy: Eddie.Stanley
priority: normal
severity: normal
status: open
title: Berkeley DB versions 4.4-4.9 are not discovered by setup.py
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2013-08-13 Thread Tim Peters

Tim Peters added the comment:

Victor, Wikipedia has a readable explanation:

http://en.wikipedia.org/wiki/NTFS_junction_point

I haven't used them much.  From cmd.exe, I've been able to delete them, not 
with "del" but with "rmdir".  You can create one from cmd.exe with the "mklink" 
command.

--
nosy: +tim_one

___
Python tracker 

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



[issue18606] Add statistics module to standard library

2013-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Revised patch with tests modified to pass, as described in pydev post.

1. test. added to test_statistics_approx import

2. delete test_main and change ending of both to
if __name__ == '__main__':
  unittest.main()

--
nosy: +terry.reedy
Added file: http://bugs.python.org/file31288/statistics2.diff

___
Python tracker 

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



[issue18728] Increased test coverage for filecmp.py

2013-08-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Hi Alex.

Typo in  "#Speicify subdirectories to hide".

I think you should not create WIN32 constant. Use this statement instead: 
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")

I think you should use addCleanup if you want to remove the directories that 
you create in that specific test. For example, in test_phase2_check_diff_files, 
you can use:
self.addCleanup(os.rmdir, check_type_dir)

That is for now.

--
nosy: +vajrasky

___
Python tracker 

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



  1   2   >