Uploaded image for project: 'Zapped: AcousticBrainz'
  1. Zapped: AcousticBrainz
  2. AB-419

UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in position 0: ordinal not in range(128)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2019-07-31.0
    • None
    • None
    • None

      Issue with writing unicode characters in datasets (name, description, class names) to csv. We should open the csv file in utf-8 mode and encode text if needed.

      https://sentry.metabrainz.org/metabrainz/acousticbrainz/issues/89878/

      UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in position 0: ordinal not in range(128)
      (2 additional frame(s) were not displayed)
      ...
        File "webserver/views/datasets.py", line 101, in download_annotation_csv
          fp = _convert_dataset_to_csv_stringio(ds)
        File "webserver/views/datasets.py", line 128, in _convert_dataset_to_csv_stringio
          writer.writerow(["description", description])
      
      UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in position 0: ordinal not in range(128)
      

            alastairp Alastair Porter
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2019-07-31.0