Add missing _optionally_create_directory in Android user_log_dir and user_runtime_dir#452
Open
bysiber wants to merge 3 commits intotox-dev:mainfrom
Open
Add missing _optionally_create_directory in Android user_log_dir and user_runtime_dir#452bysiber wants to merge 3 commits intotox-dev:mainfrom
bysiber wants to merge 3 commits intotox-dev:mainfrom
Conversation
…ntime_dir When ensure_exists=True, the Unix implementation correctly calls _optionally_create_directory on the opinionated subdirectory (e.g. the 'log' subdir within user_log_dir). The Android implementation was missing these calls, so the 'log' and 'tmp' subdirectories would not be created even when ensure_exists was set. This adds the missing _optionally_create_directory calls in user_log_dir and user_runtime_dir on Android to match the Unix behavior.
Verify that user_log_dir and user_runtime_dir create the opinion subdirectories (log/ and tmp/) when ensure_exists=True.
Author
|
Added a parametrized test that verifies |
for more information, see https://pre-commit.ci
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.
Summary
When
ensure_exists=Trueis set, the Unix implementation correctly calls_optionally_create_directoryon the opinionated subdirectory foruser_log_dir(thelogsubdir). However, the Android implementation is missing these calls for bothuser_log_diranduser_runtime_dir.Problem
On Android, calling
user_log_diroruser_runtime_dirwithensure_exists=Trueandopinion=Truedoes not create the opinionated subdirectories (logandtmprespectively), even though the parent cache directory is created. This is inconsistent with the Unix implementation which does call_optionally_create_directoryafter appending thelogsubdirectory.For example, comparing
user_log_dirin both platforms:Unix (correct):
Android (before this fix):
Fix
Added
self._optionally_create_directory(path)calls inuser_log_diranduser_runtime_dirwithin theif self.opinion:blocks, matching the existing Unix behavior.