[issue1559549] ImportError needs attributes for module and file name

2012-02-08 Thread Brian Curtin

Brian Curtin  added the comment:

Yep, I just need to actually make use of the feature. I'll generate a new patch 
shortly.

--

___
Python tracker 

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



[issue11836] multiprocessing.queues.SimpleQueue is undocumented

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Sandro, can you commit, taking Antoine's note into account?

--

___
Python tracker 

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



[issue1040439] Missing documentation on how to link with libpython

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

ISTM that part of the doc specifically deals with Unix, so this issue can be 
closed as completed.

Windows is a different issue. Perhaps the documentation should have a new 
section on embedding on Windows, similarly to the "Building C and C++ 
Extensions on Windows" section in the "extending" documentation. Anyway, if 
there's interest in that, it should be a separate issue.

--

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Changing the target version(s) and adding some documentation experts to the 
nosy list

--
nosy: +eric.araujo, ezio.melotti, sandro.tosi
versions: +Python 3.2, Python 3.3 -Python 3.1

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Eric,

Thanks for checking. I agree that this behavior is acceptable, but a 
documentation fix would be appropriate. The documentation of iterparse should 
mention the events it accepts, also saying that those are strings. 

The events are listed at http://effbot.org/zone/element-iterparse.htm

Would you like to try your hand at submitting a patch for Python 3.2? I will 
review and apply it to 3.2 and 3.3

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

>> Well, if glob() already lived in shutil, this decision would be a
no-brainer :) Having glob() in the glob module and globtree() in the
shutil module, though, looks a bit weird.
(I agree having a separate module for glob isn't ideal)


Would it be feasible to deprecate the 'glob' module, moving its functionality 
to shutil? In some future Python version, then, the module can be removed.

The same fate would go for fnmatch, I guess. There are too many modules lying 
around dealing with the same problems.

On a related note, the doc of glob explicitly mentions that it is implemented 
with os.listdir and fnmatch. Similarly, *if* the recursive glob gets accepted 
it should be implemented with walkdir (once that's in).

--

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Martin, do you find the wording I quoted (*without* the reference to a more 
Pythonic API) acceptable?

--

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-02-08 Thread Meador Inge

Meador Inge  added the comment:

> So perhaps as a temporary workaround, we could tweak setup.py to set
> -O0 for building ctypes with clang?

That would make the tests pass, but it still won't fix the fundamental 
issue.  clang and GCC have a difference in opinion as to when function
parameters and return values should be sign extended.  libffi follows
the GCC model.

I am talking to the LLVM folks right now to see why things are 
implemented this way.  Whether LLVM or libffi should be fixed depends
on the outcome of that discussion.

Due to this ABI difference compiling _ctypes with -O0 for clang will not
fix the problem because any ctypes code that interacts with C code that
was compiled by clang with optimizations has the potential to break just
like our test cases.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

We do have the option of aliasing glob.iglob as shutil.glob...

--

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2012-02-08 Thread Brett Cannon

Brett Cannon  added the comment:

Brian, what is left for updating your patch? I'm going to need this to fix 
test_pydoc to not fail in my importlib bootstrap work so I can (finally) help 
with this. Is it just actually using the new features of the exception?

--
assignee: brett.cannon -> brian.curtin

___
Python tracker 

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



[issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens()

2012-02-08 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

Updated version of my suggestion:
os.futime(fd, (atime, mtime))
os.utime(path, (atime, mtime), flags=0)
os.utimeat(dirfd, path, (atime, mtime), flags=0)

atime and mtime could be int, float, decimal.Decimal or None.
All other os.*utime*() functions were introduced in 3.3, so they would be 
removed.
flags argument of os.utime() and os.utimeat() could be 0 or os.SYMLINK_NOFOLLOW.

--

___
Python tracker 

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



[issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens()

2012-02-08 Thread STINNER Victor

STINNER Victor  added the comment:

signal.sigtimedwait() API should also be changed from:
  sigtimedwait(sigset, (timeout_sec, timeout_nsec))
to:
  sigtimedwait(sigset, timeout)

where timeout can be an int, float or decimal.Decimal. The function was 
introduced in Python 3.3, so its API can be changed.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> However, along with that itertools inspired iterator pipeline based
> design, I've also inherited Raymond's preference that particular *use
> cases* start life as recipes in the documentation.

I think it's important to remember where we are coming from. Many people
complain that using os.walk is too cumbersome. Proposing another
cumbersome solution doesn't really help.

So I'm not against walkdir *per se*, but I'm -1 on the idea that walkdir
can eliminate the need for practical functions that anybody can use
*easily*.

> >>> print '\n'.join(sorted(globtree('*.rst', '*.py')))
> ./conf.py
> ./index.rst
> ./py3k_binary_protocols.rst
> ./venv_bootstrap.rst

I think it's rather nice, but it should be available as a stdlib
function rather than a "recipe" in the documentation.

Recipes are really overrated: they aren't tested, they aren't
maintained, they aren't part of a module's docstrings or
(pydoc-generated) contents, it's not obvious what kind of quality you
can expect from them (do they handle all cases correctly), it's not
obvious which Python versions they support. Raymond may like the idea,
but that doesn't make it a "good practice" Python should follow for its
batteries.

> On a somewhat related note, I'd also like to see us start
> concentrating higher level shell utilities in the shutil namespace so
> users don't have to check multiple locations for shell-related
> functionality quite so often (that is, I'd prefer shutil.globtree over
> glob.rglob).

Well, if glob() already lived in shutil, this decision would be a
no-brainer :) Having glob() in the glob module and globtree() in the
shutil module, though, looks a bit weird.
(I agree having a separate module for glob isn't ideal)

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

I think it's important to be clear on what the walkdir API aims to be: a 
composable toolkit of utilities for directory tree processing. It's overall 
design is inspired directly by the itertools module.

Yes, it started life as a simple proposal to add shutil.filtered_walk 
(http://bugs.python.org/issue13229), but I soon realised that implementing this 
solely as a monolothic function would be foolish, since that approach isn't 
composable. What if you just wanted file filtering? Or depth limiting? Having 
it as a filtering toolkit lets you choose the exact filters you need for a 
given use case. walkdir.filtered_walk() is just an API for composing filtering 
pipelines without needing to pass the same information to multiple pipeline 
stages.

However, along with that itertools inspired iterator pipeline based design, 
I've also inherited Raymond's preference that particular *use cases* start life 
as recipes in the documentation.

A recursive glob is just a basic walkdir pipeline composition:

>>> from walkdir import file_paths, include_files
>>> def globtree(pattern, path='.'):
... return file_paths(include_files(os.walk(path), pattern))

Since filtered_walk() is just a pipeline builder, the composition can also be 
written:

>>> from walkdir import file_paths, filtered_walk
>>> def globtree(pattern, path='.'):
... return file_paths(filtered_walk(path, included_files=[pattern]))

That latter approach then suggests an alternative signature for globtree:

def globtree(*patterns, **kwds):
kwds.setdefault("top", ".")
return file_paths(filtered_walk(included_files=patterns, **kwds))

>>> print '\n'.join(sorted(globtree('*.rst')))
./index.rst
./py3k_binary_protocols.rst
./venv_bootstrap.rst

>>> print '\n'.join(sorted(globtree('*.rst', '*.py')))
./conf.py
./index.rst
./py3k_binary_protocols.rst
./venv_bootstrap.rst

On a somewhat related note, I'd also like to see us start concentrating higher 
level shell utilities in the shutil namespace so users don't have to check 
multiple locations for shell-related functionality quite so often (that is, I'd 
prefer shutil.globtree over glob.rglob).

--

___
Python tracker 

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



[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-08 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file24448/time_decimal-12.patch

___
Python tracker 

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



[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-08 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file24445/time_decimal-11.patch

___
Python tracker 

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



[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-08 Thread STINNER Victor

STINNER Victor  added the comment:

Patch version 13:
 - os.utime(path) sets the access and modification time using the currenet time 
with a subsecond resolution (e.g. microsecond resolution on Linux)
 - os.*utime*() functions uses _PyTime_t type and functions
 - add many functions to manipulate timeval, timespec and FILETIME types with 
_PyTime_t, add _PyTime_SetDenominator() function for that
 - coding style: follow PEP 7 rules for braces

So more functions (including os.*utime*()) "accept" Decimal, but using an 
implicit conversion to float.

--
Added file: http://bugs.python.org/file24461/time_decimal-13.patch

___
Python tracker 

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



[issue13609] Add "os.get_terminal_size()" function

2012-02-08 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

Thanks for merging!

I'll try to keep an eye on the buildbot results, but please add me to 
any bugs in case I miss something.

--

___
Python tracker 

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



[issue13609] Add "os.get_terminal_size()" function

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch is finally committed. Thank you Zbyszek for having been quite patient.
(according to Murphy's laws, this will surely break some buildbots)

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



[issue13609] Add "os.get_terminal_size()" function

2012-02-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c92f8de398ed by Antoine Pitrou in branch 'default':
Issue #13609: Add two functions to query the terminal size:
http://hg.python.org/cpython/rev/c92f8de398ed

--
nosy: +python-dev

___
Python tracker 

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



[issue13841] multiprocessing should use sys.exit() where possible

2012-02-08 Thread sbt

sbt  added the comment:

I think the patch makes multiprocessing.util._exit_function() run twice in 
non-main processes because it is registered with atexit, and is also called in 
Process._bootstrap().

_exit_function() does the following:

 * terminate active daemon processes;

 * join active non-daemon processes;

 * run finalizers with non-None exit priority and clear finalizer registry.

So calling _exit_function() twice is probably harmless but should perhaps be 
fixed.

P.S. It also appears that _exit_function() should set the global _exiting to 
True, since it declares the variable as a global but does not use it.  As a 
result util.is_exiting() always returns False.

--

___
Python tracker 

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



[issue13845] Use GetSystemTimeAsFileTime() to get a resolution of 100 ns on Windows

2012-02-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3965ed809a85 by Victor Stinner in branch 'default':
Issue #13845: Fix NEWS entry, the change is specific to Windows
http://hg.python.org/cpython/rev/3965ed809a85

--

___
Python tracker 

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



[issue13965] Windows 64-bit installer actually installing a 32-bit version

2012-02-08 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

On Win64, the long type is 32-bit; the compiler does not support any other 
mode. So the question "whether another memory model could have been selected 
during compilation" must be answered as "no, the compiler does not support 
multiple memory models".

We could have chosen to not use long for ob_ival. However, that would have 
cause a massive API change, as functions such as PyLong_AsLong either would 
have to change their return type, or start raising exceptions even for exact 
int objects.

In Python 3, this issue is fixed as the int type has no range constraint 
anymore.

--
status: open -> closed

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2012-02-08 Thread Alexander Jones

Alexander Jones  added the comment:

Not having this as a standard idiom makes it very tempting to just do 
copy-paste coding as in hniksic's example. Who likes to invent their own 
library for generic language-supporting idioms?

What about an alternative of giving NoneType empty enter and exit methods? So 
instead of a 'null' CM you can just use "with None"?

--
nosy: +Alexander.Jones

___
Python tracker 

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



[issue13841] multiprocessing should use sys.exit() where possible

2012-02-08 Thread Charles-François Natali

Charles-François Natali  added the comment:

Here's a trivial patch.
I run the testsuite on one of the Windows buildbots, and there was one failure, 
in test_concurrent_futures:

"""
==
FAIL: test_interpreter_shutdown 
(test.test_concurrent_futures.ProcessPoolShutdownTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\custom.bolen-windows7\build\lib\test\test_concurrent_futures.py",
 line 109, in test_interpreter_shutdown
self.assertFalse(err)
AssertionError: b'[68326 refs]\n[68326 refs]\n[68326 refs]\n[68326 
refs]\n[106059 refs]' is not false

--
"""

That's simply because test.support.strip_python_stderr only strips the first 
occurrence of the refs count printed in debug mode at output (which didn't get 
printed upon ExitProcess).

The patch changes this.

--
keywords: +needs review, patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file24460/multiprocessing_exit.diff

___
Python tracker 

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



[issue8033] sqlite: broken long integer handling for arguments to user-defined functions

2012-02-08 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue11689] sqlite: Incorrect unit test fails to detect failure

2012-02-08 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13965] Windows 64-bit installer actually installing a 32-bit version

2012-02-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

LLP64 is the model chosen by the Microsoft compiler: sizeof(long)==4.

I suppose someone already considered to change PyIntObject and use size_t 
values, but IMO it would have broken too many extensions: the pattern "if 
(PyInt_Check(obj)) value=PyInt_AS_LONG(obj);" is very very common.

--

___
Python tracker 

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



[issue13965] Windows 64-bit installer actually installing a 32-bit version

2012-02-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

platform.architecture() and struct.calcsize("P") confirm that this build used 
64-bits for pointers and 32-bits for ints.

This leaves the question of whether LLP64 is required to run Python on Windows 
or whether another memory model could have been selected during compilation 
(IOW, do we have to live with 32-bit ints on Windows)?

--
priority: normal -> low
resolution:  -> invalid

___
Python tracker 

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



[issue8184] multiprocessing.managers will not fail if listening ocket already in use

2012-02-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 434301d9f664 by Charles-François Natali in branch 'default':
Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on Connection
http://hg.python.org/cpython/rev/434301d9f664

--

___
Python tracker 

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



[issue13911] test_trace depends on dict repr() ordering

2012-02-08 Thread Mark Shannon

Mark Shannon  added the comment:

Failure occurs in test_pprint which is covered by issue 13907

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue13970] frameobject should not have f_yieldfrom attribute

2012-02-08 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I agree, FWIW.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue13971] format() doesn't parse str.

2012-02-08 Thread Eric V. Smith

Eric V. Smith  added the comment:

This is working as defined in PEP 3101: it calls PySequence_GetItem() or 
PyObject_GetItem() on the value inside the brackets. There is indeed no item in 
d that is the string "0" (including the quotes).

--
assignee:  -> eric.smith
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



[issue9750] sqlite3 iterdump fails on column with reserved name

2012-02-08 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Marko's last patch looks good to me.

--

___
Python tracker 

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



[issue13970] frameobject should not have f_yieldfrom attribute

2012-02-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Interpreter Core
nosy: +ncoghlan
stage:  -> patch review

___
Python tracker 

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



[issue13719] bdist_msi upload fails

2012-02-08 Thread Ralf Schmitt

Ralf Schmitt  added the comment:

there's a workaround in 
http://pypi.python.org/pypi/xdistutils#the-bdist-msi-fixed-command

--

___
Python tracker 

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



[issue13953] Get rid of doctests in packaging.tests.test_version

2012-02-08 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

Hi
here's a patch preview: it has to be re factored further but I stopped here as 
some tests failed: the out commented ones ... I've checked twice but I cannot 
see any diff, could you check that? Or, has maybe the behavior (due that bug) 
changed and nobody noticed?

Thanks in advance !

Francis

--
keywords: +patch
Added file: http://bugs.python.org/file24459/issue13953_58bd6a58365d.patch

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Oops, Éric, sorry about the title. I didn't even notice :)

--

___
Python tracker 

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



[issue13971] format() doesn't parse str.

2012-02-08 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +eric.smith

___
Python tracker 

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



[issue13971] format() doesn't parse str.

2012-02-08 Thread umedoblock

New submission from umedoblock :

format() mis understaning.
please pay attention to [0], [x].

>>> d = {0: "a", "0": "A"}
>>> 'd[0] = {0[0]}'.format(d)
'd[0] = a'
>>> 'd[0] = {0["0"]}'.format(d)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: '"0"'
>>> d2 = {"x": 100}
>>> 'd2[x] = {0[x]}'.format(d2)
'd2[x] = 100'

--
components: Regular Expressions
messages: 152897
nosy: ezio.melotti, umedoblock
priority: normal
severity: normal
status: open
title: format() doesn't parse str.
type: behavior
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



[issue12659] Add tests for packaging.tests.support

2012-02-08 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

> If so, could you provide a patch this time?
Done. The patch is against default.

what about against distutils2? Do you need also a patch for it?

--
Added file: http://bugs.python.org/file24458/issue12659_58bd6a58365d.patch

___
Python tracker 

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



[issue13970] frameobject should not have f_yieldfrom attribute

2012-02-08 Thread Mark Shannon

New submission from Mark Shannon :

The f_yieldfrom field should not be visible at Python level, it is an internal 
implementation detail.

Patch attached.

--
files: remove_f_yieldfrom.patch
keywords: patch
messages: 152895
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: frameobject should not have f_yieldfrom attribute
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file24457/remove_f_yieldfrom.patch

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

>>> list(glob.rglob('*/setu*.py'))

It looks quite strange to me that '/' should be allowed in a function that 
recurses down directories (see my messages above).  OTOH fnmatch is not really 
appropriate, contrary to my earlier feeling.

(Restoring my title change: as my messages were apparently overlooked, I assume 
that Eli did not revert my change on purpose but by replying to older email)

--
title: Add a recursive function to the glob package -> Support recursive globs

___
Python tracker 

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

> the problem is not Apple's in the sense that we enforce the use of the build 
> compiler.
Well, yes, and this is a known limitation, so we could argue that Apple broke 
distutils.  But...

> Without a fix along this line would mean that essentially *every* user of 
> python.org Pythons on
> the latest releases of OS X would have to ensure that the environment 
> variable override is in
> place for every Distutils install of an extension module.  That strikes me as 
> unacceptable.
> Distutils already does equally magical things.
Given that we did similar changes to support Debian multiarch instead of having 
people use environment variables, I change my position and support your patch.  
(Comments on Rietveld.)

--

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> devguide doesn’t list all build dependencies

___
Python tracker 

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-02-08 Thread Ned Deily

Ned Deily  added the comment:

Éric, no, the problem is not Apple's in the sense that we enforce the use of 
the build compiler.  Without a fix along this line would mean that essentially 
*every* user of python.org Pythons on the latest releases of OS X would have to 
ensure that the environment variable override is in place for every Distutils 
install of an extension module.  That strikes me as unacceptable.  Distutils 
already does equally magical things.  I think this is the best solution at the 
moment.  Ronald, what's your opinion?

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24456/20702d1acf17.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Removed file: http://bugs.python.org/file24455/bc286099ce9a.diff

___
Python tracker 

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



[issue11841] Bug in the version comparison

2012-02-08 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
title: Bug in the verson comparison -> Bug in the version comparison

___
Python tracker 

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



[issue12659] Add tests for packaging.tests.support

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

> I've just updated “test_support.py” and tested against 'default'
Do you mean that you have added more tests to the existing file?  If so, could 
you provide a patch this time?

> BTW: in distutils2 I get (not because of this change):
It’s a known failure that’s caused by a bug fix in 2.7.3.  I didn’t fix it 
because I need to check the original bug report for the failing test.

--

___
Python tracker 

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-02-08 Thread K Richard Pixley

K Richard Pixley  added the comment:

I think a better solution that declaring it to be apple's bug would be to 
release one binary for pre-10.7, (or maybe 10.6 with the current xcode), and a 
different binary for post-10.7.

This isn't an apple "bug" in the sense that there's anything wrong nor in the 
sense that they would ever "fix" it.  It's simply a difference between xcode 
versions.  So the choices would seem to be a) code around it or b) release 
different binaries.

I'm ok with either solution.  I'm not sure what would be best as I'm not sure I 
know all of the concerns involved.

--

___
Python tracker 

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



[issue13845] Use GetSystemTimeAsFileTime() to get a resolution of 100 ns on Windows

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Please make sure to say “on Windows” in NEWS and commit messages when you’re 
doing platform-specific changes :)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13953] Get rid of doctests in packaging.tests.test_version

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

The interesting line is just after the string:

  doctest.script_from_examples(comparison_doctest_string)

However it looks like there has been a problem with that line, as you can’t get 
the test to fail, which is strange as I did use that doctest to check #11841!  
Instead of using time to figure out doctest antics, I will just use good old 
reliable integrated unittest.

--
assignee: tarek -> eric.araujo
title: test_packaging: unused test? -> Get rid of doctests in 
packaging.tests.test_version
versions: +3rd party

___
Python tracker 

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Would you think it acceptable to judge that the problem is Apple’s and that we 
could do only a doc change with the not-so-hard envvar override?

I understand that you’d like to fix the problem for all OS X users in one go, 
but the new behavior seems a bit too magical for me.

--

___
Python tracker 

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



[issue13511] Specifying multiple lib and include directories on linux

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Ronald, is “unity platforms” a typo for “unixy platforms”?  IOW, are you 
expressing a +1 to the feature request, despite Martin’s rejection (with which 
I agree)?

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24455/bc286099ce9a.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Removed file: http://bugs.python.org/file24454/1f703b2607af.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Mark Shannon  added the comment:

Antoine Pitrou wrote:
> Antoine Pitrou  added the comment:
> 
> Looking at your latest patch, I worry about "any deletion
> +(including pop & popitem) causes a split table to become a combined table". 
> Why wouldn't you use a dummy pointer (such as ((PyObject *) 1)) to signal 
> deleted slots?

In fact here is no need for a dummy pointer.
When deleting from a split-table, the value can just be set to NULL,
the resulting key-NULL pair is legal in a split-table.
Your suggestion doesn't make the code any more complex, so I've included it.

In practice, it will very rare that a deletion occurs in a split table
(since they are only used for attribute dictionaries).

--

___
Python tracker 

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



[issue13967] also test for an empty pathname

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Will commit, thanks.

--
assignee: tarek -> eric.araujo

___
Python tracker 

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



[issue13969] path name must always be string (or None)

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Hm, that function is for internal use only, and our code always passes a 
string, so I’m not sure a type check is useful.

--

___
Python tracker 

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



[issue13915] Update tutorial/modules for PEP 3147

2012-02-08 Thread Éric Araujo

Changes by Éric Araujo :


--
title: Update Tutorial 6.1.3 for PEP 3145 -> Update tutorial/modules for PEP 
3147

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm trying the patch and its behaviour is strange:

>>> list(glob.rglob('setup.py'))
['setup.py']
>>> list(glob.rglob('setu*.py'))
[]
>>> list(glob.rglob('*/setu*.py'))
['./setup.py', './Mac/Tools/Doc/setup.py', './Tools/test2to3/setup.py', 
'./Doc/includes/setup.py', './PC/example_nt/setup.py']

I can understand the first example (although that makes the documentation 
slightly incorrect, since you need an explicit "*" path component for the 
search to be recursive), but the second one looks straight wrong.

--

___
Python tracker 

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



[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-02-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I have stumbled upon a wrong impression as well by reading the docs, but 
usually in the code, I tend to catch the specific Exceptions, like timeout 
instead or URLError when it is known. I saw some libraries following similar 
pattern too. But that could be changed, if promise in the docs that URLError 
exception is raised is corrected. 

I think, the course of action for this bug could be.

1. raise ... from .. for the appropriate Exception in 3.3 and appropriate doc 
changes.
2. Doc changes in 2.7,3.2 which say indicate the possibility of other 
exceptions besides URLError.

Having any important information in the msg part of the Exception is a bad 
idea, because it is seldom relied upon and can be changed anytime.

Shall come out with a patch.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

>> Google "walk directory". First hit is a Rosetta code page with
>> *recursive* walking implemented in various languages. So I guess it
>> does have this connotation. Regardless, os.walk has been in Python for
>> ages, and it's always been the go-to tool for recursive traversal.
>> walkdir's name suggests the same.
>
> You still haven't explained what your problem is with the idea of an
> explicitly recursive glob (as both "rglob" and "globtree" suggest).
>

The problem is that I prefer the walkdir approach, because it solves a
more general problem and overall more useful. This is also why I don't
see how it makes sense to stop discussing it here and focus on rglob.
They are related, after all!

Anyway, I'm not sure what else I can add to the discussion. I'm
starting to repeat myself, which means that I should just shut up :)

I've stated my preference, and I understand and respect yours. So
let's just see what others think.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Google "walk directory". First hit is a Rosetta code page with
> *recursive* walking implemented in various languages. So I guess it
> does have this connotation. Regardless, os.walk has been in Python for
> ages, and it's always been the go-to tool for recursive traversal.
> walkdir's name suggests the same.

You still haven't explained what your problem is with the idea of an
explicitly recursive glob (as both "rglob" and "globtree" suggest).

> walkdir is a new module proposal. If its API is tedious and awkward,
> it should probably be improved *now* while it's in development.

walkdir is not yet a module proposal, there's not even a PEP for it, and
it's in a very young state.

This issue has a working patch for rglob(), which is a single, obvious,
incremental addition to the existing glob module. If you want to discuss
walkdir, I suggest you do it in a separate issue.

(and, yes, rglob() can be reimplemented using walkdir later, if there is
a point in doing so)

--

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

@Barry, it does work on Debian as well
@Eric, I agree with closing it as a dupe

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Feedback from Antoine on IRC about my syntax proposal: “The "**" meaning is not 
really universal like other quantifiers are. [...] (also, it would be quite 
harder to implement, I think)”

That and the compat issue makes me go in favor of a new function.

I’m not sure glob is the right place: when you use glob.glob, the search is 
rooted in the current directory, and you may have sub-directories in your 
pattern, e.g. 'Lib/*/__main__.py'.  A function meaning “look for this file 
pattern recursively” would be IMO more at home in fnmatch.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

>> IOW, globbing is usually understood as the act of expanding a pattern
>> to the files it matches. Nothing in that implies recursive traversal
>> of a directory tree.
>
> Still, that's a common need. "I want all Python files in a subtree".
>
>> On the other hand, os.walk and/or walkdir suggest that in their name.
>
> I don't know why "walk" is supposedly more recursive than "glob".

Google "walk directory". First hit is a Rosetta code page with
*recursive* walking implemented in various languages. So I guess it
does have this connotation. Regardless, os.walk has been in Python for
ages, and it's always been the go-to tool for recursive traversal.
walkdir's name suggests the same.

>
>> Admittedly, we already have more than one, and a high-level tool is
>> proposed with Nick's walkdir. Why add *yet another* high-level tool?
>
> Because the walkdir spelling (IIUC) is longish, tedious and awkward.
> I could see myself typing "rglob('*.py')" in a short script or an
> interpreter session, without having to look up any kind of docs.
> Certainly not the walkdir alternative (I've already forgotten what it
> is).

walkdir is a new module proposal. If its API is tedious and awkward,
it should probably be improved *now* while it's in development. Adding
yet another tool that implements part of its functionality, winning a
golf tournament along the way, isn't the solution, IMHO.

--
title: Support recursive globs -> Add a recursive function to the glob package

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Then I propose to close this as duplicate of #13472.

--

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Feb 08, 2012, at 03:51 PM, Éric Araujo wrote:

>The correct way to get build dependencies on Debian and derivatives is to use
>“aptitude build-dep pythonX.Y” (see #13472).  I think dpkg-dev would get
>installed as a dependency; Tshepang, could you uninstall dpkg-dev and test
>the aptitude command?

+1 and that definitely works.  I use that all the time on new VMs.

If it *doesn't* work, then that's a bug in the Debian pythonX.Y package.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-08 Thread Éric Araujo

Changes by Éric Araujo :


--
title: Add a recursive function to the glob package -> Support recursive globs

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> IOW, globbing is usually understood as the act of expanding a pattern
> to the files it matches. Nothing in that implies recursive traversal
> of a directory tree.

Still, that's a common need. "I want all Python files in a subtree".

> On the other hand, os.walk and/or walkdir suggest that in their name.

I don't know why "walk" is supposedly more recursive than "glob".

> Admittedly, we already have more than one, and a high-level tool is
> proposed with Nick's walkdir. Why add *yet another* high-level tool?

Because the walkdir spelling (IIUC) is longish, tedious and awkward.
I could see myself typing "rglob('*.py')" in a short script or an
interpreter session, without having to look up any kind of docs.
Certainly not the walkdir alternative (I've already forgotten what it
is).

--

___
Python tracker 

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



[issue13963] dev guide has no mention of mechanics of patch review

2012-02-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

The correct way to get build dependencies on Debian and derivatives is to use 
“aptitude build-dep pythonX.Y” (see #13472).  I think dpkg-dev would get 
installed as a dependency; Tshepang, could you uninstall dpkg-dev and test the 
aptitude command?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

>> It is. globbing is a well-known operation that many people expect to be 
>> easily done.

According to Wikipedia (http://en.wikipedia.org/wiki/Glob_%28programming%29) - 
"The noun "glob" is used to refer to a particular pattern, e.g. "use the glob 
*.log to match all those log files"". 

IOW, globbing is usually understood as the act of expanding a pattern to the 
files it matches. Nothing in that implies recursive traversal of a directory 
tree. On the other hand, os.walk and/or walkdir suggest that in their name.

>> Which "Python spirit" are you talking about? We have many high-level
tools in the stdlib.

There should be one -- and preferably only one -- obvious way to do it. 

Admittedly, we already have more than one, and a high-level tool is proposed 
with Nick's walkdir. Why add *yet another* high-level tool?

--

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> >Or, rather, setup.py should be smart enough to warn about that.
> 
> It shouldn't just be limited to Debian and its derivatives.  Other platforms
> (even Linux OSes) will probably have similar issues.

The issue (having to install dpkg-dev) is specifically about Debian and
Ubuntu. I don't think we should have tons of platform-specific
instructions in the devguide, and I think that in this case setup.py
should detect that the required tool is missing (depending on the
platform, of course).

--

___
Python tracker 

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



[issue13960] Handling of broken comments in HTMLParser

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

After reading some emails again, I’m +1 on porting the fixes to 2.7.

1) We agree that HTML5 is the reference specification.

2) I don’t think there is sane code that would be broken if some previously 
unparsable page became parsable (an exception can be HTML parsers, but the 
obvious example BeautifulSoup does not use HTMLParser for example); HTMLParser 
is not a validating parser and never made any guarantee about the validity of 
handled pages.

3) Most people should be happy to have more pages handled by HTMLParser.

4) 2.7 is unique as long-term support, last 2.7 release.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

There is an alternative: supporting ** syntax, e.g. '**/*.py', which should 
find all *.py files in the current directory and all descendents.  At present 
glob('**/*.py') is equivalent to glob('*/*.py'), but we would say this behavior 
was undefined and the new behavior would be a new feature.

--
nosy: +eric.araujo
versions: +Python 3.3 -Python 3.4

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Feb 08, 2012, at 12:53 PM, Antoine Pitrou wrote:

>Or, rather, setup.py should be smart enough to warn about that.

It shouldn't just be limited to Debian and its derivatives.  Other platforms
(even Linux OSes) will probably have similar issues.

--

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

+1 to the suggested wording.

-1 to talking about a more pythonic API.

(Want a nit?  s/W3C-DOM/W3C DOM/)

--

___
Python tracker 

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



[issue12703] Improve error reporting for packaging.util.resolve_name

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

FYI, here is code that can handle arbitrary dotted names: 
.  I 
haven’t checked if its error reporting has the problem we’re discussing in this 
report.

An alternative would be to use colon notation, e.g. 
package.submodule:Thing.Nested.attribute.

My preference is still for find_object, using dots and with the nesting 
prohibition.

--
nosy: +erik.bray

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2012-02-08 Thread Eric Talevich

Eric Talevich  added the comment:

It's more-or-less fixed in Python 3.2:

- With cElementTree, both bytes and strings are accepted for events; 

- With ElementTree, only strings are accepted, and bytes raise a ValueError 
(unknown event).

A small inconsistency remains, but it's fine to just use strings in all cases.

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looking at your latest patch, I worry about "any deletion
+(including pop & popitem) causes a split table to become a combined table". 
Why wouldn't you use a dummy pointer (such as ((PyObject *) 1)) to signal 
deleted slots?

--

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Wed, Feb 08, 2012 at 03:42:16AM +, Eli Bendersky wrote:
> Any objections?

None. The explanation sounds reasonable.

--
nosy: +orsenthil

___
Python tracker 

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



[issue13960] Handling of broken comments in HTMLParser

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

LGTM.  What did our last discussion about following HTML5 rules for Python 2.7 
lead to?  I don’t remember if we agreed that “3.3 is soon enough” or “let’s fix 
the bugs with HTML5 as reference”.

--

___
Python tracker 

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



[issue13846] Add time.monotonic() function

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Victor, I think the doc doesn’t say why the function is useful for people like 
me who don’t already know it.  David’s explanation could be reused.

--

___
Python tracker 

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



[issue13807] logging.Handler.handlerError() may raise AttributeError in traceback.print_exception()

2012-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the prompt action!

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24454/1f703b2607af.diff

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> "file_paths(filtered_walk('.', included_files=['*.py']))" is a lot
> longer than "rglob('*.py')".
> 
> 
> It is, but is that a good enough reason to have both?

It is. globbing is a well-known operation that many people expect to be
easily done.

> However, this is not really faithful to the Python spirit, since it
> adds too many ways to do achieve the same effect, and ultimately
> confuses users.

Which "Python spirit" are you talking about? We have many high-level
tools in the stdlib.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

"file_paths(filtered_walk('.', included_files=['*.py']))" is a lot longer than 
"rglob('*.py')".


It is, but is that a good enough reason to have both? It can also be achieved 
with just a bit more code using the simple `os.walk`. I suppose there are a lot 
of instances of stdlib tools where we could add new tools that would make the 
code slightly shorter. However, this is not really faithful to the Python 
spirit, since it adds too many ways to do achieve the same effect, and 
ultimately confuses users.

That it adds additional maintenance burden on the coredevs goes without saying 
:-) Each such new burden should have a very good reason.

To conclude, personally I'm -1 on this, especially if `walkdir` eventually 
makes it into the stdlib.

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Removed file: http://bugs.python.org/file24453/a9138aba7896.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Removed file: http://bugs.python.org/file24360/6a21f3b35e20.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24453/a9138aba7896.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-08 Thread Mark Shannon

Changes by Mark Shannon :


--
hgrepos: +112

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

I can live with it either way - I just wanted to point out that our current 
examples of this kind of recursive filesystem access use a 'tree' suffix rather 
than an 'r' prefix.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Dave Malcolm wrote:
> 
> If anyone is aware of an attack via numeric hashing that's actually
> possible, please let me know (privately).  I believe only specific apps
> could be affected, and I'm not aware of any such specific apps.

I'm not sure what you'd like to see.

Any application reading user provided data from a file, database,
web, etc. is vulnerable to the attack, if it uses the read numeric
data as keys in a dictionary.

The most common use case for this is a dictionary mapping codes or
IDs to strings or objects, e.g. for caching purposes, to find a list
of unique IDs, checking for duplicates, etc.

This also works indirectly on 32-bit platforms, e.g. via date/time
or IP address values that get converted to key integers.

--

___
Python tracker 

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



[issue13965] Windows 64-bit installer actually installing a 32-bit version

2012-02-08 Thread Ralf Schmitt

Ralf Schmitt  added the comment:

according to the documentation platform.architecture() may not work on OS X.

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> To follow the shutil naming convention (rmtree, copytree, and likely
> chmodtree, chowntree), a more appropriate name might be "globtree".
> (Thanks to string methods, the 'r' prefix doesn't read correctly to
> me: what does "globbing from the right" mean?)

Well, if you put it in the glob module, it doesn't have to follow the
shutil naming convention :-)
(I prefer "rglob" myself)

--

___
Python tracker 

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



[issue13968] Add a recursive function to the glob package

2012-02-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

A fair point indeed.

To follow the shutil naming convention (rmtree, copytree, and likely chmodtree, 
chowntree), a more appropriate name might be "globtree". (Thanks to string 
methods, the 'r' prefix doesn't read correctly to me: what does "globbing from 
the right" mean?)

--

___
Python tracker 

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



[issue13956] add a note regarding building on recent versions of Debian and Ubuntu

2012-02-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Or, rather, setup.py should be smart enough to warn about that.

--
nosy: +barry, pitrou

___
Python tracker 

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



  1   2   >