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
pybind: fix unicode handling in CephFSVolumeClient::purge #8452
Conversation
Tested by ceph/ceph-qa-suite#934 |
Passing test run here (http://pulpito.ceph.com/jspray-2016-04-30_17:56:02-fs-wip-jcsp-testing---basic-mira/) minus the valgrind failure from #8747 |
Looks like that run didn't include test_purge (not using the wip-15266 suite branch). Maybe I'm missing something, but I'm not seeing how using format() handles unicode better than os.path.join - what are the types of args that fail with the latter and succeed with the former? |
Python 3 documentation suggests the following for
In this particular case, one possible fix in PY2 could be: I hope things will be simpler after we have a compatibility layer (for PY2 and PY3 dual support), during Google Summer of Code. |
os.path.join is sensitive to string encoding, but just doing a straight substitution should not be. Signed-off-by: John Spray <john.spray@redhat.com>
@jdurgin yeah, this was a weird one. I think Manila is giving us share IDs (which are very much ascii) as unicode python objects.
My reproducer PR wasn't actually using unicode properly so I've updated that too (can see it failing if you back out the join vs. format change) |
Ah, ran into similar passing of unicode from glance, cinder, and nova - since we didn't have a high-level library like this we ended up forcing everything to utf-8-encoded string types before passing to librbd. Of course, nothing actually used non-ascii chars for e.g. uuids, so it was just a nuisance, but allowed it to work with existing versions of the python bindings. |
Passing test run here: http://pulpito.ceph.com/jspray-2016-05-12_04:34:36-fs-wip-jcsp-testing-20160511---basic-smithi/187784 Any objections to merging? |
lgtm fwiw |
os.path.join is sensitive to string encoding, but
just doing a straight substitution should not be.
Signed-off-by: John Spray john.spray@redhat.com