473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

os.path.normpath bug?

Hi there,
I've noticed that os.path.normpath does not collapse redundant
separators if they're located at the beginning of the string:
>>print os.path.normpath('/a//b//c')
\a\b\c
>>print os.path.normpath('//a//b//c')
\\a\b\c

Is it intentional or is it a bug?

Jun 14 '07 #1
2 2207
billiejoex wrote:
Hi there,
I've noticed that os.path.normpath does not collapse redundant
separators if they're located at the beginning of the string:
>>>print os.path.normpath('/a//b//c')
\a\b\c
>>>print os.path.normpath('//a//b//c')
\\a\b\c

Is it intentional or is it a bug?
Intentional.

http://en.wikipedia.org/wiki/Path_(c...ing_Convention
--
Michael Hoffman
Jun 14 '07 #2
On 14 Giu, 22:35, Michael Hoffman <cam.ac...@mh391.invalidwrote:
Intentional.

http://en.wikipedia.org/wiki/Path_(c..._Naming_Conven...
--
Michael Hoffman
Got it.
Thank you.
Jun 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben Allfree | last post by:
Written to normalize web server path names based on a virtual root. I propose that something equivalent to this be added to os.path ------------------------------------- import os.path import...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: placid | last post by:
Hi all, I was just wondering if there is a anti-os.path.normpath function? For example if i have the path "C:\Program Files\Games" i want to anti-os.path.normpath is so that it becomes...
5
by: Mike Krell | last post by:
I'm running into problems trying to override __str__ on the path class from Jason Orendorff's path module (http://www.jorendorff.com/articles/python/path/src/path.py). My first attempt to do...
8
by: eliben | last post by:
Hello, os.path.split returns the head and tail of a path, but what if I want to have all the components ? I could not find a portable way to do this in the standard library, so I've concocted...
1
by: Julien | last post by:
Hi, In Windows, when a path has been normalized with os.path.normpath, you get something like this: C:/temp/my_dir/bla.txt # With forward slashes instead or backward slashes. Is it...
7
by: Daniel | last post by:
Hello, I'm writing some unit tests for my python software which uses packages. Here is the basic structure: mypackage __init__.py module1 __init__.py mod1.py
1
by: Francesco Guerrieri | last post by:
On Thu, Sep 4, 2008 at 3:25 PM, Mathieu Prevot <mathieu.prevot@gmail.comwrote: a.rstrip('/') does the job. bye, Francesco
4
by: Giampaolo Rodola' | last post by:
Hi, I'm trying to implement a function which returns whether a path is a subpath of another one (e.g. /a/b/c is a subpath of /a/b). I wrote this function which apparently seems to work fine: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.