Hacking the Fender- will not print Boss Message

This code is exactly the same as the project walk through yet the boss_message file stays empty. Can someone please lend me a second pair of eyes and help me de bug the code?

import csv
import json

compromised_users = []

with open('passwords.csv') as password_file:
  password_csv = csv.DictReader(password_file)
  for password_row in password_csv:
    compromised_users.append(password_row['Username'])

with open('compromised_users.txt','w') as compromised_user_file:
  for c_user in compromised_users:
    compromised_user_file.write(c_user)
    
with open('boss_message.json', 'w') as boss_message:
  boss_message_dict = {'recipient':'The Boss', 'message': 'Mission Success'}
  json.dump(boss_message_dict, boss_message)

with open('new_passwords.csv', 'w') as new_passwords_obj:
  slash_null_sig = """
   _  _     ___   __  ____             
/ )( \   / __) /  \(_  _)            
) \/ (  ( (_ \(  O ) )(              
\____/   \___/ \__/ (__)             
 _  _   __    ___  __ _  ____  ____  
/ )( \ / _\  / __)(  / )(  __)(    \ 
) __ (/    \( (__  )  (  ) _)  ) D ( 
\_)(_/\_/\_/ \___)(__\_)(____)(____/ 
        ____  __     __   ____  _  _ 
 ___   / ___)(  )   / _\ / ___)/ )( \
(___)  \___ \/ (_/\/    \\___ \) __ (
       (____/\____/\_/\_/(____/\_)(_/
 __ _  _  _  __    __                
(  ( \/ )( \(  )  (  )               
/    /) \/ (/ (_/\/ (_/\             
\_)__)\____/\____/\____/
"""
  new_passwords_obj.write(slash_null_sig)

Hi,

Are you doing this in the context of CC?

I’m going to start stating some stuff, some of it may be totally obvious, but personally it helps me to sort out where mistakes can appear:

boss_message is the variable where the boss_message.json is loaded.

One thing you can first do as a debug is to check whether your file is loading properly to begin with: something like print(boss_message) which should yield <io.TextIOWrapper name='boss_message.json'> or something to that extent. (although if this is within CC i think they already provide the file so this is more relevant if you’re doing it locally).

Afterwards you might want to read up on docs for json.dump() to make sure its functionality is matching your expectation of how it works: json — JSON encoder and decoder — Python 3.9.1 documentation

Hello!
So I am not quite sure what ‘the context of cc’ means, still a relatively new programmer

This project was in Python 3=>Files=> Project

I will try everything else you recommended, be wary I will most likely come back with more questions.

Oh by cc i meant shorthand for codecademy. It was basically asking if you’re doing it on the codecademy platform or on your local machine.

Ok, so one hint is, what does json.dump() do?

Does

import json
json.dumps(['bread', {'bread types': ('pita', 5)}])

display anything? What happens if i try printing the expression instead? What if I wanted to store it in a variable?