question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextIOWrapper regression bug in 1.6.12: 'file' object has no attribute 'readable'

See original GitHub issue

I think I stumbled onto a bug in 1.6.12 that impacts at least 7.1.4 and 7.3.0. It seems to be related to python 2 vs 3 and athe TextIOWrapper around the output stream. The initial registration seems to be fine (--scheme), but whenever the script is run to collect data that’s when it fails.

When I downgrade splunk-sdk version to 1.6.11 my modular input (TA) works fine again.

Here’s the traceback from the 1.6.12 version from a local 7.3 instance running on a Mac:

Traceback (most recent call last):
  File "/Users/lalleman/splunk73/splunk/etc/apps/TA-oam_dms/bin/OAM_DMS.py", line 422, in <module>
    sys.exit(OamDmsModularInput().run(sys.argv))
  File "/Users/lalleman/splunk73/splunk/etc/apps/TA-oam_dms/bin/../lib/splunklib/modularinput/script.py", line 56, in run
    return self.run_script(args, EventWriter(), sys.stdin)
  File "/Users/lalleman/splunk73/splunk/etc/apps/TA-oam_dms/bin/../lib/splunklib/modularinput/event_writer.py", line 49, in __init__
    self._out = TextIOWrapper(output)
AttributeError: 'file' object has no attribute 'readable'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
fantavlikcommented, Apr 23, 2020

Very sorry for your frustration @Bakermat, we should have publicized that issue more broadly once we verified it. I have taken your suggestion and added it to the known issues for the release here: https://github.com/splunk/splunk-sdk-python/releases/tag/1.6.12

1reaction
fantavlikcommented, Jun 1, 2020

We have released a fix in v1.6.13 https://github.com/splunk/splunk-sdk-python/releases/tag/1.6.13 but please let us know if you continue to see similar issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'_io.TextIOWrapper' object has no attribute 'next' python
There's two reasons you're running into issues here. The first is that you've created fo in write-only mode. You need a file object...
Read more >
'file' object has no attribute 'readable' - Debian Bug report logs
TextIOWrapper(stream, encoding=encoding) > AttributeError: 'file' object has no attribute 'readable' > gpg: Signature made Sat 03 Sep 2016 ...
Read more >
AttributeError: '_io.TextIOWrapper' object has no attribute 'items'
TextIOWrapper ' object has no attribute 'items'. I 'm trying to unpack the keys and the values of a yaml file. This is...
Read more >
List of messages - Issue Tracker - Python.org
TextIOWrapper ' object has no attribute '__dict__' It should be noted that it ... to pickle a file object is unfortunate, and is...
Read more >
'file' object has no attribute 'writeline' - Python Forum
I want to remove these lines and then import the rest of the files into a NoSQL database. but I'm getting the error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found