Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5262)

Unified Diff: Doc/library/socket.rst

Issue 28332: silent truncations in socket.htons and socket.ntohs
Patch Set: Created 2 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_socket.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/socket.rst Sat Oct 01 01:06:51 2016 -0500
+++ b/Doc/library/socket.rst Sun Oct 02 09:13:38 2016 +0300
@@ -664,6 +664,12 @@
where the host byte order is the same as network byte order, this is a no-op;
otherwise, it performs a 2-byte swap operation.
+ .. deprecated:: 3.7
+ In case *x* does not fit in 16-bit unsigned integer, but does fit in a
+ positive C int, it is silently truncated to 16-bit unsigned integer.
+ This silent truncation feature is deprecated, and will raise an
+ exception in future versions of Python.
+
.. function:: htonl(x)
@@ -678,6 +684,12 @@
where the host byte order is the same as network byte order, this is a no-op;
otherwise, it performs a 2-byte swap operation.
+ .. deprecated:: 3.7
+ In case *x* does not fit in 16-bit unsigned integer, but does fit in a
+ positive C int, it is silently truncated to 16-bit unsigned integer.
+ This silent truncation feature is deprecated, and will raise an
+ exception in future versions of Python.
+
.. function:: inet_aton(ip_string)
« no previous file with comments | « no previous file | Lib/test/test_socket.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+