diff --git a/ox/net.py b/ox/net.py index a3a612e..b4a470b 100644 --- a/ox/net.py +++ b/ox/net.py @@ -51,7 +51,7 @@ def open_url(url, data=None, headers=DEFAULT_HEADERS): if isinstance(url, bytes): url = url.decode('utf-8') url = url.replace(' ', '%20') - if PY3 and not isinstance(data, bytes): + if data and PY3 and not isinstance(data, bytes): data = data.encode('utf-8') req = urllib.request.Request(url, data, headers) return urllib.request.urlopen(req)