[issue4552] Doc/tools/sphinxext not included in the 2.6.1 tarball

2008-12-07 Thread Matthias Klose

Matthias Klose <[EMAIL PROTECTED]> added the comment:

> In my opinion the tar balls should contain all necessary bits and pieces
> to build the docs yourself. It makes no sense to include the Doc/ folder
> w/o any means to use them.

+ 1

> Let's include sphinxext and document the required versions of sphinx,
> docutils and jinja.

- 1, we didn't include latex in 2.5 as well.

sphinxext isn't included in sphinx, so it should be included in the
release tarball.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4589] 'with' loses ->bool exceptions

2008-12-07 Thread Jeffrey Yasskin

New submission from Jeffrey Yasskin <[EMAIL PROTECTED]>:

When a context manager's __exit__() method returns an object whose
conversion to bool raises an exception, 'with' loses that exception. For
example:

>>> class CM(object):
...   def __init__(self, exit_result):
... self.exit_result = exit_result
...   def __enter__(self):
... return 3
...   def __exit__(self, a, b, c):
... return self.exit_result()
... 
>>> class TrueAsBool(object):
...   def __nonzero__(self): return True
... 
>>> class FalseAsBool(object):
...   def __nonzero__(self): return False
... 
>>> class FailAsBool(object):
...   def __nonzero__(self):
... raise RuntimeError("Should see this but won't")
... 
>>> with CM(TrueAsBool):
...   raise AssertionError("Should NOT see this")
... 
>>> with CM(FalseAsBool):
...   raise AssertionError("Should see this")
... 
Traceback (most recent call last):
  File "", line 2, in 
AssertionError: Should see this
>>> with CM(FailAsBool):
...   raise AssertionError("Should see RuntimeException (oops)")
... 
>>> 


The problem is that WITH_CLEANUP only checks if PyObject_IsTrue(x)
returns non-zero, but that function returns <0 when the bool conversion
raises an exception.

--
assignee: jyasskin
components: Interpreter Core
messages: 77290
nosy: jyasskin
severity: normal
stage: needs patch
status: open
title: 'with' loses ->bool exceptions
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4588] Need a way to make my own bytes

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

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

Please don't use the bug tracker to obtain help, but only to report
bugs. Use [EMAIL PROTECTED] to get help.

In this specific case, also read Benjamin's answer more carefully.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4588] Need a way to make my own bytes

2008-12-07 Thread jeff deifik

jeff deifik <[EMAIL PROTECTED]> added the comment:

Doesn't work.
#!/usr/bin/env python3.0

import sys
foo = b''

for i in range (0,10):
foo += bytes(i)

sys.stdout.buffer.write(foo)

produces a binary file of 45 bytes. Here is a hex dump (the '.'
represent unprintable characters):
+00000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+01600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+03200 00 00 00 00 00 00 00 00 00 00 00 00  .

that is 45 bytes of 0.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4588] Need a way to make my own bytes

2008-12-07 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

bytes([some_number]) should do the trick.

--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

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

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
resolution:  -> works for me
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4588] Need a way to make my own bytes

2008-12-07 Thread jeff deifik

New submission from jeff deifik <[EMAIL PROTECTED]>:

I want to make my own data of types bytes in order to write it out.
For example, I want to write out the bytes 0..9

#!/usr/bin/env python3.0
foo = b''
for i in range (0,10):
foo += i
#sys.stdout.buffer.write(foo)

Here is the error:
Traceback (most recent call last):
  File "./x.py", line 4, in 
foo += i
TypeError: can't concat bytes to int

I cannot find any function to convert the int i into something
that I can append to foo. I tried chr, which produced a string
typeerror. byte() was not defined. There must be a way to convert
an integral value to a bytes type.

--
components: Interpreter Core
messages: 77286
nosy: lopgok
severity: normal
status: open
title: Need a way to make my own bytes
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4406] In Lib\tkinter\filedialog.py, class Directory define loss a"_"

2008-12-07 Thread lion.guo

lion.guo <[EMAIL PROTECTED]> added the comment:

Why didn't include this patch in python 3.0 

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4320] optparse: "1 2 3" should be seen as one string

2008-12-07 Thread Gregg Lind

Gregg Lind <[EMAIL PROTECTED]> added the comment:

Can you show an example of this not working?  Works fine for me in
2.4/2.5/2.6.

--
nosy: +gregg.lind

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Gregg Lind

Changes by Gregg Lind <[EMAIL PROTECTED]>:


--
versions: +Python 2.5, Python 2.5.3, Python 2.6, Python 2.7, Python 3.0, Python 
3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-07 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Roumen, can you take a look at (and try) the attached patch?  It uses
an environment variable, PYDBMLIBORDER to define the order of libraries
to check for dbm build suitability.  If not specified it defaults to
"ndbm:gdbm:bdb".

--
keywords: +patch
Added file: http://bugs.python.org/file12275/setup.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4483] Error to build _dbm module during make

2008-12-07 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Skip> I'm beginning to think this area needs more work.  Let's leave
Skip> this ticket closed.  I'll open a new one so we can figure out the
Skip> best way to tackle this.

http://bugs.python.org/issue4587

Skip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

The latest patch removes PyUnicode_Compare as well as lots of __cmp__
functions under Lib/. It also renames and redefines
PyUnicode_CompareWithASCIIString(). The simpler
PyUnicode_EqualToASCIIString() function is easier to use, too.

--
stage:  -> needs patch
Added file: http://bugs.python.org/file12274/remove_cmp4.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-07 Thread Skip Montanaro

Changes by Skip Montanaro <[EMAIL PROTECTED]>:


--
components: +Build
nosy: +rpetrov
priority:  -> normal
type:  -> behavior
versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-07 Thread Skip Montanaro

New submission from Skip Montanaro <[EMAIL PROTECTED]>:

Fixing issue4483 resulted in adding an extra header file check for
gdbm-based header files when the gdbm library was found.  This caused
problems for Roumen Petrov.  In considering the problems he encountered I
decided we probably need to provide users some more flexibility when
deciding which libraries and header files to use when building the dbm
module (or _dbm on 3.0).  For example, the current hard-coded perform checks
in this order: ndbm, gdbm, BerkDB.  What if the system has hdbm installed
but the builder wants to use the BerkDB compatibility API?

This ticket is to track the discussion and come up with a suitable system.

--
messages: 77280
nosy: skip.montanaro
severity: normal
status: open
title: Need to rework the dbm lib/include selection process

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4483] Error to build _dbm module during make

2008-12-07 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Roumen> The old if statement was "flat":
...

Okay, I understand now.

Roumen> The new if statement contain nested if:
Roumen> Now the second case is only 
"self.compiler.find_library_file(lib_dirs,
Roumen> 'gdbm'):" and if succeed (my case) =>
Roumen> Failed to find the necessary bits to build these modules:
Roumen> ... dbm ...
Roumen> Note the build system lack headers "gdbm/ndbm.h", "gdbm-ndbm.h".

In my mind that simply means we haven't accounted for how your system has
organized its header files.  It has a libgdbm so it probably has some sort
of gdbm header file unless you have failed to install some package.

I'm beginning to think this area needs more work.  Let's leave this ticket
closed.  I'll open a new one so we can figure out the best way to tackle
this.  In the meantime can you figure out why your system has a gdbm library
but apparently no gdbm headers (or different ones than we are currently
testing for)?

Thx,

Skip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4199] add shorthand global and nonlocal statements

2008-12-07 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
priority: high -> critical

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4573] zsh-style subpattern matching for fnmatch/glob

2008-12-07 Thread Calvin Spealman

Changes by Calvin Spealman <[EMAIL PROTECTED]>:


--
versions: +Python 2.7

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4573] zsh-style subpattern matching for fnmatch/glob

2008-12-07 Thread Calvin Spealman

Calvin Spealman <[EMAIL PROTECTED]> added the comment:

This should be applicable to 2.7, at least, as well. Here is a backport 
of the patch against trunk.

--
nosy: +ironfroggy
Added file: http://bugs.python.org/file12273/zsh-fnmatch-2.7.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Calvin Spealman

Calvin Spealman <[EMAIL PROTECTED]> added the comment:

Confirmed this behavior on my ubuntu installations but it fails properly 
on Windows.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Calvin Spealman

Changes by Calvin Spealman <[EMAIL PROTECTED]>:


--
nosy: +ironfroggy

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Sebastian Rittau

Sebastian Rittau <[EMAIL PROTECTED]> added the comment:

I'd like to see this fixed, just to decrease the amount of warning spam
I get when testing my own packages. It seems that one of my dependecies
that I have no control over is pulling this in. Adding a warning when
this module is important seems like a good idea, though.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4483] Error to build _dbm module during make

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

The old if statement was "flat":
if find_file("ndbm.h", inc_dirs, []) is not None:
   
elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
  and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
   
elif db_incs is not None:
   
else:
   miss
If the second case fail, try third and if  succeed build dbm with
"berkeley db".

The new if statement contain nested if:
Now the second case is only "self.compiler.find_library_file(lib_dirs,
'gdbm'):" and if succeed (my case) =>
Failed to find the necessary bits to build these modules:
... dbm ...
Note the build system lack headers "gdbm/ndbm.h", "gdbm-ndbm.h".


To restore previous I add copy of code from third case as new case in
nested if:
===
 'dbm', ['dbmmodule.c'],
 define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
 libraries = gdbm_libs ) )
+elif db_incs is not None:
+exts.append( Extension('dbm', ['dbmmodule.c'],
+library_dirs=dblib_dir,
+runtime_library_dirs=dblib_dir,
+include_dirs=db_incs,
+define_macros=[('HAVE_BERKDB_H',None),
+   ('DB_DBM_HSEARCH',None)],
+libraries=dblibs))
 else:
 missing.append('dbm')
 elif db_incs is not None:
===
Note that above is not proposed patch as I don't like nested ifs and
code duplicate.
Is possible the checks to be in a new separate function ?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function

2008-12-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Should be fixed in r67655.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function

2008-12-07 Thread blake madden

New submission from blake madden <[EMAIL PROTECTED]>:

