相关疑难解决方法(0)

关闭vs关闭套接字?

在C中,我理解如果我们关闭套接字,则意味着套接字将被销毁,以后可以重新使用.

关机怎么样?描述说它关闭了与该套接字的双工连接的一半.但是那个套接字会像close系统调用一样被销毁吗?

c sockets networking

199
推荐指数
6
解决办法
23万
查看次数

Python/Django"BadStatusLine"错误

我得到一个奇怪的错误,我似乎无法找到解决方案.

每次我点击这段代码时都不会发生这个错误,并且它也不会发生在循环中的同一次迭代中(它发生在循环中).如果我运行足够,它似乎没有遇到错误,程序执行成功.无论如何,我仍然想知道为什么会这样.

这是我的错误,版本,跟踪等:http://dpaste.com/681658/

似乎在我的代码中出现以下行:

page = urllib2.urlopen(url)
Run Code Online (Sandbox Code Playgroud)

url显然是一个URL.

并且import urllib2在我的代码中有.

python django

15
推荐指数
3
解决办法
2万
查看次数

如何在python WebDriver中处理偶发的BadStatusLine,CannotSendRequest错误

自从我们开始在jenkins中运行selenium UI测试以来,我们注意到在测试期间出现了一些小而烦人的错误.我们在看似随机的selenium动作(点击,退出,访问等)上得到BadStatusLine和CannotSendRequest错误.

它们通常看起来像:

  File "/usr/lib/python2.7/unittest/case.py", line 327, in run
    testMethod()
  File "/home/jenkins/workspace/Create and Upload Functional Testing/shapeways/test_suite/Portal/CreateAndUpload/TestUploadWhenNotLoggedIn_ExpectLoginModal.py", line 22, in runTest
    self.dw.visit(ShapewaysUrlBuilder.build_model_upload_url())
  File "/home/jenkins/workspace/Create and Upload Functional Testing/webdriver/webdriverwrapper/WebDriverWrapper.py", line 212, in visit
    return self.execute_and_handle_webdriver_exceptions(lambda: _visit(url))
  File "/home/jenkins/workspace/Create and Upload Functional Testing/webdriver/webdriverwrapper/WebDriverWrapper.py", line 887, in execute_and_handle_webdriver_exceptions
    return function_to_execute()
  File "/home/jenkins/workspace/Create and Upload Functional Testing/webdriver/webdriverwrapper/WebDriverWrapper.py", line 212, in <lambda>
    return self.execute_and_handle_webdriver_exceptions(lambda: _visit(url))
  File "/home/jenkins/workspace/Create and Upload Functional Testing/webdriver/webdriverwrapper/WebDriverWrapper.py", line 205, in _visit
    return self.driver.get(url)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 185, in get
    self.execute(Command.GET, {'url': url}) …
Run Code Online (Sandbox Code Playgroud)

python selenium webdriver jenkins selenium-webdriver

5
推荐指数
1
解决办法
4185
查看次数