Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CIPO: `TypeError: Incoming markup is of an invalid type: None. Markup must be a string, a bytestring, or an open filehandle.`

オープン 初心者向け
#139 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

patzilla/access/cipo/drawing.pyから始めます。ここではget_first_drawing_urlがdocument_index_htmlを解析しており、トレースバックからその値がNoneになり得ることが分かります。その値の取得方法をたどり、issueにある該当するカナダの特許IDを比較します。これらの図面APIリクエストが、インデックスHTMLが欠落していてもこのTypeErrorを発生させずに処理できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ip-tools/patzilla のほかの issue

ip-tools/patzilla の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。