question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when %TEMP% is a junction to a dir on a letter-less drive

See original GitHub issue

Description

Error when %TEMP% is a junction to a dir on a letter-less drive.

The error looks similar to jazzband/pip-tools#1061, but in pip itself.

Expected behavior

Successful install/reinstall

pip version

21.3

Python version

3.10.0, 3.9.6, 3.8.2

OS

Windows 10 x64

How to Reproduce

  1. Create a volume and don’t assign a letter to it
  2. Create dir on this volume
  3. Create a junction on this dir: ln--junction junction ‪\\?\Volume{<new volume uuid>}\dir
  4. set TEMP=%cd%\junction
  5. Install some package: pip3 install CrossMap

Output

Traceback (most recent call last):
  File "<python_install_dir>\lib\site-packages\pip\_internal\cli\base_command.py", line 164, in exc_logging_wrapper
    status = run_func(*args)
  File "<python_install_dir>\lib\site-packages\pip\_internal\cli\req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "<python_install_dir>\lib\site-packages\pip\_internal\commands\install.py", line 294, in run
    wheel_cache = WheelCache(options.cache_dir, options.format_control)
  File "<python_install_dir>\lib\site-packages\pip\_internal\cache.py", line 219, in __init__
    self._ephem_cache = EphemWheelCache(format_control)
  File "<python_install_dir>\lib\site-packages\pip\_internal\cache.py", line 196, in __init__
    super().__init__(self._temp_dir.path, format_control)
  File "<python_install_dir>\lib\site-packages\pip\_internal\cache.py", line 121, in __init__
    super().__init__(cache_dir, format_control, {"binary"})
  File "<python_install_dir>\lib\site-packages\pip\_internal\cache.py", line 44, in __init__
    assert not cache_dir or os.path.isabs(cache_dir)
AssertionError

Code of Conduct

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
grv87commented, Oct 24, 2021

os.path.realpath returns Volume{uuid}\\dir\\pip-kind-.... Yes, the prefix is lost.

I’ve reported https://bugs.python.org/issue45597.

1reaction
pfmoorecommented, Oct 21, 2021

Following the chain of calls leads to os.path.realpath(tempfile.mkdtemp(prefix=f"pip-{kind}-")). Can you confirm what that call returns in your environment? (Clearly you can just use any old prefix for the call).

If it doesn’t return a valid path, that would imply a Python bug (which we might be able to work around, but I’d also like to make sure the root issue is reported if that’s what it is).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Low Disk Space error due to a full Temp folder
To clear the Microsoft Store cache, press the Windows Logo Key + R to open the Run dialog box, then type wsreset.exe and...
Read more >
What is a safe way to move AppData\Local to a different drive?
Open the %LocalAppData% Properties dialog; Location tab → Enter desired new location; Move.
Read more >
The Ultimate Guide to Robocopy - Adam the Automator
Learn all of the robocopy commands that you can use in data migration, syncing folders, and copying even large files.
Read more >
Using Backup4all - FAQ 8
Troubleshooting the Volume Shadow Copy error messages; Not enough free disk space in temp folder; Backup .OST files. How to schedule a backup...
Read more >
Link Shell Extension (LSE)
Hardlinks, Junctions and Symbolic Links are NOT supported on FAT file systems, ... To create the Hardlinks a destination folder must be chosen, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found