pixelb / crudini

A utility for manipulating ini files
GNU General Public License v2.0
443 stars 63 forks source link

Crudini should check that stdin is valid before callin sys.stdin.isatty() #67

Closed bnelsonibm closed 4 years ago

bnelsonibm commented 4 years ago

I have a service which uses crudini to read a config file. Since my program is running as a service under systemctl, the stdin is closed. This seems to cause this exception:

File "/usr/bin/crudini", line 969, in sys.exit(main()) File "/usr/bin/crudini", line 966, in main return crudini.run() File "/usr/bin/crudini", line 831, in run if sys.stdin.isatty(): AttributeError: 'NoneType' object has no attribute 'isatty'

I think that this could be avoided if crudini would check that sys.stdin is not None before calling isatty().