Mageia Bugzilla – Attachment 7067 Details for
Bug 16845
network monitor does not display graph of traffic data (python3 regression)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
fix "argument for 's' must be a bytes object"
0003-fix-argument-for-s-must-be-a-bytes-object.patch (text/plain), 1.20 KB, created by
Thierry Vignaud
on 2015-09-29 10:42:41 CEST
(
hide
)
Description:
fix "argument for 's' must be a bytes object"
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-09-29 10:42:41 CEST
Size:
1.20 KB
patch
obsolete
>From 2664452360c58e3b4b26de17627c7c5abfbd90ce Mon Sep 17 00:00:00 2001 >From: Thierry Vignaud <thierry.vignaud@gmail.com> >Date: Tue, 29 Sep 2015 04:17:33 -0400 >Subject: [PATCH 3/5] fix "argument for 's' must be a bytes object" > >IP adress was no more fetched since switching to python3 >--- > src/monitor.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/src/monitor.py b/src/monitor.py >index 87bf2b5..78d6b4b 100644 >--- a/src/monitor.py >+++ b/src/monitor.py >@@ -188,13 +188,13 @@ class Monitor: > mac=_("No physical address") > # ip address > try: >- res = self.ioctl(0x8915, struct.pack('256s', ifname[:15]))[20:24] >+ res = self.ioctl(0x8915, struct.pack('256s',bytes(ifname[:15], 'utf-8')))[20:24] > addr=socket.inet_ntoa(res) > except: > addr=_("No address assigned") > # mac address > try: >- mac_struct=self.ioctl(0x8927, struct.pack('256s', ifname[:15]))[18:24] >+ mac_struct=self.ioctl(0x8927, struct.pack('256s', bytes(ifname[:15], 'utf-8')))[18:24] > mac=":".join(["%02x" % ord(char) for char in mac_struct]) > except: > addr=_("No address assigned") >-- >2.5.3 >
From 2664452360c58e3b4b26de17627c7c5abfbd90ce Mon Sep 17 00:00:00 2001 From: Thierry Vignaud <thierry.vignaud@gmail.com> Date: Tue, 29 Sep 2015 04:17:33 -0400 Subject: [PATCH 3/5] fix "argument for 's' must be a bytes object" IP adress was no more fetched since switching to python3 --- src/monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monitor.py b/src/monitor.py index 87bf2b5..78d6b4b 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -188,13 +188,13 @@ class Monitor: mac=_("No physical address") # ip address try: - res = self.ioctl(0x8915, struct.pack('256s', ifname[:15]))[20:24] + res = self.ioctl(0x8915, struct.pack('256s',bytes(ifname[:15], 'utf-8')))[20:24] addr=socket.inet_ntoa(res) except: addr=_("No address assigned") # mac address try: - mac_struct=self.ioctl(0x8927, struct.pack('256s', ifname[:15]))[18:24] + mac_struct=self.ioctl(0x8927, struct.pack('256s', bytes(ifname[:15], 'utf-8')))[18:24] mac=":".join(["%02x" % ord(char) for char in mac_struct]) except: addr=_("No address assigned") -- 2.5.3
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16845
:
7060
|
7065
|
7066
| 7067 |
7068
|
7069
|
7070
|
7073