pypxe / PyPXE

Pure Python PXE (DHCP-(Proxy)/TFTP/HTTP/NBD) Server
MIT License
539 stars 125 forks source link

pypxe/dhcp.py: avoid exception when invoking export_leases #193

Closed tanty closed 2 years ago

tanty commented 2 years ago

Fixes the following crash:

Traceback (most recent call last):

[...]

File "/usr/lib/python3.10/site-packages/pypxe/dhcp.py", line 145, in export_leases json.dump(export_safe, leases_file) File "/usr/lib/python3.10/json/init.py", line 180, in dump fp.write(chunk) TypeError: a bytes-like object is required, not str