From 015bc5dbe7694b9257f423bd183122c1463ff706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Dalleau?= <frederic.dalleau@collabora.co.uk> Date: Mon, 3 Oct 2016 13:43:48 +0000 Subject: [PATCH] bluez/ubt: Fix test_dun_pan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The result of an urlrequest.read is a binary stream of data. The input for file.write() is a string. Make sure the write call is fed with the proper type of data. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.co.uk> Differential Revision: https://phabricator.apertis.org/D4446 --- bluez/ubt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluez/ubt b/bluez/ubt index 343acba0..30aec180 100644 --- a/bluez/ubt +++ b/bluez/ubt @@ -471,7 +471,7 @@ class PbapDeviceProfileTester(DeviceProfileTester): service.Connect(timeout=60000) url = urllib.request.urlopen("http://connman.net") f = open(path, 'w') - f.write(url.read(1000000)) + f.write(url.read(1000000).decode('utf-8')) f.close() service.Disconnect(timeout=60000) -- GitLab