[issue15415] Add temp_dir() and change_cwd() to test.support

2013-07-29 Thread Nick Coghlan

Nick Coghlan added the comment:

No dice: 
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2399/steps/test/logs/stdio

Could someone with a Windows build set up try this out?

I'd like to rule out a conflict with the -j setting, since being dependent on 
the current working directory pretty much rules out being run in parallel with 
other tests, but I didn't see anything in regrtest that let me say "run this 
one before fanning out into parallel execution".

--

___
Python tracker 

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



[issue15415] Add temp_dir() and change_cwd() to test.support

2013-07-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 403b038ff075 by Nick Coghlan in branch '3.3':
Third attempt to fix #15415 on Windows
http://hg.python.org/cpython/rev/403b038ff075

New changeset fa13a159f063 by Nick Coghlan in branch 'default':
Merge #15415 from 3.3 (again)
http://hg.python.org/cpython/rev/fa13a159f063

--

___
Python tracker 

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



[issue18396] test_signal.test_issue9324() fails on buildbot AMD64 Windows7 SP1 3.x

2013-07-29 Thread Nick Coghlan

Nick Coghlan added the comment:

Is it possible this is indicating a real bug with faulthandler on Windows? Why 
are we returning None from signal.getsignal?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue18396] test_signal.test_issue9324() fails on buildbot AMD64 Windows7 SP1 3.x

2013-07-29 Thread Jeremy Kloth

Jeremy Kloth added the comment:

It do not think that it is a just a Windows issue wrt faulthandler. It is that 
there are no similar tests for signals on other platforms.

getsignal() needs to return *something* for the value of a handler which is not 
SIG_DFL or SIG_IGN.

--

___
Python tracker 

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



[issue15415] Add temp_dir() and change_cwd() to test.support

2013-07-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As of this moment, the test has run on one of the two Win7 machines and the xp 
buildbot. It also runs by itself on my win7 desktop with a fresh pull.

--

___
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-07-29 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 

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



[issue18396] test_signal.test_issue9324() fails on buildbot AMD64 Windows7 SP1 3.x

2013-07-29 Thread Jeremy Kloth

Jeremy Kloth added the comment:

Added nosy list from issue 18523

--
nosy: +brian.curtin, larry, pitrou

___
Python tracker 

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



[issue15415] Add temp_dir() and change_cwd() to test.support

2013-07-29 Thread Nick Coghlan

Nick Coghlan added the comment:

While there are some remaining buildbot failures, they don't appear to be 
related to this issue any more.

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



[issue18572] Remove redundant note about surrogates in string escape doc

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

Python 3.2.3 (default, Jun 15 2013, 14:13:52) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '\uD80C\uDC80'
'\ud80c\udc80'
>>> '\uD80C\uDC80' == '\U00013080'
False

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



[issue18181] PEP447: Add type.__locallookup__

2013-07-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

* Improved docmentation

* __locallookup__ is now called unconditionally, the attribute lookup
  cache is now disabled when aType.__locallookup__ != type.__locallookup__

  This gives a slightly nicer API (the only reason the new method
  was optional was due to an implementation detail in _PyType_Lookup)

--
Added file: http://bugs.python.org/file31071/issue-18181-full-v3.txt

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Following patch proposed to add a function named textwrap.summarize():

   >>> textwrap.summarize("Hello  world!", width=12)
   'Hello world!'
   >>> textwrap.summarize("Hello  world!", width=11)
   'Hello (...)'

--
components: Library (Lib)
files: summarize.patch
keywords: patch
messages: 193862
nosy: barry, georg.brandl, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Add a text truncation function
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31072/summarize.patch

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Documenting this would be useful because it appears to be non-trivial to 
actually run the benchmark suite with Python 3. 

* Using "python perf.py -b default" fails due to some code in the
  benchmarks that is not python3 compatible

