[issue4667] Patch with a couple of 2.0isms in tutorial

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r67782.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4668] examples in the functional howto are not consistent with 3.X behavior

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r67783.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4669] bytes,join and bytearray.join not in manual; help for bytes.join is wrong.

2008-12-15 Thread John Machin

New submission from John Machin :

These methods are parallel to str.join, seem to work as expected, and
have "help" entries. However there is nothing in the Library Reference
Manual about them.

>>> help(bytearray.join)
Help on method_descriptor:

join(...)
B.join(iterable_of_bytes) -> bytearray

Concatenate any number of bytes/bytearray objects, with B
in between each pair, and return the result as a new bytearray.
### OK but could use an example.

>>> help(bytes.join)
Help on method_descriptor:

join(...)
B.join(iterable_of_bytes) -> bytes

Concatenate any number of bytes objects, with B in between each pair.
### Above sentence should read "Concatenate any number of
bytes/bytearray objects, with B in between each pair, and return the
result as a new bytes object."
Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.

--
assignee: georg.brandl
components: Documentation
messages: 77849
nosy: georg.brandl, sjmachin
severity: normal
status: open
title: bytes,join and bytearray.join not in manual; help for bytes.join is 
wrong.
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue4446] Distutils Metadata Documentation Missing "platforms" Keyword

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Done in r67784.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4611] Small error in "Extending Python with C or C++"

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r67785.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4603] 3.0 document tab interpretation change

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r67786.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4595] new types example is out of date

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Already fixed in SVN.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4578] compiler: -3 warnings

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

OK, since it doesn't do any damage I've applied your patch in r67787.

--
resolution: wont fix -> fixed
status: pending -> closed

___
Python tracker 

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



[issue4568] Improved optparse "varargs" callback example

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

I've reformatted and rewritten your patch a bit and applied it as
r67788. Thanks!

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue4640] optparse - dosn't distinguish between '--option' and '-option'

2008-12-15 Thread Krzysztof Szawala

Krzysztof Szawala  added the comment:

As I mentionetd, the problem occurs with Python 2.5 (I won't be
switching to Python 3). The only perspective for me to upgrade is Python
2.6, but as I can see the problem applies to 2.6 as well.

___
Python tracker 

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



[issue4670] setup.py exception when db_setup_debug = True

2008-12-15 Thread Damien Miller

New submission from Damien Miller :

Hi,

I receive the following exception when trying to build with
db_setup_debug = True in setup.py. db_ver is not initialised in this
path, except by accident so I think the obvious solution of 

-if db_setup_debug: print "db.h: unsupported version", db
_ver, "in", d
+if db_setup_debug: print "db.h: no version in", d

Is the correct fix.

running build
running build_ext
db: looking for db.h in ./db.h
db: looking for db.h in Include/db.h
db: looking for db.h in ./Include/db.h
db: looking for db.h in /usr/local/include/db.h
db: looking for db.h in
/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Include/db.h
db: looking for db.h in
/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/db.h
db: looking for db.h in /usr/include/db.h
db.h: unsupported version
Traceback (most recent call last):
  File "./setup.py", line 1543, in 
main()
  File "./setup.py", line 1538, in main
scripts = []
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/core.py",
line 151, in setup
dist.run_commands()
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/dist.py",
line 974, in run_commands
self.run_command(cmd)
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/dist.py",
line 994, in run_command
cmd_obj.run()
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/command/build.py",
line 112, in run
self.run_command(cmd_name)
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/cmd.py",
line 333, in run_command
self.distribution.run_command(command)
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/dist.py",
line 994, in run_command
cmd_obj.run()
  File
"/usr/ports/lang/python/2.5/w-Python-2.5.3c1/Python-2.5.3c1/Lib/distutils/command/build_ext.py",
line 290, in run
self.build_extensions()
  File "./setup.py", line 97, in build_extensions
self.detect_modules()
  File "./setup.py", line 700, in detect_modules
