Skip to content

update-shape.py: the kept-copy check reads an except ImportError: handler that binds the name and then re-raises as the copy's own fallback, so a copy that cannot start is kept #897

Closed

Description

@brettheap

Goal: an except ImportError: handler whose reached body ends in raise answers no name to the kept-copy check.

Filed by lane openRepoShape-3, from its triage of #458 at the v1.1.1 release commit 5017830. The item comes from lane 2's review of #802 (issuecomment-6233233871), on #458 (issuecomment-6233551346). The v1.1.1 notes' known limits name it.

State at 5017830.

  • _fallback_in (update-shape.py:4328-4337) returns _bound_at(handler.body) and never asks whether the handler raises.
  • _reached (:4376) drops only the statements AFTER a raise.
  • The docstring at :4272 says "A handler that exits, re-raises or passes binds nothing", which is false of a handler that binds and then raises.

What happens. Take a kept copy holding

try:
    from repo_shape import NEW
except ImportError:
    NEW = None
    raise

beside a repo_shape.py without NEW. It is not refused, and Python stops on the re-raised ImportError.

Evidence. A probe at 5017830:

_names_imported -> {}; python exit 1: ImportError: cannot import name 'NEW' from 'repo_shape'
control, a handler that only binds: {} and python exit 0
control, a handler that passes: {'repo_shape': {'NEW'}}

Direction.

  • In _fallback_in, a handler whose _reached(handler.body) ends in an ast.Raise answers nothing.
  • Add a row to tests/test_update_shape_kept_helper.py.
  • update-shape.py is not a pinned copy, so nothing re-pins.

Size: S.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-10-18T14:34:02Z, for #897

    Logged in lanes/log/openRepoShape-2.md at 0a42d1bf7f6739a4ff5896a8f2ab3dcfd2b2fd10.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#897:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#897"`, kept where the row or its body names `#897`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `897` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions