[issue17206] Py_XDECREF() expands its argument multiple times

2013-04-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

As I wrote in issue17589, there are some extension modules (pytables) that 
which assume that Py_INCREF is an expression:
  return Py_INCREF(x), x;
and Py_RETURN_NONE is also defined with a comma expression.

Oh, and Cython:
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : 
(Py_INCREF(Py_False), Py_False))

--

___
Python tracker 

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



[issue17487] wave.Wave_read.getparams should be more user friendly

2013-04-08 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. I received the confirmation for my CLA, could you commit the patch? 
Thank you!

--

___
Python tracker 

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



[issue17659] First weekday

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

I believe the request is exactly a function in the locale module to expose the 
locale-dependent calendar-week-start-day information based on the algorithm in 
the linked articles.

As for being able to pass in the locale, that's a general problem with the 
current locale API, and probably should be fixed as part of a general API 
enhancement, rather than special casing this one new function.

--

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

Only group the stuff you want to see in the result:

>>> re.split(r'(^>.*$)', '>Homo sapiens catenin (cadherin-associated)')
['', '>Homo sapiens catenin (cadherin-associated)', '']

>>> re.split(r'^(>.*)$', '>Homo sapiens catenin (cadherin-associated)')
['', '>Homo sapiens catenin (cadherin-associated)', '']

If you are using grouping to get alternatives, you can use a non-capturing 
group:

>>> re.split(r'(ca(?:t|d))', '>Homo sapiens catenin (cadherin-associated)')
['>Homo sapiens ', 'cat', 'enin (', 'cad', 'herin-associated)']

(By the way, I'm a bit confused as to what exactly you are splitting in your 
original example, since you seem to be matching the whole string, and only if 
it is the whole string.  On the other hand, regular expressions regularly 
confuse me... :)

I indeed do not think it is worth complicating the interface to handle the 
unusual case of accepting and applying unknown regexes.  The one change I could 
see as a possibility would be to allow all of the groups matched by the split 
regex to appear as a single sublist.  But I'm not the maintainer of this module 
either :)

--

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The modal versus non-modal issue, plus the Windows hi-lite issue, may partly 
explain the current design. It is actually quite usable once understood. The 
problem is that the current sparse doc does not adequately explain the 
intention - use ^F once to set the key and find it once, use ^G to find again.

It might help if the Find box itself had a reminder. "Use  to find 
the text again after this box closes." I suspect I read and understood the use 
of ^G once (years ago) and just forgot it due to disuse.

I do not think we should change the current design without more thought and 
discussion*. The current behavior is intended and not a bug. I suspect that 
there are people who have learned it and use it as is. 

For Notepad++ on Windows, the model search window goes somewhat transparent 
when one shifts focus to the edit window by clicking on it. However, one must 
either do this or click [close] on the dialog in order to edit.  One can 'find 
next' either by clicking the Find Next button *or* (when the dialog is closed) 
by hitting the key bound to find-next. Having to explicitly close the window to 
edit is a trade-off. It makes it easier to find - find- find without editing. 
It makes it a bit harder to actually edit after find (an extra action).

The one search thing I do constantly in Notepad++ that is more painful is 
finding all occurrences in the current file. Find in Files defaults to *.py in 
the current directory, so one has to replace '*' with the current file name. 
There should be a Find All button in the Find box (like Notepad++) or a Current 
File button in the Find in Files box.

*Another issue: The addition of Cut Copy Paste to the *top* of the right-click 
context menu for the Find in Files *Output* window is a nuisance. It makes it 
much harder to jump to the file and line of each entry as one now has to slide 
the mouse much further to get to the 
'Go to file/line' entry. I think this should be changed. My point for this 
issue is that changing features requires thinking about more than just one 
behavior or use in isolation.

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



[issue17661] documentation of '%r' links to the wrong repr

2013-04-08 Thread Georg Brandl

Georg Brandl added the comment:

It just highlights the mistake we made calling a builtin module the same name 
as a builtin function :)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue17659] First weekday

2013-04-08 Thread Éric Araujo

Éric Araujo added the comment:

I’m not sure I understand the request.  Is it that you want to know if you 
should e.g. display a calendar with Monday or Sunday in the first column 
depending on the user country?  It looks like this could belong in the locale 
or calendar module, if there is a clear 1:1 mapping of locale to first week day 
(the links you gave seem to indicate that there is one).

I think a new API should allow people to pass the locale explicitly: for 
example, I may want to read something in English, but having the Monday as 
first weekday makes calendars much easier to understand for me.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue17661] documentation of '%r' links to the wrong repr

2013-04-08 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for catching this; Sphinx’ lookup is confusing sometimes.  Using `.repr` 
or something similar will fix it.

--
nosy: +eric.araujo, ezio.melotti

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-08 Thread Charles-François Natali

Changes by Charles-François Natali :


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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-08 Thread Charles-François Natali

Charles-François Natali added the comment:

> New version hopefully good and ready for inclusion.

Looks good to me.
Since I assume you tested your patch on OpenBSD, to me it's ready for commit.
I won't be able to do it myself before two weeks though, so if someone
beats me to it, go ahead!

> Please note that the tests are still broken and need to be addressed (bignum 
> and sys.maxsize passed to ident and data respectively).

If you could fill a separate issue for that, it would be great.

BTW, there are other OpenBSD-specific issues on the report, and we
don't have that many contributors (AFAICT noone): so if you can have a
look at them, that would be great (especially since our OpenBSD
buildbots have all been down for some time now).

--

___
Python tracker 

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



[issue6640] urlparse should parse mailto: URL headers as query parameters

2013-04-08 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
resolution: fixed -> invalid

___
Python tracker 

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



[issue6640] urlparse should parse mailto: URL headers as query parameters

2013-04-08 Thread Senthil Kumaran

Senthil Kumaran added the comment:

RFC3986 bears the weightage since urlparse aims to satisfy that. As per that, 
mailto should return the url as path, and current urlparse behaves properly.

$ ./python.exe
Python 3.4.0a0 (default:50164abbfc98+, Apr  8 2013, 22:19:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse
>>> urllib.parse.urlparse("mailto:f...@example.com?subject=hi";)
ParseResult(scheme='mailto', netloc='', path='f...@example.com', params='', 
query='subject=hi', fragment='')
>>>

So, I am closing this bug as won't fix.

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



[issue17648] test_urllib2 convert doctests to unittest

2013-04-08 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I have pushed the changes since they are restricted to test files. If there are 
review comments, I shall do make the changes. 

I shall consider to to make 3.3 tests close to default branch ones so that 
fixes can be backported. (Leaving the bug open for that).

--
resolution:  -> fixed
stage:  -> committed/rejected
type:  -> behavior

___
Python tracker 

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



[issue17648] test_urllib2 convert doctests to unittest

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb632aafff57 by Senthil Kumaran in branch 'default':
#17648 - Clean up test_urllib2.py. Converted doctests to unittest for
http://hg.python.org/cpython/rev/eb632aafff57

--
nosy: +python-dev

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

Tomasz J. Kotarba added the comment:

Hi,
I can still see one piece of functionality I have mentioned missing. Using my 
first example, even when one uses '^(>(.*))$' one cannot get ['', '>Homo 
sapiens catenin (cadherin-associated)', ''] as one will get a four-element list 
and need to deal with the third element of the returned list (i.e. the match 
for a group).  Having a parameter I have described before which allows for 
getting the output similar to what one gets for groups but for the whole 
pattern (and only that) would be very convenient for some scenarios (like when 
writing a procedure which processes texts using different (and unknown at the 
time of writing the procedure) regex patterns which uses a variable number of 
groups but also the pattern as a whole (also for performing the split 
operation)).
Of course it can be worked around using many different approaches but still, as 
I said at start, I believe it would be useful (and would not break 
compatibility).  Another possible solution (i.e. different than the one I 
suggested at start) would be to have a parameter to tell re.split to ignore the 
groups (or, going even further, to select which groups to ignore).  Anyway, I 
am not the developer of this module so if you feel it would be too much of a 
bother to add such a parameter just for the sake of convenience then, by all 
means, please feel free to disregard my comments and just close this report.
Cheers,
T
P.S.  It is very late so I can only hope I have been sane enough to properly / 
clearly express my thoughts.  Apologies if not.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-08 Thread Hiroaki Kawai

Changes by Hiroaki Kawai :


--
title: ssl clean shutdown -> ssl unclean shutdown

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Roger Serwy

Roger Serwy added the comment:

I tried the patch against 2.7 and it appears to work, but might introduce 
another interface problem. 

The search dialog opens up as a modal window which disallows the user from 
changing the text. This may or may not be desirable. The technique of using the 
"hit" tag for highlighting the search results depends on this modal behavior, 
otherwise one can edit the text and "spread" the hit tag around. 

If you comment out the "grab_set" in Lib/idlelib/SearchDialogBase.py and then 
disable the colorizer in the editor window by pressing Ctrl+/ then you can 
spread the hit tag. (You can also disable the colorizer by saving to a file 
without a .py or .pyw extension).

Should the Search Dialog be modal?

--

___
Python tracker 

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



[issue17672] ssl clean shutdown

2013-04-08 Thread Hiroaki Kawai

New submission from Hiroaki Kawai:

When using ssl module, I sometimes get unexpected error. The observed error 
varies in different situations. After the investigation, I found the reason was 
that ssl shutdown was not performed and sometimes RST was sent over the network 
instead of FIN.

I created a patch against 2.7 branch.

--
components: Library (Lib)
files: python27.patch
keywords: patch
messages: 186372
nosy: Hiroaki.Kawai
priority: normal
severity: normal
status: open
title: ssl clean shutdown
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5
Added file: http://bugs.python.org/file29750/python27.patch

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

Fix calls to BaseReportTestCase methods in subclasses. Not an override so don't 
need super().

--
Added file: http://bugs.python.org/file29749/issue-15518-1.patch

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Changes by Chris Calloway :


Removed file: http://bugs.python.org/file29747/issue-15518-1.patch

___
Python tracker 

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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-08 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is the patch. I'll have to think about whether there's a self-contained 
way to test this.

--
assignee:  -> benjamin.peterson
keywords: +patch
Added file: http://bugs.python.org/file29748/gen_fix.patch

___
Python tracker 

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



[issue17589] Make documentation about macros in C API explicit about rvalue vs statement

2013-04-08 Thread Larry Hastings

Larry Hastings added the comment:

Oh, and, yes, it's true that Py_RETURN_NONE currently takes advantage of 
Py_INCREF being an rvalue, and changing Py_INCREF to a statement would break 
the existing implementation.  But Py_RETURN_NONE itself is of necessity a 
statement.   We would simply change Py_RETURN_NONE's implementation to multiple 
statements, probably with the do { ... } while(0) trick, so it worked again.  
I'd be shocked if that change broke any existing code.  So that's no big deal.

Having external code that depends on Py_INCREF being an rvalue is my concern, 
and what I hoped you'd bring up on bug #17206.

--

___
Python tracker 

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



[issue17657] IDLE: about dialog should report the full version of TK

2013-04-08 Thread Roger Serwy

Roger Serwy added the comment:

Let's discuss improving the about dialog on idle-dev or in a new issue.

Thanks for the patch, Todd!

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



[issue17589] Make documentation about macros in C API explicit about rvalue vs statement

2013-04-08 Thread Larry Hastings

Larry Hastings added the comment:

Amaury: I'd appreciate it if you'd bring those examples up on bug 17206.  If 
we're going to change the semantics of Py_INCREF I'd prefer we did it with our 
eyes wide open.

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-08 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue17657] IDLE: about dialog should report the full version of TK

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b6de25c6054 by Roger Serwy in branch '2.7':
#17657: Show full Tk version in IDLE's about dialog.
http://hg.python.org/cpython/rev/9b6de25c6054

New changeset 769699f0a760 by Roger Serwy in branch '3.3':
#17657: Show full Tk version in IDLE's about dialog.
http://hg.python.org/cpython/rev/769699f0a760

New changeset 50164abbfc98 by Roger Serwy in branch 'default':
#17657: merge with 3.3.
http://hg.python.org/cpython/rev/50164abbfc98

--
nosy: +python-dev

___
Python tracker 

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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

The crashing version has 'import logging' at the top of generators.py.  I did 
not experience a crash when it was absent even if there was no __pycache__.

It also doesn't crash if the import is moved out of the body of first_gen.

FAULTHANDLER doesn't fair too well on this one, no real surprise :)

Fatal Python error: Segmentation fault

Current thread 0xb75856c0:
zsh: segmentation fault  PYTHONFAULTHANDLER=true ../python test.py

--
nosy: +brett.cannon, eric.snow, pitrou, r.david.murray, vinay.sajip
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

The attached patch issue-15518-1.patch replaces previous patch proposals for 
this issue.

The patch implements the suggestion to factor code common to report TestCase 
classes into a common base class BaseReportTestCase. Apologies for not having 
that in the previous patch.

Concerning the major point of msg186123, I had anticipated that there would 
need to be some discussion concerning the complexity of test data layouts and 
expected reports. So I have attached two visual aids to facilitate review and 
feedback. I made many such graphs when tracing the minimal path for complete 
test coverage and found them useful.

test_filecmp_layouts.rst details the directory and file layouts minimally 
necessary to provide complete test coverage for the report methods in 
filecmp.dircmp. The layouts are shown in pretty-printed os.walk format. 
test_filecmp_reports.rst details the reports which result from those layouts 
when all filecmp.dircmp report methods are exercised against them. The reports 
are shown as rendered by printing.

Both visual aids are laid out as tables, with TestCase names as column headers, 
and test_ method names within those TestCases as row headers. Both visual aids 
identify identical cells by an index number in the bottom right hand corner of 
each cell for cells that are duplicated.

The layouts table identifies six common directory and file layouts that would 
be necessary within a proposed filecmpdata directory. I had created these 
layouts in setUp methods in order to follow the pre-existing style of the test 
script. I agree that doing so added to the test code complexity. I agree with 
the suggestion to instead put the layouts in a filecmpdata directory. Before I 
revise the patch to do that, however, I just want in understood that there are 
six layouts minimally necessary in the proposed filecmpdata.

Placing the layouts in a filecmpdata directory will eliminate the need for a 
tearDown method in BaseReportTestCase. Placing layouts in a filecmpdata 
directory will faciliate the revision of the pre-existing TestCases in the 
script, as they use similar layouts currently created in setUp methods and 
modified in test_ methods.

--
Added file: http://bugs.python.org/file29747/issue-15518-1.patch

___
Python tracker 

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



[issue17670] expandtabs() weirdness

2013-04-08 Thread Ned Deily

Ned Deily added the comment:

Yes, the behavior is by design.  I think you are misunderstanding how 
exandtabs() works.  The "tabsize" argument indicates the number of columns each 
tab position occupies.  So, with a tabsize of 4, the tab positions occur every 
four columns; the tab positions are where the characters immediately following 
the tab character start.  Perhaps this example will make the behavior clearer:

>>> '1\t2'.expandtabs(4)
'1   2'
>>> '12\t3'.expandtabs(4)
'12  3'
>>> '123\t4'.expandtabs(4)
'123 4'

--
nosy: +ned.deily
resolution:  -> works for me
stage:  -> committed/rejected
status: open -> closed
title: expandabs() weirdness -> expandtabs() weirdness

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

The attached file test_filecmp_reports.rst documents the reports generated by 
filecmp.dircmp test methods if the directory and file layouts in 
test_filecmp_layouts.rst are followed to aid in review discussion of patch.

--
Added file: http://bugs.python.org/file29746/test_filecmp_reports.rst

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

The attached file test_filecmp_layouts.rst documents the directory and file 
layouts for complete test coverage of filecmp.dircmp report methods to aid in 
review discussion of patch.

--
Added file: http://bugs.python.org/file29745/test_filecmp_layouts.rst

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Changes by Chris Calloway :


Removed file: http://bugs.python.org/file29682/issue-15518-1.patch

___
Python tracker 

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



[issue17671] io.BufferedRWPair can use uninitialized members

2013-04-08 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc:

This segfaults on all Python versions:
  io.BufferedRWPair.__new__(io.BufferedRWPair).read()

The various "_forward_call" methods should check that the reader and writer 
objects are correctly initialized. Not NULL, at the very least.

--
components: IO
messages: 186360
nosy: amaury.forgeotdarc, pitrou
priority: normal
severity: normal
status: open
title: io.BufferedRWPair can use uninitialized members
type: crash
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



[issue17615] String comparison performance regression

2013-04-08 Thread Neil Hodgson

Neil Hodgson added the comment:

Including the wmemcmp patch did not improve the times on MSC v.1600 32 bit - if 
anything, the performance was a little slower for the test I used:

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']156
specialised:
[0.9125948707773204, 0.8990815272107868, 0.9055365478250721]
wmemcmp:
[0.9287715478844594, 0.926606017373151, 0.9155132192031097]

Looking at the assembler, there is a real call to wmemcmp which adds some time 
and wmemcmp does not seem to be optimized compared to a simple loop.

However, the use of memcmp for 1:1 is a big win. Replacing the memcmp with 
COMPARE(Py_UCS1, Py_UCS1) shows memcmp is 45% faster on 100 character strings. 
memcmp doesn't generate a real call: instead there is an inline unrolled (4 
bytes per iteration) loop.

--

___
Python tracker 

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



[issue17670] expandabs() weirdness

2013-04-08 Thread Alfredo Solano Martínez

New submission from Alfredo Solano Martínez:

I stumbled upon this by chance. Is the following behaviour by design?

>>> s = 'a\tb'
>>> s.expandtabs(1) == s.expandtabs(2)
True

In fact:
>>> s.expandtabs(1)
'a b' # 1 space
>>> s.expandtabs(2)
'a b' # 1 space
>>> s.expandtabs(3)
'a  b' # 2 spaces
>>> s.expandtabs(4)
'a   b' # 3 spaces

It seems to be an off-by-one difference from 2 onwards. 

Tested with python versions 2.7.4, 3.2.4 and 3.3.1 on a Linux x86_64 machine.

--
components: Library (Lib)
messages: 186358
nosy: asolano
priority: normal
severity: normal
status: open
title: expandabs() weirdness
type: behavior
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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson, ncoghlan

___
Python tracker 

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



[issue17626] set's __isub__ doesn't support non-sets.

2013-04-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I actually like that list.__iadd__ accepts any iterable, it's a rather nice 
piece of duck-typing.

--
nosy: +pitrou

___
Python tracker 

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



[issue17626] set's __isub__ doesn't support non-sets.

2013-04-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Confirmed.  This is by design.   Guido has long lamented that the += operator 
for lists would accept any iterable.  This led to a number of surprises:  s= 
['hello']; s += 'world'   # Oops!

