Fix typos

Found via `codespell ./linkcheck/ ./tests ./doc/man/en -L bu,noone,fo,pres,shttp`
This commit is contained in:
Kian-Meng Ang 2022-09-02 17:20:02 +08:00
parent 75196921e4
commit a70ea9ea14
18 changed files with 25 additions and 25 deletions

View file

@ -174,7 +174,7 @@ Command line option: \fB\-\-check\-extern\fP
.TP
\fBentry=\fP\fIREGEX\fP \fIUSER\fP [\fIPASS\fP] (\fI\%MULTILINE\fP)
Provide individual username/password pairs for different links. In
addtion to a single login page specified with \fBloginurl\fP multiple
addition to a single login page specified with \fBloginurl\fP multiple
FTP, HTTP (Basic Authentication) and telnet links are supported.
Entries are a triple (URL regex, username, password) or a tuple (URL
regex, username), where the entries are separated by whitespace.

View file

@ -116,7 +116,7 @@ def get_url_from(
else:
scheme = None
if not (url or name):
# use filename as base url, with slash as path seperator
# use filename as base url, with slash as path separator
name = base_url.replace("\\", "/")
allowed_schemes = aggregate.config["allowedschemes"]
# ignore local PHP files with execution directives

View file

@ -55,7 +55,7 @@ class NntpUrl(urlbase.UrlBase):
number = nntp.stat("<" + group + ">")[1]
self.add_info(_('Article number %(num)s found.') % {"num": number})
else:
# split off trailing articel span
# split off trailing article span
group = group.split('/', 1)[0]
if group:
# request group info (resp, count, first, last, name)

View file

@ -224,7 +224,7 @@ class UrlBase:
# This the real url we use when checking so it also referred to
# as 'real url'
self.url = None
# a splitted version of url for convenience
# a split version of url for convenience
self.urlparts = None
# the scheme, host, port and anchor part of url
self.scheme = self.host = self.port = self.anchor = None
@ -690,7 +690,7 @@ class UrlBase:
pass
def can_get_content(self):
"""Indicate wether url get_content() can be called."""
"""Indicate whether url get_content() can be called."""
return self.size <= self.aggregate.config["maxfilesizedownload"]
def download_content(self):
@ -956,6 +956,6 @@ class CompactUrlData:
__slots__ = urlDataAttr
def __init__(self, wired_url_data):
'''Set all attributes according to the dictionnary wired_url_data'''
'''Set all attributes according to the dictionary wired_url_data'''
for attr in urlDataAttr:
setattr(self, attr, wired_url_data[attr])

View file

@ -112,7 +112,7 @@ def synchronize(lock, func, log_duration_secs=0):
def synchronized(lock):
"""A decorator calling a function with aqcuired lock."""
"""A decorator calling a function with acquired lock."""
return lambda func: synchronize(lock, func)

View file

@ -68,7 +68,7 @@ def check_urls(aggregate):
console.internal_error()
aggregate.logger.log_internal_error()
abort(aggregate)
# Not catched exceptions at this point are SystemExit and GeneratorExit,
# Not caught exceptions at this point are SystemExit and GeneratorExit,
# and both should be handled by the calling layer.

View file

@ -94,7 +94,7 @@ def is_readable(filename):
def is_accessable_by_others(filename):
"""Check if file is group or world accessable."""
"""Check if file is group or world accessible."""
mode = os.stat(filename)[stat.ST_MODE]
return mode & (stat.S_IRWXG | stat.S_IRWXO)

View file

@ -74,7 +74,7 @@ def ftpparse(line):
# Also produced by Microsoft's FTP servers for Windows:
# "---------- 1 owner group 1803128 Jul 10 10:18 ls-lR.Z"
# "d--------- 1 owner group 0 May 9 19:45 Softlib"
# Also WFTPD for MSDOS:
# Also WFTPD for MS-DOS:
# "-rwxrwxrwx 1 noone nogroup 322 Aug 19 1996 message.ftp"
# Also NetWare:
# "d [R----F--] supervisor 512 Jan 16 18:53 login"
@ -132,7 +132,7 @@ def ftpparse(line):
info["name"] = name
return info
# MSDOS format
# MS-DOS format
# 04-27-00 09:09PM <DIR> licensed
# 07-18-00 10:16AM <DIR> pub
# 04-14-00 03:47PM 589 readme.htm

View file

@ -304,7 +304,7 @@ class _Logger(abc.ABC):
self.start_fileoutput()
if self.fd is None:
# Happens when aborting threads times out
log.warn(LOG_CHECK, "writing to unitialized or closed file")
log.warn(LOG_CHECK, "writing to uninitialized or closed file")
else:
try:
self.fd.write(s, **args)

View file

@ -38,7 +38,7 @@ class FailuresLogger(_Logger):
}
def __init__(self, **kwargs):
"""Intialize with old failures data (if found)."""
"""Initialize with old failures data (if found)."""
blacklist = os.path.join(get_user_data(), "blacklist")
if os.path.isfile(blacklist):
self.LoggerArgs["filename"] = blacklist

