Repository navigation
1.0.0a0 #106
GhostofGoes
started this conversation in
General
1.0.0a0
#106
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Pre-release of 1.0.0. There are some big changes in this release that have been years in the making, so I'm doing a pre-release to make sure it's stable before pushing a final release. Notably:
Nonewas returned in these cases)Please, test this release on your systems, and report back on the linked discussion!
PyPI release: https://pypi.org/project/getmac/1.0.0a0/
Added
getmac.get_default_interface(), which returns the name of the system's default interface.IPv4Address,IPv4Interface,IPv6Address,IPv6Interfaceipandip6arguments toget_mac_address()ipargument will accept IPv6 objects and process them as ifip6was set.ipwill still treat it like a IPv4 address. This behavior may change in a future release, withipallowing either type of address, andip6argument being deprecated.IPv4NetworkandIPv6Networkwill result in aValueError. They're networks, not hosts, and passing them makes no sense.bytesvalues forinterface,ip,ip6, andhostnamearguments toget_mac_address(). This will just calldecode("utf-8")on the bytes. This is to ease usage with certain libraries and functions that return strings as bytes.getmac.1)LanscanIface, a proper implementation oflanscan -iafor HP-UX systems. This replaces the functionality of the removedUuidLanscanmethod, and is loosely based on CPython'suuid._lanscan_getnode()implementation.settings.ARP_TIMEOUT(--arp-timeouton the command line). After sending the UDP packet to populate the ARP/NDP table, getmac keeps checking it for the host for up to this many seconds, for hosts that are slow to reply. It's off (0) by default. (Issue #101)netsh.exe(new methodsNetshNeighborsandDefaultIfaceNetsh). Before, these fell back to methods for other platforms, with a "No methods for platform 'windows'" warning. (Issue #90)Changed
getmac.settings. For example,getmac.getmac.PORTshould now begetmac.settings.PORT.RuntimeErroris now raised in cases where no methods are found matching the type of request and platform, or if all matching methods fail to test.RuntimeErrorexception, it means something went horribly wrong, and you should considor reporting the issue on GitHub..whlfile).get_mac_address()returning an old MAC for an IP that is no longer in use on Linux. Incomplete and failed entries (Flags0x0) and proxy ARP entries (Flags0xc) in/proc/net/arpare now ignored and returnNone. Also fixed a lookup for an IP like92.168.0.1matching the entry for192.168.0.1(Issue #76).ip routeincluding extra text when the route has noprotofield, e.g.ens193 onlinkinstead ofens193fordefault via 192.168.1.254 dev ens193 onlink.ifconfigparsing returning a wrong MAC for some interfaces.ifconfigparsing on Solaris and Debian GNU/kFreeBSD, which print MACs without leading zeros (e.g.0:c:29:c1:70:2a).CtypesHostmethod on Windows passing a string instead of bytes toinet_addr()when looking up a hostname.FcntlIfacemethod on Linux not closing its socket after each lookup.get_mac_address()with no arguments: if the default interface can't be found (e.g. there aren't any routes) or doesn't have a MAC (e.g. a VPN tunnel), the first interface with a MAC that isn't a loopback interface is used (Issue #78).eth0oren0, or returns the loopback interface's00:00:00:00:00:00.get_mac_address()with no arguments uses the actual default interface, instead of assuming it's named "Ethernet".GetmacExecan now find interface names >15 characters long.IpconfigExetaking seconds to minutes when a named interface wasn't found in certain cases.IpconfigExeto handle non-Englishipconfigoutput, without relying on the "Physical Address" label. Interfaces are still only found by name in English output, which is a limitation that will be addressed in a future release.(,*and.not being found (e.g.vEthernet (WSL)).NetstatIfacereturning the MAC of another interface.network_request=False(--no-net) not always preventing methods that send network requests from being used.FORCE_METHODset toArpingHostorCtypesHoststill sending a UDP packet before the ARP request.ArpFilefails.ArpVariousArgsnot parsing the output of the Linuxarpcommand from thenet-toolspackage.getmaccommand being run instead of Windows'getmac.exewhen getmac is installed in a virtual environment.IfconfigEther(macOS) runningifconfigtwice on the first lookup.DarwinNetworksetupIface(macOS) being marked unusable after looking up an interface that isn't a hardware port, like a VPN tunnel (Issue #91).Removed
getmac<1.0.0.UuidArpGetnodemethod. It's quite slow (performs up to 3 subprocess calls internally) and the functionality is already implemented byArpVariousArgs.UuidLanscanmethod. This has been replaced with the newLanscanIfacemethod. Some UUID internal function names changed with Python 3.9, and it made more sense to implement from scratch in getmac instead of continuing to rely on CPython-specific private functions.Dev
pyproject.tomland consolidated the configurations for most toolssetup.py,MANIFEST.in,requirements*.txt,tox.inipdm run update-actionsto update the pins.scripts/collect_samples.py.settingsand__version__are now published ingetmac.__all__, for type checkers.This discussion was created from the release 1.0.0a0.
All reactions