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.

tmpdir path too long on macOS

See original GitHub issue

I have a unit test that runs gpg. First we set GNUPGHOME to the temporary directory that pytest creates, then we run it using our own keys. However, gpg fails with the following error:

gpg: keybox '/private/var/folders/21/hwq39zyj4g36x6zjfyl5l8080000gn/T/pytest-of-Adam/pytest-5/test_buildcache0/gpg/pubring.kbx' created
gpg: can't connect to the agent: File name too long
gpg: agent_genkey failed: No agent running
gpg: key generation failed: No agent running

According to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206, gpg cannot handle long paths. Is there any way to shorten /private/var/folders/21/hwq39zyj4g36x6zjfyl5l8080000gn/T/pytest-of-Adam/pytest-5/test_buildcache0/gpg/pubring.kbx?

platform darwin – Python 3.7.3, pytest-3.2.5, py-1.4.34, pluggy-0.4.0

Possibly related to #291

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
The-Compilercommented, May 24, 2021

You can configure any command line option in the config via addopts.

1reaction
The-Compilercommented, Aug 30, 2019

FWIW I have this in my testsuite for a similar issue:

@pytest.fixture()
def short_tmpdir():
    with tempfile.TemporaryDirectory() as tdir:
        yield py.path.local(tdir)
Read more comments on GitHub >

github_iconTop Results From Across the Web

When "/tmp" and $TMPDIR directory are cleaned up in macOS?
My app creates and check some files in "/tmp" or $TMPDIR. It's because files tried to be saved in user selective path are...
Read more >
Symbolic link to my $TMPDIR. Will I break something? (path ...
I have rather blindly fixed a problem with a long path to a directory file raising an error in emacs. Am I going...
Read more >
469065 - "Socket path too long" due to TMPDIR - Monorail
Start Chromium with an environment variable TMPDIR set to a path of 70 characters or more. What is the expected behavior? What went...
Read more >
Why is Mac OSX temp. directory in weird path - Ask Different
The solution on macOS is to have a seperate temporary files folder for each user. This way one user cannot interfere with other...
Read more >
Where's the Temp Folder on Mac OS? How to Find & Open the ...
TMPDIR will always be a path to a seemingly nonsensical directory structure, because it is not intended to be user facing or user...
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