We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68550f6 commit 72b85c4Copy full SHA for 72b85c4
1 file changed
linkcheck/checker/ftpurl.py
@@ -25,6 +25,8 @@
25
# Python 3
26
from io import StringIO
27
28
+from builtins import bytes
29
+
30
from .. import log, LOG_CHECK, LinkCheckerError, mimeutil
31
from . import proxysupport, httpurl, internpaturl, get_index_html
32
from .const import WARN_FTP_MISSING_SLASH
@@ -116,7 +118,9 @@ def cwd (self):
116
118
Change to URL parent directory. Return filename of last path
117
119
component.
120
"""
- path = self.urlparts[2].encode(self.filename_encoding, 'replace')
121
+ path = self.urlparts[2]
122
+ if isinstance(path, bytes):
123
+ path = path.decode(self.filename_encoding, 'replace')
124
dirname = path.strip('/')
125
dirs = dirname.split('/')
126
filename = dirs.pop()
0 commit comments