Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Pyton 3.7 incompatibility #8

@emartin-merrill-r7

Description

@emartin-merrill-r7

There is a bug in swagger-codegen where it's using variable names that are reserved words in python3.7. Specifically, async is a reserved word. The result is a series of syntax error like this:

byte-compiling build/bdist.macosx-10.9-x86_64/egg/rapid7vmconsole/api_client.py to api_client.cpython-37.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/rapid7vmconsole/api_client.py", line 277
    response_type=None, auth_settings=None, async=None,
                                                ^
SyntaxError: invalid syntax

Until swagger-codegen is fixed, a work-around is to run the following on the vm-console-client-python code on a linux/unix/osx machine:
LC_ALL=C find ./ -type f -exec sed -i ‘’ ‘s/async=params.get/async_=params.get/g’ {} +
LC_ALL=C find ./ -type f -exec sed -i ‘’ ‘s/async=None/async_=None/g’ {} +
LC_ALL=C find ./ -type f -exec sed -i ‘’ ‘s/if not async/if not async_/g’ {} +

This replaces the async variable with async_ and allows the code to be compatible with python3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions