har2tree 1.31.0__tar.gz → 1.31.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: har2tree
3
- Version: 1.31.0
3
+ Version: 1.31.2
4
4
  Summary: HTTP Archive (HAR) to ETE Toolkit generator
5
5
  License: BSD-3-Clause
6
6
  Author: Raphaël Vinot
@@ -27,8 +27,8 @@ Requires-Dist: filetype (>=1.2.0)
27
27
  Requires-Dist: legacy-cgi (>=2.6.3) ; python_version >= "3.13,<4.0"
28
28
  Requires-Dist: numpy (<2.1) ; python_version < "3.10"
29
29
  Requires-Dist: numpy (<2.3) ; python_version < "3.11"
30
- Requires-Dist: numpy (>=2.3.0) ; python_version >= "3.11"
31
- Requires-Dist: publicsuffixlist (>=1.0.2.20250611)
30
+ Requires-Dist: numpy (>=2.3.1) ; python_version >= "3.11"
31
+ Requires-Dist: publicsuffixlist (>=1.0.2.20250627)
32
32
  Requires-Dist: six (>=1.17.0) ; extra == "docs"
33
33
  Requires-Dist: tinycss2 (>=1.4.0)
34
34
  Requires-Dist: w3lib (>=2.3.1)
@@ -283,7 +283,12 @@ def make_soup(html: bytes) -> BeautifulSoup:
283
283
  if doc_as_str.startswith('<?xml'):
284
284
  return BeautifulSoup(doc_as_str, 'lxml-xml')
285
285
  else:
286
- return BeautifulSoup(doc_as_str, 'lxml')
286
+ try:
287
+ return BeautifulSoup(doc_as_str, 'lxml')
288
+ except Exception as e:
289
+ logger.warning(f'Unable to parse doc with lxml, try again with the default parser: {e}')
290
+ # Fallback to the default python parser
291
+ return BeautifulSoup(doc_as_str, 'html.parser')
287
292
 
288
293
  # The CSS processing bit is taked out of WeasyPrint
289
294
  # https://github.com/Kozea/WeasyPrint/blob/main/weasyprint/css/__init__.py#L876 -> preprocess_stylesheet
@@ -380,8 +385,13 @@ def find_external_ressources(mimetype: str, data: bytes, base_url: str, all_requ
380
385
  else:
381
386
  external_ressources['css'].append(url)
382
387
  else:
383
- soup = make_soup(data)
384
- string_soup = str(soup)
388
+ try:
389
+ soup = make_soup(data)
390
+ string_soup = str(soup)
391
+ except Exception as e:
392
+ logger.warning(f'Unable to parse HTML blob: {e}')
393
+ string_soup = ''
394
+
385
395
  if not string_soup:
386
396
  # Empty HTML document, nothing to do
387
397
  return external_ressources, embedded_ressources
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "har2tree"
3
- version = "1.31.0"
3
+ version = "1.31.2"
4
4
  description = "HTTP Archive (HAR) to ETE Toolkit generator"
5
5
  authors = [
6
6
  {name="Raphaël Vinot", email="raphael.vinot@circl.lu"}
@@ -14,13 +14,13 @@ dynamic = [ "classifiers" ]
14
14
  dependencies = [
15
15
  "ete3 (>=3.1.3)",
16
16
  "beautifulsoup4[charset-normalizer,lxml] (>=4.13.4)",
17
- "publicsuffixlist (>=1.0.2.20250611)",
17
+ "publicsuffixlist (>=1.0.2.20250627)",
18
18
  "filetype (>=1.2.0)",
19
19
  # poetry up fails with the version of numpy forced for python < 3.10.
20
20
  # The work around is to comment it, run poetry up, uncomment it. and run poetry update.
21
21
  "numpy (<2.1) ; python_version < \"3.10\"",
22
22
  "numpy (<2.3) ; python_version < \"3.11\"",
23
- "numpy (>=2.3.0) ; python_version >= \"3.11\"",
23
+ "numpy (>=2.3.1) ; python_version >= \"3.11\"",
24
24
  "w3lib (>=2.3.1)",
25
25
  "tinycss2 (>=1.4.0)",
26
26
  "legacy-cgi (>=2.6.3) ; python_version >= \"3.13,<4.0\"",
@@ -45,9 +45,9 @@ classifiers = [
45
45
  docs = ["Sphinx (>=8.2.3) ; python_version >= \"3.11\"", "six (>=1.17.0)"]
46
46
 
47
47
  [tool.poetry.group.dev.dependencies]
48
- mypy = "^1.16.0"
48
+ mypy = "^1.16.1"
49
49
  pytest-cov = "^6.2.1"
50
- coverage = "^7.9.0"
50
+ coverage = "^7.9.1"
51
51
  types-beautifulsoup4 = "^4.12.0.20250516"
52
52
 
53
53
  [build-system]
File without changes
File without changes
File without changes
File without changes
File without changes