← Back to team overview

yade-dev team mailing list archive

[Bug 826176] [NEW] Problem with saveVars

 

Public bug reported:

Hi,

I want to save some variables with utils.saveVars() and load it in
another script with utils.loadVars().

test script 1:

#!/usr/bin/python
# -*- coding: utf-8 -*-
a = 1

b = 2

c = 3
utils.saveVars('savedVars',a=a,b=b,c=c)

test script 2:

#!/usr/bin/python
# -*- coding: utf-8 -*-
utils.loadVars('savedVars')

error message:

Running script save-vars-test2.py
Traceback (most recent call last):
  File "/home/me/YADE/bin/yade-bzr2877", line 183, in runScript
    execfile(script,globals())
  File "save-vars-test2.py", line 3, in <module>
    utils.loadVars('savedVars')
  File "/home/me/YADE/lib/yade-bzr2877/py/yade/utils.py", line 67, in loadVars
    d=cPickle.loads(Omega().tags['pickledPythonVariablesDictionary'+mark])
KeyError: 'Invalid key: pickledPythonVariablesDictionarysavedVars.xml.'

** Affects: yade
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yade
developers, which is the registrant for Yade.
https://bugs.launchpad.net/bugs/826176

Title:
  Problem with saveVars

Status in Yet Another Dynamic Engine:
  New

Bug description:
  Hi,

  I want to save some variables with utils.saveVars() and load it in
  another script with utils.loadVars().

  test script 1:

  #!/usr/bin/python
  # -*- coding: utf-8 -*-
  a = 1

  b = 2

  c = 3
  utils.saveVars('savedVars',a=a,b=b,c=c)

  test script 2:

  #!/usr/bin/python
  # -*- coding: utf-8 -*-
  utils.loadVars('savedVars')

  error message:

  Running script save-vars-test2.py
  Traceback (most recent call last):
    File "/home/me/YADE/bin/yade-bzr2877", line 183, in runScript
      execfile(script,globals())
    File "save-vars-test2.py", line 3, in <module>
      utils.loadVars('savedVars')
    File "/home/me/YADE/lib/yade-bzr2877/py/yade/utils.py", line 67, in loadVars
      d=cPickle.loads(Omega().tags['pickledPythonVariablesDictionary'+mark])
  KeyError: 'Invalid key: pickledPythonVariablesDictionarysavedVars.xml.'

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/826176/+subscriptions


Follow ups

References