[issue4279] Module 'parser' fails to build

2008-11-26 Thread Yaakov (Cygwin Ports)

Yaakov (Cygwin Ports) <[EMAIL PROTECTED]> added the comment:

Attempting to export and use Py_meta_grammar() gives me a broken module,
based on the results of test/test_parser.py.

This patch, which exports _PyParser_Grammar, is very simple and the test
passes.

I will gladly take guidance on this patch.

Added file: http://bugs.python.org/file12132/3.0rc3-parsermodule.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller

New submission from Thomas Heller <[EMAIL PROTECTED]>:

The following code, which only works on Windows, crashes with an access
violation somewhere in the garbage collector in a debug build:

>>> import _ctypes
[43470 refs]
>>> _ctypes.COMError(1, 2, 3)

The problem is that the PyComError_Type's tp_flags contains
Py_TPFLAGS_HAVE_GC although the tp_traverse slot is NULL.

The attached patch removes the Py_TPFLAGS_HAVE_GC which is not necessary
at all because a PyComError_Type instance (normally) only contains
simple objects (strings, numbers, None, and a tuple of strings, numbers,
and None), so no reference cycles should be possible.

--
assignee: theller
components: ctypes
files: ctypes.patch
keywords: needs review, patch, patch
messages: 76451
nosy: theller
priority: release blocker
severity: normal
status: open
title: _ctypes.COMError crash
type: crash
versions: Python 3.0
Added file: http://bugs.python.org/file12133/ctypes.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-26 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

Thanks for the review.  I commited the 'better' patch plus a NEWS entry
as svn rev. 67391.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4426] UTF7 decoding is far too strict

2008-11-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

On 2008-11-25 19:56, Nick Barnes wrote:
> Nick Barnes <[EMAIL PROTECTED]> added the comment:
> 
> Well, I could submit a diff for unicodeobject.c, but I have never
> contributed to Python (or used this particular tracking system) before.
>  Is there a standard form for contributing changes?  Unified diff?

Please send unified diffs and attach them to the ticket.

While you're at it: perhaps you could try to refactor the code a bit
in order to get rid off the many macros use throughout the codec.
They make the code a lot less readable.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com


2008-11-12: Released mxODBC.Connect 0.9.3  http://python.egenix.com/

 Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! 

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-26 Thread rb

New submission from rb <[EMAIL PROTECTED]>:

Python cannot be embedded in shared library due to dependency problems
with lib-dynload.

I am implementing a shared library (in C) that implements a specific API
as a dynamically loadable plugin to an application. To implement this
library, I am calling out to Python via the C API.

When my code tries to load a Python module, it fails. This is because
lib-dynload/time.so (for example) cannot resolve symbols that are in
libpython2.5.so because it never looks there.

In this test case I'm trying to import "time", but it seems to fail on
other modules too - presumably anything that is in lib-dynload. It also
fails if I import a pure Python module that then tries to import time.

The error produced is: ImportError:
/usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError

>From LD_DEBUG:
 29682:file=/usr/lib/python2.5/lib-dynload/time.so [0];  needed by 
/usr/lib/libpython2.5.so.1.0 [0]
...
 29682:relocation processing: /usr/lib/python2.5/lib-dynload/time.so
 29682:symbol=PyExc_ValueError;  lookup in file=./myprog [0]
 29682:symbol=PyExc_ValueError;  lookup in file=/lib/libdl.so.2 [0]
 29682:symbol=PyExc_ValueError;  lookup in file=/lib/libc.so.6 [0]
 29682:symbol=PyExc_ValueError;  lookup in
file=/lib64/ld-linux-x86-64.so.2 [0]
 29682:symbol=PyExc_ValueError;  lookup in 
file=/usr/lib/python2.5/lib-dynload/time.so [0]
 29682:symbol=PyExc_ValueError;  lookup in file=/lib/libm.so.6 [0]
 29682:symbol=PyExc_ValueError;  lookup in file=/lib/libpthread.so.0 [0]
 29682:symbol=PyExc_ValueError;  lookup in file=/lib/libc.so.6 [0]
 29682:symbol=PyExc_ValueError;  lookup in
file=/lib64/ld-linux-x86-64.so.2 [0]
 29682:/usr/lib/python2.5/lib-dynload/time.so: error: symbol lookup
error: 
undefined symbol: PyExc_ValueError (fatal)


$ nm -D /usr/lib/libpython2.5.so.1|grep PyExc_ValueError
0033a7e0 D PyExc_ValueError



$ ldd /usr/lib/python2.5/lib-dynload/time.so
libm.so.6 => /lib/libm.so.6 (0x2afe014c9000)
libpthread.so.0 => /lib/libpthread.so.0 (0x2afe0174a000)
libc.so.6 => /lib/libc.so.6 (0x2afe01967000)
/lib64/ld-linux-x86-64.so.2 (0x4000)



I am told that the problem is that lib-dynload/*.so should depend on
libpython2.5.so.1.


Test case attached. mylib.c is the library that I'm implementing reduced
to the problem case. myprog.c is a stub program that loads mylib.c to
demonstrate the problem. The "real" myprog would be any third-party
application that I have no control over that expects to be able to
dlopen() mylib.so and call functions within it.


I have been given the following workaround: in mylib.c, before
PyInitialize() I can call dlopen("libpython2.5.so", RTLD_LAZY |
RTLD_GLOBAL);

This works, but I believe that lib-dynload/*.so should depend on
libpython2.5.so.1 so this hack should not be necessary.

I am using Ubuntu 8.04 with Python version 2.5.2-2ubuntu4.1.

--
components: Library (Lib)
files: mylib.c
messages: 76454
nosy: rb
severity: normal
status: open
title: Embedding into a shared library fails
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file12134/mylib.c

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-26 Thread rb

Changes by rb <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file12135/myprog.c

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4435] Sphinx does not show failed doctests in quiet mode

2008-11-26 Thread Robert Schuppenies

New submission from Robert Schuppenies <[EMAIL PROTECTED]>:

Sphinx does not show failed doctests when run in quiet mode. Any output
from the tests seems to be suppressed. The same applies to the linkckeck
builder.

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 76455
nosy: georg.brandl, schuppenies
severity: normal
status: open
title: Sphinx does not show failed doctests in quiet mode
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



[issue4279] Module 'parser' fails to build

2008-11-26 Thread Yaakov (Cygwin Ports)

Changes by Yaakov (Cygwin Ports) <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12132/3.0rc3-parsermodule.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4436] Sphinx latex writer crashes when encountering deep section levels

2008-11-26 Thread Robert Schuppenies

New submission from Robert Schuppenies <[EMAIL PROTECTED]>:

The Sphinx latex writer crashes if a documentation has more than 7
levels in a section hierarchy. The LaTeXTranslator class defines 7
section names, each corresponding to a level. If a deeper level is
encountered, no appropriate section name can be found:

File "[..]/svn/doctools/sphinx/latexwriter.py", line 348,  in visit_title
 print "self.sectionnames", self.sectionnames[self.sectionlevel]
IndexError: list index out of range

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 76456
nosy: georg.brandl, schuppenies
severity: normal
status: open
title: Sphinx latex writer crashes when encountering deep section levels
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



[issue4437] Windows 32-bit installer crash on "cancel" in "advanced" settings

2008-11-26 Thread Francois Grieu

New submission from Francois Grieu <[EMAIL PROTECTED]>:

On an Windows XP 32-bit system without Python installed
- launch python-2.6.msi (md5 6c62c123d248a48dccbaa4d3edc12680)
- click "next >" "next >" "advanced" "cancel" "yes"
- msiexex.exe crashes (repeatable).

Installation works fine if one do not press "advanced", or press
"finish" instead of "cancel".

--
components: Installation
messages: 76459
nosy: fgrieu
severity: normal
status: open
title: Windows 32-bit installer crash on "cancel" in "advanced" settings
type: crash
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2090] __import__ with fromlist=[''] causes double initialization of modules

2008-11-26 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

Just for reference, the simplest workaround is to use:

modname = "foo.bar.baz.baq"
mod = __import__(modname, {}, {}, [modname.rsplit(".", 1)[-1]])

--
nosy: +mrts

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2090] __import__ with fromlist=[''] causes double initialization of modules

2008-11-26 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

See also http://bugs.python.org/issue4438

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2491] io.open() handles errors differently on different platforms

2008-11-26 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


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



[issue4437] Windows 32-bit installer crash on "cancel" in "advanced" settings

2008-11-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Already corrected with issue4289.

--
nosy: +amaury.forgeotdarc
resolution:  -> duplicate
status: open -> closed
superseder:  -> Python 2.6 installer crashes when selecting 'advanced' and 
cancelling it

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-26 Thread John Levon

Changes by John Levon <[EMAIL PROTECTED]>:


--
nosy: +movement

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4439] Typo in sqlite3 documentation.

2008-11-26 Thread olt

New submission from olt <[EMAIL PROTECTED]>:

There is a small typo in the possible Connection.isolation_level
http://docs.python.org/library/sqlite3.html#connection-objects
Its EXCLUSIVE not EXLUSIVE.

--
components: Distutils
messages: 76465
nosy: olt
severity: normal
status: open
title: Typo in sqlite3 documentation.
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



[issue4439] Typo in sqlite3 documentation.

2008-11-26 Thread olt

Changes by olt <[EMAIL PROTECTED]>:


--
assignee:  -> georg.brandl
components: +Documentation -Distutils
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



[issue4402] os.getenv('PATH') return different result between 2.5 and 3.0rc3

2008-11-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

(Clive's message was entirely in the HTML "unnamed" attachement)

Clive said:
> My python2.5 is from ActiveState, and python3.0 is the official.

Great.

But -- didn't you get the same behavior *before* installing python 3.0?
when python2.5 started from the "run" dialog box, didn't it get the same
addition to the PATH environment variable?

Martin: Could the msi installer remove the key named
"HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows\CURRENTVERSION\App
Paths\python.exe\Path"
when it is present? Or is this just a "Won't fix" issue?

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



[issue4366] cannot find -lpythonX.X when buinding Python on FreeBSD

2008-11-26 Thread Akira Kitada

Akira Kitada <[EMAIL PROTECTED]> added the comment:

Martin,
Two questions:

1. Isn't Christian's patch enough for this?
2. How about Python 3.0 and 2.6.1? Are they also out of scope for this?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4438] Add an easy way to __import___ submodules

2008-11-26 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

Attached is a naive proof-of-concept implementation (that breaks things,
i.e. the real implementation should strive for better
general compatibility), but works as expected:

>>> __import__('imprt.foo.foo', submodule=True)


>>> __import__('imprt.foo.foo', submodule=False)   


>>> __import__('imprt.foo.foo')


# Die on unexpected arguments like strings, lists etc to
# avoid confusion
>>> __import__('imprt.foo.foo', submodule='z')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: an integer is required

--
keywords: +patch
Added file: http://bugs.python.org/file12136/issue4438.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4440] "sort" command doesn't work in pstats if run interactively

2008-11-26 Thread Marcin Bachry

New submission from Marcin Bachry <[EMAIL PROTECTED]>:

Sort command in Python's 3.0 pstats doesn't accept any valid argument
and views help all the time:

$ python3.0 -m pstats pstats
Welcome to the profile statistics browser.
% sort cumulative
Valid sort keys (unique prefixes are accepted):
stdname -- standard name
nfl -- name/file/line
pcalls -- call count
file -- file name
calls -- call count
time -- internal time
line -- line number
cumulative -- cumulative time
module -- file name
name -- function name
%

--
components: Library (Lib)
files: pstats-fix.diff
keywords: patch
messages: 76467
nosy: marcin.bachry
severity: normal
status: open
title: "sort" command doesn't work in pstats if run interactively
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file12137/pstats-fix.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4438] Add an easy way to __import___ submodules

2008-11-26 Thread Mart Sõmermaa

New submission from Mart Sõmermaa <[EMAIL PROTECTED]>:

The need to dynamically import module foo given a module name string
'bar.baz.foo' is quite common.

Quite often, the hack described in http://bugs.python.org/issue2090 is
used (see e.g. the Google code results linked from the issue).

Quoting Brett Cannon from the issue:
"I plan to add a much simpler API to the imp module for people to use
directly so that these abuses don't continue."

Although there are reasonable workarounds, let the current ticket be a
remainder for Brett that his plan is indeed needed.

Perhaps the easiest thing to do would be to add yet another argument,
e.g. 'toplevel', to __import__, such that:

>>> __import__('imprt.foo.foo') # toplevel=True by default

>>> __import__('imprt.foo.foo', toplevel=False)


The latter can currently be achieved by

>>> __import__('imprt.foo.foo', {}, {}, ['foo'])


which is cumbersome if the module name is given in a string, resulting
in unnecessarily complex code:

modname = "imprt.foo.foo"
>>> __import__(modname, {}, {}, [modname.rsplit(".", 1)[-1]])


--
components: Interpreter Core, Library (Lib)
messages: 76460
nosy: mrts
severity: normal
status: open
title: Add an easy way to __import___ submodules
type: feature request
versions: Python 2.7, 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



[issue1772794] Telnetlib dosn't accept u'only ascii'

2008-11-26 Thread sebek

sebek <[EMAIL PROTECTED]> added the comment:

I wonder if it is the same problem as bug #3725.
In this case it has been fixed in r66904 where telnetlib knows only
understand bytes instead of characters.

see http://bugs.python.org/issue3725

--
nosy: +sebek

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4438] Add an easy way to __import___ submodules

2008-11-26 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

Just a note that `make test` passes:

322 tests OK.
38 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
test_dbm test_dl test_gl test_imageop test_imgfile test_kqueue
test_linuxaudiodev test_macos test_macostools test_normalization
test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages
test_socketserver test_startfile test_sunaudiodev test_tcl
test_timeout test_urllib2net test_urllibnet test_winreg
test_winsound test_zipfile64
3 skips unexpected on linux2:
test_tcl test_dbm test_bsddb

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4329] base64 does not properly handle unicode strings

2008-11-26 Thread Terry J. Reedy

Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

2.6 is, as far as I know, intended to be backwards compatible except for
where it fixes bugs.  Upgrading to 2.6 does (should) not change strings
(type str) to unicode.  Only importing the appropriate __future__ or
upgrading to 3.0 will do that.  I have no idea what Django does.

The 3 lines of code you posted gives exactly the same traceback in my
copy of 2.5 as the one you posted.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4433] _ctypes.COMError crash

2008-11-26 Thread Benjamin Peterson

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

Ok. Looks good.

--
keywords:  -needs review
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3020] doctest should have lib2to3 integration

2008-11-26 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
assignee: collinwinter -> 
priority:  -> low

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4441] Improve os open flag options doc

2008-11-26 Thread Terry J. Reedy

New submission from Terry J. Reedy <[EMAIL PROTECTED]>:

os module doc, File Descriptor Operations, at end.

Suggestions:

1. Replace
"The following data items are available for use in constructing the
flags parameter to the open() function."
with
"The following data items are options for the flag argument to the
open() function. These can be combined using the bitwise OR operator |."
(and remove the redundant text from the block headings -- see below).

2. In the next sentence, replace 'will not be' with 'are not'.

3. The next sentence ends with 'consult open(2).' I presume this refers
to unix manual section on the open system call.  This is cryptic and
useless to many Windows users.  Where are descriptions for flags valid
on Windows?

4. Block captions: remove repeated text and move availability note above
rather than below the block. 'Available on Unix and Windows', 'Available
on Unix only', 'Available on Windows only', 'Gnu extensions'.

5. The items in the fifth block are *not* open() options.  The caption
should instead be an un-indented introductory sentence before the block.
"The following data items are parameters to the lseek() function. ..."

--
assignee: georg.brandl
components: Documentation
messages: 76471
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Improve os open flag options doc
versions: Python 2.7, 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



[issue4329] base64 does not properly handle unicode strings

2008-11-26 Thread Michael Becker

Michael Becker <[EMAIL PROTECTED]> added the comment:

Terry,
I had a feeling Django had something to do with this. I'll have a closer
look there. For reference, in my django code, I did not explicitly
declare the string as a unicode string. Django must be importing
unicode_literals from __future__ as you suggested. I'll have a closer
look there. 

Just out of curiosity, would the 2to3 tool have resolved this issue come
3.0? Would it have change the type to a bytes? Or, would this issue need
to be caught in unit tests?

Thanks!

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4442] datetime not subclassable in the usual way

2008-11-26 Thread Chris Withers

New submission from Chris Withers <[EMAIL PROTECTED]>:

>>> from datetime import datetime
>>> class defaultdatetime(datetime):
...   defaults=(2001,1,1)
...   def __init__(self,*args):
... if not args:
...   args = self.defaults
... datetime.__init__(self,*args)
...
>>> defaultdatetime()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: function takes at least 3 arguments (0 given)

--
components: Library (Lib)
messages: 76473
nosy: cjw296
severity: normal
status: open
title: datetime not subclassable in the usual way
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4442] datetime not subclassable in the usual way

2008-11-26 Thread Chris Withers

Chris Withers <[EMAIL PROTECTED]> added the comment:

Sorry, forgot to say that the above is at best counterintuitive and not
documented anywhere...

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4442] datetime not subclassable in the usual way

2008-11-26 Thread Benjamin Peterson

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

This is because datetime does all its initialization in __new__ instead
of __init__.

--
nosy: +benjamin.peterson
priority:  -> normal
type:  -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4423] 2to3 replaces "arbitrary" variables

2008-11-26 Thread Benjamin Peterson

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

On Wed, Nov 26, 2008 at 12:45 AM, Martin v. Löwis
<[EMAIL PROTECTED]> wrote:
>
> Martin v. Löwis <[EMAIL PROTECTED]> added the comment:
>
>> This is true of many fixers. What is the use case?
>
> In this case, I wanted to work around the fixer working incorrectly
> for commands, but still have it continue to work for all the other
> modules it fixes. The context is the setup.py script of Django.

I wonder if a better way would be to configure the imports fixer
through the options dict passed to RefactoringTool. i.e.

 RefactoringTool(..., {"fix_imports:dont_transform" : ["commands",
"other_module"]})

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4439] Typo in sqlite3 documentation.

2008-11-26 Thread Benjamin Peterson

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

Thanks for the report! Fixed in r67398.

--
nosy: +benjamin.peterson
resolution:  -> duplicate
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



[issue4442] datetime not subclassable in the usual way

2008-11-26 Thread Chris Withers

Chris Withers <[EMAIL PROTECTED]> added the comment:

But that isn't documented anywhere...

--
assignee:  -> georg.brandl
components: +Documentation
nosy: +georg.brandl
type: feature request -> 

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-26 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

ubuntu comes with a static libpython.a which you can also link against.
Linking the c modules against the shared python library would make that
static library pretty much useless...

--
nosy: +schmir

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4366] cannot find -lpythonX.X when buinding Python on FreeBSD

2008-11-26 Thread Martin v. Löwis

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

> 1. Isn't Christian's patch enough for this?

No. It should be dealt with in the same way as on Linux (or the Linux
way should be changed).

> 2. How about Python 3.0 and 2.6.1? Are they also out of scope for this?

Not yet, no. However, they are soon to be released, so chances are low
that a patch arrives in time.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

Thanks for the review; committed as svn rev. 67402.

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



[issue4423] 2to3 replaces "arbitrary" variables

2008-11-26 Thread Martin v. Löwis

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

> I wonder if a better way would be to configure the imports fixer
> through the options dict passed to RefactoringTool. i.e.
> 
>  RefactoringTool(..., {"fix_imports:dont_transform" : ["commands",
> "other_module"]})

That's very obscure, IMO. I didn't know that syntax existed, and
I can't guess easily what it means (in general).

In the specific case, it's also difficult to pass the options,
since the distutils command doesn't support doing so.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4423] 2to3 replaces "arbitrary" variables

2008-11-26 Thread Benjamin Peterson

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

Ok. The building of the pattern in fix_imports is changed to
compile_pattern in r67404.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-26 Thread LuisC

New submission from LuisC <[EMAIL PROTECTED]>:

The project goal is to incorporate the functionality of interaction of 
the excel application (gnumeric) with the XO's journal. All the 
activities needs to register any change in that datastore (save and 
open files are made throw it). 

In order to apply this option, we need to call some python code from 
the implementation of the worksheet in C code. This is called embedded 
python in C. The steps followed to accomplish this goal came from the 
OLPC site recomendations, in wiki.laptop.org. The python script for the 
interaction with the journal's datastore can be found in here: 
http://wiki.laptop.org/go/Copy_to_and_from_the_Journal 

The changes in the gnumeric code are basically in the workbook-view.c 
and main-application.c to handle the open and save options. In the main-
application.c the method gui_file_copy_from_journal uses the python 
api/c to make the call to the journal script. after this method and 
during the open of the file, an exception rises. Although we are not 
sure, we believe it has to do with the closure of the python enviroment 
after the finalize call. We need to erase this exception or may be just 
handle it. 

The error running in the XO is: 

gnumeric: Python/pystate.c:561 :PyGILState: The 
assertion 'autoInterpreterState' has failed 

The configuration of the XO where we are getting the exception is: 

Python 2.5 (r25:51908, Oct 19 2007, 09:47:40) [gcc 4.1.2 20070925 (Red 
Hat 4.1.2-27)] on linux2 

Any help is greatly appreciated!!!

--
components: Interpreter Core
messages: 76484
nosy: barry, brett.cannon, doerwalter, gvanrossum, lcarrionr, lemburg, mwh
severity: normal
status: open
title: Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' 
has failed
type: resource usage
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-26 Thread Brett Cannon

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

Is this an actual bug report or more of a request for help? If it is the
former then a test case is needed in order to help figure out what is
going on. If it is the latter you should ask on
comp.lang.python/python-list.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-26 Thread Benjamin Peterson

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

Also, please do not add everyone in the project to the nosy list.

--
nosy: +benjamin.peterson -barry, doerwalter, gvanrossum, lemburg, mwh

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-26 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
nosy:  -benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

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



Re: [issue4336] Fix performance issues in xmlrpclib

2008-11-26 Thread Jeremy Hylton
I think we're making progress, but I'm still not sure about the new
httplib api.  My current worry is that endheaders() behaves very
differently when send_data is false.  My chief concern is that the
__state variable is going to indicate that the request has been sent
when we're really depending on the client to send the header.  In
general, I don't like the public send() method since it's exposing a
raw socket that could be called at any time regardless of the _state
of the object.

What if endheaders() takes body as an optional argument and sends it
along with the headers?  This accomplishes the same basic goal as
returning the header from endheaders(), but keeps the actual sending
of data encapsulated within the http connection.

Jeremy

On Tue, Nov 25, 2008 at 6:13 AM, Kristján Valur Jónsson
<[EMAIL PROTECTED]> wrote:
>
> Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment:
>
> I have addressed some issues mentioned:
> 1) I have retained the _send_output() method.
> 2) the endheaders() method now takes an optional argument, send_data
> that defaults to True.  It also returns any unsent data as a string.
> This simplifies any code wishing to send more data.
> 3) The old HTTP class needs no changes anymore.
> 4) I've fixed the test_xmlrpc.py test case to run all the tests on
> windows.  The old concern with "WSAEWOULDBLOCK" seems to be no longer
> valid.
> 5) concatenating the result from endheaders() with the request body is
> valid, in xmlrpclib, because the assumption has already been made in
> send_content() that request_body is a string (str(len(request_body)).
> However, in httplib's request() method, we now special case this.  I
> don't want to complicate the code for what appears to be a rare case.
>
> I chose not to mess with xmlrpclib and make it continue to use the old
> HTTP class in order to minimise the extent of this patch.  A simple and
> clear performance patch has in my experience a much greater chance of
> finding its way into the codebase than a more extensive rewrite :)
>
> You may have concerns regarding point 3 above, and I am open to
> suggestions.
>
> Now, what remains is the question of the read buffering for the socket
> fileobject.  Do you think that it is feasible to simply change the
> default read buffering for fileobjects to use buffering for readline()
> same as they do for read()?  Then we wouldn't need the second half of
> this patch and we could make a separate "socket" performance patch.
>
> Added file: http://bugs.python.org/file12127/xmlrpc.patch
>
> ___
> Python tracker <[EMAIL PROTECTED]>
> 
> ___
> ___
> Python-bugs-list mailing list
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-bugs-list/jeremy%40alum.mit.edu
>
>
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1755388] Problem with socket.gethostbyaddr() and KeyboardInterrupt

2008-11-26 Thread Gabriel Genellina

Gabriel Genellina <[EMAIL PROTECTED]> added the comment:

Yes, I know it's a bug, and certainly closing this report won't help 
solve it. I can't reopen this.

___
Python tracker <[EMAIL PROTECTED]>

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