Skip to content

contrib/_appengine_environ.py KeyError SERVER_SOFTWARE #1470

@wittfabian

Description

@wittfabian

https://github.com/urllib3/urllib3/blob/master/src/urllib3/contrib/_appengine_environ.py

In the development environment, the variable SERVER_SOFTWARE is sometimes not set, so the query should read as follows:

os.environ.get('SERVER_SOFTWARE', '').startswith('Development')

def is_local_appengine():
    return ('APPENGINE_RUNTIME' in os.environ and
            os.environ.get('SERVER_SOFTWARE', '').startswith('Development'))


def is_prod_appengine():
    return ('APPENGINE_RUNTIME' in os.environ and
            not os.environ.get('SERVER_SOFTWARE', '').startswith('Development') and
            not is_prod_appengine_mvms())

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions