pingzh commented on PR #28367:
URL: https://github.com/apache/airflow/pull/28367#issuecomment-1353692433

   > In additional `airflow.utils.file.mkdirs` does not use in airflow and 
community providers. So any changes here does not improve anything.
   
   @Taragolis it is true, it is not used. it was replaced by 
`Path(directory).mkdir(mode=0o777, parents=True, exist_ok=True)`, eg. 
https://github.com/apache/airflow/blob/b263dbcb0f84fd9029591d1447a7c843cb970f15/airflow/utils/log/file_task_handler.py#L345
   
   However, it is incorrect since the `0o777` won't be correctly set, see my PR 
description.
   
   @uranusjr the main gap here is the about the dir mode, see this code block:
   
   ```
   import os
   from tempfile import TemporaryDirectory
   from uuid import uuid4
   from pathlib import Path
   
   with TemporaryDirectory() as tmpdir:
       path = os.path.join(tmpdir, str(uuid4()), str(uuid4()))
       Path(path).mkdir(mode=0o777, parents=True, exist_ok=True)
       mode = oct(os.stat(path).st_mode)[-3:]
       print('mode is', mode) 
      assert mode == "777"
   ```
   
   the `mode` is `755` not `777`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to