-
Notifications
You must be signed in to change notification settings - Fork 184
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
Patching export for unicode issue #3537
Patching export for unicode issue #3537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CasperWA : few questions. Not sure about the solution, mostly also because I don't think we (me at least) fully understand the cause of the failure. Need to reproduce it first and add a test
@@ -412,7 +412,7 @@ def export_tree( | |||
} | |||
|
|||
# N.B. We're really calling zipfolder.open (if exporting a zipfile) | |||
with folder.open('data.json', mode='w') as fhandle: | |||
with folder.open('data.json', mode='w', encoding='utf-8') as fhandle: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main question is under what conditions did @AntimoMarrazzo case fail and why was this not caught by the tests. I would first want to fully understand the failure and then add a test.
dd65904
to
38b3ac9
Compare
@CasperWA what is the status of this? are you waiting for @AntimoMarrazzo to test it? did you discuss @sphuber comment in person? (in which case shouldn't we mark them as resolved?) |
Since this has been open for very long and needs more work, is it ok to close this @CasperWA ? |
Please wait a bit longer. I will get around to it soonish - at least to fully review what needs to be done and at the very least update the original issue / update the PR. |
38b3ac9
to
74a211d
Compare
Test 'b' in mode is respected, when using ZipFolder.open().
Issue aiidateam#3199 has been fixed by aiidateam#3402.
74a211d
to
dca2107
Compare
The original issue pertains to discrepancies between Py2 and Py3. A good explanation can be found in this StackOverflow accepted answer. In the current version of AiiDA we do not support Py2, so this is not an issue. The original issue is thus not truly fixed, since it pertains to an older AiiDA version (one that supports Py2). |
Thinking further about this, the issue is actually that we're using the custom |
Codecov Report
@@ Coverage Diff @@
## develop #3537 +/- ##
===========================================
+ Coverage 78.77% 78.77% +0.01%
===========================================
Files 463 463
Lines 34399 34408 +9
===========================================
+ Hits 27094 27103 +9
Misses 7305 7305
Continue to review full report at Codecov.
|
I think perhaps this PR should be closed, and issue #3492 should be directed towards the mixed Py2/Py3 versions. I will create another PR for the changes I have introduced in this PR, but they have nothing to do with the original issue, but are simply a streamlining of the |
Fixes #3492
This PR attemps to accommodate the issue described in #3492 by adding encoding info when opening the json files for writing during export and further adding some encoding info in our own
ZipFolder
.@AntimoMarrazzo, could you possibly try and export using this branch and see if it fixes your usecase?