pypxe / PyPXE

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

Update server.py for Python3 #180

Closed vbyrd closed 4 years ago

vbyrd commented 4 years ago

Python3 did away with the 'unicode' tag renaming in 'str'. This causes PyPXE in python 3 to bail out if we load a JSON config.

Ref: https://stackoverflow.com/questions/19877306/nameerror-global-name-unicode-is-not-defined-in-python-3

Error: Traceback (most recent call last): File "/usr/local/bin/pypxe", line 8, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/pypxe/server.py", line 164, in main if type(loaded_config[setting]) is unicode: NameError: name 'unicode' is not defined

icb- commented 4 years ago

Thanks for your contribution