if db_setup_debug: print "db.h: unsupported version", db_ver, "in", d
UnboundLocalError: local variable 'db_ver' referenced before assignment

--
components: Build
messages: 77860
nosy: djmdjm
severity: normal
status: open
title: setup.py exception when db_setup_debug = True
type: compile error
versions: Python 2.5.3

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau  added the comment:

A timedelta.toseconds method (or equivalent) makes no sense. The number
of seconds in a day is not fixed (due to leap seconds) and relying on
such a method would introduce subtle bugs. The only way to find out the
number of seconds in a range of dates is if you have a concrete date range.

--
nosy: +srittau

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file11919/timedelta_toseconds_float.patch

___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2008-12-15 Thread John Shue

Changes by John Shue :


--
nosy: +johnshue

___
Python tracker 

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



[issue3106] speedup some comparisons

2008-12-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 2008-12-13 16:08, Antoine Pitrou wrote:
> Antoine Pitrou  added the comment:
> 
> Here is a new patch without any dispatch shortcut in ceval.c, just
> optimizations in unicodeobject.c and longobject.c. Net result on pybench:
> 
> Test minimum run-timeaverage  run-time
>  thisother   diffthisother 
>  diff
> ---
>  CompareFloats:   166ms   170ms   -2.3%   169ms   174ms
>   -2.8%
>  CompareFloatsIntegers:   230ms   231ms   -0.7%   233ms   231ms
>   +0.8%
>CompareIntegers:   247ms   270ms   -8.7%   248ms   272ms
>   -9.0%
> CompareInternedStrings:   196ms   254ms  -22.7%   197ms   255ms
>  -22.7%
>   CompareLongs:   143ms   158ms   -9.0%   143ms   158ms
>   -9.3%
> CompareStrings:   156ms   168ms   -7.4%   157ms   169ms
>   -7.2%
> ---
> Totals:  1139ms  1252ms   -9.1%  1148ms  1260ms
>   -8.9%
> 
> 
> The patch seems fairly uncontroversial to me, I'll commit it soon if
> there's no opposition.

Why have you removed the complete error handling section in
PyUnicode_RichCompare() ?

> Added file: http://bugs.python.org/file12341/cmps5.patch

--
nosy: +lemburg

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Jon Ribbens

Jon Ribbens  added the comment:

> A timedelta.toseconds method (or equivalent) makes no sense.
> The number of seconds in a day is not fixed (due to leap seconds) and
> relying on such a method would introduce subtle bugs.

You are misunderstanding what timedelta is. It is a fixed-length period
of time. It is stored as a number of (24x3600-second) days, seconds and
microseconds. There is no "start date" or "end date", so the concept of
leap seconds just does not apply.

___
Python tracker 

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



[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

I have a test case locally that demonstrates both the missing line
number in the __main__.py from a zipfile case, as well as the display of
main.c as the filename (the latter is not specific to the zipfile case -
it also happens for a normal main module).

It still seems to me that there is something going wrong at a deeper
level for doctest to be getting the "in main.c" part wrong. I want to
get to the bottom of that before working around the problem at the line
number lookup stage.

___
Python tracker 

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



[issue2155] optparse.OptionGroup with_statement context handling

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau  added the comment:

This API is too "magical" to my liking and doesn't really reflect what
context manager's are supposed to do, i.e. handling resources. Also, I
don't see much advantage over:

group = OptionGroup(parser, "Group name")
group.add_option(...)
parser.add_option_group(group)

Finally, the __exit__ handler adds the option group to the parser in any
case, whether there was an exception raised inside the block or not.

--
nosy: +srittau

___
Python tracker 

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



[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

Re-opening, pending development of a fully passing test specifically for
the __main__.py in zipfile case.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue3106] speedup some comparisons

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le lundi 15 décembre 2008 à 14:41 +, Marc-Andre Lemburg a écrit :
> Why have you removed the complete error handling section in
> PyUnicode_RichCompare() ?

Because the only error that can occur is a TypeError when one of the two
arguments is not an unicode object, and that is handled by returning
Py_NotImplemented at the end.
(there is no implicit bytes -> unicode coercion anymore, and therefore
things are much simpler)

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> The number of seconds in a day is not fixed (due to leap seconds)

POSIX timestamp doesn't count leap seconds. It looks like the datetime 
module is not aware of the leap seconds:

>>> print datetime.datetime(2006, 1, 1) - datetime.datetime(2005, 12, 
31)
1 day, 0:00:00

About my method: I finally prefer datetime/datetime or 
datetime//datetime instead of a toseconds() method. And to convert a 
timestamp to a timestamp: see my patch attached to issue #2736.

___
Python tracker 

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



[issue4665] Failure to compile trunk on Solaris10/SPARC using C++ compiler

2008-12-15 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Closing as "won't fix" for now.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue4666] test_bad_address in test_urllib2_localnet often fails

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I tried a fix (see r67779, r6 in trunk) and it seems to work.

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I also think totimestamp() on datetime objects would be useful, I've
missed it myself a couple of times. The return value should be similar
to that of time.time(), i.e. a float.

--
nosy: +pitrou

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau  added the comment:

Leap second handling is usually configurable. Default on Debian Linux
(but similar on RHEL and SuSE):

>>> int(date(1994,1,1).strftime("%s")) - int(date(1993,1,1).strftime("%s"))
31536000

After doing "cp /usr/share/zoneinfo/right/Europe/Berlin /etc/localtime":

>>> int(date(1994,1,1).strftime("%s")) - int(date(1993,1,1).strftime("%s"))
31536001

Also, NTP servers usually get this right. I don't think, Python should
promote a wrong date handling by default, even if it's convenient.

___
Python tracker 

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



[issue4568] Improved optparse "varargs" callback example

2008-12-15 Thread Gregg Lind

Gregg Lind  added the comment:

This patch should also be applied into the py3k branch, probably.  Good
catch on updating rargs, btw.

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

What you say is "with 99500 days or more, the microsecond error is
bigger than 90%". It means that with epoch starting at 1970, you can
still return timestamps with a 1-2 microsecond accuracy for the year 2242.

Additional precision would be overkill.

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

I removed my ".toseconds() method" patch because I prefer division. 
See issue #2706 for divison, divmod, etc.

___
Python tracker 

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



[issue4575] Py_IS_INFINITY defect causes test_cmath failure on x86

2008-12-15 Thread Skip Montanaro

Skip Montanaro  added the comment:

Took me awhile to locate a SPARC C compiler on our dwindling set of
Solaris/SPARC boxes at work, but I eventually found one and got Subversion
trunk to compile.  test_cmath and test_math both pass with the
force_to_memory2 patch.  I don't know if I mentioned it earlier (replying by
email), but it also works for me on Mac OS X 10.5.5 (Intel Core2 Duo).

Skip

___
Python tracker 

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



[issue4627] Add Mac OS X Disk Images to Python.org homepage

2008-12-15 Thread Carwyn Edwards

Carwyn Edwards  added the comment:

Just to note that issue 4017 is related to this.

--
nosy: +carwyn

___
Python tracker 

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



[issue4568] Improved optparse "varargs" callback example

2008-12-15 Thread Georg Brandl

Georg Brandl  added the comment:

Yes, it will be merged to py3k automatically; we normally merge smaller
changes in batches.

___
Python tracker 

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



[issue4575] Py_IS_INFINITY defect causes test_cmath failure on x86

2008-12-15 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Skip.  Looks like this problem is 'solved in principle'.  Now I 
have to figure out a non-hackish solution.

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> (...) totimestamp() (...) return value should be similar
> to that of time.time(), i.e. a float

float is a source of many problems (rounding problems), especially for 
huge values: float is unable to store correctly microseconds for big 
values: see msg75426. A simple tuple (int, int) is simple and there is 
no rounding/float limit.

___
Python tracker 

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



[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

It turns out you were pretty close to pinpointing the problem in
doctest, but didn't quite manage to identify which step was going wrong.
The problem was actually that even after __file__ was being set
correctly, the call to linecache.getlines wasn't being given the
__loader__ access it needed in order to retrieve the source code from
inside the zipfile.

The __main__.c thing turned out just to be a red herring caused by the
choice of class name in the test code (I changed it to be __main__.Test
for the checked in unit test).

Checkin versions:
2.7 = r67790
2.6 = r67791
3.1 = r67792
3.0 = r67793

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4501] asyncore's urgent data management and connection closed events are broken when using poll()

2008-12-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
versions: +Python 2.4, Python 2.5, Python 2.5.3

___
Python tracker 

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



[issue4631] urlopen returns extra, spurious bytes

2008-12-15 Thread Jeremy Hylton

Jeremy Hylton  added the comment:

I have a patch here that seems to work for the specific url and that
passes all the tests.  Can anyone check whether it works for a larger
set of cases?

I'm a little concerned because I don't understand the new io library in
much detail.  There's an override for _checkClosed() in the HTTPResponse
that seems a little dodgy.  I'll try to get someone to review that
specifically.

Added file: http://bugs.python.org/file12361/urllib-chunked.diff

___
Python tracker 

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



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue3106] speedup some comparisons

2008-12-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 2008-12-15 16:34, Antoine Pitrou wrote:
> Antoine Pitrou  added the comment:
> 
> Le lundi 15 décembre 2008 à 14:41 +, Marc-Andre Lemburg a écrit :
>> Why have you removed the complete error handling section in
>> PyUnicode_RichCompare() ?
> 
> Because the only error that can occur is a TypeError when one of the two
> arguments is not an unicode object, and that is handled by returning
> Py_NotImplemented at the end.
> (there is no implicit bytes -> unicode coercion anymore, and therefore
> things are much simpler)

Ah, sorry, just saw that this is just for Py3.

The fast-path would probably also make sense for Py2 (keeping the
error handling, of course).

___
Python tracker 

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



[issue4671] pydoc executes the code to be documented

2008-12-15 Thread Jim_C

New submission from Jim_C :

Running pydoc [ pydoc  ] on a python module using Tkinter 
displayed the window defined in the module - not what I was 
expecting..   Running pydoc on

from os import remove
sFile='tmp.tmp'
remove(sFile)

will remove the file tmp.tmp, if it exists. 
If this behaviour is intentional ( as it appears to be, see 
imp.load_module ) & presumably integral to the operation of pydoc, then 
it might be worth providing a warning on the web page ( 
http://docs.python.org/library/pydoc.html ) ?? 
Running a code with default arguments in an arbitrary directory could 
potentially produce unwanted side effects, at the very least..
Regards ,
Jim_C

--
messages: 77881
nosy: Jim_C
severity: normal
status: open
title: pydoc executes the code to be documented
type: behavior
versions: Python 2.4

___
Python tracker 

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



[issue3954] _hotshot: invalid error control in logreader()

2008-12-15 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> amaury.forgeotdarc

___
Python tracker 

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



[issue3954] _hotshot: invalid error control in logreader()

2008-12-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed in r67797 (trunk) and r67801 (2.6)
hotshot was removed from py3k.

--
resolution: accepted -> fixed
status: open -> closed

___
Python tracker 

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



[issue4672] Distutils SWIG support blocks use of SWIG -outdir option

2008-12-15 Thread Andy Buckley

New submission from Andy Buckley :

When using distutils to build an extension module using SWIG, it makes
most sense to use the built-in SWIG support. However, the distutils seem
to "vet" the options passed via the Extension.swig_opts attr/arg:

[...]
ext_modules=[Extension('_hepmc', ['@top_srcdir@/hepmc.i'],
   swig_opts=['-c++', '-...@hepmcincpath@', '-outdir .'],
   include_dirs=['@HEPMCINCPATH@'],
   library_dirs=['@HEPMCLIBPATH@'],
   libraries=['HepMC'])],
[...]

results in this error:

building '_hepmc' extension
swigging ./hepmc.i to ./hepmc_wrap.cpp
swig -python -c++ -I/home/andy/heplocal/include -outdir . -o
./hepmc_wrap.cpp ./hepmc.i
swig error : Unrecognized option -outdir .
Use 'swig -help' for available options.
error: command 'swig' failed with exit status 1

but calling the same swig command works fine. It's the same copy of
swig, but it seems to be distutils rather than swig that is throwing the
error. This is particularly relevant since I need to use -outdir to meet
the autotools "distcheck" requirement of successfully building from a
build-dir separate from the source dir: code generation tools like SWIG
blur such a distinction and so need to support output location flags
like -outdir.

I see this was also noticed some time ago:
http://osdir.com/ml/python.distutils.devel/2006-06/msg9.html
but no useful reply was ever forthcoming ;(  Maybe this time will be
luckier!

--
components: Distutils
messages: 77883
nosy: andybuckley
severity: normal
status: open
title: Distutils SWIG support blocks use of SWIG -outdir option
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue4561] Optimize new io library

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've written a small file IO benchmark, available here:
http://svn.python.org/view/sandbox/trunk/iobench/

It runs under both 2.6 and 3.x, so that we can compare speeds of
respective implementations.

___
Python tracker 

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



[issue4673] Distutils should provide an uninstall command

2008-12-15 Thread Andy Buckley

New submission from Andy Buckley :

It would make package maintenance easier, as well as integration with
other build systems e.g. autotools (necessary for projects where not
everything is Python), if the distutils supported an uninstallation
command, e.g.

python setup.py uninstall

This would presumably require monitoring of which files were installed
where, and it's of course possible to do undesirable things, but exactly
the same counter-arguments exist for autotools, and there the uninstall
target is an important and useful feature for developers, once you know
how to behave in a way to make it safe.

--
components: Distutils
messages: 77885
nosy: andybuckley
severity: normal
status: open
title: Distutils should provide an uninstall command
type: feature request
versions: Python 2.5

___
Python tracker 

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



[issue3632] use string_print() in gdb

2008-12-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Committed in r67802.

--
resolution: accepted -> fixed
status: open -> closed

___
Python tracker 

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



[issue1479255] Fix building with SWIG's -c++ option set in setup.py

2008-12-15 Thread Andy Buckley

Andy Buckley  added the comment:

This works in my current version of distutils (Python 2.5.2, from Ubuntu
Intrepid). Maybe it was fixed and no-one noticed that this bug was
relevant ;)

--
nosy: +andybuckley

___
Python tracker 

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



[issue4666] test_bad_address in test_urllib2_localnet often fails

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

On the buildbots, the errors have now disappeared after the "fix". I'm
closing this, please reopen it if you still witness it.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4631] urlopen returns extra, spurious bytes

2008-12-15 Thread Daniel Diniz

Daniel Diniz  added the comment:

I think your patch is good, but there may be another bug around:

