# paraview.simple SaveData Paraview 5.6 built on Ubuntu .04

**URL:** https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487
**Category:** Development
**Created:** [March 18, 2019, 9:03pm UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487 "2019-03-18T21:03:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![raymon68](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@raymon68](https://discourse.paraview.org/u/raymon68)
#### Post date: [March 18, 2019, 9:03pm UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487/1 "2019-03-18T21:03:01Z")

</div>

Hello. I hope this problem has been solved. If it has, lob a tomato at me with the url for the fix printed on it. I am using paraview simple. Eclipse is the editor. I am trying to read in ExodusIIData ship it out to a binary vtm file. I get a strange error from the CreateWriter routine that SaveData calls. I got the idea to use SavaData in this manner by using Paraview’s trace log output. Here is the subroutine:

def **translateFile** (root):

global fileOut

global fileList

global xlateBar

polyDataFile = ExodusIIReader(FileName=fileList)

polyDataFile.ElementVariables = [_’_ _accstrain_ _’_ , _’_ _coherctps_ _’_ , _‘coherence’_ , _‘crack’_ , _’_ _elmass_ _’_ , _’_ _eqps_ _’_ , _‘k\_density’_ , _‘k\_energy’_ , _‘k\_temp’_ , _’_ _maxp_ _’_ , _’_ _maxstrain_ _’_ , _‘press’_ , _‘status’_ , _’_ _tgrow_ _’_]

SaveData(fileOut, proxy=polyDataFile)

Here is the Error:

File “/home/rmoral/Documents/dev/DTRA/PYTHON/Exodus2VTK/mainProg.py”, line 85, in translateFile  
SaveData(fileOut, proxy=polyDataFile)  
File “/opt/paraview-5.6/lib/python3.6/site-packages/paraview/simple.py”, line 980, in SaveData  
writer = CreateWriter(filename, proxy, \*\*extraArgs)  
File “/opt/paraview-5.6/lib/python3.6/site-packages/paraview/simple.py”, line 966, in CreateWriter  
writer\_proxy.UnRegister(None)  
AttributeError: ‘NoneType’ object has no attribute ‘UnRegister’

Thanks in advance for any help.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 19, 2019, 2:07am UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487/2 "2019-03-19T02:07:17Z")

</div>

I was able to use `SaveData` to save out a multiblock dataset to a vtm file.

What is the value of `fileOut` when you invoke `SaveData`?

---

<div class="post-metadata">

### Author: ![raymon68](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@raymon68](https://discourse.paraview.org/u/raymon68)
#### Post date: [March 19, 2019, 1:55pm UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487/3 "2019-03-19T13:55:17Z")

</div>

According to the eclipse debugger:  
fileOut = str: \<\_io.TextIOWrapper name=’/mnt/hgfs/rdgslrjm/Desktop/REZ/bart.vtm’ mode=‘w’ encoding=‘UTF-8’\>

and

polyDataFile = ExodusIIReader: \<paraview.servermanager.ExodusIIReader object at 0x7f7fab7a3390\>

Just because these things happen; When I build Paraview using CMAKE what components must I have in order this to work. I still have the build directory and I can check my build options.

Thank you

---

<div class="post-metadata">

### Author: ![raymon68](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@raymon68](https://discourse.paraview.org/u/raymon68)
#### Post date: [March 19, 2019, 5:28pm UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487/4 "2019-03-19T17:28:48Z")

</div>

Okay fixed it on my own. Whenever a Tk file dialog hands you a filename it is wrapped in the \_ioTextIOWrapper. So the cure is to hand any method that needs a real string the \_\_ioTextIOWrapper.name property. That is a bonified string of the path to the file.

fileRoot = filedialog.asksaveasfile(parent=root, filetypes=ftypes,  
title=“Select a save path and file name”)  
fileOut = fileRoot.name # fileOut now has a string of the path

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 19, 2019, 5:33pm UTC](https://discourse.paraview.org/t/paraview-simple-savedata-paraview-5-6-built-on-ubuntu-04/1487/5 "2019-03-19T17:33:08Z")

</div>

Ah, makes sense. I’m glad it is working for you.
