CIPO: `TypeError: Incoming markup is of an invalid type: None. Markup must be a string, a bytestring, or an open filehandle.`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
patzilla/access/cipo/drawing.pyから始めます。ここではget_first_drawing_urlがdocument_index_htmlを解析しており、トレースバックからその値がNoneになり得ることが分かります。その値の取得方法をたどり、issueにある該当するカナダの特許IDを比較します。これらの図面APIリクエストが、インデックスHTMLが欠落していてもこのTypeErrorを発生させずに処理できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
When searching for "Edison Thomas" at OPS, then navigating to result page 22, on a few Canadian documents, we can observe exceptions in the web server log.
API
Those API calls are impacted.
/api/drawing/CA14210A
/api/drawing/CA14209A
/api/drawing/CA14191A
/api/drawing/CA14190A
/api/drawing/CA13775A
/api/drawing/CA13774A
Details
2026-10-26 17:50:15,596 INFO [patzilla.access.cipo.drawing ][waitress-0] CIPO: Fetching first drawing of "{"country": "CA", "number": "13774", "kind": "A", "ext": ""}"
2026-10-26 17:50:15,596 INFO [patzilla.access.cipo.drawing ][waitress-0] CIPO: Index url is "http://brevets-patents.ic.gc.ca/opic-cipo/cpd/eng/patent/13774/summary.html"
2026-10-26 17:50:15,848 ERROR [waitress ][waitress-0] Exception while serving /api/drawing/CA13774A
Traceback (most recent call last):
File "/path/to/patzilla/patzilla/access/drawing.py", line 24, in get_drawing_png
payload = get_ops_image(document, page, kind, 'tiff')
File "/path/to/patzilla/patzilla/access/epo/ops/api.py", line 664, in get_ops_image
image_info = inquire_images(document)
File "/path/to/site-packages/beaker/cache.py", line 598, in cached
return cache[0].get_value(cache_key, createfunc=go)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/site-packages/beaker/cache.py", line 319, in get
return self._get_value(key, **kw).get_value()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/path/to/site-packages/beaker/container.py", line 381, in get_value
v = self.createfunc()
File "/path/to/site-packages/beaker/cache.py", line 594, in go
return func(*args, **kwargs)
File "/path/to/patzilla/patzilla/access/epo/ops/api.py", line 542, in inquire_images
raise error
pyramid.httpexceptions.HTTPNotFound: No image information for document=CA13774A
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/site-packages/waitress/channel.py", line 430, in service
task.service()
~~~~~~~~~~~~^^
File "/path/to/site-packages/waitress/task.py", line 167, in service
self.execute()
~~~~~~~~~~~~^^
File "/path/to/site-packages/waitress/task.py", line 435, in execute
app_iter = self.channel.server.application(environ, start_response)
File "/path/to/site-packages/waitress/proxy_headers.py", line 64, in translate_proxy_headers
return app(environ, start_response)
File "/path/to/site-packages/paste/deploy/config.py", line 306, in __call__
return self.app(environ, start_response)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/site-packages/pyramid/router.py", line 274, in __call__
response = self.execution_policy(environ, self)
File "/path/to/site-packages/pyramid/router.py", line 283, in default_execution_policy
return request.invoke_exception_view(reraise=True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/path/to/site-packages/pyramid/view.py", line 787, in invoke_exception_view
reraise_(*exc_info)
~~~~~~~~^^^^^^^^^^^
File "/path/to/site-packages/pyramid/_compat.py", line 178, in reraise
raise value.with_traceback(tb)
File "/path/to/site-packages/pyramid/router.py", line 281, in default_execution_policy
return router.invoke_request(request)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/path/to/site-packages/pyramid/router.py", line 249, in invoke_request
response = handle_request(request)
File "/path/to/site-packages/pyramid/tweens.py", line 43, in excview_tween
response = _error_handler(request, exc)
File "/path/to/site-packages/pyramid/tweens.py", line 13, in _error_handler
response = request.invoke_exception_view(exc_info)
File "/path/to/site-packages/pyramid/view.py", line 774, in invoke_exception_view
response = _call_view(
registry,
...<7 lines>...
request_iface=request_iface.combined,
)
File "/path/to/site-packages/pyramid/view.py", line 683, in _call_view
response = view_callable(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 401, in viewresult_to_response
result = view(context, request)
File "/path/to/site-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/path/to/site-packages/pyramid/router.py", line 147, in handle_request
response = _call_view(
registry, request, context, context_iface, view_name
)
File "/path/to/site-packages/pyramid/view.py", line 683, in _call_view
response = view_callable(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 169, in __call__
return view(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 188, in attr_view
return view(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper
return view(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
result = view(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 144, in _requestonly_view
response = view(request)
File "/path/to/site-packages/cornice/service.py", line 493, in wrapper
response = view_(request)
File "/path/to/patzilla/patzilla/navigator/services/composite.py", line 31, in drawing_handler
png = get_drawing_png(patent, page, 'FullDocumentDrawing')
File "/path/to/site-packages/beaker/cache.py", line 598, in cached
return cache[0].get_value(cache_key, createfunc=go)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/site-packages/beaker/cache.py", line 319, in get
return self._get_value(key, **kw).get_value()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/path/to/site-packages/beaker/container.py", line 381, in get_value
v = self.createfunc()
File "/path/to/site-packages/beaker/cache.py", line 594, in go
return func(*args, **kwargs)
File "/path/to/patzilla/patzilla/access/drawing.py", line 40, in get_drawing_png
payload = get_cipo_image_cached(document_id)
File "/path/to/site-packages/beaker/cache.py", line 598, in cached
return cache[0].get_value(cache_key, createfunc=go)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/site-packages/beaker/cache.py", line 319, in get
return self._get_value(key, **kw).get_value()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/path/to/site-packages/beaker/container.py", line 381, in get_value
v = self.createfunc()
File "/path/to/site-packages/beaker/cache.py", line 594, in go
return func(*args, **kwargs)
File "/path/to/patzilla/patzilla/access/drawing.py", line 72, in get_cipo_image_cached
payload = get_cipo_image(document_id)
File "/path/to/patzilla/patzilla/access/cipo/drawing.py", line 15, in fetch_first_drawing
drawing_url = get_first_drawing_url(patent)
File "/path/to/patzilla/patzilla/access/cipo/drawing.py", line 56, in get_first_drawing_url
soup = BeautifulSoup(document_index_html)
File "/path/to/site-packages/bs4/__init__.py", line 445, in __init__
raise TypeError(
f"Incoming markup is of an invalid type: {markup!r}. Markup must be a string, a bytestring, or an open filehandle."
)
TypeError: Incoming markup is of an invalid type: None. Markup must be a string, a bytestring, or an open filehandle.
- 主要言語
- Python
- スター
- 123
- フォーク
- 31
- 平均マージ
- 3時間 17分
- マージ済み PR(30日)
- 53
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ip-tools/patzilla のほかの issue
-
needs discussion
難易度 2/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ip-tools/patzilla#149 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
UI: Update Babelオープンdependencies help wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
ip-tools/patzilla の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
EclipseFdn/open-vsx.org#15057 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
FinanceFlash/unvibecode#349 ·
-
Mission statement: why this is free, in the README, Why This Exists and the wiki Home対応中かも @ChiefGyk3D が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ChiefGyk3D/Clouds-Against-Humanity#348 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vllm-project/vime#508 ·
メンテナーはふだん 4 日以内に返信