On Mon, 2019-01-28 at 17:11 +0900, Masashi Honma wrote: > On 2019/01/25 19:33, Johannes Berg wrote: > > Same here, we could just have hapd.request() take bytes (it makes sense > > anyway when communicating with another process!) and then the .decode() > > isn't needed, you just have to add a b"" to the string. > > I think it is not so good. > > If I modify the hapd.request(), I need to modify wpa_suppcant.request() also > to avoid confusion. Now, almost test cases expects string for > wpa_suppcant.request() argument. > So, much more modification will be needed. > For example, to pass the ap_eap test we needs 400+ modifications. Ok, that's no fun. However, why not make them take both? We can always assume bytes inside the function, and do something like if isinstance(query, str): query = query.encode('ascii') That way, tests that actually just use plain arguments need no modifications at all, but tests that deal with binascii or similar things that takes bytes can be converted completely to bytes and not have .decode()/.encode() sprinkled over them. johannes _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap