AttributeError: '_io.TextIOWrapper' object has no attribute 'getvalue'
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
Was debugging an AWS Lambda, trying to set `sys.stdout`
```
Traceback (most recent call last):
File "/var/task/wdb/ui.py", line 193, in loop
stop = self.interact()
File "/var/task/wdb/ui.py", line 240, in interact
rv = fun(data)
File "/var/task/wdb/ui.py", line 469, in do_eval
self.db.hooked = self.handle_exc()
File "/var/lang/lib/python3.6/contextlib.py", line 89, in __exit__
next(self.gen)
File "/var/task/wdb/__init__.py", line 653, in capture_output
out.extend(sys.stdout.getvalue().splitlines())
File "/var/task/project/hooks.py", line 59, in __getattr__
return getattr(self._replaced, attr)
File "/var/runtime/awslambda/bootstrap.py", line 361, in __getattr__
return getattr(self._fd, attr)
AttributeError: '_io.TextIOWrapper' object has no attribute 'getvalue'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with capture_output in wdb/__init__.py at the failing getvalue call, then review the AWS Lambda traceback and the stdout delegation shown in project/hooks.py. Reproduce the Lambda-specific behavior if possible; done should mean output capture no longer raises this AttributeError while handling the reported execution path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100