Skip to content

[INFRA] Python's coding directive is not honored #7569

@mikhail-dr

Description

@mikhail-dr

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • [X ] Bug
  • Requirement
  • Feature or performance improvement

Bug

When running the tool on a large number of Python files, we noticed that, if a Python file happens to have the coding directive, the tool seems unaware of it and inserts the copyright statement before the coding directive, thereby pushing that coding directive further down in the Python file, which makes it useless. the coding directive must either be in the 1st or 2nd line of a Python file:

# coding=utf-8

You can find more information on the coding directive here: https://www.python.org/dev/peps/pep-0263/#defining-the-encoding, where there is an exact regexp as well. Thanks!


Requirement or improvement

  • Please describe your requirements or improvement suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!good first issueGood first issue for beginnerslicense eye

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions