Changes between Initial Version and Version 1 of Ticket #32821


Ignore:
Timestamp:
Jun 6, 2021, 12:00:48 AM (4 years ago)
Author:
Chris Jerdonek
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32821 – Description

    initial v1  
    1 I noticed that Django doesn't use a `with` statement when it uses `os.scandir()`, which is what the [https://docs.python.org/3/library/os.html#os.scandir.close Python docs advise as of 3.6]. Here is [https://github.com/django/django/blob/ecf8af79355c8daa67722bd0de946b351f7f613d/django/core/files/storage.py#L324-L328 one example in the code]. There appear to be 7 uses of `os.scandir()` in all, with 5 in test code.
     1I noticed that Django doesn't use a `with` statement (or call `close()`) when it uses `os.scandir()`, which is what the [https://docs.python.org/3/library/os.html#os.scandir.close Python docs advise as of 3.6]. Here is [https://github.com/django/django/blob/ecf8af79355c8daa67722bd0de946b351f7f613d/django/core/files/storage.py#L324-L328 one example in the code]. There appear to be 7 uses of `os.scandir()` in all, with 5 in test code.
    22
    33Usage with the `with` statement looks like this:
Back to Top