[issue17554] Compact output for regrtest

2013-03-29 Thread Ned Deily

Ned Deily added the comment:

There definitely needs to be an option to continue to include the normal 
progress list in the output.  This is essential for comparing test runs.  I'm 
+0 on whether it be the default or not.  Actually, what is really needed for 
automated analysis of test runs is getting the complete output of a regrtest 
run in a standard serialized format, perhaps YAML, including the test name, 
test result, stdout, and stderr for each test. But that's a separate issue.  
I've attached a the output from a current OS X run with the proof-of-concept 
patch.  One issue that I see is that there are a number of tests that normally 
produce messages of various sorts to stderr and/or stdout without the test 
failing.  Suppressing the passed test names makes it difficult to figure out 
from which tests these messages are coming from.

--
nosy: +ned.deily
Added file: http://bugs.python.org/file29601/patched_regrtest_output.txt

___
Python tracker 

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



[issue17571] broken links on Lib/datetime.py docstring

2013-03-29 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

There are 2 broken links at the beginning of Lib/datetime.py.

One other thing, maybe "prototype implemented in Python" is an outdated and/or 
needless statement?

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 185494
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: broken links on Lib/datetime.py docstring
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



[issue17514] Add the license to argparse.py

2013-03-29 Thread Dirkjan Ochtman

Changes by Dirkjan Ochtman :


--
nosy: +djc

___
Python tracker 

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



[issue17572] strptime exception context

2013-03-29 Thread Claudiu.Popa

New submission from Claudiu.Popa:

When using a directive that is not recognised by time.strptime, the following 
occurs in Python 3:

>>> time.strptime("", "%D")
Traceback (most recent call last):
  File "C:\Python33\lib\_strptime.py", line 320, in _strptime
format_regex = _TimeRE_cache.compile(format)
  File "C:\Python33\lib\_strptime.py", line 268, in compile
return re_compile(self.pattern(format), IGNORECASE)
  File "C:\Python33\lib\_strptime.py", line 262, in pattern
self[format[directive_index]])
KeyError: 'D'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python33\lib\_strptime.py", line 494, in _strptime_time
tt = _strptime(data_string, format)[0]
  File "C:\Python33\lib\_strptime.py", line 329, in _strptime
(bad_directive, format))
ValueError: 'D' is a bad directive in format '%D'
>>>

Probably the KeyError should be supressed when raising the ValueError. The 
attached patch tries to fix this issue, by suppressing the context.

--
components: Library (Lib)
files: strptime.patch
keywords: patch
messages: 185495
nosy: Claudiu.Popa
priority: normal
severity: normal
status: open
title: strptime exception context
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29602/strptime.patch

___
Python tracker 

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



[issue17573] add ElementTree XML processing benchmark to benchmark suite

2013-03-29 Thread Stefan Behnel

New submission from Stefan Behnel:

Here is an artificial but pretty broad ElementTree benchmark, testing the 
modules xml.etree.ElementTree, xml.etree.cElementTree and lxml.etree (if 
importable). Please add it to the benchmark suite.

--
components: Benchmarks, XML
files: add_et_benchmark.patch
keywords: patch
messages: 185496
nosy: scoder
priority: normal
severity: normal
status: open
title: add ElementTree XML processing benchmark to benchmark suite
type: enhancement
Added file: http://bugs.python.org/file29603/add_et_benchmark.patch

___
Python tracker 

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



[issue17573] add ElementTree XML processing benchmark to benchmark suite

2013-03-29 Thread Stefan Behnel

Changes by Stefan Behnel :


--
nosy: +brett.cannon, pitrou

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2013-03-29 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

>> Where should I look?
> Tulip is at code.google.com/p/tulip

I meant in the code (and what needs to be done/refactored exactly).

--

___
Python tracker 

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



[issue17569] urllib2 urlopen truncates https pages after 32768 characters

2013-03-29 Thread J Porter

J Porter added the comment:

Here is the code (security info removed) and the output. I noticed that the 
problem is a bit different between 2.6.5 and 2.7.3 (on one the use of 
authentication is different) so I've included the output for both:

import urllib2

userData="Basic  KEY GOES HERE"

emlUrl="https://pasta.lternet.edu/package/metadata/eml/knb-lter-vcr/25/27";
emlReq=urllib2.Request(emlUrl)
emlReq.add_header('Authorization', userData)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Https,authenticated: "+str(len(emlString))

emlReq=urllib2.Request(emlUrl)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Https,Not authenticated: "+str(len(emlString))

emlUrl="http://pasta.lternet.edu/package/metadata/eml/knb-lter-vcr/25/27";
emlReq=urllib2.Request(emlUrl)
emlReq.add_header('Authorization', userData)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
print "Http,authenticated: "+str(len(emlString))


emlReq=urllib2.Request(emlUrl)
emlSock=urllib2.urlopen(emlReq,timeout=60)
emlString=emlSock.read()
lengthHttpsNotAuthenticated=len(emlString)
print "Http,authenticated: "+str(len(emlString))

OUTPUT when run on PC using Python 2.6.5
Https,authenticated: 32768
Https,Not authenticated: 32768
Http,authenticated: 40898
Http,authenticated: 40898

OUTPUT when run on Ubuntu Linux (12.4LTS):
Https,authenticated: 32768
Https,Not authenticated: 40898
Http,authenticated: 40898
Http,authenticated: 40898

--

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2013-03-29 Thread Guido van Rossum

Guido van Rossum added the comment:

start_serving() in base_events.py.

On Fri, Mar 29, 2013 at 4:58 AM, Giampaolo Rodola'
wrote:

>
> Giampaolo Rodola' added the comment:
>
> >> Where should I look?
> > Tulip is at code.google.com/p/tulip
>
> I meant in the code (and what needs to be done/refactored exactly).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17574] pysetup failing with "OSError: [Errno 18] Invalid cross-device link".

2013-03-29 Thread Valentin Lab

New submission from Valentin Lab:

running::

  $ pysetup remove shyaml
  'shyaml' cannot be removed.
  Error: [Errno 18] Invalid cross-device link

Same happens when using::

  $ pysetup install shyaml==0.1.3

Besides, I've no idea of the state of distutils2 which was promising and is 
working as far as I'm concerned (except for trivial bugs as this one).

I'm using it for several small project, and I would be glad to know that it is 
still maintained regarding such easily-corrected bugs.

Correction of this bug is trivial here because ``distutils2/install.py`` line 
57 should use ``shutil.move()`` instead of ``os.rename()``. I've tested it, and 
this does the job.

Thank you for your attention.

--
assignee: eric.araujo
components: Distutils2
messages: 185500
nosy: alexis, eric.araujo, tarek, vaab
priority: normal
severity: normal
status: open
title: pysetup failing with "OSError: [Errno 18] Invalid cross-device link".
type: crash
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



[issue17575] HTTPConnection.send

2013-03-29 Thread dspub...@freemail.hu

New submission from dspub...@freemail.hu:

http.client modul, HTTPConnection object, send method

Missing an "else" for self.sock.sendall(data) try block.


...
if hasattr(data, "read") : 
if self.debuglevel > 0: 
print("sendIng a read()able") 
encode = False 
try: 
mode = data.mode 
except AttributeError: 
# io.BytesIO and other file-like objects don't have a `mode` 
# attribute. 
pass 
else: 
if "b" not in mode: 
encode = True 
if self.debuglevel > 0: 
print("encoding file using iso-8859-1") 
while 1: 
datablock = data.read(blocksize) 
if not datablock: 
break 
if encode: 
datablock = datablock.encode("iso-8859-1") 
self.sock.sendall(datablock) 
else: #missing else
  try: 
  self.sock.sendall(data) 
  except TypeError: 
  if isinstance(data, collections.Iterable): 
for d in data: 
self.sock.sendall(d) 
  else: 
  raise TypeError("data should be a bytes-like object " 
"or an iterable, got %r" % type(data))

--
messages: 185501
nosy: dspub...@freemail.hu
priority: normal
severity: normal
status: open
title: HTTPConnection.send
type: behavior
versions: 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



