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

from_xml (string) raises path too long for Windows #57

Closed
toloudis opened this issue Dec 21, 2020 · 3 comments · Fixed by #58
Closed

from_xml (string) raises path too long for Windows #57

toloudis opened this issue Dec 21, 2020 · 3 comments · Fixed by #58

Comments

@toloudis
Copy link

I'm using Python 3.7.5, ome-types 0.2.1, and on Windows, trying to pass my xml string in to from_xml:

File "d:\src\aics\cellbrowser-tools\cellbrowser_tools\fov_processing.py", line 295, in add_segs_to_img
self.omexml = from_xml(description)
File "C:\Users\danielt\AppData\Local\Continuum\anaconda3\envs\cellbrowser-tools\lib\site-packages\ome_types_init_.py", line 37, in from_xml
d = to_dict(xml)
File "C:\Users\danielt\AppData\Local\Continuum\anaconda3\envs\cellbrowser-tools\lib\site-packages\ome_types\schema.py", line 265, in to_dict
_xml = xml if os.path.exists(xml) else StringIO(xml)
File "C:\Users\danielt\AppData\Local\Continuum\anaconda3\envs\cellbrowser-tools\lib\genericpath.py", line 19, in exists
os.stat(path)
ValueError: stat: path too long for Windows

It seems the code is using os.path.exists on the raw xml string to see if it's a file or not?

@tlambert03
Copy link
Owner

huh, that sounds like #50 (comment) which I tried to fix in #56 ... (and yeah, it does call os.path.exists to detect if it's a raw XML string or a file). However, I only tested locally on mac (where it works). will try to post a fix soon. thanks!

@toloudis
Copy link
Author

Thanks for the quick fix here. Looking forward to the release. I also heartily approve of the addition of other platforms to the tests in github actions.
And thanks for the work on this cool library -- as you probably know, we are going to incorporate it into an upcoming version of aicsimageio ! In the meantime I am trying to use it as an intermediate representation in some other processing I'm doing.

@tlambert03
Copy link
Owner

No problem! Thanks again for letting me know. Looks like tests are passing now on all three platforms, with py3.7-3.9. I just pushed v0.2.2 and it will likely post to pypi shortly.

I'm very glad to hear you're finding it useful at aics! And using it as an intermediate representation was what got me going down this line in the first place :) so will be curious to hear how that works out for you. keep me updated 👍

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

Successfully merging a pull request may close this issue.

2 participants