twisted / twisted/twisted

twisted.conch.telnet doesn't call enableRemote when using python -O

Open
#4,349 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug conch new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

ivank's avatar ivank reported
Trac ID trac#4349
Type defect
Created 2010-03-05 15:58:57Z

twisted.conch.telnet has an assert which should probably not be an assert:

assert self.enableRemote(option), "enableRemote must return True in this context (for option %r)" % (option,)

(after all, enableRemote might actually mutate something, and in this case, it looks like it does.)

python -O `which trial` twisted.conch.test.test_telnet
...

===============================================================================
[FAIL]: twisted.conch.test.test_telnet.TelnetTransportTestCase.testAcceptedEnableRequest

Traceback (most recent call last):
  File "/home/a/Projects/Twisted/twisted/conch/test/test_telnet.py", line 400, in <lambda>
    d.addCallback(lambda _:  self._enabledHelper(h, eR=['\x42']))
  File "/home/a/Projects/Twisted/twisted/conch/test/test_telnet.py", line 231, in _enabledHelper
    self.assertEquals(o.enabledRemote, eR)
twisted.trial.unittest.FailTest: not equal:
a = []
b = ['B']

===============================================================================
[FAIL]: twisted.conch.test.test_telnet.TelnetTransportTestCase.testNegotiationBlocksFurtherNegotiation

Traceback (most recent call last):
  File "/home/a/Projects/Twisted/twisted/conch/test/test_telnet.py", line 464, in <lambda>
    dR=['\x24']))
  File "/home/a/Projects/Twisted/twisted/conch/test/test_telnet.py", line 231, in _enabledHelper
    self.assertEquals(o.enabledRemote, eR)
twisted.trial.unittest.FailTest: not equal:
a = []
b = ['$']

Attachments:

  • 4349.patch (656 bytes) - added by MostAwesomeDude on 2011-03-23 05:17:09Z - Trivial fix
Searchable metadata
trac-id__4349 4349
type__defect defect
reporter__ivank ivank
priority__normal normal
milestone__ 
branch__ 
branch_author__ 
status__new new
resolution__None None
component__conch conch
keywords__ 
time__1267804737000000 1267804737000000
changetime__1301352949000000 1301352949000000
version__None None
owner__MostAwesomeDude MostAwesomeDude

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in twisted.conch.telnet at the assert around enableRemote, then run python -O which trial twisted.conch.test.test_telnet as reported. Use twisted/conch/test/test_telnet.py, especially testAcceptedEnableRequest and testNegotiationBlocksFurtherNegotiation, to verify that remote options are enabled and the tests pass with optimization enabled.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.