# System.tag.read breaking in update 8.1.36

**URL:** <https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [January 25, 2024, 8:24pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785 "2024-01-25T20:24:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [January 25, 2024, 8:24pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/1 "2024-01-25T20:24:29Z")

</div>

I have string tag value I am reading from a PLC in Ignition that broke in all my scripts when I updated to **8.1.36** from **8.1.32** I am using this string in HTTP requests and all my requests suddenly started to fail after the update. It seems like python didn't recognize it as a string anymore. I have been running these scripts for about a year now, so I know it was the update that changed things.

To fix I had to explicitly tell Python it was a string. I have all my scripts fixed, but I am wondering what would cause this and why?

Thanks

Example  
`myBarcode=system.tag.read('[.]RAW\_BARCODE').value

Working  
myBarcode=str(system.tag.read('[.]RAW\_BARCODE').value)

Update:  
Scripts are failing in the HTTP Request

```auto
conn = httplib.HTTPConnection(myConnection)	
conn.request("GET", "path=path" + myClient + "&service=service" + myBarcode)
res = conn.getresponse()
data = res.read()

```

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 25, 2024, 9:03pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/2 "2024-01-25T21:03:01Z")

</div>

`system.tag.read` has been deprecated (as of Ignition 8.0), so I wouldn't expect and action from IA on this.

You should be using `system.tag.readBlocking()` instead.

Try:

```auto
myBarcode = system.tag.readBlocking(['[.]RAW_BARCODE'])[0].value

```

and see if that works, if not, then I suspect there is something else happening.

---

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [January 25, 2024, 9:09pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/3 "2024-01-25T21:09:59Z")

</div>

For any newer scripts I have been using system.tag.readBlocking. I did update one to readBlocking when I was still tracking down the issue, it had the same effect, I needed to explicitly cast to a string to use it.

These older scripts sometime rear their head when we go through updates. I do plan on going through all our scripts and updating them to system.tag.readBlocking though.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 25, 2024, 9:14pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/4 "2024-01-25T21:14:00Z")

</div>

> [@Zachary\_Kacel1](#):
>
> I needed to explicitly cast to a string to use it

What is the error that you are getting? If you log the type of the value prior to converting it, what type does it report having?

---

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [January 25, 2024, 9:20pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/5 "2024-01-25T21:20:40Z")

</div>

Look like the type is unicode when i do a type(tag) in the Script Console

`type(system.tag.read('tag path').value) unicode`

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 25, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/6 "2024-01-25T21:22:26Z")

</div>

Unicode is a type of string. How did this break your scripts? Were you explicitly checking for the `str` type instead of `basestring` ?

---

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [January 25, 2024, 9:29pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/7 "2024-01-25T21:29:07Z")

</div>

The script broke in the HTTP request where I was building a string to do a GET request from a local webservice.

I know I should be using Ignition's HTTP Client vs httplib but these scripts were written along time ago and have been running with no issue. I have learned a lot of what not to do reading these forms and the documentation. I am just curious what made this break in the new update.

```auto
conn = httplib.HTTPConnection(myConnection)	
conn.request("GET", "path=path" + myClient + "&service=service" + myBarcode)
res = conn.getresponse()
data = res.read()

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 25, 2024, 9:32pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/8 "2024-01-25T21:32:36Z")

</div>

Ah, simple. You are using jython's stdlib for your network requests. Highly recommended you ditch all of that broken stuff. (Anything involving character encodings is likely to break in jython libraries.) Convert to Ignition's `httpClient` before the technical debt gets worse.

---

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [January 25, 2024, 9:35pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/9 "2024-01-25T21:35:47Z")

</div>

Thanks. I'm thinking I might as well bite the bullet and get all of our old scripts updated to Ignition's `httpClient` to avoid more instances like this. Sound like a good weekend project when everything is down.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 25, 2024, 9:36pm UTC](https://forum.inductiveautomation.com/t/system-tag-read-breaking-in-update-8-1-36/84785/10 "2024-01-25T21:36:42Z")

</div>

> [@Zachary\_Kacel1](#):
>
> "path=path" + myClient + "&service=service" + myBarcode`

A .format _may_ (no promises with httplib) get you out of immediate trouble, but httpClient is going to be your best bet.

```auto
"path=path{}&service=service{}".format(myClient, myBarcode)

```
