[Ironpython-users] binary strings in 2.7.2 alpha?

Daniel Fernandez fernandez_dan2 at hotmail.com
Sat Feb 4 02:39:25 CET 2012


I was trying to get Requests package to work with IronPython. I just briefly started playing with it and I like the HTTP api syntax.  I'm actually starting to look for open source python packages instead of .NET :)  Well its been a good learning opportunity navagating thru the IronPython internals.    Thanks Danny

> Date: Fri, 3 Feb 2012 17:15:19 -0800
> Subject: Re: [Ironpython-users] binary strings in 2.7.2 alpha?
> From: jdhardy at gmail.com
> To: fernandez_dan2 at hotmail.com
> CC: ironpython-users at python.org
> 
> On Fri, Feb 3, 2012 at 5:00 PM, Daniel Fernandez
> <fernandez_dan2 at hotmail.com> wrote:
> > Hi All,
> >
> > I'm playing with open source package  and I am getting an error with prefix
> > "b" with a string literal with expected str and got bytes. Here is a simple
> > example, IronPython 2.7.2 alpha I get the following
> >
> >>>> type(b"/")
> > <type 'bytes'>
> >
> > In CPython 2.7.2 I get the following
> >
> >>>> type(b"/")
> > <type 'str'>
> >
> > I searched for more information on this but I didn't find alot on it. I did
> > find one site indicating that this is a python 3.0 feature, I just wanted to
> > confirm.
> 
> Yeah, IronPython returns bytes for b'' (like Python 3) because its
> strings are unicode. On the plus side, it means that what you're
> testing probably has some changes to be made for Python 3 support.
> 
> - Jeff
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20120203/bfc1d788/attachment.html>


More information about the Ironpython-users mailing list