# Paraview throws errors when using the Python shell.

**URL:** https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353
**Category:** ParaView Support
**Created:** [January 16, 2020, 4:26pm UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353 "2020-01-16T16:26:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Pat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Pat](https://discourse.paraview.org/u/Pat)
#### Post date: [January 16, 2020, 4:26pm UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/1 "2020-01-16T16:26:44Z")

</div>

Hello,

I have just downloaded and installed Paraview’s latest nightly build and I’m getting a Unicode error whenever I want to run a file inside the Python interpreter.

```auto
>>> File "<string>", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape >>> 

```

This error occurs whenever I attempt to run a script though Paraview’s interpreter regardless of the file size. A completely blank file will still throw this error as well. I downloaded and installed the same exact version on another machine and it works just fine.

Thank you.

---

<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: [January 17, 2020, 9:23am UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/2 "2020-01-17T09:23:01Z")

</div>

What is your OS ?  
Do you have anything in your PYTHONPATH env var ?  
Do you have the same behavior with pvpython ?

---

<div class="post-metadata">

### Author: ![Pat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Pat](https://discourse.paraview.org/u/Pat)
#### Post date: [January 21, 2020, 1:18pm UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/3 "2020-01-21T13:18:17Z")

</div>

Hi Mathieu, I am on Windows 10 and I have not changed my PYTHONPATH variable. Paraview is installed on my local drive `C:\Program Files`. If I save my script under `C:\Users` or any child to the Users directory I get the unicode error. Any other sibling directory to Users or Program Files works fine. For example if I create a folder named Git (which is a sibling of Users and Program Files) everything will work and my script will be able to run inside of Paraview’s shell. I do not have this issue with the published v5.7.0 build. I will also get the same error in pvpython.

---

<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: [January 22, 2020, 3:46am UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/4 "2020-01-22T03:46:30Z")

</div>

Wow, I reproduce, thanks for testing that. It almost made it into 5.8 release which would have been bad.

I have a fix, but for me the error does not appear with pvpython, only the python shell within paraview.

---

<div class="post-metadata">

### Author: ![Pat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Pat](https://discourse.paraview.org/u/Pat)
#### Post date: [January 22, 2020, 11:30am UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/5 "2020-01-22T11:30:32Z")

</div>

Great I am glad I could help. Will your fix be available in the latest nightly build? I will try using pvpython again to test this.

(Edit): After checking with pvpython I didn’t have this issue. I did 100% run into this Unicode error yesterday, I can’t explain why I am not running into it now.

---

<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: [January 23, 2020, 2:16am UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/6 "2020-01-23T02:16:57Z")

</div>

The fix is here, it will be merged soon and should be available in ParaView 5.8-RC2 if all goes well.  
[https://gitlab.kitware.com/paraview/paraview/merge\_requests/3852](https://gitlab.kitware.com/paraview/paraview/merge_requests/3852)

---

<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: [January 27, 2020, 7:40am UTC](https://discourse.paraview.org/t/paraview-throws-errors-when-using-the-python-shell/3353/7 "2020-01-27T07:40:50Z")

</div>

The fix has been merged, is present in the latest nightly and will be present in the next release.
