t.c.i.i.ServerProtocol.selectGraphicRendition doesn't comply with interface
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| @twm reported | |
|---|---|
| Trac ID | trac#6497 |
| Type | defect |
| Created | 2013-04-29 23:42:48Z |
ITerminalTransport.selectGraphicRendition is documented as accepting the constants NORMAL, BOLD, etc. from the same module. However, those constance produce TypeError if passed, as they are ints rather than strings.
It looks like a call to str() is missing in the implementation:
class ServerProtocol(protocol.Protocol):
[...]
def selectGraphicRendition(self, *attributes):
attrs = []
for a in attributes:
attrs.append(a)
self.write('\x1b[%sm' % (';'.join(attrs),))
The copying of attriutes is also a bit silly.
Searchable metadata
trac-id__6497 6497
type__defect defect
reporter__twm twm
priority__normal normal
milestone__
branch__
branch_author__
status__new new
resolution__None None
component__conch conch
keywords__
time__1367278968000000 1367278968000000
changetime__1367280549000000 1367280549000000
version__None None
owner__
cc__z3p
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 at ServerProtocol.selectGraphicRendition and compare its argument handling with the ITerminalTransport interface documentation and constants. Verify that passing NORMAL, BOLD, and the other documented constants no longer raises TypeError, while the generated terminal escape sequence remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100