--

___
Python tracker 

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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-08 Thread Frank Hamand

Frank Hamand added the comment:

The file contents so people dont have to download the zip:

generators.py:
---
def subgen():
yield

def other_gen(self):
move = yield from subgen()

game.py:
---
class Game(object):
def __init__(self):
self.gen = self.first_gen()
next(self.gen)
def first_gen(self):
while True:
from generators import \
other_gen
yield from other_gen(self)


test.py:
---
from game import Game
Game()

--

___
Python tracker 

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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-08 Thread Frank Hamand

New submission from Frank Hamand:

I've found a very strange bug in python 3.3

It's taken me around an hour just to narrow it down to a small case where it 
happens.

I cannot for the life of me figure out the exact cause. It seems to have 
something to do with "yield from".

I've attached a case which reproduces this. Run python3.3 test.py, it should 
segfault on linux, "stopped responding" on windows.

Tested with
OS: Linux Debian-60-squeeze-32-minimal 2.6.32-5-686-bigmem
PY: Python 3.3.1rc1 (default, Mar 30 2013, 21:44:39)

OS: Windows 7 64 bit
PY: Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 
bit (Intel)] on win32


NOTES: If you get rid of "import logging" in generators.py, it only crashes if 
there's no __pycache__

--
title: Segfault caused by -> Segfault caused by weird combination of imports 
and yield from
Added file: http://bugs.python.org/file29744/segfault.zip

___
Python tracker 

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



[issue17669] Segfault caused by

2013-04-08 Thread Frank Hamand

Changes by Frank Hamand :


--
components: Interpreter Core, Windows
nosy: fhamand
priority: normal
severity: normal
status: open
title: Segfault caused by
type: crash
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



[issue16427] Faster hash implementation

2013-04-08 Thread STINNER Victor

STINNER Victor added the comment:

Does anyone know if fast_hash_3.patch may reduce the quality of the hash 
function? (May the patched hash function produce more collisions? The 
"Avalanche effect" thing.)

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-08 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file29743/bench_hash.py

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-08 Thread STINNER Victor

STINNER Victor added the comment:

fast_hash_3.patch is a litte bit (6%) slower for Unicode string shorter than 10 
characters, but much faster for string equal or longer than 100 characters (up 
to 10x faster).

I used the str type and disabled its cache ("_PyUnicode_HASH(self) = x;" in 
unicode_hash()) to run my benchmark.


Summary    |   original |    patched
---++---
Length 1   | 231 ns (*) |   244 ns (+6%)
Length 3   | 238 ns (*) |   253 ns (+6%)
Length 10  | 254 ns (*) | 251 ns
Length 20  | 280 ns (*) |   256 ns (-8%)
Length 100 | 528 ns (*) |  321 ns (-39%)
Length 10 ** 4 |  32 us (*) | 9.49 us (-70%)
Length 10 ** 8 | 329 ms (*) |  104 ms (-68%)
---++---
Total  | 329 ms (*) |  104 ms (-68%)

--
Added file: http://bugs.python.org/file29742/bench_hash.txt

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-08 Thread Federico Schwindt

Federico Schwindt added the comment:

New version hopefully good and ready for inclusion.

Please note that the tests are still broken and need to be addressed (bignum 
and sys.maxsize passed to ident and data respectively).

Thanks.

--
Added file: http://bugs.python.org/file29741/patch-Modules_selectmodule_c

___
Python tracker 

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



[issue17664] ssl.SSLError has errno value of None

2013-04-08 Thread Paul Wiseman

Paul Wiseman added the comment:

Ah ok, thanks for clearing that up. I thought there'd have been a socket.error 
with ETIMEDOUT raised as the underlying exception, similar to if it times out 
during the non-ssl part of the request

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-08 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



[issue17615] String comparison performance regression

2013-04-08 Thread STINNER Victor

STINNER Victor added the comment:

Neil.Hodgson wrote:
"The patch fixes the performance regression on Windows. The 1:1 case is better 
than either 3.2.4 or 3.3.1 downloads from python.org. Other cases are close to 
3.2.4, losing at most around 2%."

Nice, but make sure that your are using the same compiler with the same options 
(ex: make sure that you are compiling in Release mode).

Neil.Hodgson wrote:
"Perhaps taking a systematic approach to naming would allow Py_UCS1 to be 
deduced from PyUnicode_1BYTE_KIND and so avoid repeating the information in the 
case selector and macro invocation."

I don't know how to do that in C. Anyway, I prefer to have a more explicit call 
to a "simple" macro than magic implicit arguments. Optimizations sometimes make 
the code harder to read (a good example: the whole PEP 393)...

--

I wrote specialized functions to compare strings for each combination of 
Unicode kinds, and I added a fast path using wmemcmp() when possible. I don't 
see other speedup.

On Linux, Comparing astral strings in Python 3.4 is now 3 times faster than 
Python 3.2 and 3.3. I achieved my goal, I can close the issue :-D

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d3185be3e8d7 by Victor Stinner in branch 'default':
Issue #17615: Comparing two Unicode strings now uses wmemcmp() when possible
http://hg.python.org/cpython/rev/d3185be3e8d7

--

___
Python tracker 

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



[issue17660] mock.patch could whitelist builtins to not need create=True

2013-04-08 Thread Michael Foord

Michael Foord added the comment:

I don't think that's a particular issue. In general you only need to use 
"create=True" if a name is *not* available in a namespace. 

Builtin names are odd in that you can use them in a namespace even though they 
don't exist there - so you have to *remember* to use "create=True" even though 
the name *is* available. 

So this issue is about fixing that quirk.

--

___
Python tracker 

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

A bit in detail:
- ENOTCONN is a programming error, so there's no use actually catching it (you 
should fix the bug instead when you encounter it)
- EINVAL could be a candidate, but unfortunately it would clash quite nastily 
with ValueError and lead to confusion; therefore I think it's better not 
wrapping it

--
status: open -> pending

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db4a1a3d1f90 by Victor Stinner in branch 'default':
Issue #17615: Add tests comparing Unicode strings of different kinds
http://hg.python.org/cpython/rev/db4a1a3d1f90

--

___
Python tracker 

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-08 Thread Georg Brandl

Georg Brandl added the comment:

Antoine will have to decide on this, but IMO now that we released the PEP 3151 
set in Python 3.3, we should not continue adding new builtin exceptions in 
every release.

--

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

As you pointed out, you can already get that behavior by enclosing the entire 
split expression in a group.  I don't see that there is any functionality 
missing here.

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cc74062c28a6 by Victor Stinner in branch 'default':
Issue #17615: Expand expensive PyUnicode_READ() macro in unicode_compare():
http://hg.python.org/cpython/rev/cc74062c28a6

--
nosy: +python-dev

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

Tomasz J. Kotarba added the comment:

I agree that introducing an example like that plus making some slight changes 
in wording would be a welcome change to the docs to clearly explain the current 
behaviour.  Still, I maintain it would be useful to give users the option I 
described to allow them decide what output they get (i.e. also get texts 
matching the whole pattern and/or those matching the pattern and groups (e.g. 
pattern returned as kind of "group 0")).  As I said though, I realise that it 
is not for me to decide so I am just suggesting it to the powers that be.
Cheers,
T

--
components:  -Documentation

___
Python tracker 

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



[issue17655] Use writev() function in the io module

2013-04-08 Thread STINNER Victor

STINNER Victor added the comment:

I get similar Fedora 18 (Linux kernel 3.8.1), ext4 filesystem:

$ rm -f writev.out; sync; sleep 5; ./copy_write
copy+write: 1s576530.
$ rm -f writev.out; sync; sleep 5; ./writev 
writev: 1s686619.

I agree to close the issue. At least this issue can be used later is someone 
else ask why Python is not using writev() ;-)

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 29f0836c0456 by Serhiy Storchaka in branch '2.7':
Close #17666: Fix reading gzip files with an extra field.
http://hg.python.org/cpython/rev/29f0836c0456

New changeset f78d2605f452 by Serhiy Storchaka in branch '3.3':
Close #17666: Fix reading gzip files with an extra field.
http://hg.python.org/cpython/rev/f78d2605f452

New changeset cd5e3adc6fc1 by Serhiy Storchaka in branch 'default':
Close #17666: Fix reading gzip files with an extra field.
http://hg.python.org/cpython/rev/cd5e3adc6fc1

--
nosy: +python-dev
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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

>>> re.split('-', 'abc-def-jlk')
['abc', 'def', 'jlk']
>>> re.split('(-)', 'abc-def-jlk')
['abc', '-', 'def', '-', 'jlk']

Does that make it a bit clearer?  Maybe we need an actual example in the docs.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage: committed/rejected -> needs patch

___
Python tracker 

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



[issue17477] update the bsddb module do build with db 5.x versions

2013-04-08 Thread Matthias Klose

Matthias Klose added the comment:

was released with 2.7.4.

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh-oh-h, it's my fault. Thank you, Peter, for your report and the proposed fix.

--

___
Python tracker 

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



[issue15194] libffi-3.0.11 update

2013-04-08 Thread Matthias Klose

Matthias Klose added the comment:

3.0.13 is now in 2.7.4, 3.2.4, 3.3.1 and the trunk.

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

Tomasz J. Kotarba added the comment:

Marking as open till I get your response.  I hope you reconsider.

--
resolution: invalid -> 
status: closed -> open

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

Tomasz J. Kotarba added the comment:

Hi R. David Murray,
Thanks for your reply.  I just explained in my previous message to Matthew that 
documentation does actually support my view (i.e. it is an issue according to 
the documentation).  Re. the issue you mentioned (discarding information 
concerning group matching) that (plus maintaining the compatibility with legacy 
code) is why I suggested adding a new optional argument to re.split.  Apropos 
discrading information, the current behaviour results in discarding information 
about parts of the string not enclosed in grouping parentheses. 
Cheers,
T

--

___
Python tracker 

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



[issue13150] Most of Python's startup time is sysconfig

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be3b4aa2ad28 by doko in branch '2.7':
- Issue #13150, #17512: sysconfig no longer parses the Makefile and config.h
http://hg.python.org/cpython/rev/be3b4aa2ad28

--

___
Python tracker 

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



[issue17512] backport of the _sysconfigdata.py module (issue 13150) breaks the build on darwin

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be3b4aa2ad28 by doko in branch '2.7':
- Issue #13150, #17512: sysconfig no longer parses the Makefile and config.h
http://hg.python.org/cpython/rev/be3b4aa2ad28

--
nosy: +python-dev

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

Tomasz J. Kotarba added the comment:

Hi Matthew,

Thanks for such a quick reply.  I know I can get the > by putting it in 
grouping parentheses.  That's not the issue here.  The documentation you quoted 
says that it splits the string by the occurrences _OF_PATTERN_ and that texts 
of all groups are _ALSO_ returned as _PART_ of the resulting list.  It does not 
say anywhere (nor does it even suggest that) that parts of the pattern not 
grouped with parentheses are REMOVED.

That said, I did not report this issue to split hairs (I would rather split 
strings with regular expressions ;)) and perform liguistic analysis of the 
current documentation (which is not set in stone and has been changed before).  
I did that because I spotted an issue which slightly limits usefulness of 
re.split() and suggested a potential improvement which would solve the problem 
and make re.split() even better than it already is.  Whether the powers that be 
do something with this and improve re.split() is of course not my decision.

Cheers,
T

--

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report, but as Matt said it doesn't look like there is any bug 
here.  The behavior you report is what the docs say it is, and it seems to me 
that your "most useful" suggestion would discard the information about the 
group match, making specifying groups in the separator pointless.

--
nosy: +r.david.murray
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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Matthew Barnett

Matthew Barnett added the comment:

It's not a bug.

The documentation says """Split string by the occurrences of pattern. If 
capturing parentheses are used in pattern, then the text of all groups in the 
pattern are also returned as part of the resulting list."""

You're splitting on r'^>(.*)$', but not capturing the '>', therefore it's 
excluded.

If you want the '>' included, then put it inside the capture group too.

--

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Sarah

Sarah added the comment:

'Find Again' switched to 'Find Next'

--
Added file: http://bugs.python.org/file29740/issue_17511_FindNext.patch

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-08 Thread Vhati

Vhati added the comment:

The 2013-04-08 patch worked on Windows XP.

--

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I took a look at both the 'Search' and 'Replace' dialogs and both  already have 
wrap-around present as the default: '[x] Wrap around'. Sorry for not checking 
earlier.

Having the find window stay open will make it much easier to visually check all 
the options.* 

The Edit menu has 3 find entries
Find ...Cntl+F
Find again  Cntl+G
Find selection  Cntl+H

I think these menu items should lead to a 'Find' dialog, not a 'Search' dialog. 
I find the name switch confusing. Both 'find' and 'find_replace' search the 
text (and both dialogs use SearchDialogBase). That would be a trivial change to 
add to the patch if everyone agrees. Otherwise it can be a separate issue.

Re-considering whether we still need those 3 entries after this patch would be 
a separate follow-up issue.

* For automated tests, is the Idle code currently organized in such a way that 
we can code the following without actually running Idle or showing anything on 
the screen: create an edit widget or window with some text, create an 
associated dialog box, set and unset text and options in the box, call an 
'action' function, and then check in the edit window that the 'correct' text is 
highlighted and that the cursor is where it 'should' be? (This of course 
requires exact specification of 'correct' and 'should'.)

--

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-08 Thread Tomasz J. Kotarba

New submission from Tomasz J. Kotarba:

Tested in 2.7 but possibly affects the other versions as well.

A real life example (note the first character '>' being lost):

>>> import re
>>> re.split(r'^>(.*)$', '>Homo sapiens catenin (cadherin-associated)')

produces:

['', 'Homo sapiens catenin (cadherin-associated)', '']


Expected (and IMHO most useful) behaviour would be for it to return:

['', '>Homo sapiens catenin (cadherin-associated)', '']

or (IMHO much less useful as one can already get this one just by adding 
external grouping parentheses and it is ):

['', '>Homo sapiens catenin (cadherin-associated)', 'Homo sapiens catenin 
(cadherin-associated)', '']

Not sure whether it can be changed in such a mature and widely used module 
without breaking compatibility but just adding a new optional parameter for 
deciding how re.split() deals with patterns containing grouping parentheses and 
making it default to the current behaviour would be very helpful.
Best Regards

--
components: Regular Expressions
messages: 186324
nosy: ezio.melotti, mrabarnett, triquetra011
priority: normal
severity: normal
status: open
title: re.split loses characters matching ungrouped parts of a pattern
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



[issue17660] mock.patch could whitelist builtins to not need create=True

2013-04-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

To be honest this proposal sounds like a quirk more than a feature to me. If 
you only special-case builtins, people will have to remember that special case 
and it will make the API more complicated.

--
nosy: +pitrou

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch
type:  -> behavior
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue17667] Windows: build with "build_pgo.bat -2" fails to optimize python.dll

2013-04-08 Thread Anselm Kruis

New submission from Anselm Kruis:

Version: 2.7.4 (and any prior 2.7-version. not tested with 3.x)
Compiler: VS 2008 Professional

If I compile Python using the batch 

> PCbuild\build_pgo.bat -2

Visual Studio fails to correctly collect profile information for the project 
"python27.dll". As a result, no real optimisation takes place.

The command "build_pgo.bat -2" runs the full test suite 
(..\lib\test\regrtest.py) to collect profile data. Experiments show, that 
several test cases (i.e. test_os and test_subprocess) break the collection of 
profile data. Probably the failure is related to the creation of sub-processes. 
I consider it a Visual Studio bug.

To work around this issue I created a list of good test cases and patched 
build_pgo.bat to run only the tests from this list.

--
components: Build, Windows
files: build_pgo-2.patch
keywords: patch
messages: 186322
nosy: akruis
priority: normal
severity: normal
status: open
title: Windows: build with "build_pgo.bat -2" fails to optimize python.dll
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file29739/build_pgo-2.patch

___
Python tracker 

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



[issue17664] ssl.SSLError has errno value of None

2013-04-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The issue you mention is unrelated. connect_ex() returns an error code, it 
doesn't raise an exception.

As for the errno attribute being None, this is because most SSLErrors don't 
correspond to a single OS error. And in the case you mention ("the read 
operation timed out"), it isn't an OS error at all: it's simply a select() call 
timing out.

--
nosy: +pitrou
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-08 Thread Peter

New submission from Peter:

Regression in Python 3.3.0 to 3.3.1, tested under Mac OS X 10.8 and CentOS 
Linux 64bit.

The same regression also present in going from Python 2.7.3 from 2.7.4, does 
that need a separate issue filed?

Consider this VALID GZIP file, human link:
https://github.com/biopython/biopython/blob/master/Tests/GenBank/cor6_6.gb.bgz

Binary link, only a small file:
https://raw.github.com/biopython/biopython/master/Tests/GenBank/cor6_6.gb.bgz

This is compressed using a GZIP variant called BGZF which uses multiple blocks 
and records additional tags in the header, for background see:
http://blastedbio.blogspot.com/2011/11/bgzf-blocked-bigger-better-gzip.html

$ curl -O 
https://raw.github.com/biopython/biopython/master/Tests/GenBank/cor6_6.gb.bgz
$ cat cor6_6.gb.bgz | gunzip | wc
 3201183   14967

Now for the bug, expected behaviour:

$ python3.2
Python 3.2 (r32:88445, Feb 28 2011, 17:04:33) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
>>> handle = gzip.open("cor6_6.gb.bgz", "rb")
>>> data = handle.read()
>>> handle.close()
>>> len(data)
14967
>>> quit()

Broken behaviour:

$ python3.3
Python 3.3.1 (default, Apr  8 2013, 17:54:08) 
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
>>> handle = gzip.open("cor6_6.gb.bgz", "rb")
>>> data = handle.read()
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/pjcock/lib/python3.3/gzip.py", line 359, in read
while self._read(readsize):
  File "/Users/pjcock/lib/python3.3/gzip.py", line 432, in _read
if not self._read_gzip_header():
  File "/Users/pjcock/lib/python3.3/gzip.py", line 305, in _read_gzip_header
self._read_exact(struct.unpack("

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



[issue17665] convert to idiomatic unittest code

2013-04-08 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
components: Tests
files: diff
nosy: tshepang
priority: normal
severity: normal
status: open
title: convert to idiomatic unittest code
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29738/diff

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

'Find Next' is the actual (and standard) suggestion. It s a trivial change 
given that you identified the place to make it .

--

___
Python tracker 

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



[issue17589] Make documentation about macros in C API explicit about rvalue vs statement

2013-04-08 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16895] Batch file to mimic 'make' on Windows

2013-04-08 Thread Zachary Ware

Zachary Ware added the comment:

> You seem to end your subroutines (or whatever they are called) using "goto 
> end" rather than "exit /b".  Since popd follows the "end" label, does this 
> mean that you get a popd after calling each subroutine?

Yes.

> Is this intended and can it cause unmatched pushd/popd-s?

It is intended and it can, but so far I haven't run into any trouble
with it.  However, I have realized that I haven't done any testing
with some pushd's already on the stack...  I'll do some more looking
into that, and may have to implement either some form of callback
labels or counting pushd's to properly popd.

> (I am not familiar with writing batch files.)
>
> Also, I think 32 bit builds should be the default.  Many people with 64 bit 
> Windows are using Visual Studio Express which only has 32 bit support.

Fair point.  I suppose I had been assuming that the error message from
not finding the proper vcvars*.bat file would be an indication to pass
'--without-64-bit' to configure.bat, but it is much nicer to just fall
back to 32 bit.  Also, it would be nice to just implode from the start
if there is no compiler available.  Next version of the patch will do
both of these things in configure.bat; quit with an error message if
%VS100COMNTOOLS% is not defined, and check for the existence of
%VS100COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat before
setting %PY_PLATFORM% to x64.

Thanks for the comments.

--

___
Python tracker 

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



[issue17589] Make documentation about macros in C API explicit about rvalue vs statement

2013-04-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

There are some extension modules (pytables) that do
  return Py_INREF(x), x;
and Py_RETURN_NONE is also defined with a comma expression.

Oh, and Cython:
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : 
(Py_INCREF(Py_False), Py_False))

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue17649] Python/Python-ast.c: No such file or directory

2013-04-08 Thread pfg

Changes by pfg :


Removed file: http://bugs.python.org/file29736/patch-Makefile.pre.in

___
Python tracker 

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



[issue17649] Python/Python-ast.c: No such file or directory

2013-04-08 Thread pfg

pfg added the comment:

Ruslan Makhmatkhanov provided this (more complete) patch.

--
Added file: http://bugs.python.org/file29737/patch-Makefile.pre.in

___
Python tracker 

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



[issue17662] socketmodule raises on import when compiled using Setup.dist on 2.7.4

2013-04-08 Thread Kristján Valur Jónsson

Changes by Kristján Valur Jónsson :


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



[issue17662] socketmodule raises on import when compiled using Setup.dist on 2.7.4

2013-04-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bad85e4e6b7f by Kristjan Valur Jonsson in branch '2.7':
Issue #17662: fix socketmodule compilation with Setup.dist.
http://hg.python.org/cpython/rev/bad85e4e6b7f

--
nosy: +python-dev

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Sarah

Sarah added the comment:

Terry-

There should be a checkbutton option labeled 'Wrap Around'. This is 
instantiated on lines 7 and 105-111 of SearchDialogBase.py

Admittedly, it is standard practice to have a 'find' function wrap around. I 
suppose we could have the dialog start up with the 'Wrap around' box checked.

Thoughts?

Note: If we're going to make a change to the 'wrap around' settings, I think we 
should start a new issue. Wrap around really isn't related to the 'find box 
closing' issue.

--

___
Python tracker 

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



[issue17649] Python/Python-ast.c: No such file or directory

2013-04-08 Thread pfg

pfg added the comment:

The problem is Makefile.pre.in was changed in a way that stops out-of-tree 
builds.

The following patch by Markus Von Appen fixes it.

--
status: closed -> open
Added file: http://bugs.python.org/file29736/patch-Makefile.pre.in

___
Python tracker 

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



[issue17658] pythonw.exe crashes on opening IDLE

2013-04-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Please remove the PYTHONPATH environment variable.

I don't know how it came here, but it's certainly not needed: these directories 
are computed at runtime when the python27 interpreter starts;
it can only do harm when another interpreter is installed.

--

___
Python tracker 

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



[issue17570] Improve devguide Windows instructions

2013-04-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Sorry, but you cannot just rewrite ./python.exe to just python.exe

At least in http://docs.python.org/devguide/buildbots you have to make probably 
three sections: 
1. for linux users to use just ./python
2. for Mac ./python.exe
3. for Windows /PCBuild/python.exe or python_d.exe (IIRC)

--

___
Python tracker 

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



[issue17664] ssl.SSLError has errno value of None

2013-04-08 Thread Paul Wiseman

New submission from Paul Wiseman:

I was using py2.7.3 and was getting None back for the errno attribute for an 
ssl.SSLError('The read operation timed out').

I noticed in the 2.7.4 release notes that it sounds like there was a fix for 
this:

Issue #12065: connect_ex() on an SSL socket now returns the original errno
when the socket's timeout expires (it used to return None).

I've just tested in py2.7.4 and I'm still getting None back for the errno 
attribute.

I'm using this code to produce the error:

import requests

def __init__(self, exception):
# First extract the real underlying exception
exception = exception.args[0]  # This should be ssl.SSLError
super(requests.exceptions.ConnectionError, self).__init__(exception)
self.strerror = exception.strerror
self.errno = exception.errno

requests.exceptions.ConnectionError.__init__ = __init__

timeout_val = 0.2
while True:
try:
print requests.get("https://google.com";, timeout=timeout_val)
except requests.exceptions.SSLError as err:
print err.strerror
print err.errno
break
except Exception as err:
print "Got %s: %s" % (err.__class__.__name__, err)
timeout_val /= 2

--
messages: 186310
nosy: Paul.Wiseman
priority: normal
severity: normal
status: open
title: ssl.SSLError has errno value of None
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



[issue17511] Idle find function closes after each find operation

2013-04-08 Thread Sarah

Sarah added the comment:

This changes the button's text from "Find" to "Find Again", as per Todd Rovito 
and Terry J. Reedy's suggestion.

--
Added file: http://bugs.python.org/file29735/issue17511_FindAgain.patch

___
Python tracker 

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



[issue17662] socketmodule raises on import when compiled using Setup.dist on 2.7.4

2013-04-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

This is my fault, 
I admit to not being an expert in non-windows builds.
I've no idea how Modules/Setup.dist works but the patch looks reasonable and if 
it works, then all is fine.

--

___
Python tracker 

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Sorry for reopening.

Do you really sure that ENOTCONN and EINVAL doesn't worth to have separate 
sublasses?

The same question about Not Supported family.

I don't force to make new exception classes, just like to figure out the status 
quo.

If we decide to keep in stone our exceptions hierarchy for OSError's — that's 
ok.
If list is open — let's discuss

--
nosy: +georg.brandl
status: closed -> open

___
Python tracker 

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



[issue17662] socketmodule raises on import when compiled using Setup.dist on 2.7.4

2013-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +kristjan.jonsson

___
Python tracker 

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



[issue17552] socket.sendfile()

2013-04-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Added file: http://bugs.python.org/file29734/socket-sendfile2.patch

___
Python tracker 

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



[issue17552] socket.sendfile()

2013-04-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Removed file: http://bugs.python.org/file29733/socket-sendfile2.patch

___
Python tracker 

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



[issue17658] pythonw.exe crashes on opening IDLE

2013-04-08 Thread Patrick Poitras

Patrick Poitras added the comment:

It returns this:

C:\Users\Acebulf>set | findstr /i python
Path=C:\Python27\Lib\site-packages\PyQt4;C:\Program Files (x86)\NVIDIA Corporati
on\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program
Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft SQL Server\1
10\Tools\Binn\;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files\In
tel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Python27\
PYTHONPATH=C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;

--

___
Python tracker 

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



[issue17552] socket.sendfile()

2013-04-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Added file: http://bugs.python.org/file29733/socket-sendfile2.patch

___
Python tracker 

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



  1   2   >