Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d7d80b47 by Philipp Hörist at 2023-01-02T19:22:29+01:00
cq: Use OSError instead of alias
- - - - -
3 changed files:
- gajim/common/jingle_ft.py
- gajim/common/modules/bytestream.py
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/common/jingle_ft.py
=====================================
@@ -289,7 +289,7 @@ def _compute_hash(self) -> Optional[nbxmpp.Hashes2]:
return
try:
file_ = open(self.file_props.file_name, 'rb')
- except IOError:
+ except OSError:
# can't open file
return
h = nbxmpp.Hashes2()
=====================================
gajim/common/modules/bytestream.py
=====================================
@@ -360,7 +360,7 @@ def _add_upnp_igd_as_streamhost_to_query(self,
# check if we are connected with an IPv4 address
try:
socket.inet_aton(my_ip)
- except socket.error:
+ except OSError:
self._con.connection.send(iq)
return
=====================================
gajim/plugins/pluginmanager.py
=====================================
@@ -572,7 +572,7 @@ def install_from_zip(self,
except zipfile.BadZipfile:
# it is not zip file
raise PluginsystemError(_('Archive corrupted'))
- except IOError:
+ except OSError:
raise PluginsystemError(_('Archive empty'))
if zip_file.testzip():
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d7d80b47d867577378e91d3993c901a5…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d7d80b47d867577378e91d3993c901a5…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
1dbc2ed4 by Philipp Hörist at 2023-01-01T22:12:01+01:00
cfix: HTTP: Handle case where sniffer omits content-type
- - - - -
c3b9bd4e by Philipp Hörist at 2023-01-01T22:21:38+01:00
cfix: HTTP: Store lost content-length again
- - - - -
1 changed file:
- nbxmpp/http.py
Changes:
=====================================
nbxmpp/http.py
=====================================
@@ -403,7 +403,7 @@ class HTTPRequest(GObject.GObject):
def _on_content_sniffed(self,
message: Soup.Message,
- content_type: str,
+ content_type: Optional[str],
_params: GLib.HashTable,
) -> None:
@@ -419,7 +419,14 @@ class HTTPRequest(GObject.GObject):
self.cancel()
return
- self._response_content_type = content_type
+ self._response_content_length = headers.get_content_length()
+
+ if content_type is None:
+ # According to the docs, content_type is None when the sniffer
+ # decides to trust the content-type sent by the server.
+ self._response_content_type = headers.get_content_type()
+ else:
+ self._response_content_type = content_type
self._log.info('Sniffed: content-type: %s, content-length: %s',
self._response_content_type,
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/156a365a688f7e5071c2d1a…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/156a365a688f7e5071c2d1a…
You're receiving this email because of your account on dev.gajim.org.