Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42999

Re: Help: pickle module unable to load "rb" mode files in linux

Newsgroups comp.lang.python
Date 2013-04-07 06:43 -0700
References <mailman.1.1364914494.3114.python-list@python.org>
Subject Re: Help: pickle module unable to load "rb" mode files in linux
From 88888 Dihedral <dihedral88888@googlemail.com>
Message-ID <mailman.242.1365342229.3114.python-list@python.org> (permalink)

Show all headers | View raw


Surya Kasturi於 2013年4月2日星期二UTC+8下午10時54分25秒寫道:
> 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.
> 
Just use a decorator with a pass in parameter about the OS
to wrap the two versions in different platforms.

By the way any function can be saved in a variable  to 
be passed around means that the lambda 1-liner is not 
necessarily required in Python.

In C++,  the sub-classing with virtual membership function 
reload mechanism is the equivalent part.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Help: pickle module unable to load "rb" mode files in linux Surya Kasturi <suryak@ieee.org> - 2013-04-02 20:24 +0530
  Re: Help: pickle module unable to load "rb" mode files in linux 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-07 06:43 -0700
  Re: Help: pickle module unable to load "rb" mode files in linux 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-07 06:43 -0700

csiph-web