Got undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString on OpenSuSE 11.1

2009-09-25 Thread Alejandro Valdez
Hello I sent this e-mail to the python-help list but I'm not sure if
that list is active... so I post it again here:

I'm trying to build Python 2.6.2 from the sources downloaded from the
python official site on OpenSuSE 11.1 (32 bit). After installation the
python command line interpreter seems to run ok, but when I try to
install setuptools I get:

u...@linux-ba2a:~/tmp bash setuptools-0.6c9-py2.6.egg
--install-dir=/home/user/python/lib/python2.6/site-packages/
Traceback (most recent call last):
 File string, line 1, in module
 File 
/home/user/tmp/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py,
line 15, in module
 File /home/user/tmp/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py,
line 1, in module
ImportError: /home/user/python/lib/python2.6/lib-dynload/operator.so:
undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString


To compile Python I executed:

./configure --prefix=/home/user/python
./make
./make install

The compile process seems to be ok, so I'm kind of clueless :-(

Any ideas?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Got undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString on OpenSuSE 11.1

2009-09-25 Thread Alejandro Valdez
Hello Mark, thank you a lot for your hints, I compiled python using
the --enable-unicode=ucs4 parameter in configure and I could
successfully install setuptools (Anyway I'm a little suspicious about
my compiled binaries...).

You are right about the environment variables, I have set PYTHONPATH
and PYTHONHOME to:
PYTHONPATH=$HOME/python/lib/python2.6/site-packages
PYTHONHOME=$HOME/python

The compiler issued some warnings, two of them (related to Unicode)
called my attention:

In file included from Python/formatter_unicode.c:13:
Python/../Objects/stringlib/formatter.h: In function
‘unknown_presentation_type’:
Python/../Objects/stringlib/formatter.h:35: warning: format ‘%c’
expects type ‘int’, but argument 3 has type ‘Py_UNICODE’

Should I ignore them?




Other warning messages:

libpython2.6.a(posixmodule.o): In function `posix_tmpnam':
/home/mailstat/Python-2.6.2/./Modules/posixmodule.c:7129: warning: the
use of `tmpnam_r' is dangerous, better use `mkstemp'
libpython2.6.a(posixmodule.o): In function `posix_tempnam':
/home/mailstat/Python-2.6.2/./Modules/posixmodule.c:7084: warning: the
use of `tempnam' is dangerous, better use `mkstemp'
/home/mailstat/Python-2.6.2/Modules/_struct.c:187: warning:
‘get_ulong’ defined but not used
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c: In function
‘PyCurses_getsyx’:
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c:1766: warning:
‘y’ may be used uninitialized in this function
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c:1766: warning:
‘x’ may be used uninitialized in this function

On Fri, Sep 25, 2009 at 3:56 PM, Mark Dickinson dicki...@gmail.com wrote:
 On Sep 25, 7:05 pm, Alejandro Valdez alejandro.val...@gmail.com
 wrote:
 Hello I sent this e-mail to the python-help list but I'm not sure if
 that list is active... so I post it again here:

 I'm trying to build Python 2.6.2 from the sources downloaded from the
 python official site on OpenSuSE 11.1 (32 bit). After installation the
 python command line interpreter seems to run ok, but when I try to
 install setuptools I get:
 [...]
 To compile Python I executed:

 ./configure --prefix=/home/user/python
 ./make
 ./make install

 The compile process seems to be ok, so I'm kind of clueless :-(

 Any ideas?

 This is just a guess, but try configuring with:

 ./configure --enable-unicode=ucs4 --prefix=/home/user/python

 On Linux, by default, a self-compiled Python uses UCS2
 internally for its unicode support (with some support
 for UTF16).  Most Linux distributions, however, distribute
 a Python that uses UCS4 (aka UTF32) instead, so it seems
 possible that your setuptools egg is expecting to find a
 UCS4 build.

 Mark
 --
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


How to modify the content of an email

2008-01-25 Thread alejandro . valdez
Hello, I'm trying to make a python script that take an email in (raw)
text format, and add a footer to the text (or html) body of the email.

I'm aware of the email and email.mime modules, but I can't figure out
how to identify 'the main text (or html) content' from the email, and
how to be sure that I don't incorrectly identify a txt (or html)
attach as the main content of the email.

By 'main text (or html) content' I mean the text (or html) that is
showed by a Mail User Agent when it display the email to the
recipient.

Thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list