sassoftware / sassoftware/pyviyatools

listgroupsandmembers.py fails when user name has non ascii characters

Open
#69 0 comments 0 reactions 1 assignee View on GitHub

@dwstern is already working on this.

Since Mar 9, 2022.

Dominant language
Python
Stars
50
Forks
42
PR merge metrics
No merged PRs in 30d

Description

When a user name has non ascii characters and script is used like:
python listgroupsandmembers.py > user-report.csv

It fails with the following message:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 86: ordinal not in range(128)

Probably not an elegant solution, but we fixed it adding ascii replace, so non ascii characters are replaced by "?" sign

membername=member['name']
membername=membername.encode('ascii', 'replace')

The reported issue does not appear when python listgroupsandmembers.py shows results on console.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.