Skip to content

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

@lowell80

Description

@lowell80

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions