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

update-authors.py doesn’t work #3109

Open
Jayman2000 opened this issue Feb 17, 2023 · 0 comments · May be fixed by #3110
Open

update-authors.py doesn’t work #3109

Jayman2000 opened this issue Feb 17, 2023 · 0 comments · May be fixed by #3110

Comments

@Jayman2000
Copy link

Bug Report

SUMMARY

update-authors.py crashes when you run it.

STEPS TO REPRODUCE
  1. Run python3.11 update-authors.py
EXPECTED RESULTS

A list of authors is printed.

ACTUAL RESULTS

An AttributeError:

Traceback (most recent call last):
  File "/hdd/home/jayman/VC/Partially mine/galaxy/update-authors.py", line 10, in <module>
    authors = [author_re.match(entry).group(1) for entry in log_entries]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hdd/home/jayman/VC/Partially mine/galaxy/update-authors.py", line 10, in <listcomp>
    authors = [author_re.match(entry).group(1) for entry in log_entries]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
Jayman2000 added a commit to Jayman2000/galaxy-pr that referenced this issue Feb 18, 2023
Before this change, update-authors.py would use a more complicated regex
pattern. That pattern would sometimes fail to match anything and result
in match() returning None followed by an AttributeError.

The old regex pattern already assumed that there would be a "\t" before
the information that we’re looking for. This new pattern starts by
looking for the "\t" (rather than worrying about what comes before the
"\t").

The new pattern also simplifies the rules for matching an author’s name
and email. If we really want to enforce rules like “the author’s name
must only use word characters and spaces” or “the author’s email must
not contain ‘>’”, then we should add a CI check or something.

Fixes ansible#3109.
@Jayman2000 Jayman2000 linked a pull request Feb 18, 2023 that will close this issue
Jayman2000 added a commit to Jayman2000/galaxy-pr that referenced this issue Jun 13, 2023
Before this change, update-authors.py would use a more complicated regex
pattern. That pattern would sometimes fail to match anything and result
in match() returning None followed by an AttributeError.

The old regex pattern already assumed that there would be a "\t" before
the information that we’re looking for. This new pattern starts by
looking for the "\t" (rather than worrying about what comes before the
"\t").

The new pattern also simplifies the rules for matching an author’s name
and email. If we really want to enforce rules like “the author’s name
must only use word characters and spaces” or “the author’s email must
not contain ‘>’”, then we should add a CI check or something.

Fixes ansible#3109.
Jayman2000 added a commit to Jayman2000/galaxy-pr that referenced this issue Jun 13, 2023
Before this change, update-authors.py would use a more complicated regex
pattern. That pattern would sometimes fail to match anything and result
in match() returning None followed by an AttributeError.

The old regex pattern already assumed that there would be a "\t" before
the information that we’re looking for. This new pattern starts by
looking for the "\t" (rather than worrying about what comes before the
"\t").

The new pattern also simplifies the rules for matching an author’s name
and email. If we really want to enforce rules like “the author’s name
must only use word characters and spaces” or “the author’s email must
not contain ‘>’”, then we should add a CI check or something.

Fixes ansible#3109.
Jayman2000 added a commit to Jayman2000/galaxy-pr that referenced this issue Dec 4, 2024
Before this change, update-authors.py would use a more complicated regex
pattern. That pattern would sometimes fail to match anything and result
in match() returning None followed by an AttributeError.

The old regex pattern already assumed that there would be a "\t" before
the information that we’re looking for. This new pattern starts by
looking for the "\t" (rather than worrying about what comes before the
"\t").

The new pattern also simplifies the rules for matching an author’s name
and email. If we really want to enforce rules like “the author’s name
must only use word characters and spaces” or “the author’s email must
not contain ‘>’”, then we should add a CI check or something.

Fixes ansible#3109.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant