Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeeder.ewetel.de!newsfeed.xs4all.nl!newsfeed1.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'obj': 0.09; 'subject:files': 0.09; 'subject:module': 0.09; 'url:github': 0.09; 'windows,': 0.09; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'python': 0.11; 'windows': 0.15; 'attaching': 0.16; 'to:addr:web.de': 0.16; '\xc2\xa0i': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'working.': 0.19; 'example': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'script.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'source': 0.25; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'linux.': 0.31; 'object.': 0.31; 'file': 0.32; 'know.': 0.32; 'run': 0.32; 'linux': 0.33; 'url:python': 0.33; 'actual': 0.34; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'raising': 0.36; 'url:listinfo': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'skip:& 10': 0.38; 'pm,': 0.38; 'subject:" ': 0.39; 'url:mail': 0.40; 'read': 0.60; 'tell': 0.60; 'hope': 0.61; 'complete': 0.62; 'content-type:application/octet-stream': 0.65; 'filename:fname piece:index': 0.84; 'happening?': 0.84; 'observed': 0.84; 'otten': 0.84; 'url:master': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=lHiPZDl7OfnAbBRq+8B9VL4PhrwMzFktc5LxHa+AAfc=; b=IvSC56qpedwDVC9/j3aA+8m0/2+WCCX+2Cd6M9dy6EFv749n92rL/Z/AX+lCA0MEdW HkXDSZQUF5N5Blw+PT7uQpGuCmUqkkSHAPyZW7bHxBuCgFGWM1uAv/VhP0TR4X5h3zuo By1hf9UvOpJ2mnWZ1QnuSmKabt3bTWzH7eujbplcILh/ev6Tx1Dn6WeNmUHcUDBkZ2d6 GK+6+qNlxTnh9iPnrgN4Waxopj0t1npaxxkWqAkGtYGNxmBvd/5R+C0MID//ppDAmmoq bSxHjC7a+iHIYuFW07amA4lB51qrs9/nIJ1YngzA8drhMAhLuP0JRccn5sFTwctuRRoF 2JpQ== X-Received: by 10.49.18.138 with SMTP id w10mr15591045qed.64.1365327659191; Sun, 07 Apr 2013 02:40:59 -0700 (PDT) MIME-Version: 1.0 Sender: kasturisurya@gmail.com In-Reply-To: References: From: Surya Kasturi Date: Sun, 7 Apr 2013 15:10:39 +0530 X-Google-Sender-Auth: y_VnKrrY7WelTZ3OwvtCCWi1LJo Subject: Re: Help: pickle module unable to load "rb" mode files in linux To: Peter Otten <__peter__@web.de> Content-Type: multipart/mixed; boundary=047d7bea351620d52b04d9c21e0f Cc: python-list@python.org 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: 105 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365327662 news.xs4all.nl 6904 [2001:888:2000:d::a6]:57020 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42986 --047d7bea351620d52b04d9c21e0f Content-Type: multipart/alternative; boundary=047d7bea351620d52504d9c21e0d --047d7bea351620d52504d9c21e0d Content-Type: text/plain; charset=UTF-8 I am attaching the file which has to be read.. please take a look into it. The actual source code can be observed at https://github.com/scipy/SciPyCentral/blob/master/scipy_central/rest_comments/views.py#L235 when we use "rb" mode in windows, its working. but its not working in linux system (particularly CentOS) On Tue, Apr 2, 2013 at 8:50 PM, Peter Otten <__peter__@web.de> wrote: > Surya Kasturi wrote: > > > Hi, hope you can help me on it.. > > > > with open(pickle_f, 'r') as fhand: > > obj = pickle.load(fhand) > > > > > > This works on linux but not in windows until I use "rb" mode while > > creating file object. Surprisingly, the "rb" mode is not working on > > Linux.. raising EOFError. > > > > Why is this happening? > > I don't know. > > Please give a complete self-contained example that uses "wb" to write the > file and "rb" to read it, and that fails on Linux. Don't forget to tell us > the version of Python you used to run that script. > > -- > http://mail.python.org/mailman/listinfo/python-list > --047d7bea351620d52504d9c21e0d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am attaching the file which has to be read.. please take= a look into it. The actual source code can be observed at=C2=A0https://github.com/scipy/SciPyCentral/blob/master/scipy_c= entral/rest_comments/views.py#L235


when we use "rb" mode in windows, i= ts working. but its not working in linux system (particularly CentOS)
=



On Tue, Apr 2, 2013 at 8:50 PM, Peter Otten <__peter__@web.de> wrote:
Surya Kasturi wrote:

> Hi, hope you can help me on it..
>
> with open(pickle_f, 'r') as fhand:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 obj =3D pickle.load(fhand)
>
>
> This works on linux but not in windows until =C2=A0I use "rb"= ; mode while
> creating file object. Surprisingly, the "rb" mode is not wor= king on
> Linux.. raising EOFError.
>
> Why is this happening?

I don't know.

Please give a complete self-contained example that uses "wb" to w= rite the
file and "rb" to read it, and that fails on Linux. Don't forg= et to tell us
the version of Python you used to run that script.

--
http://mail.python.org/mailman/listinfo/python-list

--047d7bea351620d52504d9c21e0d-- --047d7bea351620d52b04d9c21e0f Content-Type: application/octet-stream; name="index.fpickle" Content-Disposition: attachment; filename="index.fpickle" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hf80sgbq0 gAJ9cQEoVQRib2R5cQJYDQAAADxwPnlhaG9vPC9wPgpxA1ULZGlzcGxheV90b2NxBIlVBXRpdGxl cQVYEAAAACZsdDtubyB0aXRsZSZndDtxBlUKc291cmNlbmFtZXEHVQlpbmRleC50eHRVDWN1c3Rv bXNpZGViYXJxCE5VEWN1cnJlbnRfcGFnZV9uYW1lcQlVBWluZGV4cQpVBG5leHRxC05VCHJlbGxp bmtzcQxdcQ0oVQhnZW5pbmRleHEOWA0AAABHZW5lcmFsIEluZGV4VQFJWAUAAABpbmRleHRxD2FV BG1ldGFxEH1xEVUHcGFyZW50c3ESXVUIc2lkZWJhcnNxE05VA3RvY3EUWBoAAAA8dWwgY2xhc3M9 InNpbXBsZSI+CjwvdWw+CnEVVQRwcmV2cRZOVQhtZXRhdGFnc3EXVQB1Lg== --047d7bea351620d52b04d9c21e0f--