Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Flask static_folder cannot be None" #2858

Merged
merged 2 commits into from Mar 12, 2019

Conversation

@randomstuff
Copy link
Contributor

commented Mar 11, 2019

Fix #2851. An optional second commit fixes a few other types.

@srittau
Copy link
Collaborator

left a comment

Thank you for the patch. A few notes below.

use_x_sendfile: Any = ...
json_encoder: Any = ...
json_decoder: Any = ...
jinja_options: Any = ...
jinja_options: Dict[str, Any] = ...

This comment has been minimized.

Copy link
@srittau

srittau Mar 12, 2019

Collaborator

I'd prefer to leave this as Any for now. The real solution is probably to make ImmutableDict in the werkzeug stubs generic and use that here.

default_config: Any = ...
url_rule_class: type = ...
test_client_class: type = ...
test_cli_runner_class: type = ...
session_interface: Any = ...
import_name: str = ...
template_folder: str = ...
root_path: Any = ...
root_path: str = ...

This comment has been minimized.

Copy link
@srittau

srittau Mar 12, 2019

Collaborator

As this is initialized to None, this should be Optional. Also I guess this can be unicode in Python 2, so using Optional[Union[str, Text]] seems better to me.

static_folder: str = ...
instance_path: Any = ...
static_folder: Optional[str] = ...
instance_path: str = ...

This comment has been minimized.

Copy link
@srittau

srittau Mar 12, 2019

Collaborator

Also probably Union[str, Text].

def make_config(self, instance_relative: bool = ...): ...
def auto_find_instance_path(self): ...
def open_instance_resource(self, resource: Any, mode: str = ...): ...
def open_instance_resource(self, resource: str, mode: str = ...): ...

This comment has been minimized.

Copy link
@srittau

srittau Mar 12, 2019

Collaborator

Text for Python 2.

templates_auto_reload: Any = ...
def create_jinja_environment(self): ...
def create_global_jinja_loader(self): ...
def select_jinja_autoescape(self, filename: Any): ...
def update_template_context(self, context: Any) -> None: ...
def make_shell_context(self): ...
env: Any = ...
debug: Any = ...
env: Optional[str] = ...

This comment has been minimized.

Copy link
@randomstuff

randomstuff Mar 12, 2019

Author Contributor

I guess this should be Optiona[str, Text] as well.

@randomstuff randomstuff force-pushed the randomstuff:flask_fix branch from f418493 to f9d41ed Mar 12, 2019

@srittau srittau merged commit d595a46 into python:master Mar 12, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@srittau

This comment has been minimized.

Copy link
Collaborator

commented Mar 12, 2019

Thanks! Just for future reference: We prefer submitters not to force-push, because that makes reviewing the changes harder. We squash commits anyway when merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.