Skip to content

bpo-1635741: Fix refleaks of encodings module by removing the encodings._aliases #21896

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

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deleting the _aliases in encodings module
  • Loading branch information
shihai1991 committed Aug 16, 2020
commit 4dd90d4e48371c19ea89e5d242430d3220d34ebc
9 changes: 4 additions & 5 deletions Lib/encodings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def normalize_encoding(encoding):

def search_function(encoding):

_aliases = aliases.aliases
# Cache lookup
entry = _cache.get(encoding, _unknown)
if entry is not _unknown:
Expand All @@ -83,8 +82,8 @@ def search_function(encoding):
# try in the encodings package, then at top-level.
#
norm_encoding = normalize_encoding(encoding)
aliased_encoding = _aliases.get(norm_encoding) or \
_aliases.get(norm_encoding.replace('.', '_'))
aliased_encoding = aliases.aliases.get(norm_encoding) or \
aliases.aliases.get(norm_encoding.replace('.', '_'))
if aliased_encoding is not None:
modnames = [aliased_encoding,
norm_encoding]
Expand Down Expand Up @@ -146,8 +145,8 @@ def search_function(encoding):
pass
else:
for alias in codecaliases:
if alias not in _aliases:
_aliases[alias] = modname
if alias not in aliases.aliases:
aliases.aliases[alias] = modname

# Return the registry entry
return entry
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy