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

ascii codec can't encode character "\u2019" in position 7240 #4375

Closed
toobiwankenobi opened this issue Apr 6, 2021 · 10 comments
Closed

ascii codec can't encode character "\u2019" in position 7240 #4375

toobiwankenobi opened this issue Apr 6, 2021 · 10 comments

Comments

@toobiwankenobi
Copy link

toobiwankenobi commented Apr 6, 2021

When I want to export my measurements to a spreadsheet with the module "ExportToSpreadsheet" I get the error

Encountered unrecoverable error in ExportToSpreadsheet during post-processing: `ascii` codec can't encode character "\u2019" in position 7240: ordinal not in range(128)
  • OS: macOS (of importance, see comment below)
  • CellProfiler Version 4.1.3

The same error was reported for an earlier CP version. I tried the recommended suggestions to solve the issue but it didn't help.

Data/Pipeline
The example .tiffs and the acquisition metadata can be found here. I used the following CellProfiler Pipeline. This pipeline requires certain custom-made modules which can be found here.

Any ideas?

@toobiwankenobi
Copy link
Author

it worked using windows so it is a macOS related issue

@DavidStirling
Copy link
Member

Thanks, we believe this is related to MacOS's tendency to use special quotation mark characters instead of '. Is it possible that one of your file paths or metadata fields might contain this?

@mohamadmilad
Copy link

Thanks, we believe this is related to MacOS's tendency to use special quotation mark characters instead of '. Is it possible that one of your file paths or metadata fields might contain this?

I got the same error, also I checked all my paths, and none of the files in the paths contain !

@DavidStirling
Copy link
Member

@mohamadmilad Would you happen to have a pipeline/image set that reproduces this? It'd be handy to compare each instance.

@toobiwankenobi
Copy link
Author

Thanks, we believe this is related to MacOS's tendency to use special quotation mark characters instead of '. Is it possible that one of your file paths or metadata fields might contain this?

Hi @DavidStirling , sorry for my late response. It is indeed a macOS related problem, using a windows machine "solved" the issue.

@mohamadmilad
Copy link

@mohamadmilad Would you happen to have a pipeline/image set that reproduces this? It'd be handy to compare each instance.

I used windows and did not get that error!

@bethac07
Copy link
Member

bethac07 commented May 6, 2021

I can't reproduce on my Mac (MBPro 10.15.7) with the image set and pipeline provided (I did have to change the "How many channels does the image have" setting in a couple of places) in either 4.1.3 built or source; I didn't run the ExportVarCsv model, because I didn't have the correct CSV to do so, so if you can see if on a Mac that DOES have this issue, if turning that module helps, that would narrow it to a problem with that plugin.

Otherwise, can you confirm on your end that the the issue comes up with this exact image set and pipeline in your hands?
Are you running from built or from source? If from source, is there any additional stack trace info that comes up?

@bethac07
Copy link
Member

bethac07 commented May 6, 2021

If we can't reproduce on our end, another thing you might try would be to make a copy of the pipeline and try deleting the modules one or a few at a time (start from the bottom and delete a couple (other than ExportToSpreadsheet of course), see if you get the error, etc), to try to narrow down what module(s) specifically is/are causing it, to see if either a) that module writes something weird or b) if that module has any unusual characters, in say, its module notes. I would say there's a decent-but-not-certain chance that the module notes are the issue; once you find the offending module, if it has notes you could delete them and see if that gets rid of the issue. If so, please do let us know which character it is, and we will be sure to try to add a handler.

@nilseling
Copy link

Hi all, I was able to reproduce the error on macOS using the pipelines provided by @toobiwankenobi. As @DavidStirling suggested, the issue comes from special quotation marks in the Description field of some of the modules. I was able to narrow it down to the step in the ExportToSpreadsheet module when the Experiment information is written out. After deleting all quotation marks (BodenmillerGroup/ImcSegmentationPipeline#70) the error disappeared.

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/spreadsheet-export-error/69575/2

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

No branches or pull requests

6 participants