On the page:

http://docs.python.org/3.0/extending/embedding.html#extending-embedded-python

Note that the function "Py_InitModule" is used.  From what I can tell,
this function no longer exists and regrettably I can't figure out how to
get "PyModule_Create" to work in its place.

--
assignee: georg.brandl
components: Documentation
messages: 77273
nosy: blakemadden, georg.brandl
severity: normal
status: open
title: "Extending Embedded Python" documention uses removed Py_InitModule 
function
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4457] __import__ documentation obsolete

2008-12-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Changed patch to document sys.modules trick and applied in r67654.

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

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Since the compiler package is removed in Python 3, I think it's okay for
it to raise py3k warnings -- in fact, it should raise a quite prominent
one when first imported that it's going to be removed.

--
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> pending

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

2008-12-07 Thread Leger

Leger <[EMAIL PROTECTED]> added the comment:

Ok Martin, I delete all source and /usr/lib/python3.0, restart from the
tarball. I apply the patch dbm.diff (issue4581) and after :
"configure --with-pydebug --with-doc-strings --enable-shared
--enable-profiling --enable-ipv6 --with-threads --with-tsc --prefix=/usr
> ../configure.log 2>&1
make > ../make.log 2>&1
make altinstall > ../altinstall.log 2>&1"
Launch "python3.0" and test import :
>>> import math, cmath, bz2, crypt, readline
[34363 refs]
SUCCESSFUL ! So "make clean" can't always sufficient, I learn than in
some case need to restart from the tarball is a necessary test. Many
thinks for this lesson. You can close this issue.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4483] Error to build _dbm module during make

2008-12-07 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Roumen> I'm not sure that recent commits in trunk are correct.

Roumen> Please confirm that build of dbm module with "Berkeley DB" is
Roumen> deprecated.

Can you explain how you think they are incorrect?  The code to decide how to
build the dbm module looks like this:

if we have ndbm.h:
build dbm using ndbm
else if we have a gdbm library:
if we have gdbm/ndbm.h:
build dbm using gdbm
else if we have gdbm-ndbm.h:
build dbm using gdbm
else if we found Berkeley includes:
build dbm using Berkeley db.

This overall structure agrees with that in the Python 2.4 and 2.5 setup.py.
The only thing that changed (in theory) was that there's an extra check for
gdbm-ndbm.h after we've already decided to build dbm with gdbm.  The
preference is still ndbm before gdbm before BerkDB.  That's not to say it's
correct, but nothing's changed as far as I can tell.

Maybe it should look more like this:

dbmext = None
if we have ndbm.h:
...
dbmext = Extension(...)

if dbmext is None and we have a gdbm library:
if we have gdbm/ndbm.h:
...
dbmext = Extension(...)
else if we have gdbm-ndbm.h:
...
dbmext = Extension(...)

if dbmext is None and we found Berkeley includes:
...
dbmext = Extension(...)

if dbmext is not None:
exts.append(dbmext)

That still leaves the order ndbm before gdbm before BerkDB.

Skip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4584] doctest fails to display bytes type

2008-12-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

You've included a chr(255) character in your docstring.  You need to
escape the backslash in order to include the bytes representation like
it will be generated.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4585] Build failure on OS X 10.5.5: make: *** [sharedmods] Error 1

2008-12-07 Thread Mark Dickinson

New submission from Mark Dickinson <[EMAIL PROTECTED]>:

There are two recent reports of build failures of Python 3.0 on OS X 
10.5.5: see

http://mail.python.org/pipermail/python-list/2008-November/514159.html

and

http://mail.python.org/pipermail/python-3000/2008-December/015404.html

It seems likely that these are related.  For both reports the build 
eventually fails with something like:

gcc  Python.framework/Versions/3.0/Python -o python.exe \
Modules/python.o \
 -ldl
make: *** [sharedmods] Error 1

I can reproduce this in the py3k branch and release30-maint branch on my 
Macbook by doing (at a Terminal prompt):

export LC_CTYPE="UTF-8"
./configure && make

I'll try to find time to look at this; any and all help welcomed!

--
assignee: marketdickinson
messages: 77267
nosy: marketdickinson
priority: critical
severity: normal
status: open
title: Build failure on OS X 10.5.5: make: *** [sharedmods] Error 1
type: compile error
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

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

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

I can't reproduce this. Are you sure you didn't configure with
--prefix=/usr/lib/python3.0 at some point? That would be about the only
way how sys.exec_prefix could get its value?

Can you start over with a clean source tree, and try reproducing it again?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson

Mark Florisson <[EMAIL PROTECTED]> added the comment:

Perhaps it's linux specific then. I'm on debian lenny (2.6.26-1-amd64).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4584] doctest fails to display bytes type

2008-12-07 Thread Michael Yang

New submission from Michael Yang <[EMAIL PROTECTED]>:

doctest.testmod() fails when attempting to echo back a bytes type with
ord() > 128.


def ok():
   """
>>> bytes([255,])
b'\xff'

"""
pass

def notOK():
"""
>>> b'\xff'

"""
pass

import doctest
doctest.testmod()

Traceback (most recent call last):
...
UnicodeEncodeError: 'ascii' codec can't encode character '\xff' in
position 141: ordinal not in range(128)

--
components: Extension Modules
messages: 77264
nosy: msyang
severity: normal
status: open
title: doctest fails to display bytes type
type: behavior
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

2008-12-07 Thread Leger

Leger <[EMAIL PROTECTED]> added the comment:

- "configure --with-pydebug --with-doc-strings --enable-shared
--enable-profiling --enable-ipv6 --with-threads --with-tsc --prefix=/usr"

- ">>> print(sys.exec_prefix)
/usr/lib/python3.0"
>>> print(sys.path)
['', '/usr/lib/python3.0', '/home/fred/python',
'/usr/lib/python3.0/lib-dynload', '/usr/lib/python3.0/lib/python30.zip',
'/usr/lib/python3.0/lib/python3.0',
'/usr/lib/python3.0/lib/python3.0/plat-linux2',
'/usr/lib/python3.0/lib/python3.0/lib-dynload']
[33634 refs]
>>> import time
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named time"

I don't understand why I see "/usr/lib/python3.0/lib/python3.0/..." and
why the time can't import, it is in "/usr/lib/python3.0/lib-dynload"

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4509] bugs in array.array with exports (buffer protocol)

2008-12-07 Thread gumpy

gumpy <[EMAIL PROTECTED]> added the comment:

I've opened a new memoryview/array segfault issue since #4569 was
closed: #4583

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

On Sun, Dec 7, 2008 at 13:26, Mark Dickinson <[EMAIL PROTECTED]> wrote:
>
> Mark Dickinson <[EMAIL PROTECTED]> added the comment:
>
> About unittest:
>
> unittest.TestLoader has an attribute "sortTestMethodsUsing", which it
> expects to be an old-style comparison.
>
> Should this attribute be updated (and renamed?) to expect a key function
> instead, or left as is?
>

It will break backwards-compatibility if you change it. Possibly the
best solution is to introduce a new attribute that does either key or
just lt comparison and make sortTestMethodsUsing be a descriptor that
wraps the function as needed.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4583] segfault when mutating memoryview to array.array when array is resized

2008-12-07 Thread gumpy

New submission from gumpy <[EMAIL PROTECTED]>:

This is with r67651 and related to #4569, #4509 and possibly #4580.

>>> from array import array
>>> a = array('i', range(16))
>>> m = memoryview(a)
>>> a.extend(array('i', range(48)))
>>> m[:] = array('i', range(64))
Segmentation fault

>>> from array import array
>>> a = array('b', range(16))
>>> m = memoryview(a)
>>> a.extend(array('b', range(48)))
>>> m[:] = array('b', range(64))
Segmentation fault

--
components: Interpreter Core
messages: 77260
nosy: gumpy
severity: normal
status: open
title: segfault when mutating memoryview to array.array when array is resized
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross and native build of python for mingw32 with distutils

2008-12-07 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12269/python-trunk-MINGW.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross and native build of python for mingw32 with distutils

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

The changes related to issue 4483 break build on dbm based on "Berkeley
DB" so I update mingw patch to restore bulld to previous state.

Now I expect test_anydbm, test_bsddb and test_whichdb to succeed as
before one week.

Added file: http://bugs.python.org/file12272/python-trunk-MINGW.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

About unittest:

unittest.TestLoader has an attribute "sortTestMethodsUsing", which it 
expects to be an old-style comparison.

Should this attribute be updated (and renamed?) to expect a key function 
instead, or left as is?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1490929] urllib.retrieve's reporthook called with non-helpful value

2008-12-07 Thread Krzysztof Pawlik

Krzysztof Pawlik <[EMAIL PROTECTED]> added the comment:

Attached patch adds new argument: progresshook - it will be passed two
arguments: count of downloaded bytes and total file size (or -1 if it's
not available).

Introducing new argument instead of modifying reporthook maintains
backwards compatibility, also allows removal of reporthook at one point
in the future.

This patch is against r30 SVN tag.

--
keywords: +patch
nosy: +nelchael
Added file: http://bugs.python.org/file12271/progresshook.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4483] Error to build _dbm module during make

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

I'm not sure that recent commits in trunk are correct.

Please confirm that build of dbm module with "Berkeley DB" is deprecated.

Note that exist another module gdbm[gdbmmodule.c].

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

remove_cmp3.patch adds to Christian's patch to fix 6 more test_failures:
(test_distutils, test_kqueue, test_list, test_sort, test_sqlite, 
test_userlist).

On OS X, the only remaining test failure is test_unittest.py.

Added file: http://bugs.python.org/file12270/remove_cmp3.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4582] type of __builtins__ changes if in main module or not

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

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

This is documented, intentional behavior:

http://docs.python.org/library/__builtin__.html?highlight=__builtins__

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

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

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

How did you run configure? What is sys.exec_prefix?

'/usr/lib/python3.0/lib/python3.0/lib-dynload' should not be on
sys.path, but '/usr/lib/python3.0/lib-dynload' should be.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4582] type of __builtins__ changes if in main module or not

