Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-21 Thread Marko Rauhamaa
pjmcle...@gmail.com: > not sure why utf-8 gives an error when thats the most wide all caracters > inclusive right?/ Not all sequences of bytes are legal in UTF-8. For example, >>> b'\x80'.decode("utf-8") Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'u

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-21 Thread pjmclenon
On Saturday, October 20, 2018 at 1:23:50 PM UTC-4, Terry Reedy wrote: > On 10/20/2018 8:24 AM, pjmcle...@gmail.com wrote: > > On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > > > i have a sort of decode error > > UnicodeDecodeError; 'utf-8' can't decode byte 0xb0 in position 83064:

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-21 Thread pjmclenon
On Thursday, January 29, 2009 at 11:24:46 AM UTC-5, Anjanesh Lekshminarayanan wrote: > Im reading a file. But there seems to be some encoding error. > > >>> f = open(filename) > >>> data = f.read() > Traceback (most recent call last): > File "", line 1, in > data = f.read() > File "C:\Py

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-20 Thread Terry Reedy
On 10/20/2018 8:24 AM, pjmcle...@gmail.com wrote: On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: i have a sort of decode error UnicodeDecodeError; 'utf-8' can't decode byte 0xb0 in position 83064: invalid start byte * and it seems to refer to my code line:

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-20 Thread MRAB
On 2018-10-20 13:47, Peter J. Holzer wrote: On 2018-10-20 05:24:37 -0700, pjmcle...@gmail.com wrote: On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > with open(join("docs", path), encoding="utf-8") as f: hello MRAB and google forum I feel somewhat excluded by this salutaton, a

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-20 Thread Peter J. Holzer
On 2018-10-20 05:24:37 -0700, pjmcle...@gmail.com wrote: > On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > > with open(join("docs", path), encoding="utf-8") as f: > > hello MRAB and google forum I feel somewhat excluded by this salutaton, as I'm not MRAB and I don't read this on

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-20 Thread pjmclenon
On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > On 2018-10-14 00:13, pjmcle...@gmail.com wrote: > > On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > >> ​> 1st is this script is from a library module online open source > >> > >> If it's open source, why didn't

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-15 Thread pjmclenon
On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > On 2018-10-14 00:13, pjmcle...@gmail.com wrote: > > On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > >> ​> 1st is this script is from a library module online open source > >> > >> If it's open source, why didn't

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-13 Thread MRAB
On 2018-10-14 00:13, pjmcle...@gmail.com wrote: On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: ​> 1st is this script is from a library module online open source If it's open source, why didn't you show the link to the soruce? I assume your code is this: https://github.com/

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-13 Thread pjmclenon
On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > ​> 1st is this script is from a library module online open source > > If it's open source, why didn't you show the link to the soruce? > I assume your code is this: > > https://github.com/siddharth2010/String-Search/blob/6770c7

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-05 Thread pjmclenon
On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > ​> 1st is this script is from a library module online open source > > If it's open source, why didn't you show the link to the soruce? > I assume your code is this: > > https://github.com/siddharth2010/String-Search/blob/6770c7

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread pjmclenon
On Thursday, August 30, 2018 at 2:05:16 PM UTC-4, pjmc...@gmail.com wrote: > On Thursday, August 30, 2018 at 1:29:48 PM UTC-4, MRAB wrote: > > On 2018-08-30 17:57, pjmcle...@gmail.com wrote: > > > On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote: > > >> On Thu, 30 Aug 2018 05

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread pjmclenon
On Thursday, August 30, 2018 at 1:29:48 PM UTC-4, MRAB wrote: > On 2018-08-30 17:57, pjmcle...@gmail.com wrote: > > On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote: > >> On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote: > >> > >> > my question is ... at the moment i can

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread MRAB
On 2018-08-30 17:57, pjmcle...@gmail.com wrote: On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote: On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote: > my question is ... at the moment i can only run it on windows cmd prompt > with a multiple line entry as so:: > > pyth

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread pjmclenon
On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote: > On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote: > > > my question is ... at the moment i can only run it on windows cmd prompt > > with a multiple line entry as so:: > > > > python createIndex_tfidf.py stopWords.dat t

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread Steven D'Aprano
On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote: > my question is ... at the moment i can only run it on windows cmd prompt > with a multiple line entry as so:: > > python createIndex_tfidf.py stopWords.dat testCollection.dat > testIndex.dat titleIndex.dat > > and then to query and use the n

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread pjmclenon
On Thursday, August 30, 2018 at 8:21:47 AM UTC-4, pjmc...@gmail.com wrote: > On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > > ​> 1st is this script is from a library module online open source > > > > If it's open source, why didn't you show the link to the soruce? > > I assu

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread pjmclenon
On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > ​> 1st is this script is from a library module online open source > > If it's open source, why didn't you show the link to the soruce? > I assume your code is this: > > https://github.com/siddharth2010/String-Search/blob/6770c7

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread bellcanadardp
On Wednesday, 13 June 2018 09:12:32 UTC-4, Steven D'Aprano wrote: > On Wed, 13 Jun 2018 03:55:58 -0700, bellcanadardp wrote: > > > the collFile has to be like a variable that would refer to the file > > Collection.dat..thats my best guess also in the error line , it doesnt > > actually open the f

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread bellcanadardp
On Wednesday, 13 June 2018 07:14:06 UTC-4, INADA Naoki wrote: > ​> 1st is this script is from a library module online open source > > If it's open source, why didn't you show the link to the soruce? > I assume your code is this: > > https://github.com/siddharth2010/String-Search/blob/6770c7a1e81

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread Steven D'Aprano
On Wed, 13 Jun 2018 03:55:58 -0700, bellcanadardp wrote: > the collFile has to be like a variable that would refer to the file > Collection.dat..thats my best guess also in the error line , it doesnt > actually open the file ... The file has to be opened if you are reading from it. If it isn't op

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread Steven D'Aprano
On Wed, 13 Jun 2018 04:01:24 -0700, bellcanadardp wrote: > for line in self.collFile.decode("utf-8"): > i actually write.encode...then i tried the decode but both dont have any > effect Raising AttributeError isn't an effect? py> f = open("/tmp/x") py> f.write.decode Traceback (most recent call

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread INADA Naoki
​> 1st is this script is from a library module online open source If it's open source, why didn't you show the link to the soruce? I assume your code is this: https://github.com/siddharth2010/String-Search/blob/6770c7a1e811a5d812e7f9f7c5c83a12e5b28877/createIndex.py And self.collFile is opened h

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread bellcanadardp
On Sunday, 10 June 2018 17:29:59 UTC-4, Cameron Simpson wrote: > On 10Jun2018 13:04, bellcanada...@gmail.com wrote: > >here is the full error once again > >to summarize, my script works fine in python2 > >i get this error trying to run it in python3 > >plz see below after the error, my settings f

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-13 Thread bellcanadardp
On Sunday, 10 June 2018 17:29:59 UTC-4, Cameron Simpson wrote: > On 10Jun2018 13:04, bellcanada...@gmail.com wrote: > >here is the full error once again > >to summarize, my script works fine in python2 > >i get this error trying to run it in python3 > >plz see below after the error, my settings f

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread bellcanadardp
On Sunday, 10 June 2018 17:29:59 UTC-4, Cameron Simpson wrote: > On 10Jun2018 13:04, bellcanada...@gmail.com wrote: > >here is the full error once again > >to summarize, my script works fine in python2 > >i get this error trying to run it in python3 > >plz see below after the error, my settings f

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread Cameron Simpson
On 10Jun2018 13:04, bellcanada...@gmail.com wrote: here is the full error once again to summarize, my script works fine in python2 i get this error trying to run it in python3 plz see below after the error, my settings for python 2 and python 3 for me it seems i need to change some settings to '

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread Chris Angelico
On Mon, Jun 11, 2018 at 2:49 AM, wrote: > > excuse but sorry > i took the time to manually write the code error from the traceback as you > said > and thats because i cant seem to find a way to attach files here..which would > make it so easier for me and also i could attach snippets of the act

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread bellcanadardp
On Friday, 8 June 2018 18:26:28 UTC-4, Cameron Simpson wrote: > On 05Jun2018 06:42, bellcanada...@gmail.com wrote: > >On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano wrote: > >> Don't retype a summary of what you think the error is. "character > >> undefieed" is not a thing, and there is

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread bellcanadardp
On Sunday, 10 June 2018 10:23:47 UTC-4, Steven D'Aprano wrote: > Do you enjoy wasting your own time (as well as ours) by failing to follow > instructions? > > We can't read your mind to see the code you are using, and I am getting > frustrated from telling you the same thing again and again. >

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread Steven D'Aprano
Do you enjoy wasting your own time (as well as ours) by failing to follow instructions? We can't read your mind to see the code you are using, and I am getting frustrated from telling you the same thing again and again. PLEASE PLEASE PLEASE PLEASE help us to help you. Start by reading this: h

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-10 Thread bellcanadardp
On Friday, 8 June 2018 07:42:34 UTC-4, Steven D'Aprano wrote: > On Fri, 08 Jun 2018 03:35:12 -0700, bellcanadardp wrote: > > > hello steven are you there?? > > i posted the full error message... > > No you didn't. > > I saw your post, and ignored it, because you didn't follow instructions. > I

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Steven D'Aprano
On Sat, 09 Jun 2018 08:26:10 +1000, Cameron Simpson wrote: > It is possible that Python 2 is just glossing over the problem; Python 3 > has a more rigorous view of character data. I would say that is more than just possible, it is almost certain. -- Steven D'Aprano "Ever since I learned about

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Cameron Simpson
On 05Jun2018 06:42, bellcanada...@gmail.com wrote: On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano wrote: Don't retype a summary of what you think the error is. "character undefieed" is not a thing, and there is no such thing as "byte 1x09". You need to COPY AND PASTE the EXACT error t

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Steven D'Aprano
On Fri, 08 Jun 2018 03:35:12 -0700, bellcanadardp wrote: > hello steven are you there?? > i posted the full error message... No you didn't. I saw your post, and ignored it, because you didn't follow instructions. I told you we need to see the *full* traceback, starting from the line beginning

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread bellcanadardp
On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano wrote: > On Sun, 03 Jun 2018 16:36:12 -0700, bellcanadardp wrote: > > > hello peter ...how exactly would i solve this issue .i have a script > > that works in python 2 but not pytho3..i did 2 to 3.py ...but i still > > get the errro...cha

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-05 Thread bellcanadardp
On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano wrote: > On Sun, 03 Jun 2018 16:36:12 -0700, bellcanadardp wrote: > > > hello peter ...how exactly would i solve this issue .i have a script > > that works in python 2 but not pytho3..i did 2 to 3.py ...but i still > > get the errro...cha

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-04 Thread Peter J. Holzer
On 2018-06-03 16:36:12 -0700, bellcanada...@gmail.com wrote: > On Tuesday, 22 May 2018 17:23:55 UTC-4, Peter J. Holzer wrote: > > On 2018-05-20 15:43:54 +0200, Karsten Hilbert wrote: > > > On Sun, May 20, 2018 at 04:59:12AM -0700, bellcanada...@gmail.com wrote: > > > > thank you for the reply, but

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-03 Thread Steven D'Aprano
On Sun, 03 Jun 2018 16:36:12 -0700, bellcanadardp wrote: > hello peter ...how exactly would i solve this issue .i have a script > that works in python 2 but not pytho3..i did 2 to 3.py ...but i still > get the errro...character undefieed..unicode decode error cant decode > byte 1x09 in line 74

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-03 Thread bellcanadardp
On Tuesday, 22 May 2018 17:23:55 UTC-4, Peter J. Holzer wrote: > On 2018-05-20 15:43:54 +0200, Karsten Hilbert wrote: > > On Sun, May 20, 2018 at 04:59:12AM -0700, bellcanada...@gmail.com wrote: > > > > > On Saturday, 19 May 2018 19:48:20 UTC-4, Skip Montanaro wrote: > > > > As Chris indicated,

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-30 Thread Peter J. Holzer
On 2018-05-29 16:20:36 +, Steven D'Aprano wrote: > On Tue, 29 May 2018 14:04:19 +0200, Peter J. Holzer wrote: > > > The OP has one file. > > We don't know that. All we know is that he had one file which he was > unable to read. For all we know, he has a million files, and this was > merely

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Steven D'Aprano
On Tue, 29 May 2018 14:04:19 +0200, Peter J. Holzer wrote: > The OP has one file. We don't know that. All we know is that he had one file which he was unable to read. For all we know, he has a million files, and this was merely the first of many failures. > He wants to read it. The very fact

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Steven D'Aprano
On Tue, 29 May 2018 10:34:50 +0200, Peter J. Holzer wrote: > On 2018-05-23 06:03:38 +, Steven D'Aprano wrote: >> On Wed, 23 May 2018 00:31:03 +0200, Peter J. Holzer wrote: >> > On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: >> >> You can find an encoding which is capable of decoding a fil

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-29 21:13:43 +1000, Chris Angelico wrote: > You can always solve a subset of problems. Using your own knowledge of > German, you are able to better solve problems involving German text. > But that doesn't make you any better than chardet at validating > Chinese text, or Korean text, or Kl

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Chris Angelico
On Tue, May 29, 2018 at 8:59 PM, Peter J. Holzer wrote: > On 2018-05-29 20:28:54 +1000, Chris Angelico wrote: >> Sure, but you're describing a set of rules. If you can define a set of >> rules that pin down the encoding, you could teach chardet to follow >> those rules. If you can't teach chardet

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-29 20:28:54 +1000, Chris Angelico wrote: > On Tue, May 29, 2018 at 8:09 PM, Peter J. Holzer wrote: > > On 2018-05-29 19:46:24 +1000, Chris Angelico wrote: > >> That's basically what the chardet module does, and its error rate is > >> far FAR higher than that. If you think it's easy to d

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Chris Angelico
On Tue, May 29, 2018 at 8:09 PM, Peter J. Holzer wrote: > On 2018-05-29 19:46:24 +1000, Chris Angelico wrote: >> On Tue, May 29, 2018 at 6:15 PM, Peter J. Holzer wrote: >> > So if the text is German it will contain more words with >> > umlauts and each byte which is part of a correctly spelled Ge

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-29 19:47:37 +1000, Chris Angelico wrote: > On Tue, May 29, 2018 at 6:34 PM, Peter J. Holzer wrote: > > On 2018-05-23 06:03:38 +, Steven D'Aprano wrote: > >> Mojibake is especially difficult to deal with when you are dealing with > >> short text snippets like file names or user names

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-29 19:46:24 +1000, Chris Angelico wrote: > On Tue, May 29, 2018 at 6:15 PM, Peter J. Holzer wrote: > > So if the text is German it will contain more words with > > umlauts and each byte which is part of a correctly spelled German word > > when interpreted according to ISO-8859-1 increas

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Chris Angelico
On Tue, May 29, 2018 at 6:34 PM, Peter J. Holzer wrote: > On 2018-05-23 06:03:38 +, Steven D'Aprano wrote: >> Mojibake is especially difficult to deal with when you are dealing with >> short text snippets like file names or user names which can contain >> arbitrary characters, where there is r

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Chris Angelico
On Tue, May 29, 2018 at 6:15 PM, Peter J. Holzer wrote: > So if the text is German it will contain more words with > umlauts and each byte which is part of a correctly spelled German word > when interpreted according to ISO-8859-1 increases the probability that > decoding with ISO-8859-1 will prod

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-23 06:03:38 +, Steven D'Aprano wrote: > On Wed, 23 May 2018 00:31:03 +0200, Peter J. Holzer wrote: > > On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: > >> You can find an encoding which is capable of decoding a file. That's > >> not the same thing. > > > > If the result is corr

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-29 Thread Peter J. Holzer
On 2018-05-23 08:43:02 +1000, Chris Angelico wrote: > On Wed, May 23, 2018 at 8:31 AM, Peter J. Holzer wrote: > > On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: > >> > 1) For any given file it is almost always possible to find the correct > >> >encoding (or *a* correct encoding, as there

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-23 Thread Chris Angelico
On Thu, May 24, 2018 at 6:48 AM, Dan Stromberg wrote: > On Sat, May 19, 2018 at 3:58 PM, wrote: >> On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan >> wrote: >>> > It does auto-detect it as cp1252- look at the files in the traceback and >>> > you'll see lib\encodings\cp12

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-23 Thread Dan Stromberg
On Sat, May 19, 2018 at 3:58 PM, wrote: > On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote: >> > It does auto-detect it as cp1252- look at the files in the traceback and >> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong >> > encoding, try ope

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-22 Thread Steven D'Aprano
On Wed, 23 May 2018 00:31:03 +0200, Peter J. Holzer wrote: > On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: [...] >> You can find an encoding which is capable of decoding a file. That's >> not the same thing. > > If the result is correct, it is the same thing. But how do you know what is co

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-22 Thread Chris Angelico
On Wed, May 23, 2018 at 8:31 AM, Peter J. Holzer wrote: > On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: >> On Wed, May 23, 2018 at 7:23 AM, Peter J. Holzer wrote: >> >> The best you can do is to go ask the canonical source of the >> >> file what encoding the file is _supposed_ to be in. >>

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-22 Thread Peter J. Holzer
On 2018-05-23 07:38:27 +1000, Chris Angelico wrote: > On Wed, May 23, 2018 at 7:23 AM, Peter J. Holzer wrote: > >> The best you can do is to go ask the canonical source of the > >> file what encoding the file is _supposed_ to be in. > > > > I disagree on both counts. > > > > 1) For any given file

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-22 Thread Chris Angelico
On Wed, May 23, 2018 at 7:23 AM, Peter J. Holzer wrote: >> The best you can do is to go ask the canonical source of the >> file what encoding the file is _supposed_ to be in. > > I disagree on both counts. > > 1) For any given file it is almost always possible to find the correct >encoding (or

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-22 Thread Peter J. Holzer
On 2018-05-20 15:43:54 +0200, Karsten Hilbert wrote: > On Sun, May 20, 2018 at 04:59:12AM -0700, bellcanada...@gmail.com wrote: > > > On Saturday, 19 May 2018 19:48:20 UTC-4, Skip Montanaro wrote: > > > As Chris indicated, you'll have to figure out the correct encoding. You > > > might want to ch

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread bellcanadardp
On Sunday, 20 May 2018 08:58:32 UTC-4, Richard Damon wrote: > On 5/20/18 7:59 AM, bellcanada...@gmail.com wrote: > > On Saturday, 19 May 2018 19:03:09 UTC-4, Chris Angelico wrote: > >> On Sun, May 20, 2018 at 8:58 AM, wrote: > >>> On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminar

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread Karsten Hilbert
On Sun, May 20, 2018 at 04:59:12AM -0700, bellcanada...@gmail.com wrote: > On Saturday, 19 May 2018 19:48:20 UTC-4, Skip Montanaro wrote: > > As Chris indicated, you'll have to figure out the correct encoding. You > > might want to check out the chardet module (available on PyPI, I believe) > > a

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread Skip Montanaro
> how exactly am i supposed to find oout what is the correct encodeing? It seems you are a Python beginner. Rather than just tell you how to use this one module, I'll point you at some of the ways to get help through Python. * On pypi.org, search for "chardet" and see if the author provided onlin

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread Richard Damon
On 5/20/18 7:59 AM, bellcanada...@gmail.com wrote: > On Saturday, 19 May 2018 19:03:09 UTC-4, Chris Angelico wrote: >> On Sun, May 20, 2018 at 8:58 AM, wrote: >>> On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan >>> wrote: > It does auto-detect it as cp1252- look at t

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread bellcanadardp
On Saturday, 19 May 2018 19:03:09 UTC-4, Chris Angelico wrote: > On Sun, May 20, 2018 at 8:58 AM, wrote: > > On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan > > wrote: > >> > It does auto-detect it as cp1252- look at the files in the traceback and > >> > you'll see lib\e

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread bellcanadardp
On Saturday, 19 May 2018 19:48:20 UTC-4, Skip Montanaro wrote: > As Chris indicated, you'll have to figure out the correct encoding. You > might want to check out the chardet module (available on PyPI, I believe) > and see if it can come up with a better guess. I imagine there are other > encoding

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread Peter Otten
bellcanada...@gmail.com wrote: > On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan > wrote: >> > It does auto-detect it as cp1252- look at the files in the traceback >> > and you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the >> > wrong encoding, try opening it

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread Skip Montanaro
As Chris indicated, you'll have to figure out the correct encoding. You might want to check out the chardet module (available on PyPI, I believe) and see if it can come up with a better guess. I imagine there are other encoding guessers out there. That's just one I'm familiar with. Skip -- https:

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread Chris Angelico
On Sun, May 20, 2018 at 8:58 AM, wrote: > On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote: >> > It does auto-detect it as cp1252- look at the files in the traceback and >> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong >> > encoding, try ope

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread bellcanadardp
On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote: > > It does auto-detect it as cp1252- look at the files in the traceback and > > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong > > encoding, try opening it as utf-8 or latin1 and see if that fixe

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54:

2016-04-24 Thread Peter Otten
arthur sherman wrote: > m using a python web applic (adagios, a nagios configuration tool). > when attempting a certain operation on the client side browser i get the > above error. the client side is ubunti 14.04. servers side is debian 8. > browser is ff or chrome. both show: > echo $LANG > en_U

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 308: character maps to

2014-11-14 Thread Joel Goldstick
On Fri, Nov 14, 2014 at 6:57 AM, wrote: > For 'mimetypes' in the code given below, python is giving the following > error. Kindly help. > import os matches = [] for (dirname, dirshere, fileshere) in os.walk(r'C:\Python34'): > for filename in fileshere: > if

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
On 17/11/2013 11:55 PM, Hoàng Tuấn Việt wrote: Hi all, I use Python telnetlib on Windows 7 32 bit. Here is my code: def*telnet*(/self/, host, os, username, password): connection = telnetlib.Telnet(host) connection.read_until(/'login: '/) connection.write(username + /'\r'/)

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

2013-11-18 Thread Fabio Zadrozny
On Mon, Nov 18, 2013 at 2:55 AM, Hoàng Tuấn Việt wrote: > Hi all, > > > > I use Python telnetlib on Windows 7 32 bit. Here is my code: > > > > def *telnet*(*self*, host, os, username, password): > > connection = telnetlib.Telnet(host) > > connection.read_until(*'login: '*) > >

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

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-02 Thread Νίκος
Στις 2/10/2013 10:23 πμ, ο/η Antoon Pardon έγραψε: Op 02-10-13 03:36, Steven D'Aprano schreef: On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote: People pay for some kind of guaranteed uptime. You have *no idea* what sort of contract Nikos has with his customers. Nor do you know have a

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-02 Thread Νίκος
Στις 2/10/2013 4:36 πμ, ο/η Steven D'Aprano έγραψε: On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote: People pay for some kind of guaranteed uptime. You have *no idea* what sort of contract Nikos has with his customers. Nor do you know have any idea what fees he charges. For all we kno

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-02 Thread Antoon Pardon
Op 02-10-13 03:36, Steven D'Aprano schreef: > On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote: > >> People pay for some kind of guaranteed uptime. > > You have *no idea* what sort of contract Nikos has with his customers. > Nor do you know have any idea what fees he charges. For all we k

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-01 Thread Steven D'Aprano
On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote: > People pay for some kind of guaranteed uptime. You have *no idea* what sort of contract Nikos has with his customers. Nor do you know have any idea what fees he charges. For all we know, he is promising, and charging for, 99% uptime whi

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-01 Thread Grant Edwards
On 2013-09-30, ?? wrote: > I learn during the process. That's fine as long as your customers are told up front that what they're paying for is _not_ a working usable service, but rahter a training program for you personally (a training program that's failing rather badly, IMO). > That's

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-01 Thread Antoon Pardon
Op 01-10-13 10:39, Νίκος schreef: > Στις 1/10/2013 10:27 πμ, ο/η Antoon Pardon έγραψε: >> Op 01-10-13 01:14, Νίκος schreef: >>> Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε: But what you're doing is charging your customers while you learn the very basics. >>> >>> I designed their web

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-01 Thread Νίκος
Στις 1/10/2013 10:27 πμ, ο/η Antoon Pardon έγραψε: Op 01-10-13 01:14, Νίκος schreef: Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε: But what you're doing is charging your customers while you learn the very basics. I designed their websites and they are up and running. Yes i have charged s

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-10-01 Thread Antoon Pardon
Op 01-10-13 01:14, Νίκος schreef: > Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε: >> But what you're doing >> is charging your customers while you learn the very basics. > > I designed their websites and they are up and running. > Yes i have charged some money, but they gain what they paid fo

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Steven D'Aprano
On Tue, 01 Oct 2013 01:08:41 +0300, Νίκος wrote: > stfu dickhead. And you're back in the kill-file. *plonk* -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε: But what you're doing is charging your customers while you learn the very basics. I designed their websites and they are up and running. Yes i have charged some money, but they gain what they paid for, a running website, all of them. So, its

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 8:36 AM, Νίκος wrote: > I learn during the process. > That's how i deal with the situation. > I challedge my self and then try to confront the given situation _live_. > > It's not wise to do so, but that how i operate. Everyone's learning on the job. (I learned this week th

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 1:43 πμ, ο/η Chris Angelico έγραψε: On Tue, Oct 1, 2013 at 8:30 AM, Νίκος wrote: Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε: On 30/09/2013 23:19, Νίκος wrote: 2 dickheads names Joe & Mark work together to achieve total bullshit! Well done Beavis & Butthead! rofl...

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 8:30 AM, Νίκος wrote: > Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε: >> >> On 30/09/2013 23:19, Νίκος wrote: >>> >>> >>> 2 dickheads names Joe & Mark work together to achieve total bullshit! >>> Well done Beavis & Butthead! >>> rofl... >>> >> >> Well aside from the fact

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 1:29 πμ, ο/η Chris Angelico έγραψε: On Tue, Oct 1, 2013 at 4:03 AM, Νίκος wrote: Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε: Absolutely hilarious. Please give up your web work and Python and get a job writing scripts for comedians, you'd make a large fortune. I learn P

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε: On 30/09/2013 23:19, Νίκος wrote: 2 dickheads names Joe & Mark work together to achieve total bullshit! Well done Beavis & Butthead! rofl... Well aside from the fact that you've maintained your record by being inaccurate with 50% of the names

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 4:03 AM, Νίκος wrote: > Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε: >> Absolutely hilarious. Please give up your web work and Python and get a >> job writing scripts for comedians, you'd make a large fortune. > > > I learn Python for personal pleasure because i like p

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Mark Lawrence
On 30/09/2013 23:19, Νίκος wrote: 2 dickheads names Joe & Mark work together to achieve total bullshit! Well done Beavis & Butthead! rofl... Well aside from the fact that you've maintained your record by being inaccurate with 50% of the names that you've quoted, it appears that we've someth

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 1:14 πμ, ο/η Mark Lawrence έγραψε: On 30/09/2013 23:08, Νίκος wrote: Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε: On Mon, Sep 30, 2013 at 5:34 PM, Νίκος mailto:nikos.gr...@gmail.com>> wrote: Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε: On 30/09/2013

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Mark Lawrence
On 30/09/2013 23:08, Νίκος wrote: Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε: On Mon, Sep 30, 2013 at 5:34 PM, Νίκος mailto:nikos.gr...@gmail.com>> wrote: Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε: On 30/09/2013 21:13, Νίκος wrote: And you are a majo

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Joel Goldstick
On Mon, Sep 30, 2013 at 6:08 PM, Νίκος wrote: > Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε: > >> >> >> >> On Mon, Sep 30, 2013 at 5:34 PM, Νίκος > **> wrote: >> >> Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε: >> >> On 30/09/2013 21:13, Νίκος

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Denis McMahon
On Mon, 30 Sep 2013 15:51:39 +0100, Mark Lawrence wrote: > On 30/09/2013 14:51, Grant Edwards wrote: >> On 2013-09-29, ?? wrote: >>> 29/9/2013 10:53 , ??/?? Chris Angelico : >>> You fail to understand that these code i now use was written with the >>> help of reg

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-30 Thread Νίκος
Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε: On Mon, Sep 30, 2013 at 5:34 PM, Νίκος mailto:nikos.gr...@gmail.com>> wrote: Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε: On 30/09/2013 21:13, Νίκος wrote: And you are a major asshole leading this list, who is

  1   2   3   4   >