AttributeError: 'FileSourceCodeProvider' object has no attribute 'message'
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 245
- Avg merge
- 13m
- Merged PRs (30d)
- 5
Description
I see the above error message when attempting to debug a program with warnings as errors. When running without that conversion, pudb works well
e.g., the following is fine
``` shell
$ python /home/alanb/src/python/purge_music.py
```
But the following crashes:
``` shell
$ python -W error /home/alanb/src/python/purge_music.py
Traceback (most recent call last):
File "/home/alanb/src/python/purge_music.py", line 67, in
sys.exit(main())
File "/home/alanb/src/python/purge_music.py", line 46, in main
sync = datetime(2014, 4, 18, 0, 0)
File "/home/alanb/src/python/purge_music.py", line 46, in main
sync = datetime(2014, 4, 18, 0, 0)
File "/home/alanb/lib/python2.7/bdb.py", line 49, in trace_dispatch
return self.dispatch_line(frame)
File "/home/alanb/lib/python2.7/bdb.py", line 67, in dispatch_line
self.user_line(frame)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 323, in user_line
self.interaction(frame)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 288, in interaction
self.set_frame_index(index)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 236, in set_frame_index
FileSourceCodeProvider(self, filename))
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 2120, in set_current_line
self.show_line(line, source_code_provider)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 2106, in show_line
self.set_source_code_provider(source_code_provider)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 2096, in set_source_code_provider
self.source[:] = source_code_provider.get_lines(self)
File "/home/alanb/lib/python2.7/site-packages/pudb/debugger.py", line 509, in get_lines
self.message("Could not load source file '%s':\n\n%s" % (
AttributeError: 'FileSourceCodeProvider' object has no attribute 'message'
```
Looking at that code, https://github.com/inducer/pudb/blob/master/pudb/debugger.py#L509, the error seems reasonable in that message is a method on DebuggerUI, not FileSourceCodeProvider. Line 509 is probably being exercised unusually because I have warnings promoted to exceptions.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.