Title: Test failure in test_find_periodic_pattern in string_tests.py · Issue #105639 · python/cpython · GitHub
Open Graph Title: Test failure in test_find_periodic_pattern in string_tests.py · Issue #105639 · python/cpython
X Title: Test failure in test_find_periodic_pattern in string_tests.py · Issue #105639 · python/cpython
Description: A recent test failure: FAIL: test_find_periodic_pattern (test.test_bytes.ByteArrayAsStringTest.test_find_periodic_pattern) (p='', text='') Cover the special path for periodic patterns. ----------------------------------------------------...
Open Graph Description: A recent test failure: FAIL: test_find_periodic_pattern (test.test_bytes.ByteArrayAsStringTest.test_find_periodic_pattern) (p='', text='') Cover the special path for periodic patterns. ------------...
X Description: A recent test failure: FAIL: test_find_periodic_pattern (test.test_bytes.ByteArrayAsStringTest.test_find_periodic_pattern) (p='', text='') Cover the special path for periodic patter...
Opengraph URL: https://github.com/python/cpython/issues/105639
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test failure in test_find_periodic_pattern in string_tests.py","articleBody":"A recent test failure:\r\n\r\n```\r\nFAIL: test_find_periodic_pattern (test.test_bytes.ByteArrayAsStringTest.test_find_periodic_pattern) (p='', text='')\r\nCover the special path for periodic patterns.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/string_tests.py\", line 335, in test_find_periodic_pattern\r\n self.checkequal(reference_find(p, text),\r\n File \"/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/string_tests.py\", line 60, in checkequal\r\n self.assertEqual(\r\nAssertionError: -1 != 0\r\n```\r\n\r\nThe issue is `reference_find`:\r\n\r\n```\r\n def reference_find(p, s):\r\n for i in range(len(s)):\r\n if s.startswith(p, i):\r\n return i\r\n return -1\r\n```\r\n\r\nWhen `s == p == ''`, we get `for i in range(0)`, and then `-1` is returned instead of the actual result which should be 0.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-105640\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sweeneyde","@type":"Person","name":"sweeneyde"},"datePublished":"2023-06-10T22:21:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/105639/cpython/issues/105639"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:16bc0408-f9c9-d039-5584-06f6160a53fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBA8:76A99:1E96FB8:2AF6255:6A55F72A |
| html-safe-nonce | 9533d625ff1a5eb949b84f3dec54f17c81b85bd6ebc6b150ecdb1c62fc991ba6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkE4Ojc2QTk5OjFFOTZGQjg6MkFGNjI1NTo2QTU1RjcyQSIsInZpc2l0b3JfaWQiOiIyNDU5MDAxMDY4MDMxNzAyODI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f36f8131705348670026c2a00bf435b006cc1f0c0c15faab8badbe58932c50f4 |
| hovercard-subject-tag | issue:1751139344 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/105639/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c48400be881b0d1ad3c31188af48b453eba158b9e50fe4e93391e78def58c809/python/cpython/issues/105639 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c48400be881b0d1ad3c31188af48b453eba158b9e50fe4e93391e78def58c809/python/cpython/issues/105639 |
| og:image:alt | A recent test failure: FAIL: test_find_periodic_pattern (test.test_bytes.ByteArrayAsStringTest.test_find_periodic_pattern) (p='', text='') Cover the special path for periodic patterns. ------------... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sweeneyde |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3725c7f9b2a6e3a27ef57c5aed13428c0f65e045 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width