Repository navigation
Conversation
…E#973) On Windows, os.makedirs(..., mode=0o700) does not set POSIX bits: CPython turns the mode into a DACL for the creating token. A launcher started elevated creates the directory owned by BUILTIN\Administrators, so the next non-elevated backend cannot enter it and Chewing stops composing without a log line. The profile directory already carries a user-only inherited ACL, so create the PIME directories without a mode on Windows and keep 0o700 on POSIX. The two build-time converters under cinbase/tools keep their mode: they write inside the checkout, not the profile, and are not started by the launcher. Generated with assistance from omp (deepseek-v4.1-flash)
chewing_new2() returning NULL left a context that accepted every call, so
filterKeyDown() took the Chinese branch and onKeyDown() fed a NULL engine: keys
were swallowed and nothing reached the backend log. Raise from
ChewingContext.__init__ instead; server.py already turns that into a logged
traceback and a {success:false} reply, and the message names the likely elevated
install. Skip chewing_delete for a context that was never created.
Generated with assistance from omp (deepseek-v4.1-flash)
…IME#973) The directory test pins the platform split: no mode on Windows (inherit the profile ACL), 0o700 on POSIX. The chewing test fakes libchewing so a NULL handle raises, is never passed to chewing_delete, and a valid handle is deleted once. Generated with assistance from omp (deepseek-v4.1-flash)
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #973
os.makedirs(..., mode=0o700)sets no POSIX bits on Windows: CPython turns the mode into a DACL for the creating token. A launcher that was ever started elevated therefore creates%APPDATA%\PIME\<ime>owned byBUILTIN\Administratorswith no ACE for the user, the next non-elevated backend cannot read it,chewing_new2()returns NULL after ~6 s of retries, and every key is swallowed whilepython_backend.logstays empty.ensure_user_dir(): nomodeon Windows, so the directory inherits the profile's user-only ACL;0o700on POSIX so other local users still cannot read IME data.ChewingContext.__init__whenchewing_new2()/chewing_new()return NULL, naming the elevated-install possibility.server.pyalready logs the traceback and replies{success:false}.chewing_deleteis skipped for a context that was never created.tests/test_pime_dirs.pypins the platform split;tests/test_chewing_context.pyfakes libchewing to cover the NULL and delete paths.Validation:
python3 -m unittest discover -s tests -p 'test_*.py': 22 tests OK.python/python3/python.exe, 3.15.1): 22 tests OK.import input_methods.chewing.chewing_configresolves on the shipped interpreter.os.mkdirdocumentation (a0o700mode applies access control on Windows, 3.13+) and theicaclsoutput in Chewing silently stops working (keys swallowed) if the user config folder was created by an elevated PIMELauncher #973; python/cpython#157876 tracks the elevated-owner case.The two build-time converters under
cinbase/tools/keep0o700: they write inside the checkout, not the profile, and the launcher never runs them.Generated with assistance from omp (DeepSeek V4.1 Flash).