Re: simultaneous multiple requests to very simple database

2005-01-18 Thread Ricardo Bugalho
On Tue, 18 Jan 2005 17:33:26 -0500, Eric S. Johansson wrote:

> When I look at databases, I see a bunch of very good solutions that are
> either overly complex or heavyweight on one hand and very nice and simple
> but unable to deal with concurrency on the other.  two sets of point
> solutions that try to stretch themselves and the developers to fit other
> application contexts.
> 

Have you considerded SQLite/pySQLite ?

-- 
Ricardo

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


Re: Unicode conversion in 'print'

2005-01-13 Thread Ricardo Bugalho
Hi, 
 thanks for the information. But what I was really looking for was
informaion on when and why Python started doing it (previously, it always
used sys.getdefaultencoding())) and why it was done only for 'print' when
stdout is a terminal instead of always.

On Thu, 13 Jan 2005 14:33:20 -0800, Serge Orlov wrote:

> Sure. It uses the encoding of you console. Here is explanation why it uses
> locale to get the encoding of console:
> http://www.python.org/moin/PrintFails
> 
-- 
Ricardo

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


Unicode conversion in 'print'

2005-01-13 Thread Ricardo Bugalho
Hello,
 I'm using Python 2.3.4 and I noticed that, when stdout is a terminal, the
'print' statement converts Unicode strings into the encoding defined by
the locales instead of the one returned by sys.getdefaultencoding().
However, I can't find any references to it. Anyone knows where it's
descrbed?

Example:

!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, locale

print 'Python encoding:', sys.getdefaultencoding()
print 'System encoding:', locale.getpreferredencoding()
print 'Test string: ', u'Olà mundo'


If stdout is a terminal, works fine
$ python x.py
Python encoding: ascii
System encoding: UTF-8
Test string:  Olà mundo

If I redirect the output to a file, raises an UnicodeEncodeError exception
$ python x.py > x.txt
Traceback (most recent call last):
  File "x.py", line 8, in ?
print 'Test string: ', u'Olà mundo'
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 2: 
ordinal not in range(128)


-- 
Ricardo

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