2008-12-07 Thread Neal Norwitz

New submission from Neal Norwitz <[EMAIL PROTECTED]>:

This happens on 2.4 and 3.0, probably all versions:

When running this simple program (save to a file):

print(type(__builtins__))
__import__(__file__.split('/')[-1][:-3])

I get:




I would expect the type to be consistent regardless of whether executing
the main module or from the imported module.  I haven't looked into why
this is happening or if it makes sense.  It was unexpected.

--
components: Interpreter Core
messages: 77252
nosy: nnorwitz
severity: normal
status: open
title: type of __builtins__ changes if in main module or not
type: behavior

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4581] failed to import module from lib-dynload

2008-12-07 Thread Leger

New submission from Leger <[EMAIL PROTECTED]>:

I test PY3K.final under Debian/Lenny. 
- Install steps "Configure, make, make test, make install don't generate
errors for the modules in "lib-dynload".

- "/usr/lib/python3.0/lib-dynload", contain modules (time.so, math.so, ...)

- print(sys.path) = ['', '/usr/lib/python3.0', '/home/fred/python',
'/usr/lib/python3.0/lib/python30.zip',
'/usr/lib/python3.0/lib/python3.0',
'/usr/lib/python3.0/lib/python3.0/plat-linux2',
'/usr/lib/python3.0/lib/python3.0/lib-dynload']

- When I launch "python3.0" no error is generate, but when I try to
import modules in "lib-dynload" :

Python 3.0 (r30:67503, Dec  7 2008, 19:22:34) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named time
[33620 refs]

--
components: Library (Lib)
messages: 77251
nosy: legerf
severity: normal
status: open
title: failed to import module from lib-dynload
type: resource usage
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Aaron Gallagher

Aaron Gallagher <[EMAIL PROTECTED]> added the comment:

I can't reproduce this on python 2.5.1, 2.5.2, or 2.6.0 on Mac OS 10.5.4. 
Both .read() and .readline() raise an EBADF IOError. 3.0.0 fails in the 
same way.

--
nosy: +habnabit

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4509] bugs in array.array with exports (buffer protocol)

2008-12-07 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Found another bug with memoryview and arrays in #4580.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-07 Thread Antoine Pitrou

New submission from Antoine Pitrou <[EMAIL PROTECTED]>:

The problem is with the `shape` member which doesn't get recalculated as
it should when instantiating a memoryview slice:

>>> a = array('i', range(10))
>>> m = memoryview(a)[2:8]
>>> a
array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> m[:] = array('i', range(6))
Traceback (most recent call last):
  File "", line 1, in 
ValueError: cannot modify size of memoryview object
>>> len(m)
6
>>> m.shape
(10,)

An additional problem is that `shape` is a pointer to an array of
integers, and we don't know how to reallocate it.

--
components: Interpreter Core
messages: 77248
nosy: pitrou
priority: high
severity: normal
stage: test needed
status: open
title: slicing of memoryviews when itemsize != 1 is wrong
type: behavior
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4569] Segfault when mutating a memoryview to an array.array

2008-12-07 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Fixed in r67650 and r67651.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross and native build of python for mingw32 with distutils

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

About the regression test results test.
The result from 2008-11-29 is:
306 tests OK.
1 test failed:
test_sundry
54 tests skipped:

Those skips are all expected on win32.

To get those results you mingwex library has to contain fixes for two
issues(see mingw32 bug tracker).
- 2136252 (fixed in trunk): c99, printf and float zero precision;
- 2117590 (pending): correction of function asinh - inverse hyperbolic
sine. For the python regression tests copysign is enough.

About "test_sundry" depend on _msi module. I don't plan to work on mingw
build for _msi module. Note that mingw build is with OS system default
msvcrt so there is no "Assembly Hell".

The trunk from 2008-12-07 fail in addition on test_anydbm, test_bsddb
and test_whichdb.
No idea what is wrong. It seems to that break is related to updates. As
example dbm module still fail to build on my linux.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson

Mark Florisson <[EMAIL PROTECTED]> added the comment:

s/actual/operation/

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson

Mark Florisson <[EMAIL PROTECTED]> added the comment:

Actually, I wouldn't expect it to fail like that, because it's not a bad
file descriptor, it's an actual that doesn't agree with the (userspace)
file mode. What I'd expect is probably a TypeError. Although an IOError,
with a different message, wouldn't be totally inappropriate either.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross and native build of python for mingw32 with distutils

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

The new patch is attached. Now the patch allow native build for mingw*
host OS. The build id tested in MSYS environment. The issue title is
updated to reflect this.
The main changes:
- native build require four more build-in modules (_functools, operator
,_locale, _winreg) otherwise setup.py fail to load;
- changes in distutils for python 2.6+. The previous patch work on
python 2.4 run in cross environment;
- don't build with libintl;
- use long double functions ldexp() atan2() from mingwex library as
replacement for buggy msvcrt implementation.


The new patch don't include changes related to issue 4288 (see also
issue 4279).

--
title: cross building python for mingw32 with distutils -> cross and native 
build of python for mingw32 with distutils
Added file: http://bugs.python.org/file12269/python-trunk-MINGW.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson

New submission from Mark Florisson <[EMAIL PROTECTED]>:

>>> f = os.fdopen(os.open('spam!', os.O_TRUNC|os.O_CREAT|os.O_RDWR), 'w')
>>> f.read()
''
>>> f.readline()
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 9] Bad file descriptor
>>> f.write("spamspamhihi")
>>> f.read()
''
>>> f.seek(0)
>>> f.read()
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 9] Bad file descriptor

This is very strange behaviour. First, .read() succeeds, and .readline()
fails, but after writing and seeking, .read() also fails.

In python3, both read and readline fail, but with different exceptions:

>>> f = os.fdopen(os.open('spam!', os.O_TRUNC|os.O_CREAT|os.O_RDWR), 'w')
>>> f.read()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/mark/source/code/_python-3.0/Lib/io.py", line 1718, in read
decoder.decode(self.buffer.read(), final=True))
  File "/home/mark/source/code/_python-3.0/Lib/io.py", line 668, in read
self._unsupported("read")
  File "/home/mark/source/code/_python-3.0/Lib/io.py", line 327, in
_unsupported
(self.__class__.__name__, name))
io.UnsupportedOperation: BufferedWriter.read() not supported
>>> f.readline()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/mark/source/code/_python-3.0/Lib/io.py", line 1807, in
readline
while self._read_chunk():
  File "/home/mark/source/code/_python-3.0/Lib/io.py", line 1554, in
_read_chunk
input_chunk = self.buffer.read1(self._CHUNK_SIZE)
AttributeError: 'BufferedWriter' object has no attribute 'read1'

In my opinion, all operations, in all python versions, should fail like
readline in the first example: IOError: [Errno 9] Bad file descriptor

--
messages: 77242
nosy: eggy
severity: normal
status: open
title: .read() and .readline() differ in failing
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3754] minimal cross-compilation support for configure

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

The support for *-*mingw* host is enhanced to native msys environment.
This include check for device file /dev/ptmx. The MSYS report that file
exist. As the check is skipped on mingw* host os now cugwin environment
can be used too.

Also check libintl is skipped for mingw as the native build don't use it.

Added file: http://bugs.python.org/file12268/python-trunk-CROSS.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4558] with_stdc89

2008-12-07 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

:-( the last my comment is incomplete : work for me after "minimal patch"

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I've integrated Mark's patch and fixed more tests. Who wants to pick it
up from here?

Added file: http://bugs.python.org/file12267/remove_cmp2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Changes by Christian Heimes <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12262/remove_cmp.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Sebastian Rittau

New submission from Sebastian Rittau <[EMAIL PROTECTED]>:

The attached patch replaces all instances of "x.has_key(k)" method calls
by "k in x". It also replaces one call to parser.ast2tuple by
parser.st2tuple. This removes deprecation warnings when running in -3 mode.

--
components: Library (Lib)
files: compiler.diff
keywords: patch
messages: 77238
nosy: srittau
severity: normal
status: open
title: compiler: -3 warnings
versions: Python 2.6
Added file: http://bugs.python.org/file12266/compiler.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Decimal fixes

Added file: http://bugs.python.org/file12265/remove_cmp_decimal.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

Can you fix the decimal module and tests? You know more about the module
than me. I'm half through most of the others modules.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

I'll work on fixing the unit tests if that's helpful.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

Changes by Sebastian Rittau <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12263/distutils.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

Sebastian Rittau <[EMAIL PROTECTED]> added the comment:

Oops, missed a closing parenthesis.

Added file: http://bugs.python.org/file12264/distutils.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

New submission from Sebastian Rittau <[EMAIL PROTECTED]>:

The attached patch removes all instances of the deprecated "apply"
function from distutils and thereby fixes warnings when run with -3.

--
components: Distutils
files: distutils.diff
keywords: patch
messages: 77233
nosy: srittau
severity: normal
status: open
title: distutils: -3 warnings (apply)
versions: Python 2.6
Added file: http://bugs.python.org/file12263/distutils.diff

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Craig Holmquist

Craig Holmquist <[EMAIL PROTECTED]> added the comment:

> I don't quite understand this issue yet. python26.dll is linked with
> a manifest. Isn't that good enough?

Apparently not, at least in my testing.  It seems that if a DLL is
loaded, Windows will try to resolve its dependencies by looking at that
DLL's own manifest; if that fails, Windows will try to resolve them by
looking at the EXE's manifest.  It won't check other DLLs.  From the
loader's perspective, it seems like there's no "tree" of DLLs, it's just
"EXE loads DLL, EXE loads DLL", even if the loading code is actually in
one of the DLLs.

I guess I'm more concerned about applications like Apache that only use
Python through an external module or plugin; there's no reason the
Apache developers would be expected to make this kind of change with the
manifests and everything, much less any commercial, closed-source app
(say, an IDE or editor that has plugins for several scripting
languages).  Also, the manifest trick I described as a workaround was
only as simple as it was in this case because httpd.exe didn't have any
manifest at all; if it already had an internal manifest, working-around
this would have been much more gruesome.

I understand, though, the value of "xcopy deployment", and I realize
that having some means of doing that is better than none at all.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

Here is a longer patch that removes cmp, PyObject_Compare and cmpfunc.
The slots has been renamed to tp_reserved. If the slot is used by a type
an exception is raised to notify the user about possible issues.

Missing:
* fix unit tests
* add error checks to PyObject_RichCompareBool calls
* Remove/replace the last PyUnicode Compare ASII function

Added file: http://bugs.python.org/file12262/remove_cmp.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4571] write to stdout in binary mode - is it possible?

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

switch to binary mode
>>> sys.stdout = sys.stdout.buffer

switch back
>>> sys.stdout = sys.__stdout__

--
nosy: +christian.heimes

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4571] write to stdout in binary mode - is it possible?

2008-12-07 Thread jeff deifik

jeff deifik <[EMAIL PROTECTED]> added the comment:

I don't consider sys.stdout.buffer.write(b'abc')
to be an acceptable solution. There are many programs that need
to produce binary output with standard output. Consider uudecode
and similar programs.

There needs to be a standard, portable, documented way to put stdout
into binary mode in order to write binary output. For example,
all the flavors of the print command need to be able to send binary
data to standard output.

I don't have a problem changing open statements to support binary
file i/o, but I do have a problem changing every print or write statement
in order to support binary file i/o.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4571] write to stdout in binary mode - is it possible?

2008-12-07 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Documented in r67365.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4573] zsh-style subpattern matching for fnmatch/glob

2008-12-07 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' <[EMAIL PROTECTED]>:


--
nosy: +giampaolo.rodola

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4576] "Defining new types" little outdated

2008-12-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Fixed in r67632.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4535] Build / Test Py3K failed on Ubuntu 8.10

2008-12-07 Thread Kandalintsev Alexandre

Kandalintsev Alexandre <[EMAIL PROTECTED]> added the comment:

Rob, could you repeat this test on trunk version of python?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4576] "Defining new types" little outdated

2008-12-07 Thread Kandalintsev Alexandre

New submission from Kandalintsev Alexandre <[EMAIL PROTECTED]>:

Hello!

It's need to little update "Defining new types" documentation section 
in py3.0 and py3.1:
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject *)self);

--
assignee: georg.brandl
components: Documentation
messages: 77225
nosy: exe, georg.brandl
severity: normal
status: open
title: "Defining new types" little outdated
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4506] 3.0 make test failures on Solaris 10

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Thanks, Skip.  It looks like the top priority is fixing Py_IS_INFINITY, 
then (still assuming that I'm not barking up entirely the wrong tree).  
I've opened issue 4575 for the Py_IS_INFINITY fix.

I'll look at the changes to AC_CHECK_FUNCS, too.

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Mark Dickinson

New submission from Mark Dickinson <[EMAIL PROTECTED]>:

In issue 4506, Skip reported that test_cmath fails on Solaris 10/x86 for 
3.0.  If my guesses are correct, it probably fails on all x86 systems that 
(a) use the x87 coprocessor for floating-point (as opposed to using SSE2, 
for example), and (b) don't have isinf available.

Problem: Py_IS_INFINITY is applied to a floating-point value sitting in an 
80-bit x87 register; that value is not infinity, but after moving it back 
to memory (and hence rounding from 80-bit extended precision to 64-bit 
double precision with its smaller exponent range) it becomes infinity.

Solution: Add a macro to pymath.h that forces rounding from extended 
precision to double precision; apply this macro *before* calling 
Py_IS_INFINITY.  See attached patch for an example.

Problem: After applying the attached patch to the py3k branch, the cmath 
module fails to build.  On OS X 10.5, I get:

running build_ext
building 'cmath' extension
gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-
3.1/Users/dickinsm/python_source/py3k/Modules/cmathmodule.o -
L/usr/local/lib -o build/lib.macosx-10.3-i386-3.1/cmath.so
*** WARNING: renaming "cmath" since importing it failed: 
dlopen(build/lib.macosx-10.3-i386-3.1/cmath.so, 2): Symbol not found: 
_Py_force_to_memory
  Referenced from: /Users/dickinsm/python_source/py3k/build/lib.macosx-
10.3-i386-3.1/cmath.so
  Expected in: dynamic lookup

Solution: ???

Christian, as the architect of pymath.h, do you have any ideas what I'm 
doing wrong?  Or comments on the patch in general?  What do I need to do 
to make Py_force_to_memory visible to extension modules?

--
assignee: marketdickinson
components: Extension Modules
files: force_to_memory.patch
keywords: patch
messages: 77223
nosy: christian.heimes, marketdickinson, skip.montanaro
priority: high
severity: normal
status: open
title: Py_IS_INFINITY defect causes test_cmath failure on x86
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12261/force_to_memory.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

We shouldn't remove the tp_compae slot in 3.0. That's going to break too
much 3rd party software. Instead of removing it, a deprecation warning
should be printed when the slot isn't 0.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3439] create a numbits() method for int and long types

2008-12-07 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

I plan to change my patch to come back to a method (x.numbits()) 
because other integer implementations like Decimal may be slower.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-07 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

+1 for a speedy removal of cmp and tp_compare

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4574] reading UTF16-encoded text file crashes if \r on 64-char boundary