I wrote a script to check results of 3.x against 2.x, but many pages
(http://groups.google.com/, http://en.wikipedia.org/) give 403:
Forbidden for 3.x... but work with 2.x!

If you think of this as a bug in 3.x, it could retry the request
identifying as 2.x on 403.

Other than that, your patch gives me identical results to 2.5/2.6 for
128 sites I tested (only a read(100) for each).

Interestingly, my patched version gives a file closer to the buggy
version in size, at 12700 bytes versus 12707. Your version agrees with
2.x and simple maths (128 x 100) in giving a 12799 bytes result. I have
no idea why.

HTH,
Daniel

___
Python tracker 

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



[issue4663] Increase TextIOWrapper._CHUNK_SIZE

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed in r67803, r67804.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-12-15 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

I think communicate() works as documented now: reads stdout/stderr 
until EOF, *and* waits for subprocess to terminate.

You're asking for a different method, or perhaps an optional 
parameter "return_when_died" to communicate, so it returns as soon as 
the child process terminates (I don't like the parameter name...)

I think this is more a feature request than a crash, targeted to 
2.7/3.1 - 2.4 only gets security fixes anyway.

--
nosy: +gagenellina
type: crash -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.4

___
Python tracker 

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



[issue4671] pydoc executes the code to be documented

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

That's why you shouldn't put code with side effects at the root of a
module, but inside a "if __name__ == '__main__'" guard.

Anyway, it may be worth documenting it!

--
assignee:  -> georg.brandl
components: +Documentation
nosy: +georg.brandl, pitrou
versions: +Python 2.6 -Python 2.4

___
Python tracker 

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



[issue4640] optparse - dosn't distinguish between '--option' and '-option'

2008-12-15 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

could you provide a test case / code fragment showing the bug?

--
components: +Library (Lib) -Extension Modules
nosy: +gagenellina

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2008-12-15 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

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



[issue4561] Optimize new io library

2008-12-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Without Christian's patch:

[400KB.txt] read one byte/char at a time...  0.2685 MB/s (100% CPU)
[400KB.txt] read 20 bytes/chars at a time...  4.536 MB/s (98% CPU)
[400KB.txt] read one line at a time...3.805 MB/s (99% CPU)
[400KB.txt] read 4096 bytes/chars at a time...29.23 MB/s (100% CPU)

[ 20KB.txt] read whole contents at once...52.42 MB/s (99% CPU)
[400KB.txt] read whole contents at once...45.83 MB/s (100% CPU)
[ 10MB.txt] read whole contents at once...48.78 MB/s (99% CPU)

With the patch:

[400KB.txt] read one byte/char at a time...  0.2761 MB/s (100% CPU)
[400KB.txt] read 20 bytes/chars at a time...  4.656 MB/s (99% CPU)
[400KB.txt] read one line at a time...3.956 MB/s (98% CPU)
[400KB.txt] read 4096 bytes/chars at a time...33.85 MB/s (100% CPU)

[ 20KB.txt] read whole contents at once...66.17 MB/s (99% CPU)
[400KB.txt] read whole contents at once...56.65 MB/s (99% CPU)
[ 10MB.txt] read whole contents at once...63.69 MB/s (99% CPU)

Python 2.6's builtin file object:

[400KB.txt] read one byte/char at a time...   1.347 MB/s (97% CPU)
[400KB.txt] read 20 bytes/chars at a time...  26.65 MB/s (99% CPU)
[400KB.txt] read one line at a time...184.4 MB/s (100% CPU)
[400KB.txt] read 4096 bytes/chars at a time... 1163 MB/s (99% CPU)

[ 20KB.txt] read whole contents at once... 1072 MB/s (100% CPU)
[400KB.txt] read whole contents at once...889.1 MB/s (100% CPU)
[ 10MB.txt] read whole contents at once...  600 MB/s (100% CPU)

___
Python tracker 

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



[issue4561] Optimize new io library

2008-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I'm getting caught-up with the IO changes in 3.0 and am a bit confused.
 The PEP says, "programmers who don't want to muck about in the new I/O
world can expect that the open() factory method will produce an object
backwards-compatible with old-style file objects."  So, I would have
expected that the old implementation could have remained in-place and
the resultant object registered as matching the appropriate IO ABC.  If
that had been done, the performance would be unchanged.  Does anyone
know why the entire old implementation had to be thrown-out in cases
where the API was unchanged?  Is there anything about New IO that is
fundamentally different so that the old implementation had to be tossed
in all cases?

--
nosy: +rhettinger

___
Python tracker 

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