[issue17574] pysetup failing with "OSError: [Errno 18] Invalid cross-device link".

2013-03-29 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the report.  I think this bug was already known, but development of 
distutils2 is currently stopped.  The scope and design were fundamentally 
flawed.  Current efforts are centered on defining a toolchain of builders, 
archivers and installers instead of one tool doing everything, and getting a 
bootstrap installer in the stdlib to download pip.

--

___
Python tracker 

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



[issue17575] HTTPConnection.send

2013-03-29 Thread Chris Angelico

Changes by Chris Angelico :


--
nosy: +Rosuav

___
Python tracker 

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



[issue17425] Update OpenSSL versions in Windows builds

2013-03-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sorry to reopen :-). It seems OpenSSL 1.0.1d was a kind of "brown paper bag" 
release, they've released 1.0.1e since (some of test_ssl can fail on 1.0.1d and 
succeed on 1.0.1e, as experienced on my Linux setup; the Windows buildbots also 
exhibit similar failures).

Following is their description of the fix:

“Changes between 1.0.1d and 1.0.1e [11 Feb 2013]

  *) Correct fix for CVE-2013-0169. The original didn't work on AES-NI
 supporting platforms or when small records were transferred.
 [Andy Polyakov, Steve Henson]”

--
status: closed -> open
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



[issue17554] Compact output for regrtest

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

I fixed all the tests that were producing extra output on my machine, but there 
are probably some left on other machines.  Using -uall also produces extra 
output, and I haven't decided how to deal with that yet (maybe it should be 
silenced as well).
Getting this right might require to introduce e.g. a new 
regrtest/support.print() function though...

--

___
Python tracker 

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



[issue17573] add ElementTree XML processing benchmark to benchmark suite

2013-03-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Haven't looked at the patch in detail but a couple of things:

- I don't think we need to benchmark the slow pure-Python ET, except when the 
fast version isn't present (basically, the main benchmark should try cET and 
then fallback on ET)

- I'm ok with lxml being benchmarked, but only if a well-defined version is 
included in the source tree (the problem being of course that it's not pure 
Python, so it will have to be built on the fly, assuming all dependencies are 
present :-/)

--

___
Python tracker 

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



[issue17540] logging formatter support 'style' key in dictionary config

2013-03-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6fe31ce789d by Vinay Sajip in branch '3.3':
Issue #17540: Added style to Formatter configuration by dict.
http://hg.python.org/cpython/rev/d6fe31ce789d

New changeset e097fe3a87de by Vinay Sajip in branch 'default':
Closes #17540: Merged fix from 3.3.
http://hg.python.org/cpython/rev/e097fe3a87de

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



[issue6671] webbrowser doesn't respect xfce default browser

2013-03-29 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue17573] add ElementTree XML processing benchmark to benchmark suite

2013-03-29 Thread Stefan Behnel

Stefan Behnel added the comment:

I considered lxml.etree support more of a convenience feature, just for 
comparison. Given that it's a binary package that doesn't run reliably on other 
Python implementations apart of CPython, I don't think it's really interesting 
to make it part of the benchmark suite. I'd rather add an explicit option to 
enable it than include it there.

I'm ok with the conditional import for ET, although I don't see a reason to 
exclude it. Why not be able to compare the performance of both implementations 
as well? There's a slowpickle benchmark, for example.

So, what about only testing cET by default and adding an explicit option 
"--etree-module=package.module" to change the imported module, e.g. 
"--etree-module=lxml.etree" to benchmark lxml or "--etree-module=cElementTree" 
to benchmark a separately installed 3rd party cET package?

--

___
Python tracker 

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



[issue17549] Some exceptions not highlighted in exceptions documentation.

2013-03-29 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue17573] add ElementTree XML processing benchmark to benchmark suite

2013-03-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I'm ok with the conditional import for ET, although I don't see a
> reason to exclude it. Why not be able to compare the performance of
> both implementations as well? There's a slowpickle benchmark, for
> example.

It made sense in 2.7 where both implementations were visibly selectable
(and the pure Python ones were arguably the "default" choice since their
names were less obtuse). But in 3.3 the C accelerator is automatically
enabled when importing xml.etree. So I don't think making a difference
makes much sense anymore.

> So, what about only testing cET by default and adding an explicit
> option "--etree-module=package.module" to change the imported module,
> e.g. "--etree-module=lxml.etree" to benchmark lxml or
> "--etree-module=cElementTree" to benchmark a separately installed 3rd
> party cET package?

Well, we could still add a "lxml" benchmark but disable it by default (I
mean not make it part of the main sub-suites). That way people can run
it explicitly if they want.

(also, since it's a "lxml" benchmark, it may test other things than
simply the etree API, if you like)

--

___
Python tracker 

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



[issue17453] logging.config.fileConfig error

2013-03-29 Thread Vinay Sajip

Vinay Sajip added the comment:

Removing myself from nosy, as it appears to be a ConfigParser issue.

--

___
Python tracker 

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



[issue17554] Compact output for regrtest

2013-03-29 Thread R. David Murray

R. David Murray added the comment:

-uall shouldn't produce more output by itself, it just runs more tests.  Do you 
mean that some *output* is actually conditionalized on whether a certain 
resource is enabled?

--

___
Python tracker 

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



[issue17568] re: Infinite loop with repeated empty alternative

2013-03-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett
type: enhancement -> behavior

___
Python tracker 

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



[issue17554] Compact output for regrtest

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

The tests enabled by -uall (and probably -unetwork) use open_urlresource, and 
open_urlresource has a "print('\tfetching %s ...' % url, 
file=get_original_stdout())".  This should probably be printed only when -v is 
passed.

--

___
Python tracker 

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



[issue5038] urrlib2/httplib doesn't reset file position between requests

2013-03-29 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I think, this requires triaging in terms of is the feature request still 
applicable. Except 100 is sent by httplib and the support for this was added 
few years ago, much later then this bug was originally raised.

--
assignee:  -> orsenthil

___
Python tracker 

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



[issue1712522] urllib.quote throws exception on Unicode URL

2013-03-29 Thread Mark Lawrence

Mark Lawrence added the comment:

A lot of work has already been done on this issue.  If this is likely to get 
into 2.7 then fine leave it open, if not can this be closed?

--

___
Python tracker 

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



[issue17564] test_urllib2_localnet fails

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached a patch to skip the test unless -unetwork/-uall is provided.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file29604/issue17564.diff

___
Python tracker 

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



[issue15494] Move test/support.py into a test.support subpackage

2013-03-29 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, Georg has locked the 3.2 branch now, so we can proceed with this without 
making any 3.2 blockers harder to deal with.

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



[issue14146] IDLE: source line in editor doesn't highlight when debugging

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



[issue14146] IDLE: source line in editor doesn't highlight when debugging

2013-03-29 Thread Todd Rovito

Todd Rovito added the comment:

I was going to try Python 3.4 and TK 8.6 on Windows and see what happens.

--

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2013-03-29 Thread paul j3

paul j3 added the comment:

Glenn
I looked at your t18a.py test case

parser = ArgumentParser()
parser.add_argument('--foo', dest='foo')
parser.add_argument('--bar', dest='bar')
parser.add_argument('foz')
parser.add_argument('baz', nargs='*')

and parse variations on 'a b c d --foo x --bar 1'

I think your main problem is with the 'baz', nargs='*'.  If nargs was changed 
to '+', 'a --foo x b c d --bar 1' would work, returning {foz='a', 
bar=['b','c','d']}.

argparse alternates between consuming positional and optionals until it runs 
out of arguments or argument strings.  But with '*', both 'foz' and 'baz' are 
consumed with the first set of positional strings {foz='a', baz=[]}.  When it 
gets to 'b c d' there are no more positional arguments to consume, so they get 
put into 'extras'.

With nargs='+', 'a b --foo x c d --bar 1' would assign {foz='a', baz=[b]}, and 
extras=['c','d'].

So while optionals can be interspersed with positionals, they can't be placed 
within the set of strings intended for one positional. That seems to me to very 
reasonable (why break up 'b c d'?).  And as your file demonstrates, you can 
fall back on parse_known_args to handle the extras.

--
nosy: +paul.j3

___
Python tracker 

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



[issue17571] broken links on Lib/datetime.py docstring

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

This is the module docstring:
"""Concrete date/time and related types -- prototype implemented in Python.

See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage

See also http://dir.yahoo.com/Reference/calendars/

For a primer on DST, including many current DST rules, see
http://webexhibits.org/daylightsaving/

For more about DST than you ever wanted to know, see
ftp://elsie.nci.nih.gov/pub/

Sources for time zone and DST data: http://www.twinsun.com/tz/tz-link.htm

This was originally copied from the sandbox of the CPython CVS repository.
Thanks to Tim Peters for suggesting using it.
"""

The first link is broken, the following two links look like more or less random 
page that can be found by googling, the .gov site might have been useful but 
it's broken, and the last link looks OK.
I think it would be better to replace the whole docstring with something more 
descriptive.  I'm not sure those links should be kept at all.

--
nosy: +belopolsky, ezio.melotti, tim_one

___
Python tracker 

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



[issue17571] broken links on Lib/datetime.py docstring

2013-03-29 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

Let's just update the docstring:

"""Concrete date/time and related types.

See also http://dir.yahoo.com/Reference/calendars/

For a primer on DST, including many current DST rules, see
http://webexhibits.org/daylightsaving/

Sources for time zone and DST data: http://www.twinsun.com/tz/tz-link.htm

This was originally copied from the sandbox of the CPython CVS repository.
Thanks to Tim Peters for suggesting using it.
"""

--
nosy: +fdrake

___
Python tracker 

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



[issue17572] strptime exception context

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

The fix LGTM.  The attached patch tweaks a bit your test and adds another one 
to check _strptime directly.

--
nosy: +ezio.melotti
stage:  -> commit review
Added file: http://bugs.python.org/file29605/issue17572.diff

___
Python tracker 

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



[issue17571] broken links on Lib/datetime.py docstring

2013-03-29 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Shouldn't we link to IANA for timezones information?

http://www.iana.org/time-zones/repository/tz-link.html

--

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

You also end up with this nice bit of inconsistency:

>>> x = myint(7)
>>> from operator import index
>>> range(10)[6:x]
range(6, 7)
>>> range(10)[6:x.__index__()]
range(6, 8)
>>> range(10)[6:index(x)]
range(6, 7)
>>> 

Granted, it's insane to have __index__() return a different value like this, 
but in my specific use case, it's the type of object returned from 
operator.index() that's the problem.  operator.index() returns the subclass 
instance while obj.__index__() returns the int.

(The use case is the IntEnum of PEP 435.)

--

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly

2013-03-29 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

operator.index() is just a thin wrapper around PyNumber_Index().  The 
documentation for operator.index() claims that it is equivalent to calling 
obj.__index__() but for subclasses of int, this is not true.  In fact, 
PyNumber_Index() first does (e.g. in Python 3.3) a PyLong_Check() and if that 
succeeds, the original object is returned *without* doing the moral equivalent 
in C of calling obj.__index__().  An example:

class myint(int):
def __index__(self):
return int(self) + 1

>>> x = myint(7)
>>> x.__index__()
8
>>> from operator import index
>>> index(x)
7

The C API documents PyNumber_Index() as: "Returns the o converted to a Python 
int on success or NULL with a TypeError exception raised on failure."

Because this has been the behavior of PyNumber_Index() since at least 2.7 (I 
didn't check farther back), this probably cannot be classified as a bug 
deserving to be fixed in the code for older Pythons.  It might be worth fixing 
for Python 3.4, i.e. by moving the index check before the type check.  In the 
meantime, this is probably a documentation bug.

The C API implies, but should be clearer that if o is an int subtype (int and 
long in Python 2), it is returned unchanged.  The operator.index() 
documentation should be amended to describe this behavior for int/long 
subclasses.

A different alternative would be to leave PyNumber_Index() unchanged, but with 
the doco fix, and to augment operator.index() to do the PyIndex_Check() first, 
before calling PyNumber_Index().  That's a little more redundant, but would 
provide the documented behavior without changing the C API.

--
assignee: docs@python
components: Documentation
messages: 185522
nosy: barry, docs@python
priority: normal
severity: normal
status: open
title: PyNumber_Index() is not int-subclass friendly
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, 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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
title: PyNumber_Index() is not int-subclass friendly -> PyNumber_Index() is not 
int-subclass friendly (or operator.index() docos lie)

___
Python tracker 

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



[issue17564] test_urllib2_localnet fails

2013-03-29 Thread Senthil Kumaran

Senthil Kumaran added the comment:

LGTM - please make the changes in all versions of python.

( I had the same patch pending locally and was waiting for my push->merge cycle 
time)

--

___
Python tracker 

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



[issue17564] test_urllib2_localnet fails

2013-03-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f668d2267303 by Ezio Melotti in branch '3.3':
#17564: skip test_bad_address unless the tests are run with -unetwork/-uall.
http://hg.python.org/cpython/rev/f668d2267303

New changeset a472fece6f31 by Ezio Melotti in branch '2.7':
#17564: skip test_bad_address unless the tests are run with -unetwork/-uall.
http://hg.python.org/cpython/rev/a472fece6f31

--
nosy: +python-dev

___
Python tracker 

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



[issue17564] test_urllib2_localnet fails

2013-03-29 Thread Roundup Robot

Roundup Robot added the comment:

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

--

___
Python tracker 

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



[issue17564] test_urllib2_localnet fails

2013-03-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> ezio.melotti
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



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-29 Thread Phil Connell

New submission from Phil Connell:

A recipe often requested on the likes of stackoverflow and activestate is a way 
to look 'ahead' in an iterator, without altering the values returned for 
subsequent next() calls.

Last time this came up on python-ideas, it got a reasonable reception:
  http://code.activestate.com/lists/python-ideas/19509/

So, having wanted (and implemented) this again, I thought it was worth a formal 
proposal.

Is this an idea worth pursuing?


I've attached a quick pure Python implementation, that adds a 'peek' method, 
used like this:

>>> it = lookahead(range(10))
>>> next(it)
0
>>> it.peek()
1
>>> next(it)
1
>>> it.peek(index=1)
3
>>> it.peek()
2
>>> next(it)
2

--
components: Library (Lib)
files: lookahead.py
messages: 185527
nosy: pconnell, rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: Add lookahead/peek wrapper to itertools
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file29606/lookahead.py

___
Python tracker 

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



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-29 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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



[issue14679] Define an __all__ for html.parser

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

The module only defines 2 public objects: HTMLParser and HTMLParseError.  
The attached patch adds an __all__ with only HTMLParser.  Should HTMLParseError 
be included too, even though it's deprecated and will be removed in 3.5?

@Michele:
__all__ won't fix that, but at least it will make clear that the module-level 
regex (like tagfind) are not public.  Renaming the methods is not a good idea 
IMHO, we could move the "# internal" comments in the docstrings though.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file29607/issue14679.diff

___
Python tracker 

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



[issue12271] panel.h is not found even if it's installed on various flavours of SUSE

2013-03-29 Thread Kenneth O'Brien

Kenneth O'Brien added the comment:

Removed generated files from patch. Requesting review.

--
Added file: http://bugs.python.org/file29608/ken-ncurses-suse-update.patch

___
Python tracker 

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




[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Eric Snow

Eric Snow added the comment:

Would it be okay to do a check on __index__ after the PyLong_Check() succeeds?  
Something like this:

if (PyLong_Check(item) &&
item->ob_type->tp_as_number->nb_index == 
PyLong_Type.tp_as_number->nb_index) {
Py_INCREF(item);
return item;
}

This is something Nick and I were talking about at the sprints regarding fast 
paths in the abstract API (for mappings and sequences in our case).

--
nosy: +eric.snow

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Alex Gaynor

Alex Gaynor added the comment:

In my opinion that should use PyLong_CheckExact

--
nosy: +alex

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Mar 30, 2013, at 12:29 AM, Eric Snow wrote:

>Would it be okay to do a check on __index__ after the PyLong_Check()
>succeeds?  Something like this:
>
>if (PyLong_Check(item) &&
>item->ob_type->tp_as_number->nb_index == 
> PyLong_Type.tp_as_number->nb_index) {
>Py_INCREF(item);
>return item;
>}
>
>This is something Nick and I were talking about at the sprints regarding fast
>paths in the abstract API (for mappings and sequences in our case).

I think that would work, yes.  With this extra check, overriding __index__()
in the subclass should fail this condition and fall back to the
PyIndex_Check() clause.

--

___
Python tracker 

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



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Based on previous discussions on the subject, I'm disinclined to accept a 
lookahead tool for the itertools module.  Adding a recipe using tee() may be 
reasonable though.

I'll mark this a low priority and will come back an give in more consideration 
at some point.

--
assignee:  -> rhettinger
priority: normal -> low

___
Python tracker 

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



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Unmarking the "needs patch" stage.  A rush to implementation would be premature 
at this point.

--
stage: needs patch -> 

___
Python tracker 

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



[issue14146] IDLE: source line in editor doesn't highlight when debugging

2013-03-29 Thread Todd Rovito

Todd Rovito added the comment:

I tried both TCL/TK 8.5.13 and TCL/TK 8.6 with the latest Python 3.4 on Windows 
7 the editor window never showed a line as I stepped through the debugger.  I 
am going to try in Mac/Linux to make sure I am not crazy that a line in the 
editor window does indicate where the debugger is.  Then I intend to look in 
the bug tracker on TCL/TK and possibly post a question for help.  On Windows 
the initial line does look funny on a line with a quoted string such as 
print("hello world") the yellow does not cover the quoted string.

--

___
Python tracker 

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



[issue15331] Codecs docs should explain that the bytes-bytes shorthand aliases are missing

2013-03-29 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +easy

___
Python tracker 

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



[issue14146] IDLE: source line in editor doesn't highlight when debugging

2013-03-29 Thread Todd Rovito

Todd Rovito added the comment:

Before I forget here are the general steps I followed to get TCL/TK 8.5.13 and 
8.6 to work.  For TCL/TK 8.6 I had to change the actual Visual Studio 2010 
project. 

Generally you have to follow the steps in readme.txt located in PCBuild of the 
source tree.  readme.txt references a file Tools\buildbot\external.bat which 
has the step by step instructions on how to build TCL/TK.  Skip the part about 
going to svn.python.org/external because neither 8.6 or 8.5.13 have been added 
yet.  So I downloaded the code from the sourceforge.net TCL/TK site.  This post 
explains a step that must be performed which is not documented in any of the 
references above:
http://mail.python.org/mailman/private/core-mentorship/2013-March/001593.html

Finally for TCL/TK 8.6 I had to change the visual studio project to use the 
right .lib file for TCL/TK.  Start Visual Studio 2010 right click _tkinter 
project then select properties.  Under the Linker/Input option set Additional 
Dependencies to c:\prog\cpython\tcltk\lib\tcl86tg.lib and 
c:\prog\cpython\tcltk\lib\tk86tg.lib

erase the old values.  Now rebuild and everything should just work (c) don't 
forget to manually copy the DLL files to the PCBuild directory.

--

___
Python tracker 

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



[issue17526] inspect.findsource raises undocumented error for code objects with empty filename

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee:  -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
versions:  -Python 3.2

___
Python tracker 

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



[issue17526] inspect.findsource raises undocumented error for code objects with empty filename

2013-03-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bc73223e4c10 by Ezio Melotti in branch '2.7':
#17526: fix an IndexError raised while passing code without filename to 
inspect.findsource().  Initial patch by Tyler Doyle.
http://hg.python.org/cpython/rev/bc73223e4c10

New changeset 39e103c1577e by Ezio Melotti in branch '3.3':
#17526: fix an IndexError raised while passing code without filename to 
inspect.findsource().  Initial patch by Tyler Doyle.
http://hg.python.org/cpython/rev/39e103c1577e

New changeset 8362fbb0ef42 by Ezio Melotti in branch 'default':
#17526: merge with 3.3.
http://hg.python.org/cpython/rev/8362fbb0ef42

--
nosy: +python-dev

___
Python tracker 

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



[issue14146] IDLE: source line in editor doesn't highlight when debugging

2013-03-29 Thread Todd Rovito

Todd Rovito added the comment:

I have confirmed that Linux and Mac work great but Windows fails to highlight 
the current line in the editor window.  Next I will try and find/file a bug 
with the TCL/TK folks.

--

___
Python tracker 

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



[issue17533] test_xpickle fails with "cannot import name precisionbigmemtest" or "cannot import name _2G"

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Can you try the attached patch?

--
keywords: +patch
nosy: +ezio.melotti
Added file: http://bugs.python.org/file29609/issue17533.diff

___
Python tracker 

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



[issue17539] Use the builtins module in the unittest.mock.patch example

2013-03-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0c0a03b8033 by Ezio Melotti in branch '3.3':
#17539: fix MagicMock example.  Patch by Berker Peksag.
http://hg.python.org/cpython/rev/b0c0a03b8033

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

--
nosy: +python-dev

___
Python tracker 

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



[issue17539] Use the builtins module in the unittest.mock.patch example

2013-03-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

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

___
Python tracker 

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



[issue17548] unittest.mock: test_create_autospec_unbound_methods is skipped

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2013-03-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

PSF accepts contributions from authors under Contributor Agreements. It does 
not grab software from 3rd parties, no matter how lenient the license. Roger, 
if you assigned all rights to the University, you should talk with them about 
either getting some back or about the University signing a corporate agreement. 
Also, there is a new psf 'legal' list for discussing legal matters.

And yes, I am interested in line numbers also. I do not need them to edit my 
own files, but they are handy when communicating about stdlib files.

--
nosy: +terry.reedy
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-29 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After the last exchange on #7083, Guido emailed me that I could/should revised 
the doc a bit, but he said he did *not* want the details explained because he 
regards them as CPython implementation details and not part of the language 
definition. I have not done so yet because of other issues, especially the Idle 
PEP and related discussion. What is needed is something like

"The relationship between the local namespace and the locals dict is undefined 
between calls to locals(). Changes to either may or may not be propagated to 
the other."

Perhaps add "The dict returned by locals() is intended to be used immediately, 
either for introspection or for passing on to functions such as eval() and 
exec()." and even "It is not intended to be saved and used later."

What I have not figured out yet is how to integrate the above with the current 
text.

--

___
Python tracker 

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



[issue17533] test_xpickle fails with "cannot import name precisionbigmemtest" or "cannot import name _2G"

2013-03-29 Thread Ned Deily

Ned Deily added the comment:

There's a typo in the patch and None won't work. With the following change to 
the patch:

-_2G = _1G = None
+_2G = _1M = 0

the test passes on OS X 10.5 against the system 2.5.1 and an installed 2.4.4.  
Thanks!

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue17551] Windows - accessing drive with nothing mounted forces user interaction

2013-03-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Bob, when replying by email, please snip everything except your reply, and 
perhaps a specific small quote.

Since the doc says exists returns True or False, raising a popup seems like a 
bug to be fixed.

--
nosy: +terry.reedy
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



[issue17483] Can not tell urlopen not to check the hostname for https connections.

2013-03-29 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Here is an approach to solve this. I think, going this way is safe. I shall 
append with the tests and docs.

--
Added file: http://bugs.python.org/file29610/17483-v1-notests-nodocs.patch

___
Python tracker 

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



[issue17578] Update devguide for 3.2 in security-fix-only mode

2013-03-29 Thread Ned Deily

New submission from Ned Deily:

The attached patch updates the Developer's Guide to reflect the changes in the 
development process now that the 3.2 branch has closed for bug fixes and has 
moved to security-fix-only status.

--
components: Devguide
files: devguide_32_to_security_mode.patch
keywords: patch
messages: 185548
nosy: ezio.melotti, ned.deily
priority: normal
severity: normal
stage: patch review
status: open
title: Update devguide for 3.2 in security-fix-only mode
Added file: http://bugs.python.org/file29611/devguide_32_to_security_mode.patch

___
Python tracker 

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