[ python-Bugs-1560114 ] Tutorial: incorrect info about package importing and mac

SourceForge.net noreply at sourceforge.net
Sun Sep 17 14:24:02 CEST 2006


Bugs item #1560114, was opened at 2006-09-17 14:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1560114&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: C L (cl_)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tutorial: incorrect info about package importing and mac

Initial Comment:
Section 6.4.1 of the Python tutorial says:
"Now what happens when the user writes from Sound.Effects import *? 
Ideally, one would hope that this somehow goes out to the filesystem, 
finds which submodules are present in the package, and imports them all. 
Unfortunately, this operation does not work very well on Mac and 
Windows platforms, where the filesystem does not always have accurate 
information about the case of a filename! On these platforms, there is no 
guaranteed way to know whether a file ECHO.PY should be imported as a 
module echo, Echo or ECHO."

This is incorrect. It's true that the (default *) Mac file system does not 
allow file names differing only in case in the same directory, and lets you 
access a file by any variation of case; but the file system always records 
and returns the file name with the exact capitalization that was given 
when the name was assigned. In other words, if you create a file called 
"MixedCase.py" you can access it as "mixedcase.py", "MiXeDcAsE.pY" etc., 
but if you list the contents of its parent directory the name will always be 
given as "MixedCase.py".

This has been true of all versions of the Mac OS going back to System 1.0. 
Therefore, none of that paragraph applies to any Mac system; on the 
contrary, the file system always has accurate information about the case 
of a file name. That section of the text should be changed to remove the 
reference to the Mac platform.

(*: recent Mac OS X systems also allow one to use the HFSX filesystem 
variant, which allows file names differing only in case and matches file 
names only when the case is exactly identical - ie, the fully case-sensitive 
Unix semantics. But again, this has no bearing on the ability to reliably 
obtain the exact case of the name of a file.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1560114&group_id=5470


More information about the Python-bugs-list mailing list