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

Filename providing cross platform capability #45141

Closed
atagar mannequin opened this issue Jun 29, 2007 · 5 comments
Closed

Filename providing cross platform capability #45141

atagar mannequin opened this issue Jun 29, 2007 · 5 comments
Labels
docs Documentation in the Doc dir

Comments

@atagar
Copy link
Mannequin

atagar mannequin commented Jun 29, 2007

BPO 1745533
Nosy @loewis, @orsenthil

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 2007-07-01.08:34:08.000>
created_at = <Date 2007-06-29.21:05:53.000>
labels = ['invalid', 'docs']
title = 'Filename providing cross platform capability'
updated_at = <Date 2007-07-01.08:34:08.000>
user = 'https://bugs.python.org/atagar'

bugs.python.org fields:

activity = <Date 2007-07-01.08:34:08.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2007-06-29.21:05:53.000>
creator = 'atagar'
dependencies = []
files = []
hgrepos = []
issue_num = 1745533
keywords = []
message_count = 5.0
messages = ['32426', '32427', '32428', '32429', '32430']
nosy_count = 3.0
nosy_names = ['loewis', 'orsenthil', 'atagar']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1745533'
versions = ['Python 2.4']

@atagar
Copy link
Mannequin Author

atagar mannequin commented Jun 29, 2007

The help section for the open method should note that a Unix style filename work in a cross platform fashion (like Java). After scouring several resources including two O'Reilly texts on Python, a dozen web pages, all reliant help pages, I finally got my answer from a mailing list. -Damian

@atagar atagar mannequin closed this as completed Jun 29, 2007
@atagar atagar mannequin added invalid docs Documentation in the Doc dir labels Jun 29, 2007
@atagar atagar mannequin closed this as completed Jun 29, 2007
@atagar atagar mannequin added invalid docs Documentation in the Doc dir labels Jun 29, 2007
@orsenthil
Copy link
Member

I am not getting as what you are indicating Damian. You mean to say use '/' forward slashes in all documentation as they can work cross platform?

@atagar
Copy link
Mannequin Author

atagar mannequin commented Jun 30, 2007

No, I'm talking about the documentation when entering help(file) or help(open). The filename parameter works in a cross platform fashion when given a Unix path. For instance,
file = open("/path/to/content.xml", "r") # Cross platform
file = open("\\path\\to\\content.xml", "r") # Win32 only
This seemed to be an undocumented yet important detail (unless I'm mistaken it means its advantageous to always use the former method when coding paths). However, looking around some more I think this is largely a misunderstanding on my part in terms of where the cross platform capability came from (Windows accepting a forward slash rather than the open method translating the path for the current OS). Sorry about the confusion.

1 similar comment
@atagar
Copy link
Mannequin Author

atagar mannequin commented Jun 30, 2007

No, I'm talking about the documentation when entering help(file) or help(open). The filename parameter works in a cross platform fashion when given a Unix path. For instance,
file = open("/path/to/content.xml", "r") # Cross platform
file = open("\\path\\to\\content.xml", "r") # Win32 only
This seemed to be an undocumented yet important detail (unless I'm mistaken it means its advantageous to always use the former method when coding paths). However, looking around some more I think this is largely a misunderstanding on my part in terms of where the cross platform capability came from (Windows accepting a forward slash rather than the open method translating the path for the current OS). Sorry about the confusion.

@loewis
Copy link
Mannequin

loewis mannequin commented Jul 1, 2007

I think that's what Damian says, but it's partially wrong. Python has not taken any specific effort to make / work on all systems; it just happens to work on Windows as well. However, it does so only in a limited manner: you still might need to specify drive letters, and you cannot easily pass a file name with forward slashes to an external program, as that may mistake the slashes as command line options.

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

No branches or pull requests

1 participant