Skip to content

Python 3 doesn't support unbuffered text I/O #141

Description

@EdwardBetts

temper-snmp tries to do unbuffered text I/O, but this is not supported in Python 3. Presumably nobody is using the SNMP feature and this broken code should be removed.

$ python3.13 temperusb/snmp.py 
Traceback (most recent call last):
  File "/home/edward/src/2025/vendor/temper-python/temperusb/snmp.py", line 94, in <module>
    main()
    ~~~~^^
  File "/home/edward/src/2025/vendor/temper-python/temperusb/snmp.py", line 86, in main
    sys.stdout = _unbuffered_handle(sys.stdout)
                 ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/edward/src/2025/vendor/temper-python/temperusb/snmp.py", line 21, in _unbuffered_handle
    return os.fdopen(fd.fileno(), 'w', 0)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 1068, in fdopen
ValueError: can't have unbuffered text I/O
$ ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions