Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Errors while execution of Tests #7573

Closed
deepak1725 opened this issue Jan 8, 2020 · 8 comments
Closed

Multiple Errors while execution of Tests #7573

deepak1725 opened this issue Jan 8, 2020 · 8 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@deepak1725
Copy link
Contributor

deepak1725 commented Jan 8, 2020

Environment

  • pip version: 19.3.1
  • Python version: 3.7.3
  • OS: Fedora 29

Description
Tried Executing very first command
$tox -e py36

Expected behavior
A Good success message

How to Reproduce
Maybe some environment issue, or some command is missing.

  1. Installed Tox
  2. Then Installed Python3.8
  3. Then Executed $tox -e py3.7 >> error.txt

Output

Attached Output File
[error.txt](https://github.com/pypa/pip/files/4035602/error.txt)

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jan 8, 2020
@deepak1725 deepak1725 changed the title Multiple Errors while execution Tests Multiple Errors while execution of Tests Jan 8, 2020
@uranusjr
Copy link
Member

uranusjr commented Jan 8, 2020

Could you help me run the following in python3.7:

import subprocess
subprocess.check_call(['any-command-that-does-not-exist'])

and see if it raises NotADirectoryError?

All errors (afaict) are basically one problem: you don’t have Mercurial installed. The problem though is that pip already handles this, by catching FileNotFoundError (actually, an equivalent that works on Python 2, but let’s ignore that detail now), but your OS somehow throws a different error when it cannot find a command, NotADirectoryError, which pip does not handle.

The easy fix is to, well, handle that. But this is kind of a weird behaviour on the OS’s part. Does someone have any insight into why the OS might do that, and whether it’s a good idea to accommodate it?

@deepak1725
Copy link
Contributor Author

@uranusjr Thanks for Quick response.
Here we go:

Python 3.7.3 (default, May 11 2019, 00:45:16) 
[GCC 8.3.1 20190223 (Red Hat 8.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_call(['any-command-that-does-not-exist'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.7/subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'any-command-that-does-not-exist'

Above Error is same for Python3.6 and Python3.7 each

@deepak1725
Copy link
Contributor Author

After Install Mercurial, It is left with 2 Errors only.
error2.txt

@uranusjr
Copy link
Member

uranusjr commented Jan 9, 2020

The two errors are the same, something like

FileNotFoundError: [Errno 2] No such file or directory: "/tmp/pytest-of-deepshar/pytest-13/test_freeze_mercurial_clone0/workspace/scratch/pip-test-package/*** failed to import extension hgext.qct: missing attributes: norepo, optionalrepo, inferrepo\n*** (use @command decorator to register '^qct|commit-tool')\n/tmp/pytest-of-deepshar/pytest-13/test_freeze_mercurial_clone0/workspace/scratch/pip-test-package"

I believe they are tracked in #7545.

@uranusjr
Copy link
Member

uranusjr commented Jan 9, 2020

Hmm, I just checked this on a fresh Fedora 29 Docker image:

>>> import subprocess
>>> subprocess.check_call(['asdasdfdgfgfg'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.7/subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'asdasdfdgfgfg': 'asdasdfdgfgfg'

So it seems the stdlib is doing the correct thing by default, and the NotADirectory exception you get is indeed an environment problem. I don’t know what it is though. :(

@pfmoore
Copy link
Member

pfmoore commented Jan 9, 2020

Could it be related to permissions? I'm not a Linux user myself, but I seem to recall Linux can report problems with unusual combinations of permissions in odd ways.

Do you have a directory on your $PATH with unusual permissions?

@deepak1725
Copy link
Contributor Author

Could it be related to permissions? I'm not a Linux user myself, but I seem to recall Linux can report problems with unusual combinations of permissions in odd ways.

Do you have a directory on your $PATH with unusual permissions?

AFAIK No

@deepak1725
Copy link
Contributor Author

Closing as @uranusjr specified its system-specific.
Workaround: Wrote a Docker File.

Feel Free to reopen if someone else faced similar issues.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Feb 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 14, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants