Skip to content

LocalLayerRepository.__str__ produces a malformed string (missing closing parenthesis) #584

Closed

Description

@thesayakmondal

Description

LocalLayerRepository.__str__ returns a string with an unclosed parenthesis. Every error message raised when using a local kernel (from _validate_layer, _get_kernel_layer, etc.) will contain a broken diagnostic string.

Steps to reproduce

from pathlib import Path
from kernels import LocalLayerRepository

repo = LocalLayerRepository(repo_path=Path("/tmp/my-kernel"), layer_name="MyLayer")
print(str(repo))

prints: /tmp/my-kernel (layer MyLayer

expected: /tmp/my-kernel (layer MyLayer)

Expected behavior

The string should end with ) to close the opening parenthesis:

/tmp/my-kernel (layer MyLayer)

This is consistent with how LayerRepository and LockedLayerRepository format their str output.

Environment

  • kernels version: latest (main)
  • Python version: 3.11
  • PyTorch version: N/A (pure Python bug, no GPU needed)
  • CUDA version: N/A
  • GPU model: N/A
  • OS: Windows 11
  • If using the Nix builder, output of nix-shell -p nix-info --run "nix-info -m": N/A

Additional context

Root cause: layer.py line 166.

Buggy: return f"{self._repo_path} (layer {self.layer_name}"
Fixed: return f"{self._repo_path} (layer {self.layer_name})"

The other two repository classes (LayerRepository line 115, LockedLayerRepository line 226) do not have this issue. One character fix — happy to open a PR if helpful.

Activity

  1. added
    bug
    on May 26, 2026
  2. sayakpaul commented on May 27, 2026

    @sayakpaul
    Member

    Do you have a full reproducible example?

  3. thesayakmondal commented on May 27, 2026

    @thesayakmondal
    ContributorAuthor

    Verified on kernels==0.14.1 (latest published version) using Google Colab:

    from pathlib import Path
    from kernels.layer.layer import LocalLayerRepository
    
    repo = LocalLayerRepository(repo_path=Path("/tmp/my-kernel"), layer_name="MyLayer")
    print(str(repo))

    Output:

    `/tmp/my-kernel` (layer `MyLayer`
    BUG CONFIRMED - string is missing closing )
    

    No GPU required to reproduce. Happy to open a PR with the one-character fix if that works for you.

  4. danieldk commented on May 28, 2026

    @danieldk
    Member

    Thanks for reporting, should be fixed in #597 .

  5. added a commit that references this issue on May 29, 2026
    58dcda8
  6. thesayakmondal commented on May 29, 2026

    @thesayakmondal
    ContributorAuthor

    Thanks for the quick fix @danieldk and thanks for the follow-up @sayakpaul. Happy to have caught it!

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions