Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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 by Tom Forbes, 5 years ago

Has patch: set

comment:3 by Mariusz Felisiak, 5 years ago

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 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 8454f6de:

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

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

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