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


Groups > comp.lang.python > #90542

Re: ImportError with pickle (Python 2.7.9), possibly platform dependent

Newsgroups comp.lang.python
Date 2015-05-13 03:23 -0700
References <494551ca-532f-4d4d-aff0-a3932416c8f4@googlegroups.com> <mailman.108.1430354695.3680.python-list@python.org> <20a5c7bf-2163-4b7a-8495-30ce23239903@googlegroups.com> <mailman.9.1430482176.3347.python-list@python.org>
Message-ID <c46f6933-6a3f-4e13-8396-946e675c35e7@googlegroups.com> (permalink)
Subject Re: ImportError with pickle (Python 2.7.9), possibly platform dependent
From Ben Sizer <kylotan@gmail.com>

Show all headers | View raw


On Friday, 1 May 2015 13:09:48 UTC+1, Chris Angelico  wrote:
> 
> Cool! That's part way. So, can you simply stuff OMDBMap into
> sys.modules prior to loading? It might be a bit of a hack, but it
> should work for testing, at least. Conversely, you could change the
> dump script to import via the name my_wsgi_app to make it consistent.
> 
> ChrisA

Sorry for not coming back to this sooner.

In our case we are probably just going to work with a different file format because this was something like the 3rd time that the way pickle works caused our loading to fail for some reason or other. I think the hoops we need to jump through to ensure that the dumping and loading environments match up are too high relative to the cost of switching to JSON or similar, especially if we might need to load the data from something other than Python in future (god forbid).

-- 
Ben Sizer

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


Thread

ImportError with pickle (Python 2.7.9), possibly platform dependent Ben Sizer <kylotan@gmail.com> - 2015-04-29 09:01 -0700
  Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Chris Angelico <rosuav@gmail.com> - 2015-04-30 10:44 +1000
    Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Ben Sizer <kylotan@gmail.com> - 2015-05-01 04:01 -0700
      Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Chris Angelico <rosuav@gmail.com> - 2015-05-01 22:09 +1000
        Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Ben Sizer <kylotan@gmail.com> - 2015-05-13 03:23 -0700
      Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Peter Otten <__peter__@web.de> - 2015-05-01 14:34 +0200
        Re: ImportError with pickle (Python 2.7.9), possibly platform dependent Ben Sizer <kylotan@gmail.com> - 2015-05-13 03:27 -0700

csiph-web