# TypeError using the script action in a roles or include?

**URL:** <https://forum.ansible.com/t/typeerror-using-the-script-action-in-a-roles-or-include/13594>\
**Category:** Ansible Project\
**Created:** [October 2, 2013, 7:21pm UTC](https://forum.ansible.com/t/typeerror-using-the-script-action-in-a-roles-or-include/13594 "2013-10-02T19:21:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Appnel](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@Timothy\_Appnel](https://forum.ansible.com/u/Timothy_Appnel)\
**Post date:** [October 2, 2013, 7:21pm UTC](https://forum.ansible.com/t/typeerror-using-the-script-action-in-a-roles-or-include/13594/1 "2013-10-02T19:21:37Z")

</div>

He anyone experience a TypeError using the script action in a role’s tasks or in an include?

This tasks in a roles/x/tasks/main.yml:

- name: create summary report

script: …/bin/create\_summary -d{{ today }} -i{{ output\_path }}/\* -o{{ output\_path }}/…/{{ today }}-summary.html

Throws an unhandled error when I run the playbook for hosts: 127.0.0.1

…

File “/efs/dist/bti/ansible/1.3.1/common/lib/ansible/utils/ **init**.py”, line 259, in path\_dwim\_relative

if os.path.exists(source2):

File “/efs/dist/python/core/2.7/exec/lib/python2.7/genericpath.py”, line 18, in exists

os.stat(path)

TypeError: must be encoded string without NULL bytes, not str

Same result when I do a direct include of the roles/x/tasks/main.yml file. I also got a similar result using a command where I copied the script over.

If I pull all of the tasks in that file out and embed the tasks in my playbook all is fine. I tried 1.3.2 also. I can’t deploy what’s in HEAD unless I want mine cut off by the powers that be.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 2, 2013, 9:28pm UTC](https://forum.ansible.com/t/typeerror-using-the-script-action-in-a-roles-or-include/13594/2 "2013-10-02T21:28:57Z")

</div>

I recall something recent reported about variables with the script module.

Likely could be the same. I seem to recall someone with a zero width unicode space but that might be me confusing issues together 🙂

Can you file a github so we can try to reproduce?

We might need a minimal contained example.

---

<div class="post-metadata">

**Author:** ![Timothy\_Appnel](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@Timothy\_Appnel](https://forum.ansible.com/u/Timothy_Appnel)\
**Post date:** [October 9, 2013, 5:50pm UTC](https://forum.ansible.com/t/typeerror-using-the-script-action-in-a-roles-or-include/13594/3 "2013-10-09T17:50:10Z")

</div>

Just to wrap this up…

I created a simple test example that exposes the error in 1.3.2. The example does not fail in the latest version of the code in devel/HEAD so I’m not going to file a ticket. I’ll just work around it here until I have an official 1.4 release to deploy.
