Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'differently': 0.07; 'skip:\\ 20': 0.07; "subject:' ": 0.07; 'subject:skip:s 10': 0.07; 'portions': 0.09; 'window.': 0.09; 'python': 0.11; 'thread': 0.14; 'query,': 0.16; 'received:74.208.4.195': 0.16; 'statement.': 0.16; 'stuff,': 0.16; 'thread,': 0.16; 'with?': 0.16; 'all.': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'do.': 0.18; 'trying': 0.19; 'header :User-Agent:1': 0.23; 'instead.': 0.24; 'necessary.': 0.24; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'am,': 0.29; "doesn't": 0.30; 'gives': 0.31; 'code': 0.31; '>>>>': 0.31; 'text': 0.33; 'comment': 0.34; 'trouble': 0.34; 'could': 0.34; 'problem': 0.35; 'form.': 0.35; 'but': 0.35; 'html,': 0.36; 'so,': 0.37; 'expected': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'hope': 0.61; 'new': 0.61; "you're": 0.61; "you've": 0.63; 'show': 0.63; 'name': 0.63; 'different': 0.65; 'received:74.208': 0.68; 'subject': 0.69; 'results': 0.69; 'retype': 0.84; 'organized,': 0.91; 'thoroughly': 0.91 Date: Thu, 15 May 2014 09:49:13 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: struct.unpack: why 's' fmt char convert to bytestring References: , <87mweotfe5.fsf@dpt-info.u-strasbg.fr>, <87iopbtmh1.fsf@dpt-info.u-strasbg.fr>, <871tvxtwgj.fsf@dpt-info.u-strasbg.fr>, <8761l9pi3n.fsf@elektro.pacujo.net>, <5372b488$0$29977$c3e8da3$5496439d@news.astraweb.com>, , <1613032089421800145.832800sturla.molden-gmail.com@news.gmane.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:dtYjsh3xZe4pal+QQ9xhvnWMPcZJAL7vykJoAo0jj9s 8MdjvLnejqwrW7cYBRtEFshh98Xkykv33G537jo/qrV3jdCybd RYl/+/jbv7KGeYgQ5HbLdr5GYroIy7PIAe8PPiivWOtCDzaoUM IGaiGQ6RnO7W0WHtulEnt+aytGCA5BFOF5VTvV8szGgnpChNl8 wT7zBwuxITVbLZiodPBeh3RijhL0Rr8T3mVVoMU2TCmglpQ8x7 jusJXhOEma8l50LIjAviHfoVbO2y1nQXexei/rxgfM51OTdFwS vNRgY6lUXEBRcEzi0drWNUuAHXojkL4g0sZU9hYroYnmwBA2NK 8GRerRpbtrrdNO8Y5CB8= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1400161772 news.xs4all.nl 2846 [2001:888:2000:d::a6]:54252 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71603 On 05/15/2014 08:34 AM, GuoChao wrote: > The Python documentation gives this same example:>>> record = b'raymond \x32\x12\x08\x01\x08' >>>> name, serialnum, school, gradelevel = unpack('<10sHHb', record) > but get different results as to 's', don't know why this change in Python 3? need extra work to encode...>>> name >>>> 'raymond ' # for 2.7>>> name >>>> b'raymond ' # for 3.3 >>>> >>>> Please start a new thread, don't just change the subject and hope to hijack this existing thread on Fortran. But you also need a problem statement. What is it you're having trouble with? Do you have some code that works differently in 3.3 and you want to know how to fix it? If so, show what you've tried, what resulted, and what you expected instead. Please post in text form. This is a text list, and many people cannot see your html at all. Others see it as improperly wrapped, which thoroughly masks what you're trying to do. Even when I show it as html, it doesn't make sense. Perhaps you're trying to retype the stuff, rather than copy/pasting it from your terminal window. I could comment on individual portions of your query, but hopefully when you get one that's better organized, that won't be necessary. -- DaveA