Skip to content

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

@Dev-X25874

Description

@Dev-X25874

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions