8000 wrong result from b'\xaa \xaa'.count(b'\xaa') (returns 1, expected 2) · Issue #9404 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
wrong result from b'\xaa \xaa'.count(b'\xaa') (returns 1, expected 2) #9404
Closed
@rmu75

Description

@rmu75

count() method from bytes sometimes returns wrong counts.

steps to reproduce:

MicroPython v1.19.1-dirty on 2022-09-24; linux [GCC 10.3.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> b'\xaa \xaa'.count(b'\xaa')
1
>>>

tested on unix and stm32 ports.

expected:

Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> b'\xaa \xaa'.count(b'\xaa')
2
>>>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0