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

fileinput does not use universal input #39710

Closed
reowen mannequin opened this issue Dec 15, 2003 · 3 comments
Closed

fileinput does not use universal input #39710

reowen mannequin opened this issue Dec 15, 2003 · 3 comments
Labels
stdlib Python modules in the Lib dir

Comments

@reowen
Copy link
Mannequin

reowen mannequin commented Dec 15, 2003

BPO 860515
Nosy @birkenfeld, @birkenfeld

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 = <Date 2006-02-20.20:06:31.000>
created_at = <Date 2003-12-15.19:11:32.000>
labels = ['library']
title = 'fileinput does not use universal input'
updated_at = <Date 2006-02-20.20:06:31.000>
user = 'https://bugs.python.org/reowen'

bugs.python.org fields:

activity = <Date 2006-02-20.20:06:31.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2003-12-15.19:11:32.000>
creator = 'reowen'
dependencies = []
files = []
hgrepos = []
issue_num = 860515
keywords = []
message_count = 3.0
messages = ['19417', '19418', '19419']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'georg.brandl', 'reowen']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue860515'
versions = ['Python 2.3']

@reowen
Copy link
Mannequin Author

reowen mannequin commented Dec 15, 2003

In Python 2.3.0 the fileinput module does not appear to use universal line ending mode for reading files. I found this using MacPython 2.3 (via the binary installer) but looking at the module it appears to be vanilla code. I confess I didn't see where the files were opened, so I cannot suggest a fix.

Sample code:

import fileinput
for line in fileinput.input():
	print line[0:20]

try this with text files that have some other platform's line endings. For me, it works on MacOS X for files with unix line endings, but fails if the file(s) have Mac line endings.

@reowen reowen mannequin closed this as completed Dec 15, 2003
@reowen reowen mannequin added the stdlib Python modules in the Lib dir label Dec 15, 2003
@reowen reowen mannequin closed this as completed Dec 15, 2003
@reowen reowen mannequin added the stdlib Python modules in the Lib dir label Dec 15, 2003
@birkenfeld
Copy link
Member

Logged In: YES
user_id=1188172

See patch bpo-1212287.

@birkenfeld
Copy link
Member

Logged In: YES
user_id=849994

Patch bpo-1212287 was now committed, so closing this.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant