I am googling a lot to find the solution. Maybe this is windows or python bug. I am here for getting help. It is creating problem while debuging.
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 258, in send_preamble
self._write(('Server: %s\r\n' % self.server_software).encode('iso-8859-1'))
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 803, in write
self._sock.sendall(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
[19/Apr/2019 14:31:19] ERROR [django.server:154] "GET /static/node_modules/metronic-theme-classic/assets/media/logos/favicon.ico HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 52183)
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 258, in send_preamble
self._write(('Server: %s\r\n' % self.server_software).encode('iso-8859-1'))
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 803, in write
self._sock.sendall(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
super().handle_error()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.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\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 654, in process_request_thread
self.finish_request(request, client_address)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 724, in __init__
self.handle()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
self.handle_one_request()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
handler.run(self.server.get_app())
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
super().close()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 803, in write
self._sock.sendall(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
[19/Apr/2019 14:31:21] ERROR [django.server:154] "GET /static/node_modules/metronic-theme-classic/assets/media/logos/favicon.ico HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 52185)
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 803, in write
self._sock.sendall(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
super().handle_error()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.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\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 654, in process_request_thread
self.finish_request(request, client_address)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 724, in __init__
self.handle()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
self.handle_one_request()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
handler.run(self.server.get_app())
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
super().close()
File "C:\Users\azad\AppData\Local\Programs\Python\Python36\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
Related
This question already has answers here:
Django ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
(6 answers)
Closed 3 years ago.
I am getting below error while running command. However, page is opening but on command prompt below error is coming. I referred other stackflow pages where similar error is there but it didnt helped.
python manage.py runserver
Error:
Performing system checks...
System check identified no issues (0 silenced).
December 19, 2019 - 13:04:14
Django version 2.1.5, using settings 'first_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[19/Dec/2019 13:04:19] "GET / HTTP/1.1" 200 2786
[19/Dec/2019 13:04:19] "GET /static/css/mystyle.css HTTP/1.1" 200 68
Not Found: /favicon.ico
[19/Dec/2019 13:04:19] "GET /favicon.ico HTTP/1.1" 404 2211
Traceback (most recent call last):
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\socketserver.py", line 799, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
[19/Dec/2019 13:04:19] "GET /favicon.ico HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 52848)
Traceback (most recent call last):
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\socketserver.py", line 799, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
super().handle_error()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.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\rishbans\Anaconda3\envs\DjangoProject\lib\socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\socketserver.py", line 720, in __init__
self.handle()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
self.handle_one_request()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
handler.run(self.server.get_app())
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
super().close()
File "C:\Users\rishbans\Anaconda3\envs\DjangoProject\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
Any idea, where I should look into it. Let me know if you need any specific file.
This simply means that self.status is somehow returning a None value. So insert a check and try like this:
if self.status != None:
self.status.split(' ',1)[0]
Here is the trace back of the error occurred
[17/Mar/2019 11:15:26] "GET /media/songs/Three_Days_Grace_-_Break.mp3
HTTP/1.1" 200 4579328
Traceback (most recent call last):
File "C:\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python36\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Python36\lib\socketserver.py", line 800, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
[17/Mar/2019 11:15:26] "GET /media/songs/Three_Days_Grace_-_Break.mp3 HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 54509)
Traceback (most recent call last):
File "C:\Python36\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python36\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\Python36\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\Python36\lib\socketserver.py", line 800, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python36\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "D:\Django Projects\Virtual Envs\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
super().handle_error()
File "C:\Python36\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Python36\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python36\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python36\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Python36\lib\wsgiref\handlers.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:\Python36\lib\socketserver.py", line 651, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python36\lib\socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python36\lib\socketserver.py", line 721, in __init__
self.handle()
File "D:\Django Projects\Virtual Envs\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
self.handle_one_request()
File "D:\Django Projects\Virtual Envs\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
handler.run(self.server.get_app())
File "C:\Python36\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "D:\Django Projects\Virtual Envs\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
super().close()
File "C:\Python36\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
Note that I'm still able to play the audio file my template view, but I can't seek to a specific duration of this file. Any hints as to why this is happening ?
Here's my code for models.py :
class Song(models.Model):
song_name = models.CharField(max_length=100)
album_name = models.ForeignKey(Album, on_delete=models.CASCADE)
song_file = models.FileField(upload_to='songs/', null=True,
validators=[validate_song_extension])
def get_absolute_url(self):
return reverse('music:song-detail', kwargs={'pk': self.pk})
def __str__(self):
return self.song_name
I am using a simple CreateView to accept new entries for this Song model with no form_valid() method, is that the possible cause I'm getting this error ?
I am new to the programming and i have been trying to develop an audio player using jQuery/HTML5.The audio source to the jquery is being passed by AJAX response.The audio play is fine in my local host while using Laptop.But if i connect my smartphone and try to play the audio, i get the "ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host" error.
Can someone provide me a solution?.
Thanks in Advance
Exception details:
Traceback (most recent call last):
File "C:\Python35\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python35\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python35\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\Python35\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python35\lib\socket.py", line 593, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
[18/Jul/2017 18:04:21] "GET /images/mpthreetest.mp3 HTTP/1.1" 500 59
Exception happened during processing of request from ('192.168.1.35', 33876)
Traceback (most recent call last):
File "C:\Python35\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python35\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python35\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\Python35\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python35\lib\socket.py", line 593, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python35\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Python35\lib\site-packages\django\core\servers\basehttp.py", line 95, in handle_error
super(ServerHandler, self).handle_error()
File "C:\Python35\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Python35\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python35\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python35\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Python35\lib\wsgiref\handlers.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:\Python35\lib\socketserver.py", line 628, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python35\lib\socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python35\lib\socketserver.py", line 684, in init
self.handle()
File "C:\Python35\lib\site-packages\django\core\servers\basehttp.py", line 174, in handle
handler.run(self.server.get_app())
File "C:\Python35\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Python35\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
I need to create a client/server example with TLS 1.2 in Python. I spent many hours and I did not get anything...
I'm trying this example: https://github.com/titeuf87/python3-tls-example
I'm getting this error when I execute the client.py:
Exception in callback None
handle: <Handle cancelled>
Traceback (most recent call last):
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\events.py", line 125, in _run
self._callback(*self._args)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\selector_events.py", line 667, in _read_ready
self._protocol.data_received(data)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\sslproto.py", line 486, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\sslproto.py", line 200, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 633, in do_handshake
match_hostname(self.getpeercert(), self.server_hostname)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 300, in match_hostname
% (hostname, dnsnames[0]))
ssl.CertificateError: hostname '127.0.0.1' doesn't match 'server'
Traceback (most recent call last):
File "C:\Users\PC\workspace\testingpython\client.py", line 18, in <module>
loop.run_until_complete(connect())
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\base_events.py", line 342, in run_until_complete
return future.result()
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 237, in _step
result = coro.throw(exc)
File "C:\Users\PC\workspace\testingpython\client.py", line 11, in connect
reader, writer = yield from asyncio.open_connection("127.0.0.1", 1234, ssl=sslcontext)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 64, in open_connection
lambda: protocol, host, port, **kwds)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\base_events.py", line 669, in create_connection
sock, protocol_factory, ssl, server_hostname)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\base_events.py", line 692, in _create_connection_transport
yield from waiter
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 385, in __iter__
yield self # This tells Task to wait for completion.
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 288, in _wakeup
value = future.result()
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\events.py", line 125, in _run
self._callback(*self._args)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\selector_events.py", line 667, in _read_ready
self._protocol.data_received(data)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\sslproto.py", line 486, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\asyncio\sslproto.py", line 200, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 633, in do_handshake
match_hostname(self.getpeercert(), self.server_hostname)
File "C:\Users\PC\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 300, in match_hostname
% (hostname, dnsnames[0]))
ssl.CertificateError: hostname '127.0.0.1' doesn't match 'server'
Does anyone know of any examples?
Related:
I am total new to Python and its frameworks. Just trying some hands on Django after some Python fundamentals.
Problem:
Right now I am trying to run Django server after first installation. The server runs without any error but when I try to visit the web page I get 503 Service Unavailable Error on http://127.0.0.1:8000/ and the server shuts down automatically.
Server Runs but errors after request:
D:\Code\Outer_Dir>manage.py runserver
Validating models...
0 errors found
December 23, 2013 - 21:51:36
Django version 1.6.1, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
^C
D:\Code\Outer_Dir>manage.py runserver
Validating models...
0 errors found
December 23, 2013 - 21:55:21
Django version 1.6.1, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[23/Dec/2013 21:55:26] "GET / HTTP/1.1" 200 1757
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python33\lib\socket.py", line 317, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly close
d by the remote host
[23/Dec/2013 21:55:26] "GET / HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 58251)
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python33\lib\socket.py", line 317, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly close
d by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Python33\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Python33\lib\wsgiref\handlers.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:\Python33\lib\socketserver.py", line 610, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python33\lib\socketserver.py", line 345, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python33\lib\site-packages\django\core\servers\basehttp.py", line 126
, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "C:\Python33\lib\socketserver.py", line 666, in __init__
self.handle()
File "C:\Python33\lib\wsgiref\simple_server.py", line 126, in handle
handler.run(self.server.get_app())
File "C:\Python33\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Python33\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python33\lib\socket.py", line 317, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly close
d by the remote host
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 58252)
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 333, in send_headers
self._write(bytes(self.headers))
File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "C:\Python33\lib\socket.py", line 317, in write
return self._sock.send(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly close
d by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Python33\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:\Python33\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:\Python33\lib\wsgiref\handlers.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:\Python33\lib\socketserver.py", line 610, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python33\lib\socketserver.py", line 345, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python33\lib\site-packages\django\core\servers\basehttp.py", line 126
, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "C:\Python33\lib\socketserver.py", line 666, in __init__
self.handle()
File "C:\Python33\lib\wsgiref\simple_server.py", line 126, in handle
handler.run(self.server.get_app())
File "C:\Python33\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "C:\Python33\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'