Tim Graham <[email protected]> added the comment:
I think this caused a behavior change:
Before (Python 3.6.6):
>>> from os.path import abspath
>>> abspath('/abc/')
'C:\\abc'
After (Python 3.6.7):
>>> abspath('/abc/')
'C:\\abc\\'
This causes a test failure in Django's safe_join() function:
https://github.com/django/django/blob/10d82c85aa5f8bd6adff0db49798dd368455cdcf/django/utils/_os.py#L24-L47
https://github.com/django/django/blob/10d82c85aa5f8bd6adff0db49798dd368455cdcf/tests/utils_tests/test_os_utils.py#L10
Traceback (most recent call last):
File
"C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python36\tests\utils_tests\test_os_utils.py",
line 10, in test_base_path_ends_with_sep
drive, path = os.path.splitdrive(safe_join("/abc/", "abc"))
File
"C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python36\django\utils\_os.py",
line 46, in safe_join
'component ({})'.format(final_path, base_path))
django.core.exceptions.SuspiciousFileOperation: The joined path (C:\abc\abc) is
located outside of the base path component (C:\abc\)
----------
nosy: +Tim.Graham
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31047>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com