[issue13364] Duplicated Code

2011-11-07 Thread skreft

skreft  added the comment:

One possible refactor would be.

import operator

   def logical_or(self, other, context=None):
   return self._logical_op(other, operator.__or__, context)

   def logical_xor(self, other, context=None):
   return self._logical_op(other, operator.__xor__, context)

   def logical_and(self, other, context=None):
   return self._logical_op(other, operator.__and__, context)

   def _logical_op(self, other, operation, context=None):
"""Applies a logical operation between self and other's digits."""
if context is None:
context = getcontext()

other = _convert_other(other, raiseit=True)

if not self._islogical() or not other._islogical():
return context._raise_error(InvalidOperation)

# fill to context.prec
(opa, opb) = self._fill_logical(context, self._int, other._int)

# make the operation, and clean starting zeroes
result = "".join([str(operation(int(a), int(b))) for a,b in 
zip(opa,opb)])
return _dec_from_triple(0, result.lstrip('0') or '0', 0)

--

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Florent Xicluna

Changes by Florent Xicluna :


--
keywords: +patch
Added file: http://bugs.python.org/file23622/issue13361_check.diff

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8c719e106694 by Vinay Sajip in branch 'default':
Merged fix for #13361 from 3.2.
http://hg.python.org/cpython/rev/8c719e106694

--
nosy: +python-dev

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

I've uploaded two proposals:
 - first with isinstance(name, str)
 - second which is more duck-friendly

Personally, I like ducks.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file23623/issue13361_dont_check.diff

___
Python tracker 

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



[issue13356] test_logging warning on 2.7

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8726ad774cf0 by Vinay Sajip in branch '2.7':
Closes #13356. Thanks to Florent Xicluna for the patch.
http://hg.python.org/cpython/rev/8726ad774cf0

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

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

btw, changeset a3ba905447ba does not fix the case for:

import logging
log = logging.Logger(any)

--

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

@Florent: Sorry, I didn't see your patch, for some reason. But I would say:

1. I agree that where I put the check (logging.getLogger) does not catch the 
case where someone instantiates the logger directly (using 
logging.Logger(any)), but users aren't supposed to instantiate loggers directly 
anyway - this would not result in a working logger. The check is in the same 
place where (in 2.7) we check for Unicode and encode to bytes.

2. I don't want to be too liberal in accepting logger names, since they are 
intended to mean "a place in the application". So, accepting anything other 
than text does not seem right to me - so str for 3.x, str or unicode for 2.x.

3. I thought a single test (passing in a invalid type) would be sufficient for 
the logging code, ISTM adding tests with lots of types is actually testing 
isinstance ;-)

4. I didn't notice your patch, and hence goofed in raising a ValueError instead 
of (correctly as you had it) a TypeError. I will rectify this.

--

___
Python tracker 

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



[issue13349] Uninformal error message in index() and remove() functions

2011-11-07 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The good thing about this is ease of debugging. You can see which is the 
offending value that was not found.

On the other hand, the repr of a value might be very long:

>>> [].index(list(range(1000)))
ValueError: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
(many lines of numbers)
997, 998, 999] is not in list

Also, all values don't have a very informal repr:

>>> class Foo: pass
...
>>> [].index(Foo())
Traceback (most recent call last):
  File "", line 1, in 
ValueError: <__main__.Foo object at 0xb736f92c> is not in list

--

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 60dd1568bbd1 by Vinay Sajip in branch '2.7':
Closes #13361: Raise correct exception type.
http://hg.python.org/cpython/rev/60dd1568bbd1

New changeset bc05c11b340e by Vinay Sajip in branch '3.2':
Closes #13361: Raise correct exception type.
http://hg.python.org/cpython/rev/bc05c11b340e

New changeset fb73fe5d0ab1 by Vinay Sajip in branch 'default':
Closes #13361: Merge fix from 3.2.
http://hg.python.org/cpython/rev/fb73fe5d0ab1

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-11-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I think the best thing would be to let rmtree fail (provided it closes 
> all the FDs it opened)

Agreed.

--

___
Python tracker 

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



[issue13335] Service application hang in python25.dll

2011-11-07 Thread Chandra Sekhar Reddy

Chandra Sekhar Reddy  added the comment:

Hi Amaury and Terry,

Thanks for your feedback, actually the product that we have delivered to 
customer is now in support phase, so currently there is no development going 
on, so we cannot use the latest python. 

It would be of great help if you could provide your inputs by looking at the 
process call stack. So that I can proceed further.

>From the call stack the function appears to be like memory allocation related 
>functions from python module. Is it possible for a process to hang if memory 
>request to OS is not satisfied.

Awaiting for your valuable inputs,
-Chandra

--

___
Python tracker 

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



[issue13335] Service application hang in python25.dll

2011-11-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Unfortunately there is not much in the process call stack: the creation of a 
list (PyList_New) needs to allocate some memory (not much: sizeof(PyListObject) 
+ gc overhead, probably 32 bytes).

If the system malloc() function fails and returns NULL, Python will raise a 
MemoryError.  But if malloc() blocks and freezes the process, there is not much 
Python can do.

--

___
Python tracker 

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



[issue12567] curses implementation of Unicode is wrong in Python 3

2011-11-07 Thread John Feuerstein

Changes by John Feuerstein :


