Re: the stupid encoding problem to stdout

2011-06-13 Thread Sérgio Monteiro Basto
Ian Kelly wrote: > If you want your output to behave that way, then all you have to do is > specify that with an explicit encode step. ok >> If we want we change default for whatever we want, but without this >> "default change" Python should not change his behavior depending on >> output. yeah

Re: the stupid encoding problem to stdout

2011-06-10 Thread Sérgio Monteiro Basto
Ben Finney wrote: >> > What should it decode to, then? >> >> UTF-8, as in tty > > But when you explicitly redirect to a file, it's not going to a TTY. > It's going to a file whose encoding isn't known unless you specify it. ok after thinking about this, this problem exist because Python want be

Re: the stupid encoding problem to stdout

2011-06-09 Thread Sérgio Monteiro Basto
Ben Finney wrote: >> >> Exactly the opposite , if python don't know the encoding should not >> >> try decode to ASCII. > > Are you advocating that Python should refuse to write characters unless > the encoding is specified? I could sympathise with that, but currently > that's not what Python does

Re: the stupid encoding problem to stdout

2011-06-09 Thread Sérgio Monteiro Basto
Mark Tolonen wrote: > > "Sérgio Monteiro Basto" wrote in message > news:4df137a7$0$30580$a729d...@news.telepac.pt... > >> How I change sys.stdout.encoding always to UTF-8 ? at least have a >> consistent sys.stdout.encoding > > There is an environment va

Re: the stupid encoding problem to stdout

2011-06-09 Thread Sérgio Monteiro Basto
Nobody wrote: >> Exactly the opposite , if python don't know the encoding should not try >> decode to ASCII. > > What should it decode to, then? UTF-8, as in tty, how I change this default ? > You can't write characters to a stream, only bytes. > ok got the point . Thanks, -- http://mail.p

Re: the stupid encoding problem to stdout

2011-06-09 Thread Sérgio Monteiro Basto
Ben Finney wrote: > Sérgio Monteiro Basto writes: > >> ./test.py >> moçambique >> moçambique > > In this case your terminal is reporting its encoding to Python, and it's > capable of taking the UTF-8 data that you send to it in both cases. > >> .

Re: the stupid encoding problem to stdout

2011-06-09 Thread Sérgio Monteiro Basto
Benjamin Kaplan wrote: > 2011/6/8 Sérgio Monteiro Basto : >> hi, >> cat test.py >> #!/usr/bin/env python >> #-*- coding: utf-8 -*- >> u = u'moçambique' >> print u.encode("utf-8") >> print u >> >> chmod +x test.py >&

the stupid encoding problem to stdout

2011-06-08 Thread Sérgio Monteiro Basto
hi, cat test.py #!/usr/bin/env python #-*- coding: utf-8 -*- u = u'moçambique' print u.encode("utf-8") print u chmod +x test.py ./test.py moçambique moçambique ./test.py > output.txt Traceback (most recent call last): File "./test.py", line 5, in print u UnicodeEncodeError: 'ascii' codec

Re: lxml 2.2.4 for Python 2.6

2009-11-24 Thread Sérgio Monteiro Basto
Hi, Srijit Kumar Bhadra wrote: > Is there any reason why lxml-2.2.4-py2.6-win32.egg (md5) or > lxml-2.2.4.win32-py2.6.exe is not available? > > Best regards, > /Srijit maybe ask on lxml Mailing List , should be more appropriated Sérgio M. B. -- http://mail.python.org/mailman/listinfo/python

Re: [repost please help me] python setup.py build for 32-bits on x86_64 machine

2009-11-23 Thread Sérgio Monteiro Basto
Diez B. Roggisch wrote: > Sérgio Monteiro Basto schrieb: >> Diez B. Roggisch wrote: >> >> Hi, Thanks, >>> Sérgio Monteiro Basto wrote: >>> >>>> Hi, >>>> I am in x86_64 arch , but I need >>>> compile things on 32 bits wit

Re: [repost please help me] python setup.py build for 32-bits on x86_64 machine

2009-11-23 Thread Sérgio Monteiro Basto
Diez B. Roggisch wrote: Hi, Thanks, > Sérgio Monteiro Basto wrote: > >> Hi, >> I am in x86_64 arch , but I need >> compile things on 32 bits with >> python setup.py build >> >> Can't change the fact that distutils creates x86_64 >> director

[repost please help me] python setup.py build for 32-bits on x86_64 machine

2009-11-23 Thread Sérgio Monteiro Basto
Hi, I am in x86_64 arch , but I need compile things on 32 bits with python setup.py build Can't change the fact that distutils creates x86_64 directories: build/temp.linux-x86_64-2.3/ Also if I try with a python compile in 32bits and installed in system . how I force distutils build to 32-bi

python setup.py build 32-bits on x86_64 machine

2009-11-21 Thread Sérgio Monteiro Basto
Hi, I am in x86_64 arch , but I need compile things on 32 bits. python setup.py build Can't change the fact that distutils creates x86_64 directories: gcc -pthread -shared build/temp.linux-x86_64-2.3/ Also if I try with a python compile in 32bits and installed in system . how I force distuti

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-19 Thread Sérgio Monteiro Basto
Stefan Behnel wrote: > Sérgio Monteiro Basto wrote: >> but is one single error that blocks this. >> Finally I found it , it is : >> > if I put : >> > >> p = re.compile('"align') >> content = p.sub('" align', content) >

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-19 Thread Sérgio Monteiro Basto
First, sorry about the mess, let see if kontact works better with newsgroups. Marc 'BlackJack' Rintsch wrote: >> ok but my problem is not understand what is the specific problem at line >> 1173 > > You can't just look at that line and ignore the rest.  There are 604 (!) > errors, some about tabl