Skip to content

REPL invocation fails with "path is not normalized"Β #3101

@jpwoodbu

Description

@jpwoodbu

🐞 bug report

Affected Rule

The issue is caused by the rule: @rules_python//python/bin:repl

Is this a regression?

Not strictly speaking. I do not believe the REPL feature was available prior to 1.5.0. While I've been able to reproduce this issue with both 1.5.0 and 1.5.1, I recall using the REPL feature successfully with a clone of rules_python before the 1.5.0 release.

Description

When running the example command-line from https://github.com/bazel-contrib/rules_python/blob/main/docs/repl.md I get a an error saying "path is not normalized" and the Python shell is not started.

$ bazel run @rules_python//python/bin:repl --@rules_python//python/bin:repl_dep=@rules_python//tools:wheelmaker

πŸ”¬ Minimal Reproduction

I ran the above command-line inside a brand new and empty Bazel module with these MODULE.bazel contents:

module(name="test", version="0.1.0")

bazel_dep(name="rules_python", version="1.5.1")

πŸ”₯ Exception or Error


Starting local Bazel server (8.3.1) and connecting to it...
INFO: Analyzed target @@rules_python+//python/bin:repl (82 packages loaded, 3620 targets configured).
INFO: Found 1 target...
Target @@rules_python+//python/bin:repl up-to-date:
  bazel-bin/external/rules_python+/python/bin/repl
  bazel-bin/external/rules_python+/python/bin/repl_py.py
INFO: Elapsed time: 11.545s, Critical Path: 0.89s
INFO: 6 processes: 1 action cache hit, 6 internal.
INFO: Build completed successfully, 6 total actions
INFO: Running command line: bazel-bin/external/rules_python+/python/bin/repl
Python 3.11.13 (main, Jun  9 2025, 18:12:55) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
  File "/home/jpwoodbu/.cache/bazel/_bazel_jpwoodbu/4f83e7249d0fd942371631f62dae1282/execroot/_main/bazel-out/k8-fastbuild/bin/external/rules_python+/python/bin/repl.runfiles/rules_python+/python/bin/repl_py.py", line 45, in 
    start_repl()
  File "/home/jpwoodbu/.cache/bazel/_bazel_jpwoodbu/4f83e7249d0fd942371631f62dae1282/execroot/_main/bazel-out/k8-fastbuild/bin/external/rules_python+/python/bin/repl.runfiles/rules_python+/python/bin/repl_py.py", line 38, in start_repl
    bazel_runfiles.Rlocation(STUB_PATH),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jpwoodbu/.cache/bazel/_bazel_jpwoodbu/4f83e7249d0fd942371631f62dae1282/execroot/_main/bazel-out/k8-fastbuild/bin/external/rules_python+/python/bin/repl.runfiles/rules_python+/python/runfiles/runfiles.py", line 176, in Rlocation
    raise ValueError('path is not normalized: "%s"' % path)
ValueError: path is not normalized: "rules_python+/../rules_python+/python/bin/repl_stub.py"

🌍 Your Environment

Operating System:

  
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

Reproduced on a second machine...

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
  

Output of bazel version:

  
$ bazel version
Bazelisk version: v1.20.0
Build label: 8.3.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Jun 30 16:23:40 2025 (1751300620)
Build timestamp: 1751300620
Build timestamp as int: 1751300620
  

Rules_python version:

  
1.5.1
  

Anything else relevant?
I don't think so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions