Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.10] gh-98415: Fix uuid.getnode() ifconfig implementation (GH-98423)#99020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-98415: Fix uuid.getnode() ifconfig implementation (GH-98423)
The uuid.getnode() function has multiple implementations, tested sequentially.The ifconfig implementation was incorrect and always failed: fix it.In practice, functions of libuuid library are preferred, if available:uuid_generate_time_safe(), uuid_create() or uuid_generate_time().(cherry picked from commite3ec272)Co-authored-by: Chaim Sanders <csanders-git@users.noreply.github.com>Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
  • Loading branch information
@csanders-git@corona10@miss-islington
2 people authored andmiss-islington committedNov 2, 2022
commit48af2073ca39bb3cb3b87f6439e3678044a7636d
9 changes: 7 additions & 2 deletionsLib/uuid.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -370,7 +370,12 @@ def _get_command_stdout(command, *args):
# for are actually localized, but in theory some system could do so.)
env = dict(os.environ)
env['LC_ALL'] = 'C'
proc = subprocess.Popen((executable,) + args,
# Empty strings will be quoted by popen so we should just ommit it
if args != ('',):
command = (executable, *args)
else:
command = (executable,)
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
env=env)
Expand DownExpand Up@@ -510,7 +515,7 @@ def _ifconfig_getnode():
mac = _find_mac_near_keyword('ifconfig', args, keywords, lambda i: i+1)
if mac:
return mac
return None
return None

def _ip_getnode():
"""Get the hardware address on Unix by running ip."""
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Fix detection of MAC addresses for :mod:`uuid` on certain OSs. Patch by Chaim Sanders

[8]ページ先頭

©2009-2025 Movatter.jp