-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
Fix fsevents segfault #763
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 for fixing this.
src/watchdog_fsevents.c
Outdated
const char *c_string_ptr; | ||
PyObject *py_string; | ||
|
||
c_string_ptr = CFStringGetCStringPtr(cf_string_ref, 0); | ||
c_string_ptr = CFStringGetCStringPtr(cf_string_ref, kCFStringEncodingUTF8); |
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.
You can declare and initialize c_string_ptr
in the same line.
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.
Fair point :)
930bf3a
to
c993fa4
Compare
this prevents unicode normalisation on HFS+
The tests on macOS were all failing but only on Travis. The new test was creating a directory named "TéstClass" with the e-acute represented by U+00E9. On Travis, the resulting native event had a path with name "TéstClass" where the e-acute is U+0065 and U+0301. It appears that the path as reported by FSEvents is correct, the actual file which is created is using the second, decomposed representation of e-acute, contrary to what is passed to A good writeup of the changes: https://eclecticlight.co/2017/04/06/apfs-is-currently-unusable-with-most-non-english-languages/ I have therefore changed the file name to use the decomposed characters in the first place. This explains the last commit with changes that might otherwise appear to be just "cosmetic". I can confirm that the new file name still tests the same code path and that the test fails on the master branch. |
Thank you for the fix and for the explanation about unicode stuff :) No worries about your "C level", you are making the module so much better that it does not count :) |
Release v2.0.1 online. |
Nice! |
Fixes #762 and adds a test case.
Edit: Apologies for the oversight. I did warn you that this was my first time programming in C...