这是indexloc提供的服务,不要输入任何密码
Skip to content

suspicious-url-open-usage (S310) should handle string literal #21462

@rajeee

Description

@rajeee

Summary

import urllib.request
path = "https://example.com/data.csv"
urllib.request.urlretrieve(path, "data.csv")

This currently raises suspicious-url-open-usage (S310), but it should not because path can be inferred to have Literal['https://example.com/data.csv'] type and that's safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions