question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem running fuzzingserver in virtualenv

See original GitHub issue

I tried both Python2 and PyPy with no luck in testing my server. I follow the docs, but wstest fails in unhandled exception:

$ virtualenv -p python2 ~/wstest
created virtual environment CPython2.7.18.final.0-64 in 166ms
  creator CPython2Posix(dest=/home/seny/wstest, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/seny/.local/share/virtualenv)
    added seed packages: pip==20.3.4, setuptools==44.1.1, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

$ source ~/wstest/bin/activate
$ pip install autobahntestsuite
...
$ wstest -m fuzzingclient
/home/seny/wstest/lib/python2.7/site-packages/OpenSSL/crypto.py:14: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography import utils, x509
Using implicit spec file 'fuzzingclient.json'
Loading spec from /home/seny/fuzzingclient.json

Using Twisted reactor class <class 'twisted.internet.epollreactor.EPollReactor'>
Using UTF8 Validator class <type 'wsaccel.utf8validator.Utf8Validator'>
Using XOR Masker classes <type 'wsaccel.xormask.XorMaskerNull'>

Autobahn Fuzzing WebSocket Client (Autobahn Testsuite Version 0.8.2 / Autobahn Version 0.10.9)
Ok, will run 517 test cases against 1 servers
...
Servers = [u'ws://127.0.0.1:9001']
Unhandled Error
Traceback (most recent call last):
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/wstest.py", line 346, in run
    start(options, spec)
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/wstest.py", line 280, in start
    reactor.run()
  File "/home/seny/wstest/lib/python2.7/site-packages/twisted/internet/base.py", line 1283, in run
    self.mainLoop()
  File "/home/seny/wstest/lib/python2.7/site-packages/twisted/internet/base.py", line 1292, in mainLoop
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/home/seny/wstest/lib/python2.7/site-packages/twisted/internet/base.py", line 913, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/home/seny/wstest/lib/python2.7/site-packages/twisted/internet/tcp.py", line 520, in connectionLost
    self.connector.connectionLost(reason)
  File "/home/seny/wstest/lib/python2.7/site-packages/twisted/internet/base.py", line 1171, in connectionLost
    self.factory.clientConnectionLost(self, reason)
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/fuzzing.py", line 1292, in clientConnectionLost
    self.createReports()
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/fuzzing.py", line 469, in createReports
    self.createMasterReportHTML(self.outdir)
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/fuzzing.py", line 670, in createMasterReportHTML
    agent_case_report_file = self.makeAgentCaseReportFilename(agentId, caseId, ext = 'html')
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/fuzzing.py", line 498, in makeAgentCaseReportFilename
    return self.cleanForFilename(agentId) + "_case_" + c + "." + ext
  File "/home/seny/wstest/lib/python2.7/site-packages/autobahntestsuite/fuzzing.py", line 487, in cleanForFilename
    s0 = ''.join([c if c in "abcdefghjiklmnopqrstuvwxyz0123456789" else " " for c in str.strip().lower()])
exceptions.AttributeError: 'NoneType' object has no attribute 'strip'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
neoxiccommented, Feb 5, 2022

That’s ok, totally understand.😃 Anyways, I’m grateful for the great yet not perfect test suite!😃 Thank you!

1reaction
neoxiccommented, Feb 4, 2022

I guess you are actually right. I just gave it another try, and:

4.2.1. Reading the Client’s Opening Handshake … 3. An |Upgrade| header field containing the value “websocket”, treated as an ASCII case-insensitive value. 4. A |Connection| header field that includes the token “Upgrade”, treated as an ASCII case-insensitive value.

My bad.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a python virtual env error after installing Lion
I am a complete Python/Virtualenv novice. However, I had the exact same problem and found a solution that worked for me. I believe...
Read more >
12. Virtual Environments and Packages — Python 3.11.1 ...
To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to use a Python virtual environment to manage your Python projects. You'll also dive deep into the ......
Read more >
Resolve issues between Python and Linux with virtualenv
To start working with virtualenv, enter sudo apt-get install virtualenv. Or try other variations on the install process. ... Then, type python3 to ......
Read more >
Pipenv & Virtual Environments
Python has included venv module from version 3.3. For more details: venv. Other Notes¶. Running virtualenv with the option --no-site ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found