Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Daemon Failing Due to Buffering Policy #14

@connordavison

Description

@connordavison

Hello,

DaemonizingMixin.daemonize seems to be throwing errors in Python 3+:

File "/vagrant/cli/daemon.py", line 95, in daemonize
    se = open(self.null, 'a+', 0)
ValueError: can't have unbuffered text I/O
#!/usr/bin/env python
# daemon.py
import cli.daemon

@cli.daemon.DaemonizingApp
def daemon(app):
    app.daemonize()

if __name__ == "__main__":
    daemon.run()

As the error suggests, this is due to Python 3+ not allowing unbuffered text I/O. I believe this can be fixed by either opening the stream in binary (mode="a+b"), or just opening it as buffered (buffering=-1 should suffice).

Please correct me if I've made an error!

Thanks for your time.

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