View file

@ -82,16 +82,16 @@ class SslCertificateCheck(_ConnectionPlugin):
try:
notAfter = ssl.cert_time_to_seconds(cert['notAfter'])
except ValueError as msg:
msg = _('Invalid SSL certficate "notAfter" value %r') % cert['notAfter']
msg = _('Invalid SSL certificate "notAfter" value %r') % cert['notAfter']
url_data.add_warning(msg)
return
curTime = time.time()
# Calculate seconds until certifcate expires. Can be negative if
# Calculate seconds until certificate expires. Can be negative if
# the certificate is already expired.
secondsValid = notAfter - curTime
args = dict(expire=cert['notAfter'])
if secondsValid < 0:
msg = _('SSL certficate is expired on %(expire)s.')
msg = _('SSL certificate is expired on %(expire)s.')
url_data.add_warning(msg % args)
else:
args['valid'] = strformat.strduration_long(secondsValid)

View file

@ -385,7 +385,7 @@ class Entry:
- our agent applies to this entry
- filename is URL decoded
Check if given filename is allowed to acces this entry.
Check if given filename is allowed to access this entry.
@return: True if allowed, else False
@rtype: bool

View file

@ -56,7 +56,7 @@ def unquote(s, matching=False):
@return: if s evaluates to False, return s as is, else return
string with stripped quotes
@rtype: unquoted string, or s unchanged if it is evaluting to False
@rtype: unquoted string, or s unchanged if it is evaluating to False
"""
if not s:
return s

View file

@ -29,7 +29,7 @@ for scheme in ('ldap', 'irc'):
# http://tools.ietf.org/html/rfc2396#section-2.1
# Note that the encoding is not really specified, but most browsers
# encode in UTF-8 when no encoding is specified by the HTTP headers,
# else they use the page encoding for followed link. See als
# else they use the page encoding for followed link. See also
# http://code.google.com/p/browsersec/wiki/Part1#Unicode_in_URLs
url_encoding = "utf-8"
@ -117,7 +117,7 @@ def parse_qsl(qs, encoding, keep_blank_values=0, strict_parsing=0):
errors raise a ValueError exception.
@type strict_parsing: bool
@returns: list of triples (key, value, separator) where key and value
are the splitted CGI parameter and separator the used separator
are the split CGI parameter and separator the used separator
for this CGI parameter which is either a semicolon or an ampersand
@rtype: list of triples
"""

View file

@ -14,7 +14,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
Define standard test support classes funtional for LinkChecker tests.
Define standard test support classes functional for LinkChecker tests.
"""
import os
import re

View file

@ -33,7 +33,7 @@ class TestMailBad(MailTest):
self.mail_error('mailto:"a""@example.com', cache_key="mailto:a")
self.mail_error('mailto:""a"@example.com', cache_key='mailto:""a"@example.com')
self.mail_error('mailto:"a\\"@example.com', cache_key='mailto:a"@example.com')
# local part unqouted
# local part unquoted
self.mail_error("mailto:.a@example.com")
self.mail_error("mailto:a.@example.com")
self.mail_error("mailto:a..b@example.com")

View file

@ -34,7 +34,7 @@ class TestClamav(unittest.TestCase):
@need_clamav
def testInfected(self):
# from the clamav test direcotry: the clamav test file as html data
# from the clamav test directory: the clamav test file as html data
data = (
b'<a href="data:application/octet-stream;base64,'
b"TVpQAAIAAAAEAA8A//8AALgAAAAhAAAAQAAaAAAAAAAAAAAAAAAAAAAAAAAAAA"

View file

@ -57,7 +57,7 @@ patterns = (
"d--------- 1 owner group 0 May 9 19:45 Softlib",
dict(name="Softlib", tryretr=False, trycwd=True),
),
# Also WFTPD for MSDOS:
# Also WFTPD for MS-DOS:
(
"-rwxrwxrwx 1 noone nogroup 322 Aug 19 1996 message.ftp",
dict(name="message.ftp", tryretr=True, trycwd=False),
@ -94,7 +94,7 @@ patterns = (
"CII-MANUAL.TEX;1 213/216 29-JAN-1996 03:33:12 [ANONYMOU,ANONYMOUS] (RWED,RWED,,)",
dict(name="CII-MANUAL.TEX", tryretr=True, trycwd=False),
),
# MSDOS format
# MS-DOS format
(
"04-27-00 09:09PM <DIR> licensed",
dict(name="licensed", tryretr=False, trycwd=True),