Skip to content

pipes uses text files and the locale encodig #85322

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
serhiy-storchaka opened this issue Jun 28, 2020 · 3 comments
Closed

pipes uses text files and the locale encodig #85322

serhiy-storchaka opened this issue Jun 28, 2020 · 3 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 41150
Nosy @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-06-28.16:22:22.781>
labels = ['3.8', 'type-bug', 'library', '3.9', '3.10']
title = 'pipes uses text files and the locale encodig'
updated_at = <Date 2020-06-28.16:22:22.781>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2020-06-28.16:22:22.781>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-06-28.16:22:22.781>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 41150
keywords = []
message_count = 1.0
messages = ['372524']
nosy_count = 1.0
nosy_names = ['serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41150'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

@serhiy-storchaka
Copy link
Member Author

The pipes module was designed as a Python interface to Unix shell pipelines. In Python 2 it works with binary streams (on Unix). But in Python 3 it opens all files and pipes in text mode with the locale encoding. It makes it unapplicable for processing binary data and text data non-encodable with the locale encoding.

@serhiy-storchaka serhiy-storchaka added 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 28, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@vstinner
Copy link
Member

I never used the pipes module. Is it really used in the wild? It's now planned for removal in Python 3.13: https://peps.python.org/pep-0594/

Its docstring mentions converting a GIF file to a PPM image. The GIF format is binary, so using text in the pipes modules sounds like a bug for me.

I suggest to leave the code as it is and waits until the module is simply removed in Python 3.13. IMO it's too late (since Python 3.0) to fix it.

@methane
Copy link
Member

methane commented May 25, 2022

I agree with victor.

@methane methane closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2022
@methane methane moved this to Done in Locale issues 🗺 May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

3 participants