[issue33891] ntpath join doesnt check whether path variable None or not

2018-06-20 Thread Xiang Zhang


Xiang Zhang  added the comment:

This is not a bug in ntpath. Raising a TypeError is a normal behavior when 
passed a wrong argument and I think the error message tells good info. You 
should figure out why pipenv passes a None to os.path.join.

--
nosy: +xiang.zhang
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33891] ntpath join doesnt check whether path variable None or not

2018-06-17 Thread Ömer FADIL USTA

New submission from Ömer FADIL USTA :

In https://github.com/python/cpython/blob/master/Lib/ntpath.py#L76
def join(path, *paths):
path = os.fspath(path)

the path variable used directly in fspath method without checking is exist or 
not so it cause :

  File "d:\python\37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "d:\python\37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "D:\Python\37\Scripts\pipenv.exe\__main__.py", line 9, in 
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 722, 
in __call__
return self.main(*args, **kwargs)
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 697, 
in main
rv = self.invoke(ctx)
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 1043, 
in invoke
return Command.invoke(self, ctx)
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 895, 
in invoke
return ctx.invoke(self.callback, **ctx.params)
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 535, 
in invoke
return callback(*args, **kwargs)
  File "d:\python\37\lib\site-packages\pipenv\vendor\click\decorators.py", line 
17, in new_func
return f(get_current_context(), *args, **kwargs)
  File "d:\python\37\lib\site-packages\pipenv\cli.py", line 217, in cli
do_py()
  File "d:\python\37\lib\site-packages\pipenv\core.py", line 1703, in do_py
click.echo(which('python', allow_global=system))
  File "d:\python\37\lib\site-packages\pipenv\core.py", line 125, in which
os.path.join(location, 'Scripts'), command
  File "d:\python\37\lib\ntpath.py", line 76, in join
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType'. Make sure 
pipenv is on the PATH.

--
messages: 319835
nosy: usta
priority: normal
severity: normal
status: open
title: ntpath join doesnt check whether path variable None or not
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com