I am getting an error and a warning: The warning says that it cannot find the TftpContext in init.py in the library,
The error I am getting is: AttributeError: module 'tftpy' has no attribute 'TftpContext'. I have tried to uninstall and reinstall the library but it is not seeing TftpContext method in the TftpContexts file. I even tried to import it directly "from tftpy.TftpContexts import TftpContext" but I was wondering if this was an error in the library? Thanks!
It was a possible syntax error, I had to change a line of code for it to work: transfer_mode = tftpy.TftpContexts.TftpContext(tftp_server, 69, timeout=5)
Set the TFTP server address and filename
(this is an example IP not the actual one) tftp_server = "192.168.1.1" filename = "block.txt"
Create a TftpClient object
client = tftpy.TftpClient(tftp_server, 69)
Set the transfer mode to octet mode
transfer_mode = tftpy.TftpContext() transfer_mode.set_blksize(512) transfer_mode.set_timeout(5)
Upload the file using octet mode
client.upload(filename, filename, transfer_mode)
I am getting an error and a warning: The warning says that it cannot find the TftpContext in init.py in the library, The error I am getting is: AttributeError: module 'tftpy' has no attribute 'TftpContext'. I have tried to uninstall and reinstall the library but it is not seeing TftpContext method in the TftpContexts file. I even tried to import it directly "from tftpy.TftpContexts import TftpContext" but I was wondering if this was an error in the library? Thanks!