Hacking the Fender Error

I’m trying to write the username of each compromised_user in compromsied_users to compromised_user_file but it says:

Traceback (most recent call last):
File “script.py”, line 11, in
compromised_user_file.write(compromised_users)
TypeError: write() argument must be str, not list

Can somebody help on what I need to do to fix this.

1 Like

Welcome to the forums @trk075

Python is telling you quite clearly what the issue is.

TypeError: write() argument must be str, not list

Your variable compromised_users is evidently a list, and the write() function requires a string.

If you did something like this

for c_user in compromised_users:
    compromised_user_file.write(c_user)

you might find it works.

(This is a guess, as I don’t have access to your complete code. Should give you a good starting point, though.)