Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4be1e249
Kaydet (Commit)
4be1e249
authored
Ara 18, 2013
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#19855: uuid.get_node now looks on the PATH for executables on unix.
Patch by Serhiy Storchaka.
üst
320b3915
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
27 deletions
+32
-27
uuid.py
Lib/uuid.py
+28
-27
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/uuid.py
Dosyayı görüntüle @
4be1e249
...
...
@@ -312,34 +312,35 @@ class UUID(object):
return
int
((
self
.
int
>>
76
)
&
0xf
)
def
_find_mac
(
command
,
args
,
hw_identifiers
,
get_index
):
import
os
for
dir
in
[
''
,
'/sbin/'
,
'/usr/sbin'
]:
executable
=
os
.
path
.
join
(
dir
,
command
)
if
not
os
.
path
.
exists
(
executable
):
continue
import
os
,
shutil
executable
=
shutil
.
which
(
command
)
if
executable
is
None
:
path
=
os
.
pathsep
.
join
((
'/sbin'
,
'/usr/sbin'
))
executable
=
shutil
.
which
(
command
,
path
=
path
)
if
executable
is
None
:
return
None
try
:
# LC_ALL to get English output, 2>/dev/null to
# prevent output on stderr
cmd
=
'LC_ALL=C
%
s
%
s 2>/dev/null'
%
(
executable
,
args
)
with
os
.
popen
(
cmd
)
as
pipe
:
for
line
in
pipe
:
words
=
line
.
lower
()
.
split
()
for
i
in
range
(
len
(
words
)):
if
words
[
i
]
in
hw_identifiers
:
try
:
return
int
(
words
[
get_index
(
i
)]
.
replace
(
':'
,
''
),
16
)
except
(
ValueError
,
IndexError
):
# Virtual interfaces, such as those provided by
# VPNs, do not have a colon-delimited MAC address
# as expected, but a 16-byte HWAddr separated by
# dashes. These should be ignored in favor of a
# real MAC address
pass
except
IOError
:
continue
return
None
try
:
# LC_MESSAGES to get English output, 2>/dev/null to
# prevent output on stderr
cmd
=
'LC_MESSAGES=C
%
s
%
s 2>/dev/null'
%
(
executable
,
args
)
with
os
.
popen
(
cmd
)
as
pipe
:
for
line
in
pipe
:
words
=
line
.
lower
()
.
split
()
for
i
in
range
(
len
(
words
)):
if
words
[
i
]
in
hw_identifiers
:
try
:
return
int
(
words
[
get_index
(
i
)]
.
replace
(
':'
,
''
),
16
)
except
(
ValueError
,
IndexError
):
# Virtual interfaces, such as those provided by
# VPNs, do not have a colon-delimited MAC address
# as expected, but a 16-byte HWAddr separated by
# dashes. These should be ignored in favor of a
# real MAC address
pass
except
IOError
:
pass
def
_ifconfig_getnode
():
"""Get the hardware address on Unix by running ifconfig."""
...
...
Misc/NEWS
Dosyayı görüntüle @
4be1e249
...
...
@@ -29,6 +29,10 @@ Core and Builtins
Library
-------
- Issue #19855: uuid.getnode() on Unix now looks on the PATH for the
executables used to find the mac address, with /sbin and /usr/sbin as
fallbacks.
- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment