mirror of https://github.com/scrapy/scrapy.git
Small cleanup.
This commit is contained in:
parent
53539483c3
commit
8050257c14
|
|
@ -290,7 +290,8 @@ class FTPFeedStorage(BlockingFeedStorage):
|
|||
feed_options: Optional[Dict[str, Any]] = None,
|
||||
):
|
||||
u = urlparse(uri)
|
||||
assert u.hostname
|
||||
if not u.hostname:
|
||||
raise ValueError(f"Got a storage URI without a hostname: {uri}")
|
||||
self.host: str = u.hostname
|
||||
self.port: int = int(u.port or "21")
|
||||
self.username: str = u.username or ""
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ def xmliter_lxml(
|
|||
|
||||
reader = _StreamReader(obj)
|
||||
tag = f"{{{namespace}}}{nodename}" if namespace else nodename
|
||||
# technically, etree.iterparse only needs .read() AFAICS, but this is how it's typed
|
||||
iterable = etree.iterparse(
|
||||
cast("SupportsReadClose[bytes]", reader), tag=tag, encoding=reader.encoding
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue