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

Error due to 'special' characters while exporting to csv #12

Open
kkemseke opened this issue Oct 30, 2023 · 1 comment
Open

Error due to 'special' characters while exporting to csv #12

kkemseke opened this issue Oct 30, 2023 · 1 comment

Comments

@kkemseke
Copy link

all_assets = aem.dam.list('/content/dam',csv_file='C:/Data/list.csv',)


UnicodeEncodeError Traceback (most recent call last)
Cell In[10], line 1
----> 1 all_assets = aem.dam.list('/content/dam',csv_file='C:/Data/list.csv',)

File ~\AppData\Local\anaconda3\lib\site-packages\dampy\lib\Assets.py:47, in Assets.list(self, path, csv_dump, csv_file)
45 dir, fname = dir_n_file(csv_file, 'csv')
46 env = Env(dir)
---> 47 env.writeCSV(fname, list=asset_list)
48 return asset_list

File ~\AppData\Local\anaconda3\lib\site-packages\dampy\lib\Env.py:80, in Env.writeCSV(self, fname, list, data)
78 if list:
79 for v in list:
---> 80 wr.writerow([v])
81 elif data:
82 for v in data:

File ~\AppData\Local\anaconda3\lib\encodings\cp1252.py:19, in IncrementalEncoder.encode(self, input, final)
18 def encode(self, input, final=False):
---> 19 return codecs.charmap_encode(input,self.errors,encoding_table)[0]

UnicodeEncodeError: 'charmap' codec can't encode characters in position 66-69: character maps to

@kkemseke
Copy link
Author

the csv-writer probably needs utf-8 encoding

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