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

gh-126004: fix positions handling in codecs.replace_errors #127674

Merged
merged 17 commits into from
Jan 23, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Dec 6, 2024

Python/codecs.c Outdated Show resolved Hide resolved
@picnixz picnixz requested a review from encukou January 3, 2025 18:39
Python/codecs.c Outdated Show resolved Hide resolved
@picnixz picnixz requested a review from encukou January 22, 2025 11:13
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Python/codecs.c Outdated Show resolved Hide resolved
Python/codecs.c Outdated Show resolved Hide resolved
Python/codecs.c Outdated Show resolved Hide resolved
@picnixz picnixz merged commit 225296c into python:main Jan 23, 2025
41 checks passed
@picnixz picnixz deleted the fix/codecs/replace-errors-126004 branch January 23, 2025 10:44
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.x has failed when building commit 225296c.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1380/builds/2419) and take a look at the build logs.
  4. Check if the failure is related to this commit (225296c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1380/builds/2419

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Android 3.x has failed when building commit 225296c.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1594/builds/1124) and take a look at the build logs.
  4. Check if the failure is related to this commit (225296c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1594/builds/1124

Failed tests:

  • test_android

Failed subtests:

  • test_bytes - test.test_android.TestAndroidOutput.test_bytes

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/data/user/0/org.python.testbed/files/python/lib/python3.14/test/test_android.py", line 63, in assert_log
    line = self.logcat_queue.get(timeout=(deadline - time()))
  File "/data/user/0/org.python.testbed/files/python/lib/python3.14/queue.py", line 212, in get
    raise Empty
_queue.Empty


Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Volumes/InternalDisk/Users/android/buildarea/3.x.mhsmith-android-aarch64/build/Android/android.py", line 531, in run_testbed
    async with asyncio.TaskGroup() as tg:
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/taskgroups.py", line 134, in __aexit__
    raise propagate_cancellation_error
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/taskgroups.py", line 110, in __aexit__
    await self._on_completed_fut
asyncio.exceptions.CancelledError


Traceback (most recent call last):
  File "/data/user/0/org.python.testbed/files/python/lib/python3.14/test/test_android.py", line 53, in setUp
    self.assert_log("I", tag, message, skip=True, timeout=5)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/org.python.testbed/files/python/lib/python3.14/test/test_android.py", line 65, in assert_log
    self.fail(f"line not found: {expected!r}")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: line not found: 'test.test_android.TestAndroidOutput.test_bytes 1737630241.1795416'

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

The iOS failures seem unrelated though I cannot confirm and the Android failure may be related so I'll check

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

The code that seems to fail is:

self.assertEqual(write_len, stream.write(b))
if lines is None:
    lines = [b.decode()]
self.assert_logs(level, tag, lines)

However, we're using a strict or a backslashreplace error handler in b.decode() and the logcat process:

    def setUp(self):
        self.logcat_process = subprocess.Popen(
            ["logcat", "-v", "tag"], stdout=subprocess.PIPE,
            errors="backslashreplace"
        )

so I don't know how it was affected by this change. I'll rerun the build bot for this one and if it still fails, I'll revert the PR.

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

!buildbot aarch64 Android 3.x

@bedevere-bot
Copy link

The regex 'aarch64 Android 3.x' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

Nevermind, the two build bots are actually green on the latest main ¯\_(ツ)_/¯

@mhsmith
Copy link
Member

mhsmith commented Jan 23, 2025

I'm not sure what happened with the iOS buildbot, but the Android failure is a known problem: #124666.

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

Thank you for confirming this. iOS build bot seems to never run so it could be a network issue or build bot issue.

@mhsmith
Copy link
Member

mhsmith commented Jan 23, 2025

The iOS buildbot had some issues recently (#129200), but it should be back to normal now. This particular failure is one I haven't seen before – it looks like it passed the test suite and then crashed at the end.

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 this pull request may close these issues.

5 participants