Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-145980: Add support for alternative alphabets in the binascii module#145981

Merged
serhiy-storchaka merged 12 commits intopython:mainfrom
serhiy-storchaka:binascii-alphabet
Mar 20, 2026
Merged

gh-145980: Add support for alternative alphabets in the binascii module#145981
serhiy-storchaka merged 12 commits intopython:mainfrom
serhiy-storchaka:binascii-alphabet

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedMar 15, 2026
edited by github-actionsbot
Loading

  • Add the alphabet parameter in functions b2a_base64(), a2b_base64(), b2a_base85() and a2b_base85().
  • And a number of "*_ALPHABET" constants.
  • Remove b2a_z85() and a2b_z85().

📚 Documentation preview 📚:https://cpython-previews--145981.org.readthedocs.build/

…i module* Add the alphabet parameter in functions b2a_base64(), a2b_base64(),  b2a_base85() and a2b_base85().* And a number of "*_ALPHABET" constants.* Remove b2a_z85() and a2b_z85().
static PyObject *
get_reverse_table(binascii_state *state, PyObject *alphabet, int size, int padchar)
{
PyObject *reverse_table;
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest having agoto error for cleanup in case this function grows.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think this is preliminary.

@serhiy-storchaka
Copy link
MemberAuthor

Damn, what is now? I spent more time fighting the CI than fixing genuine bugs.

@serhiy-storchaka
Copy link
MemberAuthor

Are there other suggestions or notes? I am going to merge this PR, because it is a dependence for#146192 and other changes.

@picnixz
Copy link
Member

Not from side!

@serhiy-storchakaserhiy-storchaka merged commit4507d49 intopython:mainMar 20, 2026
50 checks passed
@serhiy-storchakaserhiy-storchaka deleted the binascii-alphabet branchMarch 20, 2026 11:07
@serhiy-storchaka
Copy link
MemberAuthor

Thank you for your review@picnixz.

@bedevere-bot
Copy link

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

Hi! The buildbotARM64 MacOS M1 Refleaks NoGIL 3.x (tier-2) has failed when building commit4507d49.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/1368/builds/4852) and take a look at the build logs.
  4. Check if the failure is related to this commit (4507d49) 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/1368/builds/4852

Failed tests:

  • test_capi
  • test.test_concurrent_futures.test_interpreter_pool
  • test_import

Test leaking resources:

  • test_interpreter_pool: references
  • test_capi: references
  • test_interpreter_pool: memory blocks
  • test_import: references
  • test_capi: memory blocks
  • test_import: memory blocks

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

==

Click to see traceback logs
TracebackTests.test_nonexistent_module_nested) ... okTracebackTests.test_broken_parent) ... okTracebackTests.test_unencodable_filename) ... skipped 'need TESTFN_UNENCODABLE'TracebackTests.test_exec_failure_nested) ... okTraceback (most recent call last):  File"<string>", line10, in<module>  File"<frozen importlib._bootstrap>", line786, inmodule_from_spec  File"<frozen importlib._bootstrap_external>", line1025, increate_module  File"<frozen importlib._bootstrap>", line491, in_call_with_frames_removedImportError:module _test_module_state_shared does not support loading in subinterpretersxpected failureTracebackTests.test_import_bug) ... okTracebackTests.test_syntax_error) ... okTracebackTests.test_nonexistent_module) ... okTracebackTests.test_broken_from) ... okTracebackTests.test_broken_submodule) ... okTracebackTests.test_exec_failure) ... okTracebackTests.test_broken_parent_from) ... ok

@bedevere-bot
Copy link

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

Hi! The buildbots390x Fedora Stable Refleaks 3.x (tier-3) has failed when building commit4507d49.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/1641/builds/1849) and take a look at the build logs.
  4. Check if the failure is related to this commit (4507d49) 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/1641/builds/1849

Failed tests:

  • test_capi
  • test.test_concurrent_futures.test_interpreter_pool
  • test_import

Test leaking resources:

  • test_interpreter_pool: references
  • test_capi: references
  • test_interpreter_pool: memory blocks
  • test_import: references
  • test_capi: memory blocks
  • test_import: memory blocks

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

==

Click to see traceback logs
TracebackTests.test_nonexistent_module_nested) ... okTracebackTests.test_broken_parent) ... okTracebackTests.test_exec_failure_nested) ... okTracebackTests.test_import_bug) ... okTracebackTests.test_syntax_error) ... okTracebackTests.test_nonexistent_module) ... okTracebackTests.test_unencodable_filename) ... okTracebackTests.test_broken_from) ... okTracebackTests.test_broken_submodule) ... okTracebackTests.test_exec_failure) ... okTracebackTests.test_broken_parent_from) ... ok

@bedevere-bot
Copy link

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

Hi! The buildbotPPC64LE Fedora Stable Refleaks 3.x (tier-2) has failed when building commit4507d49.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/280/builds/2905) and take a look at the build logs.
  4. Check if the failure is related to this commit (4507d49) 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/280/builds/2905

Failed tests:

  • test_capi
  • test.test_concurrent_futures.test_interpreter_pool
  • test_import

Test leaking resources:

  • test_interpreter_pool: references
  • test_capi: references
  • test_interpreter_pool: memory blocks
  • test_import: references
  • test_capi: memory blocks
  • test_import: memory blocks

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

==

Click to see traceback logs
TracebackTests.test_nonexistent_module_nested) ... okTracebackTests.test_broken_parent) ... okTracebackTests.test_exec_failure_nested) ... okTracebackTests.test_import_bug) ... okTracebackTests.test_syntax_error) ... okTracebackTests.test_nonexistent_module) ... okTracebackTests.test_unencodable_filename) ... okTracebackTests.test_broken_from) ... okTracebackTests.test_broken_submodule) ... okTracebackTests.test_exec_failure) ... okTracebackTests.test_broken_parent_from) ... ok

ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull requestMar 20, 2026
…i module (pythonGH-145981)* Add the alphabet parameter in functions b2a_base64(), a2b_base64(),  b2a_base85(), and a2b_base85().* And a number of "*_ALPHABET" constants.* Remove b2a_z85() and a2b_z85().
kangtastic added a commit to kangtastic/cpython that referenced this pull requestMar 20, 2026
- Use the new `alphabet` parameter in `binascii`- Remove `binascii.a2b_base32hex()` and `binascii.b2a_base32hex()`- Change value for `.. versionadded::` ReST directive in docs for  new `binascii` functions to "next" instead of "3.15"
@vstinner
Copy link
Member

This change introduced reference leaks in 3 tests:

  • test_capi:test.test_capi.test_misc.SubinterpreterTest.test_mutate_exception test
  • test_concurrent_futures.test_interpreter_pool
  • test_import

I wrote#146230 to fix the leak.

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull requestMar 22, 2026
* upstream/main: (1475 commits)  Docs: replace all `datetime` imports with `import datetime as dt` (python#145640)pythongh-146153: Use `frozendict` in pure python fallback for `curses.has_key` (python#146154)pythongh-138234: clarify returncode behavior for subprocesses created with `shell=True` (python#138536)pythongh-140947: fix contextvars handling for server tasks in asyncio  (python#141158)pythonGH-100108: Add async generators best practices section (python#141885)pythonGH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` (pythonGH-146120)pythongh-146228: Better fork support in cached FastPath (python#146231)pythongh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (pythongh-146229)pythongh-145980: Fix copy/paste mistake in binascii.c (python#146230)pythongh-146092: Raise MemoryError on allocation failure in _zoneinfo (python#146165)pythongh-91279: Note `SOURCE_DATE_EPOCH` support in `ZipFile.writestr()` doc (python#139396)pythongh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (python#146201)pythongh-143930: Reject leading dashes in webbrowser URLspythongh-145916: Soft-deprecate ctypes.util.find_library (pythonGH-145919)pythongh-146205: Check the errno with != 0 in close impls in select module (python#146206)pythongh-146171: Fix nested AttributeError suggestions (python#146188)pythongh-146099: Optimize _GUARD_CODE_VERSION+IP via function version symbols (pythonGH-146101)pythongh-145980: Add support for alternative alphabets in the binascii module (pythonGH-145981)pythongh-145754: Update signature retrieval in unittest.mock to use forwardref annotation format (python#145756)pythongh-145177: Add emscripten run --test, uses test args from config.toml (python#146160)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@picnixzpicnixzpicnixz left review comments

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@serhiy-storchaka@picnixz@bedevere-bot@vstinner

[8]ページ先頭

©2009-2026 Movatter.jp