--
nosy: +john.feuerstein

___
Python tracker 

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



[issue13362] Many PEP 8 errors

2011-11-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2011/11/7 skreft :
>
> skreft  added the comment:
>
> Hi all again:
>
> in the original posting of this issue,  I asked what would be the best way to 
> address this issue. Additionally I proposed to use existing tools to check 
> the current code. These tools could be easily added to the tests in a non 
> failing mode, so developers who modify the code, could know that the source 
> code does not follow the coding style and probably she/he could improve the 
> code. This tool would also help newcomers to contribute better code.
>
> Unfortunately, by the decision of rejecting this issue without even answering 
> the full issue, I conclude that the Python team is not willing to improve its 
> own basecode.
>
> I repeat my posture, python source code should be a model of a python 
> project, hence if there are tools that can ensure or improve the quality of 
> the project, they should be incorporated to the development process.

It can be cleaned up and modernized as it is changed for some other
purpose. Ultimately, it doesn't matter in the least bit how many lines
are between inline comments and other code, which seems to be
principally what pep8.py cares about in Lib/*.

--

___
Python tracker 

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



[issue13152] textwrap: support custom tabsize

2011-11-07 Thread John Feuerstein

John Feuerstein  added the comment:

textwrap_tabsize_v2.diff:

* Moved the tabsize parameter to the end of the parameter list
* Added documentation update
* Made the test case more obvious

--
Added file: http://bugs.python.org/file23624/textwrap_tabsize_v2.diff

___
Python tracker 

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



[issue13365] str.expandtabs documentation is wrong

2011-11-07 Thread John Feuerstein

New submission from John Feuerstein :

The documentation for str.expandtabs([tabsize]) is wrong:
 
"Return a copy of the string where all tab characters are replaced by one or 
more spaces, depending on the current column and the given tab size. [...]"

This should read "zero or more spaces":

>>> 'a\tb'.expandtabs(0)
'ab'
>>> 'a\tb'.expandtabs(-1)
'ab'

The description in Objects/unicodeobject.c does not include this error.

--
assignee: docs@python
components: Documentation
files: expandtabs_doc.diff
keywords: patch
messages: 147222
nosy: docs@python, john.feuerstein
priority: normal
severity: normal
status: open
title: str.expandtabs documentation is wrong
versions: Python 3.3
Added file: http://bugs.python.org/file23625/expandtabs_doc.diff

___
Python tracker 

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



[issue13358] HTMLParser incorrectly handles cdata elements.

2011-11-07 Thread Michael Brooks

Michael Brooks  added the comment:

This one should also have a priority change. Tested python 2.7.3

--MIke

On Sun, Nov 6, 2011 at 12:54 PM, Michael Brooks wrote:

>
> Michael Brooks  added the comment:
>
> Yes I am running python 2.7.2.
>
> On Sun, Nov 6, 2011 at 12:52 PM, Ezio Melotti  >wrote:
>
> >
> > Ezio Melotti  added the comment:
> >
> > Have you tried with the latest 2.7? (see msg147170)
> >
> > --
> > nosy: +ezio.melotti
> > stage:  -> test needed
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue13365] str.expandtabs documentation is wrong

2011-11-07 Thread Eli Bendersky

Eli Bendersky  added the comment:

While we're at it, wouldn't it be clearer to say "... where each tab character 
is replaced by..."?

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue6397] Implementing Solaris "/dev/poll" in the "select" module

2011-11-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


Removed file: http://bugs.python.org/file23532/0b701eb5e9e3.diff

___
Python tracker 

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



[issue6397] Implementing Solaris "/dev/poll" in the "select" module

2011-11-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


Added file: http://bugs.python.org/file23626/528fdd816160.diff

___
Python tracker 

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



[issue13365] str.expandtabs documentation is wrong

2011-11-07 Thread Eli Bendersky

Eli Bendersky  added the comment:

Other than that, the patch looks good.

--

___
Python tracker 

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



[issue6397] Implementing Solaris "/dev/poll" in the "select" module

2011-11-07 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Please, review.

With current code, each devpoll object has capacity for managing 256 fds, by 
default. This is about 2048 bytes. The cost seems reasonable, since a normal 
program will have only a few devpoll objects around. I have considered an 
optional parameter to tune this, but interaction with rlimit is messy. Even if 
we manage 65536 fds, the memory cost is about 512Kbytes per devpoll, and you 
surely can affort it if you are actually managing 65536 descriptors...

The code is not threadsafe. It doesn't crash, but concurrent use of a devpoll 
has undefined results.

Please, review for integration.

--

___
Python tracker 

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



[issue13224] Change str(class) to return only the class name

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

I misreported: dict.update is actually okay, but collections.Counter.update (a 
Python method) is a not an unbound method but a function (py3k-style).

--

___
Python tracker 

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



[issue6397] Implementing Solaris "/dev/poll" in the "select" module

2011-11-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +neologix

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-11-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

Re. Paul Moore's comment - IMO he's right about the problem, but changing only 
packaging.manifest._translate_pattern doesn't do it. The equivalent fix has to 
be made in distutils.filelist.translate_pattern. I've made the change in the 
pythonv branch, and the test no longer fails.

--

___
Python tracker 

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



[issue7071] distutils and IronPython compatibility

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

I think this change was wrong.  Please see my rationale in 
http://bugs.python.org/issue12119.

(BTW, I’d be surprised if byte compilation was the only compat issue with 
distutils and IronPython.  For a start, sys.version[:3] is used to get the 
version number.  I should be able to get Mono and IronPython in a few weeks or 
months and see how much issues there are in distutils and distutils2.)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue11610] Improved support for abstract base classes with descriptors

2011-11-07 Thread Darren Dale

Darren Dale  added the comment:

I just double-checked that the unit tests do not raise any warnings with this 
patch.

Can it be merged?

--

___
Python tracker 

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



[issue13345] Invisible Files in Windows 7

2011-11-07 Thread Jon Bryan

Jon Bryan  added the comment:

Thanks for the suggestions.

Since I can put the OEM-supplied DLL in another directory and everything works 
just fine, I'm not going to spend any more time on it.  I assume that it's 
something to do with file permissions in Win7 that I don't have any inclination 
to delve into further.  And I can always run it on my old laptop if I have to.

===
Jon

--

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

[global variables]
> one possible approach might be: Have those bindings be instance variables in 
> a Database class in
> database.py, and have a module-level binding to an instance of it. Then, 
> tests can have their
> own instance which is thrown away aftereach test.
I’m not sure we can do that, or that I understand the suggestion.  If you’re 
talking about how pprint/textwrap/reprlib use a module-level instance to offer 
module-level functions with some defaults, I think the database module can’t 
work that way.  We have module-level classes (Distribution and 
EggInfoDistribution, no inheritance) and module-level functions 
(get_distribution, the one in the failing test, for example) which may use any 
of the four caches and return instances of either class.  If I understand your 
suggestion correctly, you’d move database._cache_egg to 
database.EggInfoDistribution._cache, and maybe change the code to move the 
cache logic to the *Distribution classes instead of in the various functions 
(thus implementing a singleton registry like logging loggers.  I like this idea.

Writing this made me think of another possible solution: dependency injection!  
Just like the functions have a paths argument that defaults to sys.path if None 
is passed, I could change the internal cache generation function to take 
arguments for the four caches, so that the tests could pass fresh dictionaries 
that would not be shared between tests, unlike database-module-level global 
objects.

> This problem was not trivial to find, because it appears that test execution 
> order may not be
> entirely deterministic: I couldn't see any other reason why the flag would 
> have different values
> on different machines.
Sorry, what flag?

> I believe that you (Éric) had difficulty reproducing it.
More than difficulty: I have not yet reproduced it.  The tests pass on my OS, 
Debian x86_64 with linux3.  I’ve installed Arch but not cloned/built Python yet.

> Perhaps we don't need to re-implement, but instead add more tests around 
> cache invalidation
> and cache contents.
The packaging database cache API is not fantastic.  Libraries or applications 
can turn it off entirely, or clear it so that sys.path gets scanned again.  I’m 
not even sure that our tests do the right thing: They disable the cache in 
setUp and re-enable it in cleanup, but maybe they should just clear it in 
cleanup.  (BTW I have added a regrtest check to make sure the cache is 
re-enabled and clean after tests run.)  In any case, we don’t have tests that 
check the behavior of the database module with respect to caching.

“There are only two hard problems in Computer Science: cache invalidation and 
naming things” (Phil Karlton), and I’m less bad at the latter.  The student who 
implemented most of the database module is not active in our group anymore, but 
Michael Mulich, who started the module but did not write the cache code, still 
is.  So there’s hope that we can fix this together (and thanks for all the 
reports, diagnosis and suggestions so far!).

> Re. Paul Moore's comment - IMO he's right about the problem, but changing only
> packaging.manifest._translate_pattern doesn't do it. The equivalent fix has 
> to be made in
> distutils.filelist.translate_pattern. I've made the change in the pythonv 
> branch, and the test no
> longer fails.
Patches for upstream cpython would be most helpful.  I also think that fixing 
bugs in the pythonv branch makes it harder to review.

--
nosy: +michael.mulich

___
Python tracker 

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-11-07 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
hgrepos: +88
keywords: +needs review, patch

___
Python tracker 

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-11-07 Thread Jason R. Coombs

Changes by Jason R. Coombs :


Added file: http://bugs.python.org/file23627/fffeff7721c0.diff

___
Python tracker 

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-11-07 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I've created three changesets, addressing the issue in 2.7, 3.2, and 3.3, 
including tests. Please review and comment. If there are no objections, I'll 
push the changesets after 24 hours.

--

___
Python tracker 

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



[issue11610] Improved support for abstract base classes with descriptors

2011-11-07 Thread Éric Araujo

Changes by Éric Araujo :


___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-11-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

> 
>>  entirely deterministic: I couldn't see any other reason why the flag 
> would have different values
>>  on different machines.
> Sorry, what flag?

By "flag" I mean _cache_generated_egg ("flag" as in Boolean value)

> Patches for upstream cpython would be most helpful.  I also think that fixing 
> bugs in the pythonv branch makes it harder to review.

Ordinarily I'd submit a cpython patch, but in this case it's a one liner as 
Paul has
suggested, so there's not much to review / comment on.IMO BitBucket makes it
reasonably easy to review short patches like this. Here's the change to
packaging.manifest:

--- a/Lib/packaging/manifest.py    Sun Nov 06 22:27:53 2011 +
+++ b/Lib/packaging/manifest.py    Mon Nov 07 14:58:23 2011 +
@@ -366,7 +366,8 @@
 # ditch end of pattern character
 empty_pattern = _glob_to_re('')
 prefix_re = _glob_to_re(prefix)[:-len(empty_pattern)]
-    pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re)
+    # See issue 13193: Don't use os.path.join
+    pattern_re = "^%s/.*%s" % (prefix_re, pattern_re)
 else:   # no prefix -- respect anchor flag
 if anchor:
 pattern_re = "^" + pattern_re

and the change to distutils.filelist:

--- a/Lib/distutils/filelist.py    Mon Nov 07 14:58:23 2011 +
+++ b/Lib/distutils/filelist.py    Mon Nov 07 15:06:18 2011 +
@@ -313,7 +313,8 @@
 # ditch end of pattern character
 empty_pattern = glob_to_re('')
 prefix_re = (glob_to_re(prefix))[:-len(empty_pattern)]
-    pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re)
+    # See issue 13193: Don't use os.path.join
+    pattern_re = "^%s/.*%s" % (prefix_re, pattern_re)
 else:   # no prefix -- respect anchor flag
 if anchor:
 pattern_re = "^" + pattern_re

You'll see I used a different idiom to Paul in my fix :-)

Can the distutils/packaging duplication not be avoided? IMO the correct
cpython fix would address this.

--

___
Python tracker 

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



[issue13283] removal of two unused variable in locale.py

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

> Éric, thanks for paying attention to this.
You’re welcome.  I hope that my commits get reviewed too.

> In this particular case, I checked the code and verified that the
> variables were not used anywhere.
Yep, I can’t imagine third-party code being broken by this, contrary to 
module-level names for example.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

Another nice API: http://feldboris.alwaysdata.net/blog/unittest-template.html

--

___
Python tracker 

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



[issue13341] Incorrect documentation for "u" PyArg_Parse format unit

2011-11-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +loewis

___
Python tracker 

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



[issue13349] Uninformal error message in index() and remove() functions

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

> The good thing about this is ease of debugging.
Exactly!  +1 for the idea.

> On the other hand, the repr of a value might be very long:
You can restrict the length with % formats.

> Also, all values don't have a very informal repr:
Not your problem.  This change will still be much more useful than the current 
'x'.  Some reprs are very helpful, other ones give the ID so can be used in 
debugging, other ones are not helpful at all so authors will have to make them 
more helpful or debug their code otherwise.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13349] Uninformal error message in index() and remove() functions

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

> There's also documentation and tests that depend on this actual error message:
> Doc/library/doctest.rst:   ValueError: list.remove(x): x not in list
> Lib/test>/test_xml_etree.py:ValueError: list.remove(x): x not in list
That’s a well-known doctest problem.  Just update the doc.  Writing robust 
doctests is an art:

>>> str(someobject)
'output that can change'
>>> 'something I want' in str(someobject)  # more robust, but less useful if it 
>>> fails
True

>>> something.index(spam)
traceback blah:
ValueError: output that can change
>>> try: something.index(spam)
... except ValueError: print('spam not in something')  # more robust, but ugly
spam not in something

--

___
Python tracker 

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



[issue7252] list().index() should provide better error reporting

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

> FWIW, quickly grepping through the raises of ValueErrors in the 2.6
> stdlib doesn't bring up any other usage of repeat-with-fake-variable-x.

#13349 begs to differ :)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13364] Duplicated code in decimal module

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  If I may offer recommendations about submitting bugs:
- Know that stable branches don’t get code cleanups, only bug fixes, so you 
have to target 3.3
- Focused bugs (“code duplication in packaging commands”) are much better that 
over-broad bugs

--
nosy: +eric.araujo
title: Duplicated Code -> Duplicated code in decimal module
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



[issue13193] test_packaging and test_distutils failures

2011-11-07 Thread Éric Araujo

Éric Araujo  added the comment:

> By "flag" I mean _cache_generated_egg ("flag" as in Boolean value)
Ah, I had forgotten this earlier message:

> I get the opposite failure to Nadeem as far as 
> InstallDataTestCase.test_resources: it works on
> Ubuntu 64-bit, but fails on 32-bit. Digging into it a bit further, I find 
> that _generate_cache in
> Lib/packaging/database.py returns prematurely in the failing case, because 
> _cache_generated_egg is
> True in the failing case but not in the test run which succeeds.

That it depends on the architecture currently baffles me.

> Ordinarily I'd submit a cpython patch, but in this case it's a one liner as 
> Paul has suggested,
> so there's not much to review / comment on.
A patch in the list of files is much easier to find that a one-liner in a 
message.  Anyway, it’s not your fault.  Antoine was kind enough to get my 
attention on the buildbot failures; to make this manageable, I will open 
separate reports with specific names for each different bug.

> Here's the change to packaging.manifest: [snip]
> and the change to distutils.filelist: [snip]
Thanks.  Luckily, these modules recently gained full test coverage, so I will 
be able to commit the fixes and feel safe.

> You'll see I used a different idiom to Paul in my fix :-)
I’m a big fan of format strings other string concatenation, too.

> Can the distutils/packaging duplication not be avoided?
No.  They are independent modules.  distutils will die; packaging will be 
improved and cleaned up.  However, contributors can work on packaging only and 
leave the gruesome backporting work to me.

> IMO the correct cpython fix would address this.
I don’t understand.

--

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-07 Thread sbt

sbt  added the comment:

Testing the patch a bit more thoroughly, I found that data received from the 
readable end of the pipe can be corrupted by the C implementation.  This seems 
to be because two of the previously dormant codepaths did not properly maintain 
the necessary invariants.

I got the failures to go away by adding

self->pos += avail;

in two places.  However, I really do not know what all the attributes mean.  
(Should self->raw_pos also be modified...?)  Someone familiar with the code 
would need to check whether things are being done properly.  This new patch 
adds some XXX comments in places  in bufferedio.c which I am unsure about.

--
Added file: http://bugs.python.org/file23628/write_blockingioerror.patch

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-11-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

>
> That it depends on the architecture currently baffles me.

>

The only explanation I can come up with is that on different machines, the 
order of the tests might be slightly different. That would allow the flag to be 
set differently on different machines, based on which other tests have run 
earlier.

Different ordering could be explained by hash implementations and/or dict 
bucket sizes being different on different architectures.

>>  Can the distutils/packaging duplication not be avoided?
> No.  They are independent modules.  distutils will die; packaging will be 
> improved and cleaned up.  However, contributors can work on packaging only 
> and 
> leave the gruesome backporting work to me.
> 
>>  IMO the correct cpython fix would address this.
> I don’t understand.

I meant removing the duplication - but from your explanation, I agree that 
there is no point, since distutils has a limited lifetime.

--

___
Python tracker 

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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-11-07 Thread Vitja Makarov

Vitja Makarov  added the comment:

Perhaps it's better to calculate utc-offset for each timestamp cause we never 
know what is correct timezone for given time.

That could be done in C:

localtime, utc_offset = time.localtime_ex(t)

Where localtime is the same as returned by localtime() and utc_offset is set to 
tm.tm_gmtoff.
If tm_gmtoff isn't available on the target platform time.timezone or 
time.altzone will be used depending on time.daylight.


Here is simple python version, that subtracts gmtime from localtime tuple:

import time

def calculate_utc_offset(t):
"""
Returns localtime offset for given unix-time `t`
"""
loco = time.localtime(t)
utc = time.gmtime(t)
odd = cmp(loco.tm_year, utc.tm_year) or cmp(loco.tm_yday, utc.tm_yday)
return (1440 * odd +
60 * (loco.tm_hour - utc.tm_hour) +
loco.tm_min - utc.tm_min))

--
versions: +Python 2.6, 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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-11-07 Thread R. David Murray

R. David Murray  added the comment:

Unless I misunderstand your concerns, this is a duplicate of issue 665194.

--
nosy: +r.david.murray
resolution:  -> duplicate
status: open -> closed
superseder:  -> datetime-RFC2822 roundtripping

___
Python tracker 

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



[issue13348] test_unicode_file fails: shutil.copy2 says "same file"

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fcff91a7b397 by Florent Xicluna in branch 'default':
More assertions in test_unicode_file, to chase issue #13348.
http://hg.python.org/cpython/rev/fcff91a7b397

--
nosy: +python-dev

___
Python tracker 

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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-11-07 Thread Vitja Makarov

Vitja Makarov  added the comment:

I'm not quite sure. The problem is email.utils.formatdate doesn't respect TZ 
info changes since it uses time.timezone (or time.altzone) for utc offset. 

Btw it seems that issue 665194 should fix the problem.

--

___
Python tracker 

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



[issue13366] test_pep277 failures under WIndows

2011-11-07 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The 3.x Windows buildbots all fail in test_pep277.



==
FAIL: test_open (test.test_pep277.UnicodeFileTests)
--
Traceback (most recent call last):
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
125, in test_open
self._apply_failure(os.listdir, name, NotADirectoryError)
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
105, in _apply_failure
(fn.__name__, filename, exc_filename))
AssertionError: '@test_2416_tmp\\6_\u306b\u307d\u3093\\*.*' != 
'@test_2416_tmp\\6_\u306b\u307d\u3093'
- @test_2416_tmp\6_\u306b\u307d\u3093\*.*
? 
+ @test_2416_tmp\6_\u306b\u307d\u3093
 : Function 'listdir('@test_2416_tmp\\6_\u306b\u307d\u3093') failed with bad 
filename in the exception: '@test_2416_tmp\\6_\u306b\u307d\u3093\\*.*'

==
FAIL: test_open (test.test_pep277.UnicodeNFCFileTests)
--
Traceback (most recent call last):
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
125, in test_open
self._apply_failure(os.listdir, name, NotADirectoryError)
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
105, in _apply_failure
(fn.__name__, filename, exc_filename))
AssertionError: '@test_2416_tmp\\10_\u0385�\\*.*' != 
'@test_2416_tmp\\10_\u0385�'
- @test_2416_tmp\10_\u0385�\*.*
? 
+ @test_2416_tmp\10_\u0385�
 : Function 'listdir('@test_2416_tmp\\10_\u0385\xb4') failed with bad filename 
in the exception: '@test_2416_tmp\\10_\u0385\xb4\\*.*'

==
FAIL: test_open (test.test_pep277.UnicodeNFDFileTests)
--
Traceback (most recent call last):
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
125, in test_open
self._apply_failure(os.listdir, name, NotADirectoryError)
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
105, in _apply_failure
(fn.__name__, filename, exc_filename))
AssertionError: '@test_2416_tmp\\9_\u66e8\u05e9\u3093\u0434\u0393�\\*.*' != 
'@test_2416_tmp\\9_\u66e8\u05e9\u3093\u0434\u0393�'
- @test_2416_tmp\9_\u66e8\u05e9\u3093\u0434\u0393�\*.*
?
+ @test_2416_tmp\9_\u66e8\u05e9\u3093\u0434\u0393�
 : Function 'listdir('@test_2416_tmp\\9_\u66e8\u05e9\u3093\u0434\u0393\xdf') 
failed with bad filename in the exception: 
'@test_2416_tmp\\9_\u66e8\u05e9\u3093\u0434\u0393\xdf\\*.*'

==
FAIL: test_open (test.test_pep277.UnicodeNFKCFileTests)
--
Traceback (most recent call last):
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
125, in test_open
self._apply_failure(os.listdir, name, NotADirectoryError)
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
105, in _apply_failure
(fn.__name__, filename, exc_filename))
AssertionError: '@test_2416_tmp\\17_   A\\*.*' != '@test_2416_tmp\\17_   A'
- @test_2416_tmp\17_   A\*.*
?   
+ @test_2416_tmp\17_   A
 : Function 'listdir('@test_2416_tmp\\17_   A') failed with bad filename in the 
exception: '@test_2416_tmp\\17_   A\\*.*'

==
FAIL: test_open (test.test_pep277.UnicodeNFKDFileTests)
--
Traceback (most recent call last):
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
125, in test_open
self._apply_failure(os.listdir, name, NotADirectoryError)
  File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_pep277.py", line 
105, in _apply_failure
(fn.__name__, filename, exc_filename))
AssertionError: '@test_2416_tmp\\11_ \u0308\u0301\u03a5\u0301\u03a5\u0308\\*.*' 
!= '@test_2416_tmp\\11_ \u0308\u0301\u03a5\u0301\u03a5\u0308'
- @test_2416_tmp\11_ \u0308\u0301\u03a5\u0301\u03a5\u0308\*.*
?  
+ @test_2416_tmp\11_ \u0308\u0301\u03a5\u0301\u03a5\u0308
 : Function 'listdir('@test_2416_tmp\\11_ 
\u0308\u0301\u03a5\u0301\u03a5\u0308') failed with bad filename in the 
exception: '@test_2416_tmp\\11_ \u0308\u0301\u03a5\u0301\u03a5\u0308\\*.*'

--
components: Interpreter Core, Tests
messages: 147248
nosy: ezio.melotti, haypo, loewis, pitrou
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: test_pep277 failures under WIndows
type: behavior
versions: Python 3.3

___
Python tracker 

_

[issue6397] Implementing Solaris "/dev/poll" in the "select" module

2011-11-07 Thread Ross Lagerwall

Changes by Ross Lagerwall :


--
nosy: +rosslagerwall

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-11-07 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Thanks Charles, I'll take your comments into account and take a look at making 
a general walker method.

--

___
Python tracker 

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



[issue13366] test_pep277 failures under WIndows

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

I'm guilty on this one :-)

--
assignee:  -> flox
components: +Windows -Interpreter Core
keywords: +buildbot
nosy: +flox

___
Python tracker 

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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-11-07 Thread R. David Murray

R. David Murray  added the comment:

formatdate doesn't know anything about datetimes, so it doesn't make any sense 
to me to say that it doesn't notice changes in tzinfo.  That's why the fix for 
issue 665194 introduces a new method for formatting datetimes.

--

___
Python tracker 

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



[issue13173] Default values for string.Template

2011-11-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

When I need defaults, I make them part of the mapping that gets passed into 
.substitute() and .safe_substitute().  It doesn't feel to me like it's 
necessary to attach them to the Template instance.  Also, couldn't you just 
subclass string.Template if you wanted defaults?  OTOH, since it can be done in 
a backward compatible way, I guess I'm -0 on the change.

--

___
Python tracker 

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-11-07 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Perhaps the reason should include the status code, too? It makes HTTP errors 
much more useful, as you'll immediately see what's going on from the status 
code.

--

___
Python tracker 

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



[issue13361] getLogger does not check its argument

2011-11-07 Thread Eric Snow

Eric Snow  added the comment:

FYI, the following changesets were also for this issue.  They had the wrong 
issue number (#13661, which doesn't actually exist so no big deal), which is 
why they didn't show up in this issue automatically.


New changeset 5f3b7528b144 by Vinay Sajip in branch '2.7':
Closes #13661: Check added for type of logger name.
http://hg.python.org/cpython/rev/5f3b7528b144

New changeset a3ba905447ba by Vinay Sajip in branch '3.2':
Closes #13661: Check added for type of logger name.
http://hg.python.org/cpython/rev/a3ba905447ba

--
nosy: +eric.snow

___
Python tracker 

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



[issue13366] test_pep277 failures under WIndows

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 655d65bcc939 by Florent Xicluna in branch 'default':
Closes #13366: fix test_pep277 failure on Windows.
http://hg.python.org/cpython/rev/655d65bcc939

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

___
Python tracker 

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



[issue13345] Invisible Files in Windows 7

2011-11-07 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Closing the report as invalid then.

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

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

test fails on x86 Windows7 2.7 buildbot
(ok on 3.2 and 3.3)


test_unix_mbox (test.test_mailbox.MaildirTestCase) ... 
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\dbapi.py:649:
 DeprecationWarning: buffer() not supported in 3.x
  b = sqlite.Binary(chr(0) + "'")
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\types.py:70:
 DeprecationWarning: buffer() not supported in 3.x
  val = buffer("Guglhupf")
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\types.py:234:
 DeprecationWarning: buffer() not supported in 3.x
  val = buffer("Guglhupf")
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\types.py:350:
 DeprecationWarning: buffer() not supported in 3.x
  result = self.con.execute('select ? as "x [bin]"', 
(buffer(zlib.compress(testdata)),)).fetchone()[0]
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\userfunctions.py:39:
 DeprecationWarning: buffer() not supported in 3.x
  return buffer("blob")
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\userfunctions.py:200:
 DeprecationWarning: buffer() not supported in 3.x
  self.assertEqual(val, buffer("blob"))
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\userfunctions.py:237:
 DeprecationWarning: buffer() not supported in 3.x
  cur.execute("select isblob(?)", (buffer("blob"),))
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\userfunctions.py:255:
 DeprecationWarning: buffer() not supported in 3.x
  ("foo", 5, 3.14, None, buffer("blob"),))
D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\sqlite3\test\userfunctions.py:347:
 DeprecationWarning: buffer() not supported in 3.x
  cur.execute("select checkType('blob', ?)", (buffer("blob"),))
test test_mailbox failed -- Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\test_mailbox.py",
 line 803, in test_reread
self.assertFalse(refreshed())
AssertionError: True is not false

ok

==
FAIL: test_reread (test.test_mailbox.TestMaildir)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\2.7.bolen-windows7\build\lib\test\test_mailbox.py",
 line 803, in test_reread
self.assertFalse(refreshed())
AssertionError: True is not false

--
Ran 280 tests in 5.250s

--
keywords: +buildbot -patch
status: closed -> open

___
Python tracker 

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-11-07 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

My initial instinct was to agree - the status code is useful. However, in 
looking at the FTP code, it sometimes just sets other objects (socket.error for 
example) as the 'reason'. The docs say 'reason' is a string or another 
exception.

I'm tempted to leave it as is. This fix is mainly to provide a reasonable value 
for .reason. The __str__ and .code are already exposed, so to create a reason 
with a code would create yet another string representation of the error which 
is different from every other representation already present.

--

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 59dca1e2363d by Brian Curtin in branch 'default':
Fix #13327. utimensat now has the atime and mtime arguments set as optional,
http://hg.python.org/cpython/rev/59dca1e2363d

--

___
Python tracker 

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



[issue13366] test_pep277 failures under WIndows

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2cd6b417e488 by Florent Xicluna in branch 'default':
Some win32 platforms raise NotADirectoryError, others FileNotFoundError. Issue 
#13366.
http://hg.python.org/cpython/rev/2cd6b417e488

--

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-07 Thread Brian Curtin

Brian Curtin  added the comment:

Changeset 045e8757f10d was also entered for this, which should conclude the 
changes. Everything seems to have survived the buildbots for now, so closing as 
fixed. Feel free to reopen if there are any other issues.

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



[issue13327] Update utime API to not require explicit None argument

2011-11-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5e18ff5476e8 by Brian Curtin in branch 'default':
News updates for #13327.
http://hg.python.org/cpython/rev/5e18ff5476e8

--

___
Python tracker 

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



[issue13335] Service application hang in python25.dll

2011-11-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am closing this because there is no issue for currently maintained CPython. 
If you have further questions, try python-list or a question-answer forum such 
as StackOverflow.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue13313] test_time fails: tzset() do not change timezone

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

Maybe it is related.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=93810

Ambiguous timezone names (AEST vs EST)

--

___
Python tracker 

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-11-07 Thread Michael Foord

Michael Foord  added the comment:

On OS X Lion, with XCode 4.2 installed, I find the following works (no need to 
install macports):

./configure CC=gcc-4.2 --prefix=/dev/null --with-pydebug

--
nosy: +michael.foord

___
Python tracker 

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



[issue13309] test_time fails: time data 'LMT' does not match format '%Z'

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

LMT stands for Local Mean Time.

I found a report of someone having an issue parsing timezone with Python 2.6. 
Looks quite similar.
http://www.aczoom.com/forums/blockhosts/mar-10-151801-domains-blockhosts5599-error-failed-to-parse-date-for-ip-18911419951

--
components: +Library (Lib)

___
Python tracker 

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-11-07 Thread Michael Foord

Michael Foord  added the comment:

Ah, it seems I have XCode 3.2.6 installed alongside XCode 4.2.

--

___
Python tracker 

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



[issue1200313] HTMLParser fails to handle charref in attribute value

2011-11-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

unescape() already converts named, decimal and hexadecimal entities, so this 
can be closed.

--
assignee: fdrake -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> out of date
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue9375] ElementPath parser in ElementTree 1.3 does not reject "element//" as invalid

2011-11-07 Thread Florent Xicluna

Changes by Florent Xicluna :


--
status: pending -> closed

___
Python tracker 

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



[issue13367] PyCapsule_New's argument *must* not a NULL.

2011-11-07 Thread INADA Naoki

New submission from INADA Naoki :

http://docs.python.org/c-api/capsule.html?highlight=capsule#PyCapsule_New

> The pointer argument may not be NULL.

I think "must not" is correct.

--
assignee: docs@python
components: Documentation
messages: 147269
nosy: docs@python, naoki
priority: normal
severity: normal
status: open
title: PyCapsule_New's argument *must* not a NULL.
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



[issue13367] PyCapsule_New's argument *must* not a NULL.

2011-11-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +larry

___
Python tracker 

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



[issue11812] transient socket failure to connect to 'localhost'

2011-11-07 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Checking the testsuite source code, I see several issues:

The server thread only waits for 3 seconds for the connection. If a connection 
is not created before 3 seconds, the server suicides and when the connection is 
tried, it will fail. This probably explain why the problem is sporadic and 
seems to depend of name resolving. If the DNS resolver is "slow", we have a 
problem.

Also, the event is signaled twice in the server, and the client does a wait and 
a clear. If the thread scheduler is lucky, the server would signal twice and 
THEN the client would wait (and return inmediatelly) and clear, completelly 
missing the second signaling and hanging the client in the next wait (in the 
teardown).

So, I would propose:

1. Use 127.0.0.1 instead of "localhost".

2. Delete the timeout in the server. I don't see the purpose of it, except be 
sure the server thread dies eventually. Lets configure the thread as "daemon", 
and don't mind with the thread join.

3. Cleanup the Event signaling.

4. "time.sleep(0.1)?"... Please... :-)

Opinions?.

I assign the issue to myself. Please, provide feedback and I will create & 
apply the patch.

I have seen this issue too in 2.7, in my buildbots (OpenIndiana).

You can reproduce the issue easily changing the "self.sock.settimeout(3)" to 
"self.sock.settimeout(0.01)", for instance.

PS: I see use of test.support.HOST in the testuite, but that attribute is not 
documented anywhere. :-??

"""
Python 3.2.2 (default, Sep  5 2011, 01:49:10) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import support
>>> support.HOST
'localhost'
"""

Should it be 127.0.0.1, or not use at all, since it is not documented?.

PPS: I only checked telnetlib, not ftplib.

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



[issue11812] transient socket failure to connect to 'localhost'

2011-11-07 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

About the "support.HOST", changing from "localhost" to "127.0.0.1" could be 
problematic is servers without IPv4 support (servers IPv6 only). I guess this 
is a theorical problem so far, and that when we find this issue the exception 
would be pretty obvious...

Opinions?.

What about documenting "support.HOST"?

--

___
Python tracker 

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



[issue13368] Possible problem in documentation of module subprocess, method send_signal

2011-11-07 Thread Eli Bendersky

New submission from Eli Bendersky :

docs@ list report by Daniel Dieterle:

in the documentation 
(http://docs.python.org/library/subprocess.html#subprocess.Popen.send_signal) 
is a bug.

CTRL_C_EVENT can not be sent to processes started with a creationflags 
parameter which includes CREATE_NEW_PROCESS_GROUP. Why can be read in the msdn 
documentation 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155%28v=vs.85%29.aspx
 .

A workaround using CTRL_C_EVENT nevertheless is described here:
http://stackoverflow.com/questions/7085604/sending-c-to-python-subprocess-objects-on-windows/7980368#7980368
 

--

I do not know why the subprocess.CREATE_NEW_PROCESS_GROUP parameter was 
introduced. But it is useless for terminating a process with os.kill() in 
combination with signal.SIGTERM, which corresponds to a CTRL-C-EVENT.
A CTRL-C-EVENT is only forwarded to the process if the process group is zero. 
Therefore the Note in the documentation on Popen.send_signal() is wrong.

--
assignee: docs@python
components: Documentation
messages: 147272
nosy: docs@python, eli.bendersky
priority: normal
severity: normal
status: open
title: Possible problem in documentation of module subprocess, method 
send_signal
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



[issue13367] PyCapsule_New's argument *must* not a NULL.

2011-11-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13367] PyCapsule_New's argument *must* not a NULL.

2011-11-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

In this context, "may" means "allowed to". In other words, it is equivalent to 
"The pointer argument is not allowed to be NULL".

--
nosy: +benjamin.peterson
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-11-07 Thread Florent Xicluna

Florent Xicluna  added the comment:

This is a transient failure, other builds are successful.

Maybe the line "time.sleep(2.01 + self._box._skewfactor)" could be changed to 
"time.sleep(2.5 + self._box._skewfactor)" in 
test_mailbox.TestMaildir.test_reread.

Closing because it's not related to this issue.

--
status: open -> closed

___
Python tracker 

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-11-07 Thread Lucas Sinclair

Lucas Sinclair  added the comment:

Well the configure parameters suggested by Michael Foord worked. I was able to 
build cpython on a mac. But I could not have guessed how to make it work.

Shouldn't these instructions be added here http://docs.python.org/devguide/ ?

Shouldn't the latest version of OS X be included in the list of *nix systems 
that cpython is checked to build on ?

--

___
Python tracker 

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