Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#30588 closed Bug (fixed)

ipdb breaks the autoreloader.

Reported by: Tom Forbes Owned by: Tom Forbes
Component: Utilities Version: 2.2
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (5)

comment:2 Changed 3 months ago by Tom Forbes

Has patch: set

comment:3 Changed 3 months ago by felixxm

Component: UncategorizedUtilities
Owner: changed from nobody to Tom Forbes
Status: newassigned
Summary: ipdb breaks the autoreloaderipdb breaks the autoreloader.
Triage Stage: UnreviewedAccepted

Thanks for the report.

Regression in b2790f74d4f38c8b297b7c1cef6875d2378f6fa6.

comment:4 Changed 3 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In 8454f6de:

Fixed #30588 -- Fixed crash of autoreloader when main module doesn't have file attribute.

comment:5 Changed 3 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In bdc1de2:

[2.2.x] Fixed #30588 -- Fixed crash of autoreloader when main module doesn't have file attribute.

Backport of 8454f6dea49dddb821bfcb7569ea222bb487dfd1 from master

Note: See TracTickets for help on using tickets.
Back to Top