[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78efbf499611 by Berker Peksag in branch '3.5':
Issue #26384: Fix UnboundLocalError in socket._sendfile_use_sendfile
https://hg.python.org/cpython/rev/78efbf499611

New changeset 2156aa4050c7 by Berker Peksag in branch '3.6':
Issue #26384: Merge from 3.5
https://hg.python.org/cpython/rev/2156aa4050c7

New changeset 0d440fda8604 by Berker Peksag in branch 'default':
Issue #26384: Merge from 3.6
https://hg.python.org/cpython/rev/0d440fda8604

--
nosy: +python-dev

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Changes by Berker Peksag :


Added file: http://bugs.python.org/file44721/issue26384_v3.diff

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Serhiy. Here's an updated patch.

--
versions: +Python 3.7
Added file: http://bugs.python.org/file44720/issue26384_v2.diff

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This issue can be tested without moking os.fstat():

class F:
def fileno(self):
return fd
with socket.socket() as sock:
fd = os.open(os.curdir, os.O_RDONLY)
os.close(fd)
self.assertRaises(socket._GiveupOnSendfile,
  sock._sendfile_use_sendfile, F())

os.fstat() can raise not only OSError. It may be worth to test also with fd = 
2**1000 and fd = None.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-02-18 Thread Berker Peksag

New submission from Berker Peksag:

I noticed this while working on issue 16915:

Traceback (most recent call last):
  ...
  File "/home/berker/projects/cpython/default/Lib/socket.py", line 262, in 
_sendfile_use_sendfile
raise _GiveupOnSendfile(err)  # not a regular file
UnboundLocalError: local variable 'err' referenced before assignment

Here's a patch.

--
components: Library (Lib)
files: socket_unboundlocalerror.diff
keywords: patch
messages: 260464
nosy: berker.peksag
priority: normal
severity: normal
stage: patch review
status: open
title: UnboundLocalError in socket._sendfile_use_sendfile
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41956/socket_unboundlocalerror.diff

___
Python tracker 

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