Skip to content

Commit

Permalink
fix: CLI crash on Windows and Python < 3.8 when the schema path conta…
Browse files Browse the repository at this point in the history
…ins characters unrepresentable at the OS level.
  • Loading branch information
chr1st1ank authored and Stranger6667 committed Feb 8, 2020
1 parent f2e160d commit fd3cfc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/changelog.rst
Expand Up @@ -6,6 +6,11 @@ Changelog
`Unreleased`_
-------------

Fixed
~~~~~

- CLI crash on Windows and Python < 3.8 when the schema path contains characters unrepresentable at the OS level. `#400`_

`0.24.0`_ - 2020-02-07
----------------------

Expand Down Expand Up @@ -678,6 +683,7 @@ Fixed
.. _0.3.0: https://github.com/kiwicom/schemathesis/compare/v0.2.0...v0.3.0
.. _0.2.0: https://github.com/kiwicom/schemathesis/compare/v0.1.0...v0.2.0

.. _#400: https://github.com/kiwicom/schemathesis/issues/400
.. _#394: https://github.com/kiwicom/schemathesis/issues/394
.. _#391: https://github.com/kiwicom/schemathesis/issues/391
.. _#386: https://github.com/kiwicom/schemathesis/issues/386
Expand Down
4 changes: 2 additions & 2 deletions src/schemathesis/cli/__init__.py
@@ -1,4 +1,4 @@
import pathlib
import os
import traceback
from contextlib import contextmanager
from enum import Enum
Expand Down Expand Up @@ -193,7 +193,7 @@ def run( # pylint: disable=too-many-arguments

with abort_on_network_errors():
options.update({"checks": selected_checks, "workers_num": workers_num})
if pathlib.Path(schema).is_file():
if os.path.isfile(schema):
options["loader"] = from_path
elif app is not None and not urlparse(schema).netloc:
# If `schema` is not an existing filesystem path or an URL then it is considered as an endpoint with
Expand Down

0 comments on commit fd3cfc3

Please sign in to comment.