-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With https turned on verbose > 3 wsgidav fs_dav_provider crashes with AttributeError: 'int' object has no attribute 'encode' #198
Comments
sinshutu
added a commit
to sinshutu/wsgidav
that referenced
this issue
Dec 26, 2020
It seemed to be an error because REMOTE_PORT became an int. Change debug log output diff --git a/wsgidav/debug_filter.py b/wsgidav/debug_filter.py
index 09e02b7..b91c6de 100644
--- a/wsgidav/debug_filter.py
+++ b/wsgidav/debug_filter.py
@@ -143,6 +143,7 @@ class WsgiDavDebugFilter(BaseMiddleware):
# threading.currentThread().ident, method))
for k, v in environ.items():
if k == k.upper():
+ _logger.info("{:<20}: '{}'".format(k, v))
_logger.info("{:<20}: '{}'".format(k, safe_re_encode(v, "utf8")))
_logger.info("\n")
diff --git a/wsgidav/util.py b/wsgidav/util.py
index 319e256..65afbe7 100644
--- a/wsgidav/util.py
+++ b/wsgidav/util.py
@@ -404,6 +404,7 @@ def safe_re_encode(s, encoding_to, errors="backslashreplace"):
(e.g. if we don't know the encoding, see #87, #96)
"""
# prev = s
+ print("safe_re_encode({}, {})".format(s, encoding_to))
if not encoding_to:
encoding_to = "ASCII"
if compat.is_bytes(s): outout
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using WsgiDAV/3.0.5-a3 Python/3.8.0 Linux-5.4.0-1030-gcp-x86_64-with-glibc2.27
This bug is similar to #189 but I tried including "'error_printer': {'catch_all': True}" and the crash still happened. Thank you for your help!
Code used from a wsgidav server.py example.
The following output is produced:
The text was updated successfully, but these errors were encountered: