Re: [Django] #15799: Document what exception should be raised when trying to open non-existent file

11 views
Skip to first unread message

Django

unread,
May 21, 2023, 12:00:06 AM5/21/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
--------------------------------------+------------------------------------
Reporter: Jonas H. | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: File uploads/storage | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Collin Anderson):

* cc: Collin Anderson (added)
* needs_docs: 0 => 1
* type: New feature => Cleanup/optimization
* easy: 0 => 1


Comment:

`FileNotFoundError` was added in Python 3.3 / PEP 3151 and kinda fixed
this issue.

Could maybe help to document raising exceptions like `FileNotFoundError`
here https://docs.djangoproject.com/en/dev/howto/custom-file-storage/ ,
though probably doesn't need to be super thoroughly documented, as it
mostly should be similar to Python's open().

--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 24, 2023, 3:46:25 AM5/24/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Ashis Kar
Type: | Status: assigned
Cleanup/optimization |
Component: File | Version: dev
uploads/storage |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ashis Kar):

* owner: nobody => Ashis Kar
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:5>

Django

unread,
Aug 2, 2023, 7:59:51 AM8/2/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: assigned

Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anthony Kugel):

* owner: nobody => Anthony Kugel

Django

unread,
Aug 4, 2023, 1:27:39 AM8/4/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: assigned
Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_docs: 1 => 0
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17144 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:6>

Django

unread,
Aug 4, 2023, 1:46:22 AM8/4/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: assigned
Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:7>

Django

unread,
Aug 4, 2023, 11:40:39 AM8/4/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: assigned
Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:8>

Django

unread,
Aug 4, 2023, 12:07:48 PM8/4/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: closed

Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"8edaf07a28a3e3848ab1edbdcd2fdc25e6bd6015" 8edaf07a]:
{{{
#!CommitTicketReference repository=""
revision="8edaf07a28a3e3848ab1edbdcd2fdc25e6bd6015"
Fixed #15799 -- Doc'd that Storage._open() should raise FileNotFoundError
when file doesn't exist.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:9>

Django

unread,
Aug 4, 2023, 12:09:13 PM8/4/23
to django-...@googlegroups.com
#15799: Document what exception should be raised when trying to open non-existent
file
-------------------------------------+-------------------------------------
Reporter: Jonas H. | Owner: Anthony
Type: | Kugel
Cleanup/optimization | Status: closed
Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"a22aeef55551dc6827b11afcc994a342fca93453" a22aeef5]:
{{{
#!CommitTicketReference repository=""
revision="a22aeef55551dc6827b11afcc994a342fca93453"
[4.2.x] Fixed #15799 -- Doc'd that Storage._open() should raise


FileNotFoundError when file doesn't exist.

Backport of 8edaf07a28a3e3848ab1edbdcd2fdc25e6bd6015 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15799#comment:10>

Reply all
Reply to author
Forward
0 new messages