Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\ua000' in position 0: ordinal not in range(128)

2015-01-14 Thread Dave Angel
$ ./main.py ꀀabcd޴ ~$ cat main.sh #!/usr/bin/env bash set -v ./main.py | xxd ./main_encode.py | xxd ~$ ./main.sh ./main.py | xxd Traceback (most recent call last): File "./main.py", line 4, in print u UnicodeEncodeError: 'ascii' codec can't encode character u&

UnicodeEncodeError: 'ascii' codec can't encode character u'\ua000' in position 0: ordinal not in range(128)

2015-01-13 Thread Peng Yu
y | xxd Traceback (most recent call last): File "./main.py", line 4, in print u UnicodeEncodeError: 'ascii' codec can't encode character u'\ua000' in position 0: ordinal not in range(128) ./main_encode.py | xxd 000: ea80 8061 6263 64de b40a

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

2013-11-27 Thread Terry Reedy
On 11/27/2013 7:37 AM, Tim Golden wrote: On 27/11/2013 08:31, Hoàng Tuấn Việt wrote: I cannot see your reply in python-list until I search this question on Internet again. (cc-ing the OP because of the nature of the problem) Viet, That's because you're not subscribed to the list. The way it

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

2013-11-27 Thread Tim Golden
On 27/11/2013 08:31, Hoàng Tuấn Việt wrote: > I cannot see your reply in python-list until I search this question > on Internet again. (cc-ing the OP because of the nature of the problem) Viet, That's because you're not subscribed to the list. The way it works is that you subscribe to the list a

RE: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

2013-11-27 Thread Hoàng Tuấn Việt
Hi Fabio, I cannot see your reply in python-list until I search this question on Internet again. I try (username.encode('utf-8') + '\r') and the problem is fixed. Thank you very much. Viet >You should be able to reproduce the same behavior on PyDev if in your run >configuratio

Re: UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128)

2013-11-18 Thread Colin J. Williams
/], } }, console = [{/'script'/: /‘my_program.py'/}] ) and run the programe, I encounter this error: UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128) at line: connection.write(username + &

Re: UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128)

2013-11-18 Thread Fabio Zadrozny
t; > setup( > > options = { > > *"py2exe"*:{ > > *"packages"*: [*'wx.lib.pubsub'*], > > *"dll_excludes"*: [*"MSVCP90.dll"*, *"HID.DLL"*, > *"w9xpopen.e

Re: UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128)

2013-11-18 Thread Terry Reedy
On 11/17/2013 11:55 PM, Hoàng Tuấn Việt wrote: Hi I use Python telnetlib on Windows 7 32 bit. Here is my code: To better help us help you, what exact version of Python? Please post plain text without html. Please post programs single spaced with just occasional blank lines. -- Terry Jan Reed

UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128)

2013-11-18 Thread Hoàng Tuấn Việt
quot;], } }, console = [{'script': ‘my_program.py'}] ) and run the programe, I encounter this error: UnicodeDecodeError: 'ascii' codec can't decodee byte 0xff in position 0: ordinal not in range(128) at line: connection.write(username + '\r&#x

Re: 'ascii' codec can't encode character u'\xe4' in position 4: ordinal not in range(128)

2009-11-08 Thread Ben Finney
balavignesh writes: > Whats the wrong in my code? Without seeing your code, all we could do is guess, poorly. Far better would be if you can construct a very small example, one that you post here so any reader here could run it, that demonstrates the behaviour you want explained. Don't forget t

'ascii' codec can't encode character u'\xe4' in position 4: ordinal not in range(128)

2009-11-08 Thread balavignesh
Hello friends, I am using pyWPS + GRASS to generate the maps for the given request XML. As my requestxml contains scandinavian letters , i got the following error, " 'ascii' codec can't encode character u'\xe4' in position 4: ordinal not in ra

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-18 Thread akhil1988
> decoding. So, if you know your source is always utf-8, try > something like: > > import sys > import io > > sys.stdin = io.TextIOWrapper(sys.stdin.detach(), encoding='utf8') > > for line in sys.stdin: > line = lin

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-18 Thread akhil1988
t; > -- > http://mail.python.org/mailman/listinfo/python-list > > -- View this message in context: http://www.nabble.com/UnicodeEncodeError%3A-%27ascii%27-codec-can%27t-encode-character-u%27%5Cxb7%27-in-position-13%3A-ordinal-not-in-range%28128%29-tp24509879p24550497.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-17 Thread Scott David Daniels
akhil1988 wrote: > Nobody-38 wrote: On Thu, 16 Jul 2009 15:43:37 -0700, akhil1988 wrote: ... In Python 3 you can't decode strings because they are Unicode strings and it doesn't make sense to decode a Unicode string. You can only decode encoded things which are byte strings. So you are mixing

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-17 Thread Piet van Oostrum
> akhil1988 (a) wrote: >a> Well, you were write: unintentionally I removed strip(). But the problem >does >a> not ends here: >a> I get this error now: >a> File "./temp.py", line 488, in >a> main() >a> File "./temp.py", line 475, in main >a> for line in sys.stdin: >a> File "/u

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-17 Thread Nobody
On Thu, 16 Jul 2009 20:26:39 -0700, akhil1988 wrote: > Well, you were write: unintentionally I removed strip(). But the problem does > not ends here: > > I get this error now: > > File "./temp.py", line 488, in > main() > File "./temp.py", line 475, in main > for line in sys.stdin: >

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
e >> elsif #do something here >> >> If I remove the decode statement, line == '' never gets true. > > Did you inadvertently remove the strip() as well? > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- View this

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread Nobody
On Thu, 16 Jul 2009 15:43:37 -0700, akhil1988 wrote: >> In Python 3 you can't decode strings because they are Unicode strings >> and it doesn't make sense to decode a Unicode string. You can only >> decode encoded things which are byte strings. So you are mixing up byte >> strings and Unicode stri

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
ncoded things which are byte strings. So you are mixing up byte > strings and Unicode strings. > -- > Piet van Oostrum > URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] > Private email: p...@vanoostrum.org > -- > http://mail.python.org/mailman/listinfo/python-list &g

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread Piet van Oostrum
> akhil1988 (a) wrote: >a> ok! >a> I got the indentation errors fixed. Bu I get another error: >a> Traceback (most recent call last): >a> File "./temp.py", line 484, in >a> main() >a> File "./temp.py", line 476, in main >a> line.decode('utf-8').strip() >a> AttributeError: 'str'

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
ow how it goes. >> -- >> http://mail.python.org/mailman/listinfo/python-list >> >> > > -- View this message in context: http://www.nabble.com/UnicodeEncodeError%3A-%27ascii%27-codec-can%27t-encode-character-u%27%5Cxb7%27-in-position-13%3A-ordinal-not-in-range%28128%29-tp24509879p24523113.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
code you're using > entirely. Let us know how it goes. > -- > http://mail.python.org/mailman/listinfo/python-list > > -- View this message in context: http://www.nabble.com/UnicodeEncodeError%3A-%27ascii%27-codec-can%27t-encode-character-u%27%5Cxb7%27-in-position-13%3A-o

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread John Machin
On Jul 16, 9:04 pm, akhil1988 wrote: > Please click reply on the post and then read this reply in the editor. > Actually, some sequences have been replaced to their graphical form when > this post is published. So the python code is being displayed, what actually > it is not. What editor? I guess

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread Max Erickson
akhil1988 wrote: > > akhil1988 wrote: >> >> I have switched to python 3.1 , but now I am getting some syntax >> errors in the code: >> >> File "./customWikiExtractor.py", line 81 >> __char_entities = {' ' :u'\u00A0', '¡' >> :u'\u00A1', >> '¢':u'\u00A2', >>

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread alex23
On Jul 16, 9:00 pm, akhil1988 wrote: > I have switched to python 3.1 , but now I am getting some syntax errors in > the code: Python 3.x was a major release that endeavoured to clean up a number of lingering issues with the language, the upshot being that it isn't entirely backwards compatible wi

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
00B6', > '·' :u'\u00B7', > '¸' :u'\u00B8', '¹' :u'\u00B9', > 'º':u'\u00BA',} > > --Akhil > > > John Nagle-2 wrote: >> >> akhil1988 wrote

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread akhil1988
u'\u00B8', '¹' :u'\u00B9', 'º':u'\u00BA',} --Akhil John Nagle-2 wrote: > > akhil1988 wrote: >> Sorry, it is sgmllib.py and not sgmmlib.py > > Oh, that bug again. See > > http://bugs.python.org/issue1651995

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread Piet van Oostrum
ates on 'line', on which I use line = >a> line.decode('utf-8') as 'line' is read as bytes from a stream. >a> And if I use line = line.encode('utf-8'), >a> I start getting other error like >a> UnicodeDecodeError: 'ascii' code

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-16 Thread John Nagle
akhil1988 wrote: Sorry, it is sgmllib.py and not sgmmlib.py Oh, that bug again. See http://bugs.python.org/issue1651995 It's a bug in SGMLParser. When Python 2.5 restricted ASCII to 0..127, SGMLParser needed to be modified, but wasn't. I reported that bug in February 2007. It w

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread akhil1988
ine' is read as bytes from a stream. And if I use line = line.encode('utf-8'), I start getting other error like UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4561: ordinal not in range(128) at line = line.replace('<<', u'«').r

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread Chris Rebert
> Chris Rebert-6 wrote: >> >> On Wed, Jul 15, 2009 at 9:34 PM, akhil1988 wrote: >>> >>> Hi! >>> >>> Can anyone please help me getting rid of this error: >>> UnicodeEncodeError: 'ascii' codec can't encode character u'\

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread akhil1988
; print >> sys.stdout, 'line: %s' % line > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in > position 13: ordinal not in range(128) > > I am giving a string to the python code as input, and python processes it > like this: > > li

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread akhil1988
Well, All I get is this traceback: File "./customWikiExtractor.py", line 492, in ? main() File "./customWikiExtractor.py", line 480, in main print >> sys.stdout, 'line: %s' % line UnicodeEncodeError: 'ascii' codec can't encode charact

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread Chris Rebert
On Wed, Jul 15, 2009 at 9:34 PM, akhil1988 wrote: > > Hi! > > Can anyone please help me getting rid of this error: > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position > 13: ordinal not in range(128) > > I am not a python

UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128)

2009-07-15 Thread akhil1988
Hi! Can anyone please help me getting rid of this error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 13: ordinal not in range(128) I am not a python programmer (though intend to start learning this wonderful language), I am just usin

Re: ordinal not in range

2009-03-02 Thread Jaap van Wingerde
Stefan Behnel wrote: >> Jaap van Wingerde wrote: >> outfile = codecs.open(output, "w", "utf_8") > I guess you mixed up the case here. > Does this help? > outfile = codecs.open(output, "wb", encoding="UTF-8") According to the Python "Codec registry an base classes"

Re: ordinal not in range

2009-02-21 Thread Jaap van Wingerde
Stefan Behnel wrote: Omschrijving = Omschrijving.replace(u"priv?", u'privé') (mind the u"...") outfile = codecs.open(output, "wb", encoding="UTF-8") (mind the "wb" for 'write binary/bytes') It works now! Looks like you'd be happier with Python 3.0, BTW... Python 3 is not in De

Re: ordinal not in range

2009-02-21 Thread Stefan Behnel
t; outfile.write (Omschrijving) > File "/usr/lib/python2.5/codecs.py", line 638, in write > return self.writer.write(data) > File "/usr/lib/python2.5/codecs.py", line 303, in write > data, consumed = self.encode(object, self.errors) > UnicodeDecodeError

ordinal not in range

2009-02-21 Thread Jaap van Wingerde
most recent call last): File "/home/jaap/Desktop/unicode.py", line 9, in outfile.write (Omschrijving) File "/usr/lib/python2.5/codecs.py", line 638, in write return self.writer.write(data) File "/usr/lib/python2.5/codecs.py", line 303, in write da

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128)

2005-11-06 Thread Diez B. Roggisch
> I would've thought that the 'b' option meant I can write any binary > code I like to the file, > but that's not so? You can. But if you write a unicode-object (wich is an abstract data type with no byte representation), it has to be converted to a string - which you have to do either explicit.

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' inposition 99: ordinal not in range(128)

2005-11-06 Thread Fredrik Lundh
tNote > File "points.pyc", line 151, in setNote > File "point.pyc", line 100, in writeNote > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in > position 99: ordinal not in range(128) > > The piece of code in

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128)

2005-11-06 Thread Francach
e 151, in setNote File "point.pyc", line 100, in writeNote UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128) The piece of code involved is: noteFileObj = open(noteFile, "wb") noteFil