# Paraview 5.8.0 crashes when using vtkXMLPolyDataReader in Programmable Source

**URL:** https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819
**Category:** Development
**Tags:** python
**Created:** [July 12, 2020, 5:59pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819 "2020-07-12T17:59:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AHanke](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@AHanke](https://discourse.paraview.org/u/AHanke)
#### Post date: [July 12, 2020, 5:59pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/1 "2020-07-12T17:59:02Z")

</div>

Running ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit on Windows 10 Version 1903 on GTX 1080 Driver Version 451.67 with Python Version 3.7.8:4b47a5b6ba I tried using a Python wrapped vtkXMLPolyDataReader in the script part of a Programmable Source.

```python
import vtk
from paraview.vtk.vtkIOXML import vtkXMLPolyDataReader
SourceFile=vtkXMLPolyDataReader(Path/to/test.vtp)

```

Paraview freezes when pressing Apply and then closes. The files reads fine, when using the GUI load menu option or the Python Shell. The only error message I found is from the windows event viewer.  
Because the error log is too long, here a pastebin link: [Crash report](https://pastebin.com/7aGmCmVk).

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 12, 2020, 8:03pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/2 "2020-07-12T20:03:31Z")

</div>

I am not sure if that’s the issue, but you should remove the `import vtk`. That’s unnecessary.

---

<div class="post-metadata">

### Author: ![AHanke](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@AHanke](https://discourse.paraview.org/u/AHanke)
#### Post date: [July 12, 2020, 8:50pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/3 "2020-07-12T20:50:18Z")

</div>

As suggested I tried removing `import vtk`, no change in behaviour. Would have been too easy.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 13, 2020, 8:50am UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/4 "2020-07-13T08:50:22Z")

</div>

here is a working example

```
from paraview.vtk.vtkIOXML import vtkXMLPolyDataReader
sourceFile=vtkXMLPolyDataReader()
sourceFile.SetFileName("path/to/file.vtp")
sourceFile.Update()
pdo = self.GetPolyDataOutput()
pdo.ShallowCopy(sourceFile.GetOutput())
```

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 13, 2020, 9:07pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/5 "2020-07-13T21:07:15Z")

</div>

I’d just add that `DeepCopy` is not necessary, and just a `ShallowCopy` would suffice and is generally better here.

---

<div class="post-metadata">

### Author: ![AHanke](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@AHanke](https://discourse.paraview.org/u/AHanke)
#### Post date: [July 14, 2020, 3:51pm UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/6 "2020-07-14T15:51:11Z")

</div>

Thank you for providing a working example.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 15, 2020, 7:23am UTC](https://discourse.paraview.org/t/paraview-5-8-0-crashes-when-using-vtkxmlpolydatareader-in-programmable-source/4819/7 "2020-07-15T07:23:22Z")

</div>

Right, I’ve updated the example.