* Using "make_perf3.sh" and then running "... -b default" still fails,
  because not all libraries are translated (the test run stopped because
  splitfire couldn't be found)

* Using "-b 2n3" instead instead of "-b default" or "-b all" works, but
  runs only a subset of the benchmark.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> * Using "-b 2n3" instead instead of "-b default" or "-b all" works,
> but
>   runs only a subset of the benchmark.

I think we should include a copy of the 2to3'ed third-party libs in
the benchmarks repo, this would running avoid the length and tedious
conversion on every user's computer.

--

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The overhead of 2to3 isn't too bad, especially because only a subset of the 
benchmarks is translated in the first place. 

It is more important that there is better documentation than there is now, it 
seems that you're supposed to use either '-b 2n3' or make_perf3.sh with '-b 
py3k'.  Neither of which are mentioned in README.txt.

--

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The overhead of 2to3 isn't too bad, especially because only a subset
> of the benchmarks is translated in the first place.

Well, the biggest time is spent translating the third-party libraries,
not benchmark files.
Also, it's simply tedious manual work (you have to create a separate
directory etc.).

> It is more important that there is better documentation than there is
> now, it seems that you're supposed to use either '-b 2n3' or
> make_perf3.sh with '-b py3k'.  Neither of which are mentioned in
> README.txt.

That's because the benchmark suite was initially 2.x-only, and the
"make_perf3.sh" was a quick hack to make some of the benchmarks work
on 3.x.

Nowadays the goal is for benchmark files to be 2.x and 3.x compatible
in the same codebase, so that only third-party libs remain to
translate. Adding 3.x-compatible versions of the third-party libs
would eliminate that last step.

--

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Perhaps the "placeholder" argument should actually include the last whitespace, 
to allow people to omit the whitespace, or use a non-breaking space instead?

   >>> textwrap.summarize("Hello  world!", width=11, placeholder='...')
   'Hello...'

--

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The attached patch for the benchmark README.txt should document the status quo.

--
Added file: http://bugs.python.org/file31073/issue-18181-full-v3.txt

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Christian Heimes

Changes by Christian Heimes :


--
Removed message: http://bugs.python.org/msg193235

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Christian Heimes

Christian Heimes added the comment:

I have moved the static pages to bitbucket:

  http://tiran.bitbucket.org/python-lcov/

--

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Dave Malcolm

Dave Malcolm added the comment:

On Mon, 2013-07-29 at 14:01 +, Ronald Oussoren wrote:
> Ronald Oussoren added the comment:
> 
> The attached patch for the benchmark README.txt should document the status 
> quo.
> 
> --
> Added file: http://bugs.python.org/file31073/issue-18181-full-v3.txt
It looks like you attached the wrong patch: the patch you attached seems
to be unrelated to benchmarking (and presumably relates to issue 18181)

--

___
Python tracker 

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



[issue18572] Remove redundant note about surrogates in string escape doc

2013-07-29 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On 29/07/13 22:27, R. David Murray wrote:

 '\uD80C\uDC80' == '\U00013080'
> False

Are you running a wide build? In a narrow build, it returns True.

--

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Sorry about that. I stored the patch file in the wrong directory and attached 
the most recent file in the directory where I had expected the patch to be.

--
Added file: http://bugs.python.org/file31074/issue-17449-readme.txt

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Ronald Oussoren

Changes by Ronald Oussoren :


Removed file: http://bugs.python.org/file31073/issue-18181-full-v3.txt

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jul 29, 2013, at 01:55 PM, Antoine Pitrou wrote:

>Perhaps the "placeholder" argument should actually include the last 
>whitespace, to allow people to omit the whitespace, or use a non-breaking 
>space instead?
>
>   >>> textwrap.summarize("Hello  world!", width=11, placeholder='...')
>   'Hello...'

I guess the placeholder default is ' (...)' then?

--

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> >Perhaps the "placeholder" argument should actually include the last
> >whitespace, to allow people to omit the whitespace, or use a
> >non-breaking space instead?
> >
> >   >>> textwrap.summarize("Hello  world!", width=11,
> >   >>> placeholder='...')
> >   'Hello...'
> 
> I guess the placeholder default is ' (...)' then?

Yeah.
(of course, another default could be used)

--

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue18586] Allow running benchmarks for Python 3 from same directory

2013-07-29 Thread Brett Cannon

New submission from Brett Cannon:

As of right now, to run the benchmark suite you need to use make_perf3.sh to 
generate a Python 3 compatible version of the benchmarks. That was fine when 
the benchmark suite didn't have much support for Python 3 and thus was just 
used for Python 3 very often. But now that a lot more benchmarks work it should 
be updated so that this extra step can be avoided.

--
components: Benchmarks
messages: 193875
nosy: brett.cannon, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Allow running benchmarks for Python 3 from same directory
type: behavior

___
Python tracker 

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



[issue17449] dev guide appears not to cover the benchmarking suite

2013-07-29 Thread Brett Cannon

Brett Cannon added the comment:

I agree with Antoine that the time has come to drop make_perf3.sh and make it 
so that Python 3 doesn't require a separate build of the benchmark directory. 
Created http://bugs.python.org/issue18586 to track this idea.

--

___
Python tracker 

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



[issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()

2013-07-29 Thread Ezio Melotti

Ezio Melotti added the comment:

This is a leftover from 2.7.  In 2.7 the docs have a SimpleWidgetTestCase used 
as base class for two other classes, and then the same example is reimplemented 
by using a single WidgetTestCase class.
I think it would be better to make the two docs converge, by renaming the 
SimpleWidgetTestCase in 3.x to WidgetTestCase, and get rid of the 
SimpleWidgetTestCase example in 2.7.

--

___
Python tracker 

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



[issue18587] urllib raises exception with string in 'errno' attribute

2013-07-29 Thread Denis

New submission from Denis:

On 'connection refused' error urllib creates IOError with wrong arguents:
args ('socket error', error(, 'Connection refused'))

It results to dirty hacks in Python code like
  'if e.errno == "socket error": ...'

instead of traditional

  'id e.errno == errno.ECONNREFUSED: ...'

--
files: pyerror.py
messages: 193878
nosy: denkoren
priority: normal
severity: normal
status: open
title: urllib raises exception with string in 'errno' attribute
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file31075/pyerror.py

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Something is not right if we use more than one space.

>>> textwrap.summarize('hello  world!', width=12)
'hello world!'
>>> textwrap.summarize('hello  world!', width=11)
'hello (...)'
>>> textwrap.summarize('hello  world!', width=10)
'(...)'

I expect the last statement would give result: 'hello (...)' because 'hello' is 
just 5 characters, less than 10.

--
nosy: +vajrasky

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Beside of that, I notice the new lines are deleted silently.

>>> textwrap.summarize('republicans are red,\ndemocrats are blue,\nneither one 
>>> of them,\ncares about you.', width=46)
'republicans are red, democrats are blue, (...)'

--

___
Python tracker 

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



[issue18572] Remove redundant note about surrogates in string escape doc

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

Probably.  I think the default build on Gentoo is wide.

That seems to make the existing text even more incorrect :)

--

___
Python tracker 

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



[issue18584] examples in email.policy doc are fu'd

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

Thank you for the report.  We currently don't have automated testing of the 
doctest strings, and I must have neglected to hand test those examples before 
release.  I will fix (and test!) them ASAP.

--
components: +email
nosy: +barry, r.david.murray
stage:  -> needs patch
type:  -> behavior
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



[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2013-07-29 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +denkoren

___
Python tracker 

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



[issue18588] timeit examples should be consistent

2013-07-29 Thread Clay McClure

Changes by Clay McClure :


--
assignee: docs@python
components: Documentation
nosy: claymation, docs@python
priority: normal
severity: normal
status: open
title: timeit examples should be consistent
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue18587] urllib raises exception with string in 'errno' attribute

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 6471, which we really do need to fix.  But there 
are backward compatibility concerns with fixing it in 2.7, I'm afraid.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> errno and strerror attributes incorrectly set on socket errors 
wrapped by urllib

___
Python tracker 

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



[issue18588] timeit examples should be consistent

2013-07-29 Thread Clay McClure

New submission from Clay McClure:

The timeit module documentation includes examples of command-line and 
programmatic invocation, but the results between the two sets of examples don't 
agree.

This patch brings the results into agreement with each other.

--
keywords: +patch
Added file: http://bugs.python.org/file31076/18588.patch

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Brett Cannon

Brett Cannon added the comment:

How much slower is the execution of Python under the coverage? And can you run 
it with regrtest's -j (I assume not, but I thought I would ask)?

I'm asking because this would be interesting to try and tie into devinabox, but 
having to run two multi-hour testing runs might be a bit much to ask of sprint 
leaders.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Christian Heimes

Christian Heimes added the comment:

I'm using the PSF's virtual machine for Coverity Scan to run the lcov tests. A 
full configure (without pydebug), build, test and analyze cycle takes about 25 
to 30 minutes. I'm not sure if gcov supports multiple processes.

Maybe we can set up a service that builds C and Py coverage reports once a day? 
The service could push the reports to a public web site and offer rsync pulls 
over ssh for developers.

--

___
Python tracker 

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



[issue18589] cross-referencing doesn't work between the extending guide and c-api

2013-07-29 Thread Antoine Pitrou

New submission from Antoine Pitrou:

It doesn't seem possible to make reference links to e.g. the definition for 
tp_clear. Both :attr:`tp_clear` and :attr:`PyTypeObject.tp_clear` do not make 
any link. The extending guide is littered with such broken references.

--
assignee: docs@python
components: Documentation
messages: 193887
nosy: docs@python, eric.araujo, ezio.melotti, georg.brandl, pitrou
priority: high
severity: normal
status: open
title: cross-referencing doesn't work between the extending guide and c-api
type: behavior
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



[issue18589] cross-referencing doesn't work between the extending guide and c-api

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ahah, it seems the correct markup is :c:member:`~PyTypeObject.tp_clear`

Now all the existing references have to be fixed...

--

___
Python tracker 

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



[issue18589] cross-referencing doesn't work between the extending guide and c-api

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The following command does the trick:

sed -i "s/:attr:\`tp_/:c:member:\`~PyTypeObject.tp_/g" `find -name "*.rst"`

It does not fix word-wrapping, though. Is it ok to commit?

--

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Brett Cannon

Brett Cannon added the comment:

And I should part of the reason I would love a daily report is it currently 
takes a couple of hours to run a full coverage report and that's without branch 
coverage.

--

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Brett Cannon

Brett Cannon added the comment:

My long term hope is something exactly like that. I'm about to rewrite the 
instructions for handling coverage.py to use a venv for devinabox, but it's 
definitely something that can be entirely automated for a daily report.

--

___
Python tracker 

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



[issue18584] examples in email.policy doc are fu'd

2013-07-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ffc7ea3c04a5 by R David Murray in branch '3.3':
#18584: make doctest examples in email documentation pass.
http://hg.python.org/cpython/rev/ffc7ea3c04a5

New changeset 206685a4b19c by R David Murray in branch 'default':
Merge #18584: make doctest examples in email documentation pass.
http://hg.python.org/cpython/rev/206685a4b19c

--
nosy: +python-dev

___
Python tracker 

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



[issue18584] examples in email.policy doc are fu'd

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

OK, this fixed.  The 'as_string' example will still fail, as I never added the 
policy argument to that method.  I'll deal with that in a separate issue.

Unfortunately it is quite possible there are other errors in the new docs, 
since they are new...I will review them in the coming month as I'll be working 
on adding some additional new features to the provisional policies.

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



[issue18481] lcov report

2013-07-29 Thread Christian Heimes

Christian Heimes added the comment:

Yeah, it's horrible slow. We need something like 
https://bitbucket.org/ned/coveragepy/src/2c5fb3a8b81cc56d8ad57dd1bd83ef7740f0d65d/coverage/tracer.c?at=default
 in the core. I already talked to Ned about contributing the module.

--

___
Python tracker 

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



[issue18590] 'Search' and 'Replace' dialogs don't work on quoted text in Windows

2013-07-29 Thread Sarah

New submission from Sarah:

In Windows, the 'find' and 'replace' dialogs do not work properly on text that 
has been commented out using quotation marks.

More specifically, the dialog *finds* the text in question, however, it does 
not *highlight* it. Without the highlighting, a user can't see which text has 
been found. Since the whole point of the find function is to show the user 
where the text is located, this is a bug. 

Credit for the fix goes to Roger Serwy, who suggested raising the hit tag.

My patch uses the show_hit function from patch 17511*. I have included the 
show_hit function, but not the rest of patch 17511.

Are there guidelines for submitting patches that utilize elements of other 
patches?

*show_hit is originally from the ReplaceDialog. 17511 added it to SearchDialog

--
components: IDLE, Windows
files: SearchDialogPatch.patch
keywords: patch
messages: 193895
nosy: Sarah
priority: normal
severity: normal
status: open
title: 'Search' and 'Replace' dialogs don't work on quoted text in Windows
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file31077/SearchDialogPatch.patch

___
Python tracker 

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



[issue18590] 'Search' and 'Replace' dialogs don't work on quoted text in Windows

2013-07-29 Thread Sarah

Changes by Sarah :


--
resolution:  -> works for me
Added file: http://bugs.python.org/file31078/ReplaceDialogPatch.patch

___
Python tracker 

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



[issue18590] 'Search' and 'Replace' dialogs don't work on quoted text in Windows

2013-07-29 Thread R. David Murray

R. David Murray added the comment:

Yes, we make the issue have a dependency on the issue it is using.  I have done 
that for this one.

--
dependencies: +Idle find function closes after each find operation
nosy: +r.david.murray
resolution: works for me -> 
stage:  -> patch review
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



[issue18577] lru_cache enhancement: lru_timestamp helper function

2013-07-29 Thread Peter Santoro

Peter Santoro added the comment:

I updated my proposed lru_timestamp function with the following change:

1) raise TypeError instead of ValueError

--
Added file: http://bugs.python.org/file31079/lru.py

___
Python tracker 

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



[issue18585] Add a text truncation function

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Vajrasky, thanks. The former is a bug, but the latter is a feature. summarize() 
re-uses the textwrap machinery to normalize spaces.

--

___
Python tracker 

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




[issue18591] threading.Thread.run returning a result

2013-07-29 Thread James Lu

New submission from James Lu:

I have attached a *possible* new version of threading.py
that returns the value of the target.

--
components: Library (Lib)
files: threading.py
messages: 193899
nosy: James.Lu
priority: normal
severity: normal
status: open
title: threading.Thread.run returning a result
type: enhancement
Added file: http://bugs.python.org/file31080/threading.py

___
Python tracker 

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2013-07-29 Thread Catherine Devlin

Catherine Devlin added the comment:

Attaching a test that verifies that shutil.copytree is, in fact, preserving 
permissions (as of Python 3.4.0a0 (default:66a3dc613627, Jul 27 2013, 21:23:10) 
)

As far as I can tell this can be closed.

--
nosy: +catherinedevlin
Added file: http://bugs.python.org/file31081/test1666318.patch

___
Python tracker 

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



[issue18570] OverflowError in division: wrong message

2013-07-29 Thread Mark Dickinson

Mark Dickinson added the comment:

I'd prefer to keep the current behaviour for int / int with an out-of-range 
result (i.e., raise OverflowError).  As far as possible, I believe Python 
should raise an exception rather than return an infinity or nan whenever 
possible (with exceptions when one or other of the operands was an infinity or 
nan to begin with).  The math module does this consistently;  but (mostly for 
historical reasons) the core of Python doesn't have a lot of consistency w.r.t. 
overflow versus infinities:

Still, my own preference would be to try to move to greater use of exceptions 
rather than to greater use of 'inf' and 'nan' results.  So if anything, 2**1023 
/ 2**-3 would ideally raise OverflowError rather than return 'inf'.

Note that 1 / 0 also currently raises an exception rather than returning an 
infinity.

Agreed that 'long int' should be 'int'.

--

___
Python tracker 

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



[issue18591] threading.Thread.run returning a result

2013-07-29 Thread James Lu

James Lu added the comment:

run's calling function needs to return.

--

___
Python tracker 

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



[issue18591] threading.Thread.run returning a result

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hi! I'm not sure what feature exactly you're proposing here, but please follow 
the devguide's guidelines to submit a proper patch:
http://docs.python.org/devguide/patch.html
And more generally:
http://docs.python.org/devguide/

--
nosy: +pitrou

___
Python tracker 

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2013-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Catherine, I think it would be nice to apply your patch to avoid any further 
regressions. However, you should first sign a contributor's agreement 
(http://www.python.org/psf/contrib/). Could you please do so and post here once 
it is done?

--
assignee: tarek -> 
components: +Tests
nosy: +pitrou
stage: test needed -> patch review
type: behavior -> enhancement
versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Comments on the diff.

> -Two good reasons to break a particular rule:
> +Some especially good reasons to ignore a particular guideline:

It's probably enough to just s/Two/Some/ - not sure the 'especially' emphasis
is really needed.

> +3. Because the code in question predates the introduction of the rule and
> +   there is no other reason to be modifying that code (especially if
> +   conforming to the updated style guide risks breaking backwards
> +   compatibility)

I'd rather s/rules/recommendation/.

Also, I'm not sure the parenthetical comment is necessary, but if you
disagree, perhaps remove the parentheses and rephrase more assertively:
"...that code.  Don't break backward compatibility just to conform to the
recommendations in this PEP."

> -second-most popular way is with tabs only.  Code indented with a
> -mixture of tabs and spaces should be converted to using spaces
> -exclusively.  When invoking the Python command line interpreter with
> +second-most popular way is with tabs only. In Python 3, these are the
> +only two permitted options (mixing tabs and spaces in the same file will
> +raise an error).

I don't think the parenthetical comment adds much.  They'll find this out soon
enough.

> +
> +Code indented with a mixture of tabs and spaces should be converted to
> +using spaces exclusively.

Perhaps more assertively (but perhaps controversial): "Spaces-only indentation
is recommended."

> -There are still many devices around that are limited to 80 character
> -lines; plus, limiting windows to 80 characters makes it possible to
> -have several windows side-by-side.  The default wrapping on such
> -devices disrupts the visual structure of the code, making it more
> -difficult to understand.  Therefore, please limit all lines to a
> -maximum of 79 characters.  For flowing long blocks of text (docstrings
> -or comments), limiting the length to 72 characters is recommended.
> +Limiting the required editor window width to 80 characters makes it possible
> +to have several files open side-by-side, and works well when using code
> +review tools that present the two versions in adjacent columns.
> +
> +The default wrapping in most tools disrupts the visual structure of the
> +code, making it more difficult to understand. Some web based tools may not
> +offer line wrapping at all. Therefore, please limit all lines to a maximum
> +of 79 characters.  For flowing long blocks of text (docstrings or comments),
> +limiting the length to 72 characters is recommended.

Because I've fielded some questions about this over the years, perhaps add a
footnote explaining why 79 characters is recommended instead of 80.  Even
though the window might be 80 characters wide, some editors (e.g. Emacs) place
a glyph in column 80 instead of the 80th character, so the text actually wraps
after the 79th character.

> -- Relative imports for intra-package imports are highly discouraged.
> -  Always use the absolute package path for all imports.  Even now that
> -  PEP 328 is fully implemented in Python 2.5, its style of explicit
> -  relative imports is actively discouraged; absolute imports are more
> -  portable and usually more readable.
> +- Absolute imports are recommended, as they are usually more readable and
> +  tend to be better behaved (or at least give better error messages) if the
> +  mport system is incorrectly configured (such as when a directory inside a

s/mport/import/

> +- Wildcard imports (``from  import *``) should be avoided, as they
> +  make it unclear which names are present in the namespace, confusing both
> +  readers and many automated tools. There is one defensible use case for
> +  a wildcard import, which is to republish an internal interface as part
> +  of a public API (for example, overwriting a pure Python implementation of
> +  an interface with the definitions from an optional accelerator module).

Although I'll note that even in this case, it can be preferable to explicitly
name the symbols being republished.  import-* is useful if that list is too
difficult to manage, e.g. it changes often, is dynamically created, or is just
huge.  Perhaps this should also reiterate the recommendation that
intentionally republished symbols should be named in the masked module's
__all__.

[section on public and internal interfaces]

Nicely written!

> -  or ``a = a + b``.  Those statements run more slowly in Jython.  In
> -  performance sensitive parts of the library, the ``''.join()`` form
> -  should be used instead.  This will ensure that concatenation occurs
> -  in linear time across various implementations.
> +  or ``a = a + b``.  This optimisation is fragile even in CPython (it only

s/optimisation/optimization/ but I guess we don't need to argue about that
particular bikeshed colour :).

> +  The first form means that the name of the resulting function object is
> +  specifically 'f' instead of the generic ''. This is more useful
> +  for tracebacks and str

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jul 27, 2013, at 03:13 PM, Guido van Rossum wrote:

>- I think we should recommend against tabs outright.  They are getting more
>- and more misunderstood.

+1

>- Regarding line length, I think it is reasonable to mention that many
>- organizations are settling on 100 as a compromise.  On newer laptops you
>- can still fit two terminal windows (with a reasonable font size) side by
>- side.  (Also many people checking code into the stdlib ignore the 80 char
>- limit. :-( )

Really?  I haven't seen much 100 character limits.  Have you seen this at
Google or Dropbox?

As for the stdlib checkins > 80 chars, yeah, that really annoys me!

>- Which reminds me.  Do we have a recommendation yet to write
>  except Exception:
>instead of
>  except:
>If not, we should.

PEP 8 current says this:

  A bare ``except:`` clause will catch SystemExit and
  KeyboardInterrupt exceptions, making it harder to interrupt a
  program with Control-C, and can disguise other problems.  If you
  want to catch all exceptions that signal program errors, use
  ``except Exception:`` (bare except is equivalent to ``except
  BaseException:``).

>- I wouldn't mind seeing at least a mild recommendation against using
>exceptions for non-local control flow.  The lessons of StopIteration
>suggest that such designs are often fraught with subtle problems.

As with everything (and which IMHO does not need to be stated again), there
are sometimes good reasons to stray from the recommendations in the PEP.  So
in general +1 for such a mild con recommendation.  Those who understand why
it's generally a bad idea will also understand when it's proper to stray.

(The only argument against such things is of course the pep8 tool, which
codifies the recommendations in this PEP.  Some packages actually run the pep8
checker as part of their test suite, so if we change a recommendation and that
gets pulled into pep8, then tests can break.)

--

___
Python tracker 

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



[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jul 28, 2013, at 09:48 PM, Nick Coghlan wrote:

>
>Nick Coghlan added the comment:
>
>"with statements are good", basically.

`with ExitStack() as stack` is even better :)

--

___
Python tracker 

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



[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jul 28, 2013, at 04:59 AM, Raymond Hettinger wrote:

>- Regarding line length, I think it is reasonable to mention that many
>organizations are settling on 100 as a compromise.  On newer laptops you
>can still fit two terminal windows (with a reasonable font size) side by
>side
>
>+1 I've seen too many atrocities committed by people trying to scrunch code
>into 80 columns (weird line splits, over-abbreviated variable names, etc).

That's unfortunately.  "Weird" is almost never needed.  Long lines are a code
smell IMHO.

--

___
Python tracker 

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



[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Guido van Rossum

Guido van Rossum added the comment:

[Guido]
>>- Regarding line length, I think it is reasonable to mention that many
>>- organizations are settling on 100 as a compromise.  On newer laptops you
>>- can still fit two terminal windows (with a reasonable font size) side by
>>- side.  (Also many people checking code into the stdlib ignore the 80 char
>>- limit. :-( )

[Barry]
> Really?  I haven't seen much 100 character limits.  Have you seen this at
> Google or Dropbox?

At Google people argue to raise the 80 char limit forever -- and they
use 2-space indents. For Java they've accepted 100 chars. At Dropbox
they also use 100 chars (although nobody enforces style rules here, so
many lines are even longer :-( ).

> (The only argument against such things is of course the pep8 tool, which
> codifies the recommendations in this PEP.  Some packages actually run the pep8
> checker as part of their test suite, so if we change a recommendation and that
> gets pulled into pep8, then tests can break.)

I hate that tool. It only covers a small part of the PEP, and is very
nitpicky about the part it does support, causing people to contort
their code to shut up the tool instead of learning and understanding
the PEP and applying common sense.

--

___
Python tracker 

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



[issue18570] OverflowError in division: wrong message

2013-07-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

+-infinity and nans were created for reasons that do not apply to standard 
python. In Fortran, C, etcetera, float arrays can only contain floats (hence 
calling a non-number a float) and continuing a computation after numerical 
error is more difficult or impossible. So something as simple as the following 
is not possible.


for time in range(1, 1000):
  for x in range(1000):
for y in range(1000):
  try:
data[x][y] = 
  except Exception as e:
data[x][y] = None  # will propagate just like NaNs!

I think we might be better with two consistently behaving float classes: proper 
Python floats with no inf or nan, just exceptions; and ieee floats, similar to 
Decimals, with as complete implementation of the ieee standard as possible, 
including various nan types and access to FPU flags. What we have now is a 
compromise that I doubt is truly satisfactory to anyone.

--

___
Python tracker 

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



[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue18592] IDLE: Unit test for SearchDialogBase.py

2013-07-29 Thread Phil Webster

New submission from Phil Webster:

This is a basic set of tests for SearchDialogBase. It mainly consists of gui 
code, so I was not completely sure of how/what to test. Before venturing any 
further, I thought I would make sure I'm heading in the right direction.

--
components: IDLE
messages: 193911
nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Unit test for SearchDialogBase.py
type: enhancement
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



[issue18592] IDLE: Unit test for SearchDialogBase.py

2013-07-29 Thread Phil Webster

Changes by Phil Webster :


--
keywords: +patch
Added file: http://bugs.python.org/file31082/test_searchdialogbase.patch

___
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-07-29 Thread Phil Webster

Changes by Phil Webster :


--
nosy: +philwebster

___
Python tracker 

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



[issue18481] lcov report

2013-07-29 Thread Brett Cannon

Brett Cannon added the comment:

It's actually slower even with tracer.c. You actually can't use the full 
coverage script without using the tracer extension module.

--

___
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-07-29 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +Todd.Rovito

___
Python tracker 

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



[issue18593] Typo in Lib/multiprocessing/heap.py

2013-07-29 Thread Vajrasky Kok

New submission from Vajrasky Kok:

$ grep Inheirtable Lib/multiprocessing/*
Lib/multiprocessing/heap.py:# Inheirtable class which wraps an mmap, and from 
which blocks can be allocated

--
assignee: docs@python
components: Documentation
messages: 193913
nosy: docs@python, vajrasky
priority: normal
severity: normal
status: open
title: Typo in Lib/multiprocessing/heap.py
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



[issue18593] Typo in Lib/multiprocessing/heap.py

2013-07-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +sbt

___
Python tracker 

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



[issue18594] C accelerator for collections.Counter is slow

2013-07-29 Thread Stefan Behnel

New submission from Stefan Behnel:

The C accelerator for the collections.Counter class (_count_elements() in 
_collections.c) is slower than the pure Python versions for data that has many 
unique entries. This is because the fast path for dicts is not taken (Counter 
is a subtype of dict) and the slower fallback path raises exceptions for each 
value that wasn't previously seen. This can apparently make it slower than 
calling get() on Python side.

My suggestion is to drop the fallback path from the accelerator completely and 
to only call the C function when it's safe to use it, e.g. when "type(self) is 
Counter" and not a subclass.

--
components: Library (Lib)
messages: 193914
nosy: scoder, serhiy.storchaka
priority: normal
severity: normal
status: open
title: C accelerator for collections.Counter is slow
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