Esri / ago-tools

A Python package to assist with administering ArcGIS Online Organizations.
Apache License 2.0
87 stars 88 forks source link

createUserListCSV doesn't handle unicode and delimiters in FullName #28

Open compukab opened 10 years ago

compukab commented 10 years ago

The full name of a user might have unicode characters. These are not handled correctly at the moment.

dataWriter.writerow([user['fullName'], user['email'], user['username'], user['role'], time.strftime("%Y-%m-%d",time.gmtime(user['created']/1000))]) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)

The full name of a user might contain a delimiter character (such as a comma) so a csv.QUOTE_NONNUMERIC may be more appropriate.