2008-12-07 Thread Antoine Pitrou

Changes by Antoine Pitrou <[EMAIL PROTECTED]>:


--
nosy: +pitrou

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4574] reading UTF16-encoded text file crashes if \r on 64-char boundary

2008-12-07 Thread John Machin

New submission from John Machin <[EMAIL PROTECTED]>:

Problem in the newline handling in io.py, class
IncrementalNewlineDecoder, method decode. It reads text files in 128-
byte chunks. Converting CR LF to \n requires special case handling
when '\r' is detected at the end of the decoded chunk in case
there's an LF at the start of the next chunk. It prepends b'\r' (only 1
byte) to the next chunk's raw bytes and decodes that. But \r in UTF-16
takes 2 bytes; we are now 1 byte out of kilter and various failures are
possible (including silently producing garbage output from a truncated
file with an odd number of bytes).

The attached script illustrates the problems.

--
components: Interpreter Core
files: py30cr64bug.py
messages: 77219
nosy: sjmachin
severity: normal
status: open
title: reading UTF16-encoded text file crashes if \r on 64-char boundary
type: crash
versions: Python 3.0
Added file: http://bugs.python.org/file12260/py30cr64bug.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4263] BufferedWriter non-blocking overage

2008-12-07 Thread Sever Băneșiu

Sever Băneșiu <[EMAIL PROTECTED]> added the comment:

Christian, if the patch looks good to you I think now it's a good time
to commit it.

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> I understand the rationale behind #4120, but it seems like it only helps
> a narrow set of applications, namely "applications that link dynamically
> with the same version of MSVCR90 as Python and that bundle the MSVCR90
> DLL and that can't install the VS2008 redist". 

This is not a narrow set, though. It includes all the applications that
use py2exe and friends to create stand-alone applications. This case
absolutely must be supported.

> The 2.6.0 behavior - requiring the VS2008 redist to be installed - is
> hardly perfect (to put it mildly), but in my opinion it's more obvious
> and straightforward, and more consistent with the behavior of other
> Windows software.

Python has a long tradition of supporting "xcopy deployment". I don't
want Microsoft to dictate that we stop supporting that. I find the need
to have end-users install the CRT redist particularly unacceptable.

I don't quite understand this issue yet. python26.dll is linked with
a manifest. Isn't that good enough?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4573] zsh-style subpattern matching for fnmatch/glob

2008-12-07 Thread Erick Tryzelaar

New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:

As I mentioned on python-ideas, I my project needs to extend fnmatch to 
support zsh-style globbing, where you can use brackets to designate 
subexpressions. Say you had a directory structure like this:

foo/
 foo.ext1
 foo.ext2
bar/
 foo.ext1
 foo.ext2

The subexpressions will let you do patterns like this:

>>> glob.glob('foo/foo.{ext1,ext2}')
['foo/foo.ext1', 'foo/foo.ext2']
>>> glob.glob('foo/foo.ext{1,2}')
['foo/foo.ext1', 'foo/foo.ext2']
>>> glob.glob('{foo,bar}')
['bar', 'foo']
>>> glob.glob('{foo,bar}/foo*')
['bar/foo.ext1', 'bar/foo.ext2', 'foo/foo.ext1', 'foo/foo.ext2']
>>> glob.glob('{foo,bar}/foo.{ext*}')
['bar/foo.ext1', 'bar/foo.ext2', 'foo/foo.ext1', 'foo/foo.ext2']
>>> glob.glob('{f?o,b?r}/foo.{ext*}')
['bar/foo.ext1', 'bar/foo.ext2', 'foo/foo.ext1', 'foo/foo.ext2']


Would this be interesting to anyone else? It would unfortunately break 
fnmatch since it currently treats {} as ordinary characters. It'd be 
easy to work around that by adding a flag or using a different function 
name though. Anyway, here's the patch against the head of py3k.

--
components: Library (Lib)
files: zsh-fnmatch.diff
keywords: patch
messages: 77216
nosy: erickt
severity: normal
status: open
title: zsh-style subpattern matching for fnmatch/glob
type: feature request
versions: Python 3.0
Added file: http://bugs.python.org/file12259/zsh-fnmatch.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4571] write to stdout in binary mode - is it possible?

2008-12-07 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Is that an official way? If yes, it needs to be documented.

--
nosy: +georg.brandl

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-07 Thread Winfried Plappert

Changes by Winfried Plappert <[EMAIL PROTECTED]>:


--
nosy: +wplappert

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3476] BufferedWriter not thread-safe

2008-12-07 Thread Winfried Plappert

Changes by Winfried Plappert <[EMAIL PROTECTED]>:


--
nosy: +wplappert

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4565] io write() performance very slow

2008-12-07 Thread Winfried Plappert

Changes by Winfried Plappert <[EMAIL PROTECTED]>:


--
nosy: +wplappert

___
Python tracker <[EMAIL PROTECTED]>

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