Registry / http-networking / win-inet-pton

win-inet-pton

JSON →
library1.1.0pypypi✓ verified 84d ago

Provides native inet_pton and inet_ntop implementations for Windows using ctypes. Version 1.1.0 is current; maintenance mode with rare updates.

pip install win-inet-pton
INSTALL
IMPORT
SIG · WIN-INET-PTON
W
win-inet-pton
http-networkingpythonv1.1.0
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

inject_into_socket
✓ from win_inet_pton import inject_into_socket
✗ from win_inet_pton import inet_pton

Monkey-patches socket module on Windows so inet_pton and inet_ntop work the same as on Unix.

import socket from win_inet_pton import inet_pton, inet_ntop # Monkey-patch socket module to add missing functions on Windows socket.inet_pton = inet_pton socket.inet_ntop = inet_ntop # Now you can use inet_pton and inet_ntop directly via socket print(socket.inet_pton(socket.AF_INET, '8.8.8.8'))
Debug
Known issues
gotchaThis library is Windows-only. Importing it on non-Windows systems will raise an ImportError unless you guard it. Always use the check `if sys.platform == 'win32':` before importing.
fix
Wrap import in a platform check.
affects: all
gotchaThe library monkey-patches the built-in socket module. If you assign the functions via `socket.inet_pton = inet_pton`, ensure you do it only once to avoid double-patching. Doing it repeatedly is harmless but confusing.
fix
Apply the patch in a single location, e.g., at the start of your application.
affects: all
deprecatedPython 3.4+ on Windows includes official `inet_pton` support in the socket module. This library is only needed for Python 2.7 or earlier Python 3 versions. For modern Python, consider dropping it.
fix
For Python 3.4+, remove the dependency; the functions are built-in.
affects: >=3.4
Upgrade
Version history
1.1.0latest on PyPI · released Feb 19, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources
win-inet-pton — pip install win-inet-pton · libregistry