Skip to content

Unable to use pytest from mapped network drive #5826

@abhilash1in

Description

@abhilash1in
  • a detailed description of the bug or suggestion
    Running pyest --version using PowerShell displays the pytest version when I'm in my home directory or any other local directory on my Windows machine. When I cd into a mapped network drive (Q:\) and run pyest --version, I get PermissionError: [WinError 5] Access is denied: '.'. I get the same error when I run pyest --version inside as well as outside a virtual environment when I'm in a mapped network drive.
  • output of pip list from the virtual environment you are using
(env) PS Q:\Projects\Abhilash\Feeds> pip list
Package            Version
------------------ -------
asn1crypto         0.24.0
astroid            2.2.5
atomicwrites       1.3.0
attrs              19.1.0
bcrypt             3.1.7
cffi               1.12.3
colorama           0.4.1
coverage           4.5.4
cryptography       2.7
importlib-metadata 0.20
isort              4.3.21
lazy-object-proxy  1.4.2
mccabe             0.6.1
more-itertools     7.2.0
packaging          19.1
paramiko           2.6.0
pip                19.0.3
pluggy             0.12.0
py                 1.8.0
pycparser          2.19
pylint             2.3.1
pymssql            2.1.4
PyNaCl             1.3.0
pyparsing          2.4.2
pytest             5.1.2
pytest-cov         2.7.1
setuptools         40.8.0
six                1.12.0
typed-ast          1.4.0
wcwidth            0.1.7
wrapt              1.11.2
zipp               0.6.0
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.
  • pytest and operating system versions
PS C:\Users\kishorea> pytest --version
This is pytest version 5.1.2, imported from c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\pytest.py
setuptools registered plugins:
  pytest-cov-2.7.1 at c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\pytest_cov\plugin.py
PS C:\Users\kishorea>
PS C:\Users\kishorea> (Get-WMIObject win32_operatingsystem).name
Microsoft Windows 10 Enterprise|C:\WINDOWS|\Device\Harddisk0\Partition4
  • minimal example if possible
PS C:\Users\kishorea> pytest --version
This is pytest version 5.1.2, imported from c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\pytest.py
setuptools registered plugins:
  pytest-cov-2.7.1 at c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\pytest_cov\plugin.py
PS C:\Users\kishorea> q:
PS Q:\> pytest --version
Traceback (most recent call last):
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\kishorea\AppData\Local\Programs\Python\Python37\Scripts\pytest.exe\__main__.py", line 9, in <module>
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\_pytest\config\__init__.py", line 59, in main
    config = _prepareconfig(args, plugins)
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\_pytest\config\__init__.py", line 195, in _prepareconfig
    config = get_config(args, plugins)
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\site-packages\_pytest\config\__init__.py", line 160, in get_config
    args=args, plugins=plugins, dir=Path().resolve()
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\pathlib.py", line 1151, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "c:\users\kishorea\appdata\local\programs\python\python37\lib\pathlib.py", line 202, in resolve
    s = self._ext_to_normal(_getfinalpathname(s))
PermissionError: [WinError 5] Access is denied: '.'
PS Q:\>

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: windowswindows platform-specific problemtype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions