Skip to content
Myr

Merge branch '6.x-maintenance'

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

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents 0ad05de, 15977f2 · Browse files · 3 files+38 added−20 removed
This commit

State

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

Diff stats

3 files+38 added−20 removed

  • tests:+11 added−0 removed
  • other:+27 added−20 removed

3 files+38 added−20 removed

modified:click/types.py+20 added-20 removed
418 unmodified lines
419 self.path_type,420 filename_to_ui(value)421 ), param, ctx)422423 if not self.file_okay and stat.S_ISREG(st.st_mode):424 self.fail('%s "%s" is a file.' % (425 self.path_type,426 filename_to_ui(value)427 ), param, ctx)428 if not self.dir_okay and stat.S_ISDIR(st.st_mode):429 self.fail('%s "%s" is a directory.' % (430 self.path_type,431 filename_to_ui(value)432 ), param, ctx)433 if self.writable and not os.access(value, os.W_OK):434 self.fail('%s "%s" is not writable.' % (435 self.path_type,436 filename_to_ui(value)437 ), param, ctx)438 if self.readable and not os.access(value, os.R_OK):439 self.fail('%s "%s" is not readable.' % (440 self.path_type,441 filename_to_ui(value)442 ), param, ctx)423 if not self.file_okay and stat.S_ISREG(st.st_mode):424 self.fail('%s "%s" is a file.' % (425 self.path_type,426 filename_to_ui(value)427 ), param, ctx)428 if not self.dir_okay and stat.S_ISDIR(st.st_mode):429 self.fail('%s "%s" is a directory.' % (430 self.path_type,431 filename_to_ui(value)432 ), param, ctx)433 if self.writable and not os.access(value, os.W_OK):434 self.fail('%s "%s" is not writable.' % (435 self.path_type,436 filename_to_ui(value)437 ), param, ctx)438 if self.readable and not os.access(value, os.R_OK):439 self.fail('%s "%s" is not readable.' % (440 self.path_type,441 filename_to_ui(value)442 ), param, ctx)443444 return self.coerce_path_result(rv)445446
106 unmodified lines
modified:tests/test_arguments.py+11 added
104 unmodified lines
105 assert result.output == 'Hey!'106 assert result.exit_code == 0107108109def test_path_args(runner):110 @click.command()111 @click.argument('input', type=click.Path(dir_okay=False, allow_dash=True))112 def foo(input):113 click.echo(input)114115 result = runner.invoke(foo, ['-'])116 assert result.output == '-\n'117 assert result.exit_code == 0118119120def test_file_atomics(runner):121 @click.command()122 @click.argument('output', type=click.File('wb', atomic=True))123 def inout(output):
166 unmodified lines
modified:CHANGES+7 added
9 unmodified lines
1011- The exception objects now store unicode properly.12- Added the ability to hide commands and options from help.1314Version 6.515-----------1617(bugfix release; not yet released)1819- Fix bug in `click.Path` where it would crash when passed a `-`. See #551.2021Version 6.422-----------2324(bugfix release; released on March 24th 2016)
323 unmodified lines