Skip to content
Myr

Merge remote-tracking branch 'origin/8.0.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents c3687bf, 09b9d61 · Browse files · 2 files+16 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−5 removed

  • tests:+11 added−0 removed
  • other:+5 added−5 removed

2 files+16 added−5 removed

modified:src/click/types.py+5 added-5 removed
843 unmodified lines
844 # path even if the path to the link is absolute.845 if os.path.islink(rv):846 rv = os.readlink(rv)847848 # Join dir_ with the resolved symlink. If the resolved849 # path is relative, this will make it relative to the850 # original containing directory. If it is absolute, this851 # has no effect.852 rv = os.path.join(dir_, rv)848 # Join dir_ with the resolved symlink if the resolved849 # path is relative. This will make it relative to the850 # original containing directory.851 if not os.path.isabs(rv):852 rv = os.path.join(dir_, rv)853854 try:855 st = os.stat(rv)856 except OSError:
205 unmodified lines
modified:tests/test_types.py+11 added
124 unmodified lines
125126 # test127 ctx = click.Context(click.Command("do_stuff"))128 rv = click.Path(resolve_path=True).convert(sym_path, None, ctx)129130 # os.readlink prepends path prefixes to absolute131 # links in windows.132 # https://docs.microsoft.com/en-us/windows/win32/133 # ... fileio/naming-a-file#win32-file-namespaces134 #135 # Here we strip win32 path prefix from the resolved path136 rv_drive, rv_path = os.path.splitdrive(rv)137 stripped_rv_drive = rv_drive.split(os.path.sep)[-1]138 rv = os.path.join(stripped_rv_drive, rv_path)139140 assert rv == real_path