This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author iMath
Recipients SG, asvetlov, berker.peksag, iMath, kristjan.jonsson, pje, r.david.murray, steve.dower, tim.golden
Date 2016-08-09.02:31:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470709883.38.0.458322014171.issue27682@psf.upfronthosting.co.za>
In-reply-to
Content
I use the following django view function also produce the same exception 

def sendFiles(request): 
    fileName = request.GET['fileName']

    pathToFile = os.path.join(filesDir, fileName)
    response = FileResponse(open(pathToFile, 'rb'))

    response['Content-Type'] = 'application/octet-stream'
    response[
        'Content-Disposition'] = 'attachment; fileName="{}"'.format(fileName)
    response['Content-Length'] = os.path.getsize(pathToFile)
    # HttpResponse(open(os.path.join(os.getcwd(), 'LYYDownloaderServer.log'), 'r'), content_type='text/plain')
    return response

Tested with sending file Git-2.8.4-32-bit.exe (29.8MB), if tested with sending file GitHubSetup.exe(670kb),then no exception occurred.

the exception like the following 

    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 5
00 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 62237)
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 141, in run
    self.handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 92, in handle_error
    super(ServerHandler, self).handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 368, in handle_error
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 625, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 354, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 99, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 681, in __init__
    self.handle()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 179, in handle
    handler.run(self.server.get_app())
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 144, in run
    self.close()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\simple_
server.py", line 36, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 2
00 8192
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 5
00 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 62229)
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 141, in run
    self.handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 92, in handle_error
    super(ServerHandler, self).handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 368, in handle_error
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 625, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 354, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 99, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 681, in __init__
    self.handle()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 179, in handle
    handler.run(self.server.get_app())
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 144, in run
    self.close()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\simple_
server.py", line 36, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 2
00 8192
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 5
00 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 62231)
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
    return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 141, in run
    self.handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 92, in handle_error
    super(ServerHandler, self).handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 368, in handle_error
    self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
    self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 625, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 354, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 99, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 681, in __init__
    self.handle()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 179, in handle
    handler.run(self.server.get_app())
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 144, in run
    self.close()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\simple_
server.py", line 36, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
History
Date User Action Args
2016-08-09 02:31:23iMathsetrecipients: + iMath, pje, kristjan.jonsson, tim.golden, r.david.murray, asvetlov, berker.peksag, steve.dower, SG
2016-08-09 02:31:23iMathsetmessageid: <1470709883.38.0.458322014171.issue27682@psf.upfronthosting.co.za>
2016-08-09 02:31:23iMathlinkissue27682 messages
2016-08-09 02:31:20iMathcreate