Opened 7 years ago
Closed 7 years ago
#6576 closed (invalid)
lxml.etree.tostring crashes after importing django.contrib.gis.db.models
Description
I know that sounds strange, but under the following conditions my python shell ends with a bus-errer:
- MacBookPro
- Mac OSX 10.5 - Leopard
- Python 2.5
- psycopg2, lxml2.0
- Revision 7104
/.../models.py
from django.contrib.gis.db import models
in the terminal
...$python manage.py shell Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from lxml import etree >>> etree.tostring(etree.Element('TEST')) Bus error
the only way to get this work is passing the unicode object as encoding keyword
>>> etree.tostring(etree.Element('TEST'),encoding=unicode)
Change History (1)
comment:1 Changed 7 years ago by jbronn
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to invalid
- Status changed from new to closed
Note: See TracTickets for help on using tickets.
I'm pretty sure this is lxml, and not GeoDjango related. I reproduced the bug; however I also reproduced it independently of any Django/GeoDjango installation. I use IPython, and I repeated the bug as follows:
(1) Invoke IPython, independently of Django/GeoDjango:
(2) Bug reproduced as follows
My guess is that IPython and Django both set up something unicode-wise that lxml doesn't like (remember lxml 2.0 is still in 'beta'). Thus, I'm marking this as invalid unless there I'm presented with some concrete evidence to the contrary.