PyCQA / flake8-bugbear

A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
MIT License
1.06k stars 104 forks source link

Replace hash with unsafe_hash #486

Closed kasium closed 1 month ago

kasium commented 2 months ago

Background: https://www.attrs.org/en/stable/changelog.html#deprecations

Closes #485

cooperlees commented 2 months ago

Thanks.

Is 3.13 introducing a new type for single char strings or something?

  ======================================================================
  FAIL: test_b907_format_specifier_permutations (__main__.BugbearTestCase.test_b907_format_specifier_permutations)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/runner/work/flake8-bugbear/flake8-bugbear/tests/test_bugbear.py", line 765, in test_b907_format_specifier_permutations
      old = format_string.format("hello")
  ValueError: Unknown format code 'b' for object of type 'str'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/runner/work/flake8-bugbear/flake8-bugbear/tests/test_bugbear.py", line 768, in test_b907_format_specifier_permutations
      visitor.errors == []
  AssertionError: b907 raised for 'b' not valid for string

  ----------------------------------------------------------------------
kasium commented 2 months ago

Not that I'm aware off. Let me check it tomorrow

kasium commented 2 months ago

I cannot reproduce it locally. I think the whole error is misleading. As far as I can tell from the code, the error is, that visitor.errors == [] which sounds like test pollution.

JelleZijlstra commented 2 months ago

Might be the same AST thing I mentioned in #487

kasium commented 2 months ago

I think so, too. I used the latest greates 3.13-dev and everything worked