Commit 9af9498c authored by Georg Brandl's avatar Georg Brandl

Remove things specific to the old Macintosh, and spell "Mac OS X" consistently.

parent f2a2c796
...@@ -326,7 +326,7 @@ This module provides the following functions. ...@@ -326,7 +326,7 @@ This module provides the following functions.
``'posix'``, ``'nt'``), and *compiler* defaults to the default compiler for ``'posix'``, ``'nt'``), and *compiler* defaults to the default compiler for
that platform. Currently only ``'posix'`` and ``'nt'`` are supported, and the that platform. Currently only ``'posix'`` and ``'nt'`` are supported, and the
default compilers are "traditional Unix interface" (:class:`UnixCCompiler` default compilers are "traditional Unix interface" (:class:`UnixCCompiler`
class) and Visual C++(:class:`MSVCCompiler` class). Note that it's perfectly class) and Visual C++ (:class:`MSVCCompiler` class). Note that it's perfectly
possible to ask for a Unix compiler object under Windows, and a Microsoft possible to ask for a Unix compiler object under Windows, and a Microsoft
compiler object under Unix---if you supply a value for *compiler*, *plat* is compiler object under Unix---if you supply a value for *compiler*, *plat* is
ignored. ignored.
......
...@@ -302,8 +302,8 @@ or the :command:`bdist` command with the :option:`--formats` option:: ...@@ -302,8 +302,8 @@ or the :command:`bdist` command with the :option:`--formats` option::
If you have a pure module distribution (only containing pure Python modules and If you have a pure module distribution (only containing pure Python modules and
packages), the resulting installer will be version independent and have a name packages), the resulting installer will be version independent and have a name
like :file:`foo-1.0.win32.exe`. These installers can even be created on Unix or like :file:`foo-1.0.win32.exe`. These installers can even be created on Unix
Mac OS platforms. platforms or Mac OS X.
If you have a non-pure distribution, the extensions can only be created on a If you have a non-pure distribution, the extensions can only be created on a
Windows platform, and will be Python version dependent. The installer filename Windows platform, and will be Python version dependent. The installer filename
......
...@@ -88,7 +88,7 @@ regular filename characters, ``?`` matches any single regular filename ...@@ -88,7 +88,7 @@ regular filename characters, ``?`` matches any single regular filename
character, and ``[range]`` matches any of the characters in *range* (e.g., character, and ``[range]`` matches any of the characters in *range* (e.g.,
``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of "regular filename ``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of "regular filename
character" is platform-specific: on Unix it is anything except slash; on Windows character" is platform-specific: on Unix it is anything except slash; on Windows
anything except backslash or colon; on Mac OS 9 anything except colon. anything except backslash or colon.
**\*\*** Windows support not there yet **\*\*** **\*\*** Windows support not there yet **\*\***
......
...@@ -46,9 +46,7 @@ Distutils will take care of converting this platform-neutral representation into ...@@ -46,9 +46,7 @@ Distutils will take care of converting this platform-neutral representation into
whatever is appropriate on your current platform before actually using the whatever is appropriate on your current platform before actually using the
pathname. This makes your setup script portable across operating systems, which pathname. This makes your setup script portable across operating systems, which
of course is one of the major goals of the Distutils. In this spirit, all of course is one of the major goals of the Distutils. In this spirit, all
pathnames in this document are slash-separated. (Mac OS 9 programmers should pathnames in this document are slash-separated.
keep in mind that the *absence* of a leading slash indicates a relative path,
the opposite of the Mac OS convention with colons.)
This, of course, only applies to pathnames given to Distutils functions. If This, of course, only applies to pathnames given to Distutils functions. If
you, for example, use standard Python functions such as :func:`glob.glob` or you, for example, use standard Python functions such as :func:`glob.glob` or
......
...@@ -25,10 +25,9 @@ the Python interpreter to run some Python code. ...@@ -25,10 +25,9 @@ the Python interpreter to run some Python code.
So if you are embedding Python, you are providing your own main program. One of So if you are embedding Python, you are providing your own main program. One of
the things this main program has to do is initialize the Python interpreter. At the things this main program has to do is initialize the Python interpreter. At
the very least, you have to call the function :cfunc:`Py_Initialize` (on Mac OS, the very least, you have to call the function :cfunc:`Py_Initialize`. There are
call :cfunc:`PyMac_Initialize` instead). There are optional calls to pass optional calls to pass command line arguments to Python. Then later you can
command line arguments to Python. Then later you can call the interpreter from call the interpreter from any part of the application.
any part of the application.
There are several different ways to call the interpreter: you can pass a string There are several different ways to call the interpreter: you can pass a string
containing Python statements to :cfunc:`PyRun_SimpleString`, or you can pass a containing Python statements to :cfunc:`PyRun_SimpleString`, or you can pass a
......
...@@ -390,8 +390,7 @@ files. Don't try this on Windows. On Windows, ``select`` works with sockets ...@@ -390,8 +390,7 @@ files. Don't try this on Windows. On Windows, ``select`` works with sockets
only. Also note that in C, many of the more advanced socket options are done only. Also note that in C, many of the more advanced socket options are done
differently on Windows. In fact, on Windows I usually use threads (which work differently on Windows. In fact, on Windows I usually use threads (which work
very, very well) with my sockets. Face it, if you want any kind of performance, very, very well) with my sockets. Face it, if you want any kind of performance,
your code will look very different on Windows than on Unix. (I haven't the your code will look very different on Windows than on Unix.
foggiest how you do this stuff on a Mac.)
Performance Performance
......
...@@ -568,7 +568,7 @@ Unicode filenames ...@@ -568,7 +568,7 @@ Unicode filenames
Most of the operating systems in common use today support filenames that contain Most of the operating systems in common use today support filenames that contain
arbitrary Unicode characters. Usually this is implemented by converting the arbitrary Unicode characters. Usually this is implemented by converting the
Unicode string into some encoding that varies depending on the system. For Unicode string into some encoding that varies depending on the system. For
example, MacOS X uses UTF-8 while Windows uses a configurable encoding; on example, Mac OS X uses UTF-8 while Windows uses a configurable encoding; on
Windows, Python uses the name "mbcs" to refer to whatever the currently Windows, Python uses the name "mbcs" to refer to whatever the currently
configured encoding is. On Unix systems, there will only be a filesystem configured encoding is. On Unix systems, there will only be a filesystem
encoding if you've set the ``LANG`` or ``LC_CTYPE`` environment variables; if encoding if you've set the ``LANG`` or ``LC_CTYPE`` environment variables; if
......
...@@ -58,7 +58,7 @@ There is an alternative, more powerful interface to the coder and decoder, see ...@@ -58,7 +58,7 @@ There is an alternative, more powerful interface to the coder and decoder, see
the source for details. the source for details.
If you code or decode textfiles on non-Macintosh platforms they will still use If you code or decode textfiles on non-Macintosh platforms they will still use
the Macintosh newline convention (carriage-return as end of line). the old Macintosh newline convention (carriage-return as end of line).
As of this writing, :func:`hexbin` appears to not work in all cases. As of this writing, :func:`hexbin` appears to not work in all cases.
.. _toolbox: .. _toolbox:
********************* **********************
MacOS Toolbox Modules Mac OS Toolbox Modules
********************* **********************
There are a set of modules that provide interfaces to various MacOS toolboxes. There are a set of modules that provide interfaces to various Mac OS toolboxes.
If applicable the module will define a number of Python objects for the various If applicable the module will define a number of Python objects for the various
structures declared by the toolbox, and operations will be implemented as structures declared by the toolbox, and operations will be implemented as
methods of the object. Other operations will be implemented as functions in the methods of the object. Other operations will be implemented as functions in the
...@@ -240,7 +240,7 @@ The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and ...@@ -240,7 +240,7 @@ The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and
:deprecated: :deprecated:
This module is only fully available on MacOS9 and earlier under classic PPC This module is only fully available on Mac OS 9 and earlier under classic PPC
MacPython. Very limited functionality is available under Carbon MacPython. MacPython. Very limited functionality is available under Carbon MacPython.
.. index:: single: Scrap Manager .. index:: single: Scrap Manager
......
...@@ -19,8 +19,7 @@ run CGI scripts. ...@@ -19,8 +19,7 @@ run CGI scripts.
.. note:: .. note::
This module can run CGI scripts on Unix and Windows systems; on Mac OS it will This module can run CGI scripts on Unix and Windows systems.
only be able to run Python scripts within the same process as itself.
.. note:: .. note::
......
...@@ -206,7 +206,7 @@ Window objects have the following methods, among others: ...@@ -206,7 +206,7 @@ Window objects have the following methods, among others:
.. method:: Window.open() .. method:: Window.open()
Override this method to open a window. Store the MacOS window-id in Override this method to open a window. Store the Mac OS window-id in
:attr:`self.wid` and call the :meth:`do_postopen` method to register the window :attr:`self.wid` and call the :meth:`do_postopen` method to register the window
with the parent application. with the parent application.
......
...@@ -16,8 +16,7 @@ IDLE has the following features: ...@@ -16,8 +16,7 @@ IDLE has the following features:
* coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit
* cross-platform: works on Windows and Unix (on Mac OS, there are currently * cross-platform: works on Windows and Unix
problems with Tcl/Tk)
* multi-window text editor with multiple undo, Python colorizing and many other * multi-window text editor with multiple undo, Python colorizing and many other
features, e.g. smart indent and call tips features, e.g. smart indent and call tips
......
...@@ -42,8 +42,8 @@ This module provides an interface to the mechanisms used to implement the ...@@ -42,8 +42,8 @@ This module provides an interface to the mechanisms used to implement the
searched, but first it searches a few special places: it tries to find a searched, but first it searches a few special places: it tries to find a
built-in module with the given name (:const:`C_BUILTIN`), then a frozen built-in module with the given name (:const:`C_BUILTIN`), then a frozen
module (:const:`PY_FROZEN`), and on some systems some other places are looked module (:const:`PY_FROZEN`), and on some systems some other places are looked
in as well (on the Mac, it looks for a resource (:const:`PY_RESOURCE`); on in as well (on Windows, it looks in the registry which may point to a
Windows, it looks in the registry which may point to a specific file). specific file).
If search is successful, the return value is a 3-element tuple ``(file, If search is successful, the return value is a 3-element tuple ``(file,
pathname, description)``: pathname, description)``:
...@@ -153,12 +153,6 @@ indicate the search result of :func:`find_module`. ...@@ -153,12 +153,6 @@ indicate the search result of :func:`find_module`.
The module was found as dynamically loadable shared library. The module was found as dynamically loadable shared library.
.. data:: PY_RESOURCE
The module was found as a Mac OS 9 resource. This value can only be returned on
a Mac OS 9 or earlier Macintosh.
.. data:: PKG_DIRECTORY .. data:: PKG_DIRECTORY
The module was found as a package directory. The module was found as a package directory.
......
...@@ -23,7 +23,7 @@ everyday programming. Some of these modules are explicitly designed to ...@@ -23,7 +23,7 @@ everyday programming. Some of these modules are explicitly designed to
encourage and enhance the portability of Python programs by abstracting encourage and enhance the portability of Python programs by abstracting
away platform-specifics into platform-neutral APIs. away platform-specifics into platform-neutral APIs.
The Python installers for the Windows and Mac platforms usually include The Python installers for the Windows platform usually includes
the entire standard library and often also include many additional the entire standard library and often also include many additional
components. For Unix-like operating systems Python is normally provided components. For Unix-like operating systems Python is normally provided
as a collection of packages, so it may be necessary to use the packaging as a collection of packages, so it may be necessary to use the packaging
......
.. _mac-specific-services: .. _mac-specific-services:
************************* **************************
MacOS X specific services Mac OS X specific services
************************* **************************
This chapter describes modules that are only available on the Mac OS X platform. This chapter describes modules that are only available on the Mac OS X platform.
...@@ -12,7 +12,7 @@ Mac-specific Python programming. ...@@ -12,7 +12,7 @@ Mac-specific Python programming.
.. warning:: .. warning::
These modules are deprecated and are removed in 3.0 These modules are deprecated and are removed in 3.0.
.. toctree:: .. toctree::
......
:mod:`MacOS` --- Access to Mac OS interpreter features :mod:`MacOS` --- Access to Mac OS interpreter features
====================================================== ======================================================
......
:mod:`macpath` --- MacOS 9 path manipulation functions :mod:`macpath` --- Mac OS 9 path manipulation functions
====================================================== =======================================================
.. module:: macpath .. module:: macpath
:synopsis: MacOS 9 path manipulation functions. :synopsis: Mac OS 9 path manipulation functions.
This module is the Mac OS 9 (and earlier) implementation of the :mod:`os.path` This module is the Mac OS 9 (and earlier) implementation of the :mod:`os.path`
......
...@@ -480,7 +480,7 @@ For an example of the usage of queues for interprocess communication see ...@@ -480,7 +480,7 @@ For an example of the usage of queues for interprocess communication see
multithreading/multiprocessing semantics, this number is not reliable. multithreading/multiprocessing semantics, this number is not reliable.
Note that this may raise :exc:`NotImplementedError` on Unix platforms like Note that this may raise :exc:`NotImplementedError` on Unix platforms like
MacOS X where ``sem_getvalue()`` is not implemented. Mac OS X where ``sem_getvalue()`` is not implemented.
.. method:: empty() .. method:: empty()
...@@ -774,7 +774,7 @@ object -- see :ref:`multiprocessing-managers`. ...@@ -774,7 +774,7 @@ object -- see :ref:`multiprocessing-managers`.
A bounded semaphore object: a clone of :class:`threading.BoundedSemaphore`. A bounded semaphore object: a clone of :class:`threading.BoundedSemaphore`.
(On Mac OSX this is indistinguishable from :class:`Semaphore` because (On Mac OS X this is indistinguishable from :class:`Semaphore` because
``sem_getvalue()`` is not implemented on that platform). ``sem_getvalue()`` is not implemented on that platform).
.. class:: Condition([lock]) .. class:: Condition([lock])
......
...@@ -226,13 +226,13 @@ write files see :func:`open`, and for accessing the filesystem see the ...@@ -226,13 +226,13 @@ write files see :func:`open`, and for accessing the filesystem see the
Return ``True`` if both pathname arguments refer to the same file or directory Return ``True`` if both pathname arguments refer to the same file or directory
(as indicated by device number and i-node number). Raise an exception if a (as indicated by device number and i-node number). Raise an exception if a
:func:`os.stat` call on either pathname fails. Availability: Macintosh, Unix. :func:`os.stat` call on either pathname fails. Availability: Unix.
.. function:: sameopenfile(fp1, fp2) .. function:: sameopenfile(fp1, fp2)
Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file. Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file.
Availability: Macintosh, Unix. Availability: Unix.
.. function:: samestat(stat1, stat2) .. function:: samestat(stat1, stat2)
...@@ -240,7 +240,7 @@ write files see :func:`open`, and for accessing the filesystem see the ...@@ -240,7 +240,7 @@ write files see :func:`open`, and for accessing the filesystem see the
Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same file. Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same file.
These structures may have been returned by :func:`fstat`, :func:`lstat`, or These structures may have been returned by :func:`fstat`, :func:`lstat`, or
:func:`stat`. This function implements the underlying comparison used by :func:`stat`. This function implements the underlying comparison used by
:func:`samefile` and :func:`sameopenfile`. Availability: Macintosh, Unix. :func:`samefile` and :func:`sameopenfile`. Availability: Unix.
.. function:: split(path) .. function:: split(path)
......
This diff is collapsed.
:mod:`plistlib` --- Generate and parse MacOS X ``.plist`` files :mod:`plistlib` --- Generate and parse Mac OS X ``.plist`` files
=============================================================== ================================================================
.. module:: plistlib .. module:: plistlib
:synopsis: Generate and parse MacOS X plist files. :synopsis: Generate and parse Mac OS X plist files.
.. moduleauthor:: Jack Jansen .. moduleauthor:: Jack Jansen
.. sectionauthor:: Georg Brandl <georg@python.org> .. sectionauthor:: Georg Brandl <georg@python.org>
.. (harvested from docstrings in the original file) .. (harvested from docstrings in the original file)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
single: property list single: property list
This module provides an interface for reading and writing the "property list" This module provides an interface for reading and writing the "property list"
XML files used mainly by MacOS X. XML files used mainly by Mac OS X.
The property list (``.plist``) file format is a simple XML pickle supporting The property list (``.plist``) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings. Usually the basic object types, like dictionaries, lists, numbers and strings. Usually the
...@@ -73,7 +73,7 @@ This module defines the following functions: ...@@ -73,7 +73,7 @@ This module defines the following functions:
.. function:: readPlistFromResource(path[, restype='plst'[, resid=0]]) .. function:: readPlistFromResource(path[, restype='plst'[, resid=0]])
Read a plist from the resource with type *restype* from the resource fork of Read a plist from the resource with type *restype* from the resource fork of
*path*. Availability: MacOS X. *path*. Availability: Mac OS X.
.. warning:: .. warning::
...@@ -84,7 +84,7 @@ This module defines the following functions: ...@@ -84,7 +84,7 @@ This module defines the following functions:
.. function:: writePlistToResource(rootObject, path[, restype='plst'[, resid=0]]) .. function:: writePlistToResource(rootObject, path[, restype='plst'[, resid=0]])
Write *rootObject* as a resource with type *restype* to the resource fork of Write *rootObject* as a resource with type *restype* to the resource fork of
*path*. Availability: MacOS X. *path*. Availability: Mac OS X.
.. warning:: .. warning::
......
...@@ -22,7 +22,7 @@ copying and removal. For operations on individual files, see also the ...@@ -22,7 +22,7 @@ copying and removal. For operations on individual files, see also the
can't copy all file metadata. can't copy all file metadata.
On POSIX platforms, this means that file owner and group are lost as well On POSIX platforms, this means that file owner and group are lost as well
as ACLs. On MacOS, the resource fork and other metadata are not used. as ACLs. On Mac OS, the resource fork and other metadata are not used.
This means that resources will be lost and file type and creator codes will This means that resources will be lost and file type and creator codes will
not be correct. On Windows, file owners, ACLs and alternate data streams not be correct. On Windows, file owners, ACLs and alternate data streams
are not copied. are not copied.
......
...@@ -188,7 +188,7 @@ The :mod:`signal` module defines the following functions: ...@@ -188,7 +188,7 @@ The :mod:`signal` module defines the following functions:
Change system call restart behaviour: if *flag* is :const:`False`, system calls Change system call restart behaviour: if *flag* is :const:`False`, system calls
will be restarted when interrupted by signal *signalnum*, otherwise system calls will will be restarted when interrupted by signal *signalnum*, otherwise system calls will
be interrupted. Returns nothing. Availability: Unix, Mac (see the man page be interrupted. Returns nothing. Availability: Unix (see the man page
:manpage:`siginterrupt(3)` for further information). :manpage:`siginterrupt(3)` for further information).
Note that installing a signal handler with :func:`signal` will reset the restart Note that installing a signal handler with :func:`signal` will reset the restart
......
...@@ -104,7 +104,7 @@ This module defines one class called :class:`Popen`: ...@@ -104,7 +104,7 @@ This module defines one class called :class:`Popen`:
If *universal_newlines* is :const:`True`, the file objects stdout and stderr are If *universal_newlines* is :const:`True`, the file objects stdout and stderr are
opened as text files, but lines may be terminated by any of ``'\n'``, the Unix opened as text files, but lines may be terminated by any of ``'\n'``, the Unix
end-of-line convention, ``'\r'``, the Macintosh convention or ``'\r\n'``, the end-of-line convention, ``'\r'``, the old Macintosh convention or ``'\r\n'``, the
Windows convention. All of these external representations are seen as ``'\n'`` Windows convention. All of these external representations are seen as ``'\n'``
by the Python program. by the Python program.
......
...@@ -582,8 +582,8 @@ always available. ...@@ -582,8 +582,8 @@ always available.
================ =========================== ================ ===========================
Windows ``'win32'`` Windows ``'win32'``
Windows/Cygwin ``'cygwin'`` Windows/Cygwin ``'cygwin'``
MacOS X ``'darwin'`` Mac OS X ``'darwin'``
MacOS 9 ``'mac'`` Mac OS 9 ``'mac'``
OS/2 ``'os2'`` OS/2 ``'os2'``
OS/2 EMX ``'os2emx'`` OS/2 EMX ``'os2emx'``
RiscOS ``'riscos'`` RiscOS ``'riscos'``
......
...@@ -67,8 +67,7 @@ An explanation of some terminology and conventions is in order. ...@@ -67,8 +67,7 @@ An explanation of some terminology and conventions is in order.
* The precision of the various real-time functions may be less than suggested by * The precision of the various real-time functions may be less than suggested by
the units in which their value or argument is expressed. E.g. on most Unix the units in which their value or argument is expressed. E.g. on most Unix
systems, the clock "ticks" only 50 or 100 times a second, and on the Mac, times systems, the clock "ticks" only 50 or 100 times a second.
are only accurate to whole seconds.
* On the other hand, the precision of :func:`time` and :func:`sleep` is better * On the other hand, the precision of :func:`time` and :func:`sleep` is better
than their Unix equivalents: times are expressed as floating point numbers, than their Unix equivalents: times are expressed as floating point numbers,
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
The :mod:`Tkinter` module ("Tk interface") is the standard Python interface to The :mod:`Tkinter` module ("Tk interface") is the standard Python interface to
the Tk GUI toolkit. Both Tk and :mod:`Tkinter` are available on most Unix the Tk GUI toolkit. Both Tk and :mod:`Tkinter` are available on most Unix
platforms, as well as on Windows and Macintosh systems. (Tk itself is not part platforms, as well as on Windows systems. (Tk itself is not part of Python; it
of Python; it is maintained at ActiveState.) is maintained at ActiveState.)
.. note:: .. note::
......
...@@ -151,10 +151,10 @@ Notes: ...@@ -151,10 +151,10 @@ Notes:
Only on Windows platforms. Only on Windows platforms.
(3) (3)
Only on MacOS platforms; requires the standard MacPython :mod:`ic` module. Only on Mac OS platforms; requires the standard MacPython :mod:`ic` module.
(4) (4)
Only on MacOS X platform. Only on Mac OS X platform.
Here are some simple examples:: Here are some simple examples::
......
...@@ -75,7 +75,7 @@ Physical lines ...@@ -75,7 +75,7 @@ Physical lines
A physical line is a sequence of characters terminated by an end-of-line A physical line is a sequence of characters terminated by an end-of-line
sequence. In source files, any of the standard platform line termination sequence. In source files, any of the standard platform line termination
sequences can be used - the Unix form using ASCII LF (linefeed), the Windows sequences can be used - the Unix form using ASCII LF (linefeed), the Windows
form using the ASCII sequence CR LF (return followed by linefeed), or the form using the ASCII sequence CR LF (return followed by linefeed), or the old
Macintosh form using the ASCII CR (return) character. All of these forms can be Macintosh form using the ASCII CR (return) character. All of these forms can be
used equally, regardless of platform. used equally, regardless of platform.
......
...@@ -23,7 +23,7 @@ You could write a Unix shell script or Windows batch files for some of these ...@@ -23,7 +23,7 @@ You could write a Unix shell script or Windows batch files for some of these
tasks, but shell scripts are best at moving around files and changing text data, tasks, but shell scripts are best at moving around files and changing text data,
not well-suited for GUI applications or games. You could write a C/C++/Java not well-suited for GUI applications or games. You could write a C/C++/Java
program, but it can take a lot of development time to get even a first-draft program, but it can take a lot of development time to get even a first-draft
program. Python is simpler to use, available on Windows, MacOS X, and Unix program. Python is simpler to use, available on Windows, Mac OS X, and Unix
operating systems, and will help you get the job done more quickly. operating systems, and will help you get the job done more quickly.
Python is simple to use, but it is a real programming language, offering much Python is simple to use, but it is a real programming language, offering much
......
...@@ -237,15 +237,15 @@ automatically added to the end. ``'r+'`` opens the file for both reading and ...@@ -237,15 +237,15 @@ automatically added to the end. ``'r+'`` opens the file for both reading and
writing. The *mode* argument is optional; ``'r'`` will be assumed if it's writing. The *mode* argument is optional; ``'r'`` will be assumed if it's
omitted. omitted.
On Windows and the Macintosh, ``'b'`` appended to the mode opens the file in On Windows, ``'b'`` appended to the mode opens the file in binary mode, so there
binary mode, so there are also modes like ``'rb'``, ``'wb'``, and ``'r+b'``. are also modes like ``'rb'``, ``'wb'``, and ``'r+b'``. Windows makes a
Windows makes a distinction between text and binary files; the end-of-line distinction between text and binary files; the end-of-line characters in text
characters in text files are automatically altered slightly when data is read or files are automatically altered slightly when data is read or written. This
written. This behind-the-scenes modification to file data is fine for ASCII behind-the-scenes modification to file data is fine for ASCII text files, but
text files, but it'll corrupt binary data like that in :file:`JPEG` or it'll corrupt binary data like that in :file:`JPEG` or :file:`EXE` files. Be
:file:`EXE` files. Be very careful to use binary mode when reading and writing very careful to use binary mode when reading and writing such files. On Unix,
such files. On Unix, it doesn't hurt to append a ``'b'`` to the mode, so it doesn't hurt to append a ``'b'`` to the mode, so you can use it
you can use it platform-independently for all binary files. platform-independently for all binary files.
.. _tut-filemethods: .. _tut-filemethods:
......
...@@ -157,9 +157,9 @@ shell scripts, by putting the line :: ...@@ -157,9 +157,9 @@ shell scripts, by putting the line ::
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning (assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the of the script and giving the file an executable mode. The ``#!`` must be the
first two characters of the file. On some platforms, this first line must end first two characters of the file. On some platforms, this first line must end
with a Unix-style line ending (``'\n'``), not a Mac OS (``'\r'``) or Windows with a Unix-style line ending (``'\n'``), not a Windows (``'\r\n'``) line
(``'\r\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is ending. Note that the hash, or pound, character, ``'#'``, is used to start a
used to start a comment in Python. comment in Python.
The script can be given an executable mode, or permission, using the The script can be given an executable mode, or permission, using the
:program:`chmod` command:: :program:`chmod` command::
......
...@@ -516,7 +516,7 @@ These environment variables influence Python's behavior. ...@@ -516,7 +516,7 @@ These environment variables influence Python's behavior.
If this environment variable is set, ``sys.argv[0]`` will be set to its If this environment variable is set, ``sys.argv[0]`` will be set to its
value instead of the value got through the C runtime. Only works on value instead of the value got through the C runtime. Only works on
MacOS X. Mac OS X.
Debug-mode variables Debug-mode variables
......
...@@ -528,11 +528,11 @@ all users using a machine or a particular site installation. ...@@ -528,11 +528,11 @@ all users using a machine or a particular site installation.
Python 2.6 introduces a convention for user-specific site directories. Python 2.6 introduces a convention for user-specific site directories.
The directory varies depending on the platform: The directory varies depending on the platform:
* Unix and MacOS: :file:`~/.local/` * Unix and Mac OS X: :file:`~/.local/`
* Windows: :file:`%APPDATA%/Python` * Windows: :file:`%APPDATA%/Python`
Within this directory, there will be version-specific subdirectories, Within this directory, there will be version-specific subdirectories,
such as :file:`lib/python2.6/site-packages` on Unix/MacOS and such as :file:`lib/python2.6/site-packages` on Unix/Mac OS and
:file:`Python26/site-packages` on Windows. :file:`Python26/site-packages` on Windows.
If you don't like the default directory, it can be overridden by an If you don't like the default directory, it can be overridden by an
...@@ -2784,12 +2784,12 @@ Ippolito. ...@@ -2784,12 +2784,12 @@ Ippolito.
The :mod:`plistlib` module: A Property-List Parser The :mod:`plistlib` module: A Property-List Parser
-------------------------------------------------- --------------------------------------------------
The ``.plist`` format is commonly used on MacOS X to The ``.plist`` format is commonly used on Mac OS X to
store basic data types (numbers, strings, lists, store basic data types (numbers, strings, lists,
and dictionaries) by serializing them into an XML-based format. and dictionaries) by serializing them into an XML-based format.
It resembles the XML-RPC serialization of data types. It resembles the XML-RPC serialization of data types.
Despite being primarily used on MacOS X, the format Despite being primarily used on Mac OS X, the format
has nothing Mac-specific about it and the Python implementation works has nothing Mac-specific about it and the Python implementation works
on any platform that Python supports, so the :mod:`plistlib` module on any platform that Python supports, so the :mod:`plistlib` module
has been promoted to the standard library. has been promoted to the standard library.
...@@ -2905,7 +2905,7 @@ Changes to Python's build process and to the C API include: ...@@ -2905,7 +2905,7 @@ Changes to Python's build process and to the C API include:
:file:`PCbuild` directory for the build files. (Implemented by :file:`PCbuild` directory for the build files. (Implemented by
Christian Heimes.) Christian Heimes.)
* On MacOS X, Python 2.6 can be compiled as a 4-way universal build. * On Mac OS X, Python 2.6 can be compiled as a 4-way universal build.
The :program:`configure` script The :program:`configure` script
can take a :option:`--with-universal-archs=[32-bit|64-bit|all]` can take a :option:`--with-universal-archs=[32-bit|64-bit|all]`
switch, controlling whether the binaries are built for 32-bit switch, controlling whether the binaries are built for 32-bit
...@@ -3057,7 +3057,7 @@ Port-Specific Changes: Windows ...@@ -3057,7 +3057,7 @@ Port-Specific Changes: Windows
.. ====================================================================== .. ======================================================================
Port-Specific Changes: MacOS X Port-Specific Changes: Mac OS X
----------------------------------- -----------------------------------
* When compiling a framework build of Python, you can now specify the * When compiling a framework build of Python, you can now specify the
...@@ -3069,7 +3069,7 @@ Port-Specific Changes: MacOS X ...@@ -3069,7 +3069,7 @@ Port-Specific Changes: MacOS X
:func:`macostools.touched` function to be removed because it depended on the :func:`macostools.touched` function to be removed because it depended on the
:mod:`macfs` module. (:issue:`1490190`) :mod:`macfs` module. (:issue:`1490190`)
* Many other MacOS modules have been deprecated and will removed in * Many other Mac OS modules have been deprecated and will removed in
Python 3.0: Python 3.0:
:mod:`_builtinSuites`, :mod:`_builtinSuites`,
:mod:`aepack`, :mod:`aepack`,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment