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 nascheme
Recipients SilentGhost, martin.panter, nascheme
Date 2016-06-24.17:17:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466788631.48.0.620909577176.issue27377@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you for the excellent review Martin.  I'm attaching a new patch which I think addresses your points.  I created it from hg, maybe that works nicer.

I've added constants for SO_DOMAIN, SO_PROTOCOL, SO_PASSCRED, SO_PEERSEC, and SO_PASSEC.

Using SO_PROTOCOL to get the protocol value seems to work fine on Linux.

I've dropped the union as you suggest.  I think the docs have been fixed.

I would be okay with making fdtype() a non-public function.  It seems possibly useful though.

Regarding the name, currently I think fromfd2 is best.  It really does what fromfd() should have done if SO_TYPE/SO_PROTOCOL was available and portable.  

Extending fromfd() seems a bad idea.  I don't want dup() and it seems better that application code can use hasattr() to test for new functionality.  You can work around not having fromfd2() by using getsockname() and then using some ugly text matching to work out what kind of socket you have.
History
Date User Action Args
2016-06-24 17:17:11naschemesetrecipients: + nascheme, SilentGhost, martin.panter
2016-06-24 17:17:11naschemesetmessageid: <1466788631.48.0.620909577176.issue27377@psf.upfronthosting.co.za>
2016-06-24 17:17:11naschemelinkissue27377 messages
2016-06-24 17:17:11naschemecreate