[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

Sushant added the comment:

The CSV is around 75 MB, not that big I guess. And I've tried Chrome, Edge and 
Firefox

--

___
Python tracker 
<http://bugs.python.org/issue27682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

Sushant added the comment:

Also, since I re-installed everything, I got python 3.5 too

--

___
Python tracker 
<http://bugs.python.org/issue27682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

Sushant added the comment:

There have been a few times when this code ran perfectly fine, without any 
errors whatsoever. 

So the structure is like this-

This code reads a csv, processes it and save it in a model-

class Endday(models.Model):
  company = models.TextField(null=True)
  eop = models.TextField(max_length=10) 

Now the database is postgresql, as soon as save is called, data is posted 
there. This code runs fine on my colleague's computer(same code) but he has 
windows 7. Thinking this might be a windows error, I re-installed windows 10 
from the scratch. But to no help. At last, I had to knock python's door.

--

___
Python tracker 
<http://bugs.python.org/issue27682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

Sushant added the comment:

The code is actually quite simple, I'll post it over here-

def import_eop(request):
  with 
open('C:/Users/sg/Desktop/projects/drfapi/venv/drf/prices_companies_indices_transpose.csv')
 as f:
contents = f.readlines()
dates = contents[0]
dates = dates.split(",")
dates = dates[1:]
d = []
for i in range(len(dates)):
  d.append(Dates(date=dates[i]))
Dates.objects.bulk_create(d)
companies = []
entry = []
for i in range(1, len(contents)):
  csline = contents[i].split(",")
  prices = csline[1:len(csline)]
  company = csline[0]
  prices =[float(x) for x in prices]
  entry = (Endday(company=company, eop=prices))
  entry.save()
  f.close()
  print('Saved to database')
  return HttpResponse('Ok')


Now as you see, I'm not even handling wsgiref.close() at all. This isn't a 
django issue since django community themselves pointed me to this direction. 
Let me know if I can be of any help.

--
nosy: +SG

___
Python tracker 
<http://bugs.python.org/issue27682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

Changes by Sushant :


--
nosy: +asvetlov, kristjan.jonsson, pje, steve.dower, tim.golden -SG

___
Python tracker 
<http://bugs.python.org/issue27682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-04 Thread Sushant

New submission from Sushant:

While saving, this error shows up and is whatever is saving gets saved twice-

Traceback (most recent call last):
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
138, in run
self.finish_response()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
180, in finish_response
self.write(data)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
274, in write
self.send_headers()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
332, in send_headers
    self.send_preamble()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\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\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
453, in _write
result = self.stdout.write(data)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\socket.py", line 593, in 
write
return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted 
by the software in your host machine
[04/Aug/2016 17:25:59] "GET /api/importeop/ HTTP/1.1" 500 59

Exception happened during processing of request from ('127.0.0.1', 51082)
Traceback (most recent call last):
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
138, in run
self.finish_response()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
180, in finish_response
self.write(data)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
274, in write
self.send_headers()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
332, in send_headers
self.send_preamble()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\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\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
453, in _write
result = self.stdout.write(data)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\socket.py", line 593, in 
write
return self._sock.send(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\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
141, in run
self.handle_error()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\servers\basehttp.py",
 line 92, in handle_error
super(ServerHandler, self).handle_error()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
368, in handle_error
self.finish_response()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
180, in finish_response
self.write(data)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
274, in write
self.send_headers()
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handlers.py", line 
331, in send_headers
if not self.origin_server or self.client_is_modern():
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\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\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py", line 
625, in process_request_thread
self.finish_request(request, client_address)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py", line 
354, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\Sushant 
Gahlot\AppData\Local\Programs\Python\Python35-32\lib\