Social-GPT / agent

MIT License
37 stars 10 forks source link

Encoding error when running on windows #2

Open fxxholub opened 1 year ago

fxxholub commented 1 year ago

Happens when trying to save the first post (tweet in this case):

---------

Generated Tweet

"Creativity is intelligence having fun." - Albert Einstein πŸš€πŸ’‘ Show us your creative side! What's that one project you've been passionately working on this week? Share your journey & 
let's fuel each other's creative engines! πŸŽ¨πŸ–ŒοΈ #CreativityChallenge #InspireToCreate 🌟

---------

Traceback (most recent call last):
  File "C:\Users\fxxho\Desktop\HeadlineGPT\dev\agent\main.py", line 72, in <module>
    main()
  File "C:\Users\fxxho\Desktop\HeadlineGPT\dev\agent\main.py", line 48, in main
    posts_prompt_expansion, mode).generate_tweet()
  File "C:\Users\fxxho\Desktop\HeadlineGPT\dev\agent\generators\tweet_generator.py", line 29, in generate_tweet
    add_item_to_file(Files.twitter_results, tweet)
  File "C:\Users\fxxho\Desktop\HeadlineGPT\dev\agent\utils.py", line 59, in add_item_to_file
    write_to_file(
  File "C:\Users\fxxho\Desktop\HeadlineGPT\dev\agent\utils.py", line 21, in write_to_file
    f.write(content + "\n")
  File "C:\Users\fxxho\AppData\Local\Programs\Python\Python310\lib\encodings\cp1250.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 64-65: character maps to <undefined>
teamcoltra commented 8 months ago

Once this gets merged your problem should be fixed or you can grab my copy.