[Django] #30588: ipdb breaks the autoreloader

5 views
Skip to first unread message

Django

unread,
Jun 23, 2019, 1:24:15 PM6/23/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader
-------------------------------------------+------------------------
Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.2
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
Using ipdb within Django causes an error:

{{{
File "/usr/local/lib/python3.7/site-
packages/django/utils/autoreload.py", line 249, in watched_files
yield from iter_all_python_module_files()
File "/usr/local/lib/python3.7/site-
packages/django/utils/autoreload.py", line 103, in
iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "/usr/local/lib/python3.7/site-
packages/django/utils/autoreload.py", line 120, in iter_modules_and_files
sys_file_paths.append(module.__file__)
AttributeError: module '__main__' has no attribute '__file__'
}}}

ipython seems to patch __main__:
https://github.com/ipython/ipython/blob/7b42de99c651de35f487adea3f57824ad97bcd74/IPython/testing/globalipapp.py#L115

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

Django

unread,
Jun 23, 2019, 1:35:13 PM6/23/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader
---------------------------------+--------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.2
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by Tom Forbes):

PR: https://github.com/django/django/pull/11507

--
Ticket URL: <https://code.djangoproject.com/ticket/30588#comment:1>

Django

unread,
Jun 23, 2019, 1:35:23 PM6/23/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader
---------------------------------+--------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Tom Forbes):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30588#comment:2>

Django

unread,
Jun 24, 2019, 2:50:22 AM6/24/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader.
---------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: Bug | Status: assigned
Component: Utilities | Version: 2.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* owner: nobody => Tom Forbes
* status: new => assigned
* component: Uncategorized => Utilities
* stage: Unreviewed => Accepted


Comment:

Thanks for the report.

Regression in b2790f74d4f38c8b297b7c1cef6875d2378f6fa6.

--
Ticket URL: <https://code.djangoproject.com/ticket/30588#comment:3>

Django

unread,
Jun 26, 2019, 12:45:09 AM6/26/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader.
---------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: Bug | Status: closed
Component: Utilities | Version: 2.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"8454f6dea49dddb821bfcb7569ea222bb487dfd1" 8454f6de]:
{{{
#!CommitTicketReference repository=""
revision="8454f6dea49dddb821bfcb7569ea222bb487dfd1"
Fixed #30588 -- Fixed crash of autoreloader when __main__ module doesn't
have __file__ attribute.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30588#comment:4>

Django

unread,
Jun 26, 2019, 12:45:56 AM6/26/19
to django-...@googlegroups.com
#30588: ipdb breaks the autoreloader.
---------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: Bug | Status: closed
Component: Utilities | Version: 2.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

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

In [changeset:"bdc1de21992bfbc58e719442d3fb990894b6b713" bdc1de2]:
{{{
#!CommitTicketReference repository=""
revision="bdc1de21992bfbc58e719442d3fb990894b6b713"
[2.2.x] Fixed #30588 -- Fixed crash of autoreloader when __main__ module


doesn't have __file__ attribute.

Backport of 8454f6dea49dddb821bfcb7569ea222bb487dfd1 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages