Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError: 'charmap' codec can't encode character '\u2726' in position 30: character maps to <undefined> #5

Open
blairg23 opened this issue May 3, 2021 · 1 comment

Comments

@blairg23
Copy link

blairg23 commented May 3, 2021

Doesn't seem to handle certain encoding characters?

OS: Windows 10
Python 3.8
Using the GitBash terminal

Running under normal conditions for the following users:

{
    "save_directory": "./art",
    "artists": [
        "kuvshinov_ilya",
        "guweiz",
        "nababa",
        "polkin",
        "rossdraws",
        "tsuaii",
        "viccolatte",
        "wlop"
    ]
}

Error code:

$ python main.py -r

there are 8 artists

download for artist Ilya Kuvshinov begins

artist Ilya Kuvshinov is up-to-date

download for artist Z.W. Gu begins

artist Z.W. Gu is up-to-date

download for artist arata yokoyama begins

artist arata yokoyama is up-to-date

download for artist Ilya Knyazev begins

artist Ilya Knyazev is up-to-date

Traceback (most recent call last):
  File "main.py", line 53, in <module>
    main()
  File "main.py", line 49, in main
    download_artists(api, config)
  File "main.py", line 9, in download_artists
    result = api.save_artists(config.artists, config.save_dir)
  File "H:\Dropbox\Projects\Python\scrapers\artstation-scraper\lib\artstation.py", line 106, in save_artists
    files = self.save_artist(id, dir_path)
  File "H:\Dropbox\Projects\Python\scrapers\artstation-scraper\lib\artstation.py", line 89, in save_artist
    print(f"download for artist {artist_name} begins\n")
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python38-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2726' in position 30: character maps to <undefined>


@blairg23
Copy link
Author

This appears to be strictly an OS issue, which this solves: https://stackoverflow.com/a/63573649/1224827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant