Fix deprecated datetime.utcnow() and test assertion for clean_text
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@ import tempfile
|
||||
import hashlib
|
||||
import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
@@ -119,7 +119,7 @@ class BaseCollector(ABC):
|
||||
title=self._extract_title(url),
|
||||
raw_path=final_path,
|
||||
content_hash=content_hash,
|
||||
fetch_date=datetime.utcnow().isoformat(),
|
||||
fetch_date=datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
etag=etag,
|
||||
last_modified=last_modified,
|
||||
char_count=len(content.decode('utf-8', errors='replace')),
|
||||
|
||||
Reference in New Issue
Block a user