Error during logging with trial: StdioOnnaStick instance has no attribute 'isatty'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| tremolo reported | |
|---|---|
| Trac ID | trac#3067 |
| Type | defect |
| Created | 2008-03-07 13:04:57Z |
In _AnsiColorizer.supported() in module twisted.trial.reporter the call to sys.stderr.isatty() fails, because sys.stderr is wrapped by a StdioOnnaStick instance
and there is no isatty method in that class.
This issue came up already in
http://twistedmatrix.com/pipermail/twisted-python/2007-November/016380.html
but i could not find a matching ticket and the problem remains in svn trunk.
I attached a little patch to add a hasattr test to make sure isatty() is present.
It might also be a good idea to give StdioOnnaStick an isatty method and i added another patch to do that.
Attachments:
- isatty_check.patch (561 bytes) - added by tremolo on 2008-03-07 13:05:18Z -
- isatty_StdioOnnaStick.patch (429 bytes) - added by tremolo on 2008-03-07 13:06:40Z -
Searchable metadata
trac-id__3067 3067
type__defect defect
reporter__tremolo tremolo
priority__low low
milestone__
branch__
branch_author__
status__new new
resolution__None None
component__trial trial
keywords__trial_reporter_isatty_StdioOnnaStick trial reporter isatty StdioOnnaStick
time__1204895097000000 1204895097000000
changetime__1243884829000000 1243884829000000
version__None None
owner__
cc__tremolo
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in twisted.trial.reporter, at _AnsiColorizer.supported(), and inspect StdioOnnaStick where trial replaces sys.stderr. Reproduce the logging failure under trial and compare the attached isatty_check.patch and isatty_StdioOnnaStick.patch. Done means trial logging no longer raises when stderr lacks isatty, with the relevant reporter behavior verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100