Python writes hadoop program to report error stop iteration? under ubuntu

problem description

the platform version of the problem and what methods you have tried

Watch hadoop videos on

imooc,
ubuntu18.04 systems, and use anaconda3"s python interpreter to execute.
my code is exactly the same as in the video.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
def read_lines (hdfs_client):

file_b = "/tmp/test/file_b"
with hdfs_client.open(file_b, "wb", replication=1 ) as f:
    f.write(b"hello\nhadoop")
    
with hdfs_client.open(file_b, "rb") as f:
    lines = f.readlines()
    assert len(lines) = 2

what result do you expect? What is the error message actually seen?

although there is a problem running, but looking at the file_b file, two lines of hello hadoop (have been written)
so what"s wrong with that f.readlines?

the video is executed with python2, which I haven"t tried.
under my anaconda, I can"t run without the python2 module that comes with the python3, system.

Dec.01,2021

assert len (lines) = 2 should be assert len (lines) = = 2

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35de7-2bfbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35de7-2bfbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?