Re: Newbie question about text encoding

2015-03-08 Thread Chris Angelico
On Mon, Mar 9, 2015 at 5:34 PM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> As to the notion of rejecting the construction of strings containing >> these invalid codepoints, I'm not sure. Are there any languages out >> there that have a Unicode string type that requires that all >> codepoi

Re: Newbie question about text encoding

2015-03-08 Thread Steven D'Aprano
Chris Angelico wrote: > As to the notion of rejecting the construction of strings containing > these invalid codepoints, I'm not sure. Are there any languages out > there that have a Unicode string type that requires that all > codepoints be valid (no surrogates, no U+FFFE, etc)? U+FFFE and U+FFF

Re: Newbie question about text encoding

2015-03-08 Thread Marko Rauhamaa
Ben Finney : > Steven D'Aprano writes: > >> '\udd00' should be a SyntaxError. > > I find your argument convincing, that attempting to construct a > Unicode string of a lone surrogate should be an error. Then we're back to square one: >>> b'\x80'.decode('utf-8', errors='surrogateescape') '

Re: Append a file

2015-03-08 Thread Jason Venneri
Jason; Thank you for your response. I’m just starting out with Python and the tutorials I have done are on 2.7.9. I will looking on to python3. It is preloaded on Mac :-). Jason ___ jv92...@gmail.com 619-227-0927 > On Mar 6, 2015, at 9:37 PM, Jason Friedman w

Re: Newbie question about text encoding

2015-03-08 Thread random832
On Sun, Mar 8, 2015, at 22:09, Ben Finney wrote: > Steven D'Aprano writes: > > > '\udd00' should be a SyntaxError. > > I find your argument convincing, that attempting to construct a Unicode > string of a lone surrogate should be an error. > > Shouldn't the error type be a ValueError, though? T

Re: Newbie question about text encoding

2015-03-08 Thread Rustom Mody
On Monday, March 9, 2015 at 7:39:42 AM UTC+5:30, Cameron Simpson wrote: > On 07Mar2015 22:09, Steven D'Aprano wrote: > >Rustom Mody wrote: > >>[...big snip...] > >> Some parts are here some earlier and from my memory. > >> If details wrong please correct: > >> - 200 million records > >> - Containi

Re: Newbie question about text encoding

2015-03-08 Thread Chris Angelico
On Mon, Mar 9, 2015 at 1:09 PM, Ben Finney wrote: > Steven D'Aprano writes: > >> '\udd00' should be a SyntaxError. > > I find your argument convincing, that attempting to construct a Unicode > string of a lone surrogate should be an error. > > Shouldn't the error type be a ValueError, though? The

Re: Newbie question about text encoding

2015-03-08 Thread Ben Finney
Steven D'Aprano writes: > '\udd00' should be a SyntaxError. I find your argument convincing, that attempting to construct a Unicode string of a lone surrogate should be an error. Shouldn't the error type be a ValueError, though? The statement is not, to my mind, erroneous syntax. -- \ “P

Re: Newbie question about text encoding

2015-03-08 Thread Cameron Simpson
On 07Mar2015 22:09, Steven D'Aprano wrote: Rustom Mody wrote: [...big snip...] Some parts are here some earlier and from my memory. If details wrong please correct: - 200 million records - Containing 4 strings with SMP characters - System made with python and mysql. SMP works with python, brea

Re: Newbie question about text encoding

2015-03-08 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Steven D'Aprano : > >> Marko Rauhamaa wrote: >>> '\udd00' is a valid str object: >> >> Is it though? Perhaps the bug is not UTF-8's inability to encode lone >> surrogates, but that Python allows you to create lone surrogates in >> the first place. That's not a rhetorical q

Re: surprising exception text

2015-03-08 Thread Mark Lawrence
On 08/03/2015 22:56, Cameron Simpson wrote: On 08Mar2015 18:52, Mark Lawrence wrote: On 08/03/2015 18:20, Steven D'Aprano wrote: Mark Lawrence wrote: On 08/03/2015 09:15, Cameron Simpson wrote: Gotta love this: TypeError: decoding with 'utf-8' codec failed (TypeError: '_io.BufferedReader' d

Re: surprising exception text

2015-03-08 Thread Cameron Simpson
On 08Mar2015 18:52, Mark Lawrence wrote: On 08/03/2015 18:20, Steven D'Aprano wrote: Mark Lawrence wrote: On 08/03/2015 09:15, Cameron Simpson wrote: Gotta love this: TypeError: decoding with 'utf-8' codec failed (TypeError: '_io.BufferedReader' does not support the buffer interface) Not to

Re: Opaque error message on UTF-8 decode

2015-03-08 Thread Chris Angelico
On Mon, Mar 9, 2015 at 8:23 AM, Mark Lawrence wrote: > I'd raise an issue so there's a formal record that we can refer to in the > future. Besides what's one issue like this compared to the "Python can't do > decimal sums properly" which gets raised every few months by newbies :) http://bugs.pyt

Re: Opaque error message on UTF-8 decode

2015-03-08 Thread Mark Lawrence
On 08/03/2015 21:15, Chris Angelico wrote: b"\xed\xb4\x80".decode() Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte But 0xED is not a continuation byte, it's a start byte. And it's a per

Opaque error message on UTF-8 decode

2015-03-08 Thread Chris Angelico
>>> b"\xed\xb4\x80".decode() Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte But 0xED is not a continuation byte, it's a start byte. And it's a perfectly valid one: >>> b"\xed\x9f\xbf".deco

Re: Newbie question about text encoding

2015-03-08 Thread Chris Angelico
On Mon, Mar 9, 2015 at 5:25 AM, Steven D'Aprano wrote: > Perhaps the bug is not UTF-8's inability to encode lone > surrogates, but that Python allows you to create lone surrogates in the > first place. That's not a rhetorical question. It's a genuine question. As to the notion of rejecting the co

Re: Newbie question about text encoding

2015-03-08 Thread Chris Angelico
On Mon, Mar 9, 2015 at 5:25 AM, Steven D'Aprano wrote: > Marko Rauhamaa wrote: > >> Chris Angelico : >> >>> Once again, you appear to be surprised that invalid data is failing. >>> Why is this so strange? U+DD00 is not a valid character. > > But it is a valid non-character code point. > >>> It is

Re: Newbie question about text encoding

2015-03-08 Thread Marko Rauhamaa
Steven D'Aprano : > Marko Rauhamaa wrote: >> '\udd00' is a valid str object: > > Is it though? Perhaps the bug is not UTF-8's inability to encode lone > surrogates, but that Python allows you to create lone surrogates in > the first place. That's not a rhetorical question. It's a genuine > questio

Visual kalendar like korganizer or evolution calendaar (outlook calendar) a print priview and enventualy an adressbook

2015-03-08 Thread Michael Parchet
Hello, I am working with pyqt framework and i'm looking for a calendar (organizer) like korganizer, evolution or outlook calendar that is OS indépendent with recurrence event. writting in python with an UI framework (ex pyqt, pygtk, wkpython, tkinter or other ui framwork) Where could I find

Re: surprising exception text

2015-03-08 Thread Mark Lawrence
On 08/03/2015 18:20, Steven D'Aprano wrote: Mark Lawrence wrote: On 08/03/2015 09:15, Cameron Simpson wrote: Gotta love this: TypeError: decoding with 'utf-8' codec failed (TypeError: '_io.BufferedReader' does not support the buffer interface) Not to worry:-) Cheers, Cameron Simpson Wha

Re: MSVC2013

2015-03-08 Thread Mark Lawrence
On 08/03/2015 17:57, polyver...@gmail.com wrote: On Saturday, March 7, 2015 at 5:36:07 PM UTC+1, Mark Lawrence wrote: On 07/03/2015 15:55, polyver...@gmail.com wrote: Out of curiosity, is there any plan to use a more recent version of Visual Studio (i.e.: 2013) to compile the official Python3

Re: Newbie question about text encoding

2015-03-08 Thread Steven D'Aprano
Rustom Mody wrote: > On Saturday, March 7, 2015 at 4:39:48 PM UTC+5:30, Steven D'Aprano wrote: >> Rustom Mody wrote: >> > This includes not just bug-prone-system code such as Java and Windows >> > but seemingly working code such as python 3. >> >> What Unicode bugs do you think Python 3.3 and abo

Re: Newbie question about text encoding

2015-03-08 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Chris Angelico : > >> Once again, you appear to be surprised that invalid data is failing. >> Why is this so strange? U+DD00 is not a valid character. But it is a valid non-character code point. >> It is quite correct to throw this error. > > '\udd00' is a valid str o

Re: Design thought for callbacks

2015-03-08 Thread Cem Karan
Hi all, I apologize for taking so long to reply, but neither my work schedule nor the weather have been kind in the past week. That said, I've been thinking long and hard about what everyone has said, and have decided that it would be useful to write a wrap-up email that attempts to encapsulate

Re: surprising exception text

2015-03-08 Thread Steven D'Aprano
Mark Lawrence wrote: > On 08/03/2015 09:15, Cameron Simpson wrote: >> Gotta love this: >> >> TypeError: decoding with 'utf-8' codec failed (TypeError: >> '_io.BufferedReader' does not support the buffer interface) >> >> Not to worry:-) >> >> Cheers, >> Cameron Simpson >> > > What is the bug repo

Re: MSVC2013

2015-03-08 Thread polyvertex
On Saturday, March 7, 2015 at 5:36:07 PM UTC+1, Mark Lawrence wrote: > On 07/03/2015 15:55, polyver...@gmail.com wrote: > > Out of curiosity, is there any plan to use a more recent version of Visual > > Studio (i.e.: 2013) to compile the official Python3 distribution for > > Windows? > > Is it in

Re: Adding a 'struct' into new python type

2015-03-08 Thread Lakshmipathi.G
Hi Jason, Thanks for the response. Okay, Will try to convert 'struct test' into new python object (say 'PyStructTest') and include it inside CountDictType as pyobject instead of 'struct'. Will post details here, If i encounter any issues. Cheers, Lakshmipathi.G FOSS Programmer. www.giis.co.in

Re: surprising exception text

2015-03-08 Thread Mark Lawrence
On 08/03/2015 09:15, Cameron Simpson wrote: Gotta love this: TypeError: decoding with 'utf-8' codec failed (TypeError: '_io.BufferedReader' does not support the buffer interface) Not to worry:-) Cheers, Cameron Simpson What is the bug report number? -- My fellow Pythonistas, ask not what

Become Microsoft Research Certified

2015-03-08 Thread monika786agrawal
Microsoft Research India is excited to introduce MEC (short for "Massively Empowered Classrooms"), a research project designed to bring the highest quality classroom material to every undergraduate engineering student in India. Go to the website and get registered http://bit.ly/1BV3uI9 4 course

surprising exception text

2015-03-08 Thread Cameron Simpson
Gotta love this: TypeError: decoding with 'utf-8' codec failed (TypeError: '_io.BufferedReader' does not support the buffer interface) Not to worry:-) Cheers, Cameron Simpson The Design View editor of Visual InterDev 6.0 is currently incompatible with Compatibility Mode, and may not function

Re: Newbie question about text encoding

2015-03-08 Thread Chris Angelico
On Sun, Mar 8, 2015 at 7:09 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Once again, you appear to be surprised that invalid data is failing. >> Why is this so strange? U+DD00 is not a valid character. It is quite >> correct to throw this error. > > '\udd00' is a valid str object: > >>>>

Re: Newbie question about text encoding

2015-03-08 Thread Marko Rauhamaa
Chris Angelico : > Once again, you appear to be surprised that invalid data is failing. > Why is this so strange? U+DD00 is not a valid character. It is quite > correct to throw this error. '\udd00' is a valid str object: >>> '\udd00' '\udd00' >>> '\udd00'.encode('utf-32') b'\xff\xfe

Re: Newbie question about text encoding

2015-03-08 Thread Steven D'Aprano
Steven D'Aprano wrote: > Marko Rauhamaa wrote: > >> Steven D'Aprano : >> >>> Marko Rauhamaa wrote: >>> That said, UTF-8 does suffer badly from its not being a bijective mapping. >>> >>> Can you explain? >> >> In Python terms, there are bytes objects b that don't satisfy: >> >>b.d