From barry@users.sourceforge.net Tue Oct 1 00:07:42 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 16:07:42 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Header.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv6887 Modified Files: Header.py Log Message: Docstring consistency with the updated .tex files. Index: Header.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Header.py 30 Sep 2002 15:51:31 -0000 1.12 --- Header.py 30 Sep 2002 23:07:35 -0000 1.13 *************** *** 206,214 **** (i.e. isinstance(s, StringType) is true), then charset is the encoding of that byte string, and a UnicodeError will be raised if the string ! cannot be decoded with that charset. If `s' is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In this case, when producing an RFC 2822 compliant header using RFC 2047 rules, the Unicode string will be encoded using the ! following charsets in order: us-ascii, the charset hint, utf-8. """ if charset is None: --- 206,215 ---- (i.e. isinstance(s, StringType) is true), then charset is the encoding of that byte string, and a UnicodeError will be raised if the string ! cannot be decoded with that charset. If s is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In this case, when producing an RFC 2822 compliant header using RFC 2047 rules, the Unicode string will be encoded using the ! following charsets in order: us-ascii, the charset hint, utf-8. The ! first character set not to provoke a UnicodeError is used. """ if charset is None: *************** *** 377,381 **** def encode(self): ! """Encode a message header, possibly converting charset and encoding. There are many issues involved in converting a given string for use in --- 378,382 ---- def encode(self): ! """Encode a message header into an RFC-compliant format. There are many issues involved in converting a given string for use in From barry@users.sourceforge.net Tue Oct 1 01:02:36 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 17:02:36 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv28660 Modified Files: Charset.py Log Message: Docstring consistency with the updated .tex files. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Charset.py 28 Sep 2002 17:47:56 -0000 1.6 --- Charset.py 1 Oct 2002 00:02:33 -0000 1.7 *************** *** 86,90 **** # Convenience functions for extending the above mappings def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): ! """Add charset properties to the global map. charset is the input character set, and must be the canonical name of a --- 86,90 ---- # Convenience functions for extending the above mappings def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): ! """Add character set properties to the global registry. charset is the input character set, and must be the canonical name of a *************** *** 105,109 **** Both input_charset and output_charset must have Unicode codec entries in the module's charset-to-codec mapping; use add_codec(charset, codecname) ! to add codecs the module does not know about. See the codec module's documentation for more information. """ --- 105,109 ---- Both input_charset and output_charset must have Unicode codec entries in the module's charset-to-codec mapping; use add_codec(charset, codecname) ! to add codecs the module does not know about. See the codecs module's documentation for more information. """ *************** *** 127,131 **** charset is the canonical name of a character set. codecname is the name of a Python codec, as appropriate for the second argument to the unicode() ! built-in, or to the .encode() method of a Unicode string. """ CODEC_MAP[charset] = codecname --- 127,131 ---- charset is the canonical name of a character set. codecname is the name of a Python codec, as appropriate for the second argument to the unicode() ! built-in, or to the encode() method of a Unicode string. """ CODEC_MAP[charset] = codecname *************** *** 139,144 **** for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the ! applicable codecs. Given an character set, it will do its best to provide ! information on how to use that character set in an email. Certain character sets must be encoded with quoted-printable or base64 --- 139,145 ---- for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the ! applicable codecs. Given a character set, it will do its best to provide ! information on how to use that character set in an email in an ! RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 *************** *** 210,214 **** the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being ! encoded. The function should then set the Content-Transfer-Encoding: header itself to whatever is appropriate. --- 211,215 ---- the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being ! encoded. The function should then set the Content-Transfer-Encoding header itself to whatever is appropriate. *************** *** 236,243 **** Uses the input_codec to try and convert the string to Unicode, so it ! can be safely split on character boundaries (even for double-byte characters). ! Returns the string untouched if we don't know how to convert it to Unicode with the input_charset. --- 237,244 ---- Uses the input_codec to try and convert the string to Unicode, so it ! can be safely split on character boundaries (even for multibyte characters). ! Returns the string as-is if it isn't known how to convert it to Unicode with the input_charset. *************** *** 257,264 **** """Convert a splittable string back into an encoded string. ! Uses the proper codec to try and convert the string from ! Unicode back into an encoded format. Return the string as-is ! if it is not Unicode, or if it could not be encoded from ! Unicode. Characters that could not be converted from Unicode will be replaced --- 258,264 ---- """Convert a splittable string back into an encoded string. ! Uses the proper codec to try and convert the string from Unicode back ! into an encoded format. Return the string as-is if it is not Unicode, ! or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced *************** *** 283,287 **** """Return the output character set. ! This is self.output_charset if that is set, otherwise it is self.input_charset. """ --- 283,287 ---- """Return the output character set. ! This is self.output_charset if that is not None, otherwise it is self.input_charset. """ From barry@users.sourceforge.net Tue Oct 1 01:05:26 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 17:05:26 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Encoders.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv29955 Modified Files: Encoders.py Log Message: Docstring consistency with the updated .tex files. Index: Encoders.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Encoders.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Encoders.py 19 May 2002 23:44:19 -0000 1.6 --- Encoders.py 1 Oct 2002 00:05:24 -0000 1.7 *************** *** 52,56 **** """Encode the message's payload in Base64. ! Also, add an appropriate Content-Transfer-Encoding: header. """ orig = msg.get_payload() --- 52,56 ---- """Encode the message's payload in Base64. ! Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() *************** *** 62,68 **** def encode_quopri(msg): ! """Encode the message's payload in Quoted-Printable. ! Also, add an appropriate Content-Transfer-Encoding: header. """ orig = msg.get_payload() --- 62,68 ---- def encode_quopri(msg): ! """Encode the message's payload in quoted-printable. ! Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() *************** *** 74,78 **** def encode_7or8bit(msg): ! """Set the Content-Transfer-Encoding: header to 7bit or 8bit.""" orig = msg.get_payload() if orig is None: --- 74,78 ---- def encode_7or8bit(msg): ! """Set the Content-Transfer-Encoding header to 7bit or 8bit.""" orig = msg.get_payload() if orig is None: From barry@users.sourceforge.net Tue Oct 1 01:44:16 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 17:44:16 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Utils.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv11254 Modified Files: Utils.py Log Message: Docstring consistency with the updated .tex files. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Utils.py 28 Sep 2002 20:49:57 -0000 1.19 --- Utils.py 1 Oct 2002 00:44:13 -0000 1.20 *************** *** 222,231 **** def make_msgid(idstring=None): ! """Returns a string suitable for RFC 2822 compliant Message-ID:, e.g: <20020201195627.33539.96671@nightshade.la.mastaler.com> Optional idstring if given is a string used to strengthen the ! uniqueness of the Message-ID, otherwise an empty string is used. """ timeval = time.time() --- 222,231 ---- def make_msgid(idstring=None): ! """Returns a string suitable for RFC 2822 compliant Message-ID, e.g: <20020201195627.33539.96671@nightshade.la.mastaler.com> Optional idstring if given is a string used to strengthen the ! uniqueness of the message id. """ timeval = time.time() *************** *** 287,297 **** def encode_rfc2231(s, charset=None, language=None): ! """Encode string according to RFC 2231""" import urllib s = urllib.quote(s, safe='') if charset is None and language is None: return s ! else: ! return "%s'%s'%s" % (charset, language, s) --- 287,303 ---- def encode_rfc2231(s, charset=None, language=None): ! """Encode string according to RFC 2231. ! ! If neither charset nor language is given, then s is returned as-is. If ! charset is given but not language, the string is encoded using the empty ! string for language. ! """ import urllib s = urllib.quote(s, safe='') if charset is None and language is None: return s ! if language is None: ! language = '' ! return "%s'%s'%s" % (charset, language, s) *************** *** 299,303 **** def decode_params(params): ! """Decode parameters list according to RFC 2231""" new_params = [] # maps parameter's name to a list of continuations --- 305,312 ---- def decode_params(params): ! """Decode parameters list according to RFC 2231. ! ! params is a sequence of 2-tuples containing (content type, string value). ! """ new_params = [] # maps parameter's name to a list of continuations From barry@users.sourceforge.net Tue Oct 1 01:51:50 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 17:51:50 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Iterators.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv13470 Modified Files: Iterators.py Log Message: _structure(): Swap fp and level arguments. Index: Iterators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Iterators.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Iterators.py 1 Sep 2002 21:04:43 -0000 1.11 --- Iterators.py 1 Oct 2002 00:51:47 -0000 1.12 *************** *** 15,19 **** ! def _structure(msg, level=0, fp=None): """A handy debugging aid""" if fp is None: --- 15,19 ---- ! def _structure(msg, fp=None, level=0): """A handy debugging aid""" if fp is None: *************** *** 23,25 **** if msg.is_multipart(): for subpart in msg.get_payload(): ! _structure(subpart, level+1, fp) --- 23,25 ---- if msg.is_multipart(): for subpart in msg.get_payload(): ! _structure(subpart, fp, level+1) From barry@users.sourceforge.net Tue Oct 1 01:52:30 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 17:52:30 -0700 Subject: [Python-checkins] python/dist/src/Lib/email MIMEText.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv13717 Modified Files: MIMEText.py Log Message: Docstring consistency with the updated .tex files. Index: MIMEText.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEText.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MIMEText.py 28 Sep 2002 20:27:28 -0000 1.6 --- MIMEText.py 1 Oct 2002 00:52:27 -0000 1.7 *************** *** 23,29 **** _subtype is the MIME sub content type, defaulting to "plain". ! _charset is the character set parameter added to the Content-Type: header. This defaults to "us-ascii". Note that as a side-effect, the ! Content-Transfer-Encoding: header will also be set. The use of the _encoder is deprecated. The encoding of the payload, --- 23,29 ---- _subtype is the MIME sub content type, defaulting to "plain". ! _charset is the character set parameter added to the Content-Type header. This defaults to "us-ascii". Note that as a side-effect, the ! Content-Transfer-Encoding header will also be set. The use of the _encoder is deprecated. The encoding of the payload, *************** *** 43,47 **** DeprecationWarning, 2) # Because set_payload() with a _charset will set its own ! # Content-Transfer-Encoding: header, we need to delete the # existing one or will end up with two of them. :( del self['content-transfer-encoding'] --- 43,47 ---- DeprecationWarning, 2) # Because set_payload() with a _charset will set its own ! # Content-Transfer-Encoding header, we need to delete the # existing one or will end up with two of them. :( del self['content-transfer-encoding'] From barry@users.sourceforge.net Tue Oct 1 02:05:54 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 18:05:54 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailheaders.tex,NONE,1.1 emailmimebase.tex,NONE,1.1 email.tex,1.11,1.12 emailencoders.tex,1.2,1.3 emailexc.tex,1.2,1.3 emailgenerator.tex,1.3,1.4 emailiter.tex,1.2,1.3 emailmessage.tex,1.5,1.6 emailparser.tex,1.5,1.6 emailutil.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18003 Modified Files: email.tex emailencoders.tex emailexc.tex emailgenerator.tex emailiter.tex emailmessage.tex emailparser.tex emailutil.tex Added Files: emailheaders.tex emailmimebase.tex Log Message: Vast update to email version 2. This could surely use proofreading. --- NEW FILE: emailheaders.tex --- \declaremodule{standard}{email.Header} \modulesynopsis{Representing non-ASCII headers} \rfc{2822} is the base standard that describes the format of email messages. It derives from the older \rfc{822} standard which came into widespread at a time when most email was composed of \ASCII{} characters only. \rfc{2822} is a specification written assuming email contains only 7-bit \ASCII{} characters. Of course, as email has been deployed worldwide, it has become internationalized, such that language specific character sets can now be used in email messages. The base standard still requires email messages to be transfered using only 7-bit \ASCII{} characters, so a slew of RFCs have been written describing how to encode email containing non-\ASCII{} characters into \rfc{2822}-compliant format. These RFCs include \rfc{2045}, \rfc{2046}, \rfc{2047}, and \rfc{2231}. The \module{email} package supports these standards in its \module{email.Header} and \module{email.Charset} modules. If you want to include non-\ASCII{} characters in your email headers, say in the \mailheader{Subject} or \mailheader{To} fields, you should use the \class{Header} class (in module \module{email.Header} and assign the field in the \class{Message} object to an instance of \class{Header} instead of using a string for the header value. For example: \begin{verbatim} >>> from email.Message import Message >>> from email.Header import Header >>> msg = Message() >>> h = Header('p\xf6stal', 'iso-8859-1') >>> msg['Subject'] = h >>> print msg.as_string() Subject: =?iso-8859-1?q?p=F6stal?= \end{verbatim} Notice here how we wanted the \mailheader{Subject} field to contain a non-\ASCII{} character? We did this by creating a \class{Header} instance and passing in the character set that the byte string was encoded in. When the subsequent \class{Message} instance was flattened, the \mailheader{Subject} field was properly \rfc{2047} encoded. MIME-aware mail readers would show this header using the embedded ISO-8859-1 character. \versionadded{2.2.2} Here is the \class{Header} class description: \begin{classdesc}{Header}{\optional{s\optional{, charset\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}}}} Create a MIME-compliant header that can contain many character sets. Optional \var{s} is the initial header value. If \code{None} (the default), the initial header value is not set. You can later append to the header with \method{append()} method calls. \var{s} may be a byte string or a Unicode string, but see the \method{append()} documentation for semantics. Optional \var{charset} serves two purposes: it has the same meaning as the \var{charset} argument to the \method{append()} method. It also sets the default character set for all subsequent \method{append()} calls that omit the \var{charset} argument. If \var{charset} is not provided in the constructor (the default), the \code{us-ascii} character set is used both as \var{s}'s initial charset and as the default for subsequent \method{append()} calls. The maximum line length can be specified explicit via \var{maxlinelen}. For splitting the first line to a shorter value (to account for the field header which isn't included in \var{s}, e.g. \mailheader{Subject}) pass in the name of the field in \var{header_name}. The default \var{maxlinelen} is 76, and the default value for \var{header_name} is \code{None}, meaning it is not taken into account for the first line of a long, split header. Optional \var{continuation_ws} must be RFC 2822 compliant folding whitespace, and is usually either a space or a hard tab character. This character will be prepended to continuation lines. \end{classdesc} \begin{methoddesc}[Header]{append}{s\optional{, charset}} Append the string \var{s} to the MIME header. Optional \var{charset}, if given, should be a \class{Charset} instance (see \refmodule{email.Charset}) or the name of a character set, which will be converted to a \class{Charset} instance. A value of \code{None} (the default) means that the \var{charset} given in the constructor is used. \var{s} may be a byte string or a Unicode string. If it is a byte string (i.e. \code{isinstance(s, StringType)} is true), then \var{charset} is the encoding of that byte string, and a \exception{UnicodeError} will be raised if the string cannot be decoded with that character set. If \var{s} is a Unicode string, then \var{charset} is a hint specifying the character set of the characters in the string. In this case, when producing an \rfc{2822}-compliant header using \rfc{2047} rules, the Unicode string will be encoded using the following charsets in order: \code{us-ascii}, the \var{charset} hint, \code{utf-8}. The first character set to not provoke a \exception{UnicodeError} is used. \end{methoddesc} \begin{methoddesc}[Header]{encode}{} Encode a message header into an RFC-compliant format, possibly wrapping long lines and encapsulating non-\ASCII{} parts in base64 or quoted-printable encodings. \end{methoddesc} The \class{Header} class also provides a number of methods to support standard operators and built-in functions. \begin{methoddesc}[Header]{__str__}{} A synonym for \method{Header.encode()}. Useful for \code{str(aHeader)} calls. \end{methoddesc} \begin{methoddesc}[Header]{__unicode__}{} A helper for the built-in \function{unicode()} function. Returns the header as a Unicode string. \end{methoddesc} \begin{methoddesc}[Header]{__eq__}{other} This method allows you to compare two \class{Header} instances for equality. \end{methoddesc} \begin{methoddesc}[Header]{__ne__}{other} This method allows you to compare two \class{Header} instances for inequality. \end{methoddesc} The \module{email.Header} module also provides the following convenient functions. \begin{funcdesc}{decode_header}{header} Decode a message header value without converting the character set. The header value is in \var{header}. This function returns a list of \code{(decoded_string, charset)} pairs containing each of the decoded parts of the header. \var{charset} is \code{None} for non-encoded parts of the header, otherwise a lower case string containing the name of the character set specified in the encoded string. Here's an example: \begin{verbatim} >>> from email.Header import decode_header >>> decode_header('=?iso-8859-1?q?p=F6stal?=') [('p\\xf6stal', 'iso-8859-1')] \end{verbatim} \end{funcdesc} \begin{funcdesc}{make_header}{decoded_seq\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}} Create a \class{Header} instance from a sequence of pairs as returned by \function{decode_header()}. \function{decode_header()} takes a header value string and returns a sequence of pairs of the format \code{(decoded_string, charset)} where \var{charset} is the name of the character set. This function takes one of those sequence of pairs and returns a \class{Header} instance. Optional \var{maxlinelen}, \var{header_name}, and \var{continuation_ws} are as in the \class{Header} constructor. \end{funcdesc} \declaremodule{standard}{email.Charset} \modulesynopsis{Character Sets} This module provides a class \class{Charset} for representing character sets and character set conversions in email messages, as well as a character set registry and several convenience methods for manipulating this registry. Instances of \class{Charset} are used in several other modules within the \module{email} package. \versionadded{2.2.2} \begin{classdesc}{Charset}{\optional{input_charset}} Map character sets to their email properties. This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email message in an RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email. Optional \var{input_charset} is as described below. After being alias normalized it is also used as a lookup into the registry of character sets to find out the header encoding, body encoding, and output conversion codec to be used for the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is necessary. If \var{input_charset} is \code{euc-jp}, then headers will be encoded with base64, bodies will not be encoded, but output text will be converted from the \code{euc-jp} character set to the \code{iso-2022-jp} character set. \end{classdesc} \class{Charset} instances have the following data attributes: \begin{datadesc}{input_charset} The initial character set specified. Common aliases are converted to their \emph{official} email names (e.g. \code{latin_1} is converted to \code{iso-8859-1}). Defaults to 7-bit \code{us-ascii}. \end{datadesc} \begin{datadesc}{header_encoding} If the character set must be encoded before it can be used in an email header, this attribute will be set to \code{Charset.QP} (for quoted-printable), \code{Charset.BASE64} (for base64 encoding), or \code{Charset.SHORTEST} for the shortest of QP or BASE64 encoding. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{body_encoding} Same as \var{header_encoding}, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. \code{Charset.SHORTEST} is not allowed for \var{body_encoding}. \end{datadesc} \begin{datadesc}{output_charset} Some character sets must be converted before the can be used in email headers or bodies. If the \var{input_charset} is one of them, this attribute will contain the name of the character set output will be converted to. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{input_codec} The name of the Python codec used to convert the \var{input_charset} to Unicode. If no conversion codec is necessary, this attribute will be \code{None}. \end{datadesc} \begin{datadesc}{output_codec} The name of the Python codec used to convert Unicode to the \var{output_charset}. If no conversion codec is necessary, this attribute will have the same value as the \var{input_codec}. \end{datadesc} \class{Charset} instances also have the following methods: \begin{methoddesc}[Charset]{get_body_encoding}{} Return the content transfer encoding used for body encoding. This is either the string \samp{quoted-printable} or \samp{base64} depending on the encoding used, or it is a function, in which case you should call the function with a single argument, the Message object being encoded. The function should then set the \mailheader{Content-Transfer-Encoding} header itself to whatever is appropriate. Returns the string \samp{quoted-printable} if \var{body_encoding} is \code{QP}, returns the string \samp{base64} if \var{body_encoding} is \code{BASE64}, and returns the string \samp{7bit} otherwise. \end{methoddesc} \begin{methoddesc}{convert}{s} Convert the string \var{s} from the \var{input_codec} to the \var{output_codec}. \end{methoddesc} \begin{methoddesc}{to_splittable}{s} Convert a possibly multibyte string to a safely splittable format. \var{s} is the string to split. Uses the \var{input_codec} to try and convert the string to Unicode, so it can be safely split on character boundaries (even for multibyte characters). Returns the string as-is if it isn't known how to convert \var{s} to Unicode with the \var{input_charset}. Characters that could not be converted to Unicode will be replaced with the Unicode replacement character \character{U+FFFD}. \end{methoddesc} \begin{methoddesc}{from_splittable}{ustr\optional{, to_output}} Convert a splittable string back into an encoded string. \var{ustr} is a Unicode string to ``unsplit''. This method uses the proper codec to try and convert the string from Unicode back into an encoded format. Return the string as-is if it is not Unicode, or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced with an appropriate character (usually \character{?}). If \var{to_output} is \code{True} (the default), uses \var{output_codec} to convert to an encoded format. If \var{to_output} is \code{False}, it uses \var{input_codec}. \end{methoddesc} \begin{methoddesc}{get_output_charset}{} Return the output character set. This is the \var{output_charset} attribute if that is not \code{None}, otherwise it is \var{input_charset}. \end{methoddesc} \begin{methoddesc}{encoded_header_len}{} Return the length of the encoded header string, properly calculating for quoted-printable or base64 encoding. \end{methoddesc} \begin{methoddesc}{header_encode}{s\optional{, convert}} Header-encode the string \var{s}. If \var{convert} is \code{True}, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the higher-level \class{Header} class to deal with these issues (see \refmodule{email.Header}). \var{convert} defaults to \code{False}. The type of encoding (base64 or quoted-printable) will be based on the \var{header_encoding} attribute. \end{methoddesc} \begin{methoddesc}{body_encode}{s\optional{, convert}} Body-encode the string \var{s}. If \var{convert} is \code{True} (the default), the string will be converted from the input charset to output charset automatically. Unlike \method{header_encode()}, there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on the \var{body_encoding} attribute. \end{methoddesc} The \class{Charset} class also provides a number of methods to support standard operations and built-in functions. \begin{methoddesc}[Charset]{__str__}{} Returns \var{input_charset} as a string coerced to lower case. \end{methoddesc} \begin{methoddesc}[Charset]{__eq__}{other} This method allows you to compare two \class{Charset} instances for equality. \end{methoddesc} \begin{methoddesc}[Header]{__ne__}{other} This method allows you to compare two \class{Charset} instances for inequality. \end{methoddesc} The \module{email.Charset} module also provides the following functions for adding new entries to the global character set, alias, and codec registries: \begin{funcdesc}{add_charset}{charset\optional{, header_enc\optional{, body_enc\optional{, output_charset}}}} Add character properties to the global registry. \var{charset} is the input character set, and must be the canonical name of a character set. Optional \var{header_enc} and \var{body_enc} is either \code{Charset.QP} for quoted-printable, \code{Charset.BASE64} for base64 encoding, \code{Charset.SHORTEST} for the shortest of qp or base64 encoding, or \code{None} for no encoding. \code{SHORTEST} is only valid for \var{header_enc}. It describes how message headers and message bodies in the input charset are to be encoded. Default is no encoding. Optional \var{output_charset} is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method \method{Charset.convert()} is called. The default is to output in the same character set as the input. Both \var{input_charset} and \var{output_charset} must have Unicode codec entries in the module's character set-to-codec mapping; use \function{add_codec(charset, codecname)} to add codecs the module does not know about. See the \refmodule{codecs} module's documentation for more information. The global character set registry is kept in the module global dictionary \code{CHARSETS}. \end{funcdesc} \begin{funcdesc}{add_alias}{alias, canonical} Add a character set alias. \var{alias} is the alias name, e.g. \code{latin-1}. \var{canonical} is the character set's canonical name, e.g. \code{iso-8859-1}. The global charset alias registry is kept in the module global dictionary \code{ALIASES}. \end{funcdesc} \begin{funcdesc}{add_codec}{charset, codecname} Add a codec that map characters in the given character set to and from Unicode. \var{charset} is the canonical name of a character set. \var{codecname} is the name of a Python codec, as appropriate for the second argument to the \function{unicode()} built-in, or to the \method{encode()} method of a Unicode string. \end{funcdesc} --- NEW FILE: emailmimebase.tex --- Ordinarily, you get a message object structure by passing a file or some text to a parser, which parses the text and returns the root of the message object structure. However you can also build a complete object structure from scratch, or even individual \class{Message} objects by hand. In fact, you can also take an existing structure and add new \class{Message} objects, move them around, etc. This makes a very convenient interface for slicing-and-dicing MIME messages. You can create a new object structure by creating \class{Message} instances, adding attachments and all the appropriate headers manually. For MIME messages though, the \module{email} package provides some convenient subclasses to make things easier. Each of these classes should be imported from a module with the same name as the class, from within the \module{email} package. E.g.: \begin{verbatim} import email.MIMEImage.MIMEImage \end{verbatim} or \begin{verbatim} from email.MIMEText import MIMEText \end{verbatim} Here are the classes: \begin{classdesc}{MIMEBase}{_maintype, _subtype, **_params} This is the base class for all the MIME-specific subclasses of \class{Message}. Ordinarily you won't create instances specifically of \class{MIMEBase}, although you could. \class{MIMEBase} is provided primarily as a convenient base class for more specific MIME-aware subclasses. \var{_maintype} is the \mailheader{Content-Type} major type (e.g. \mimetype{text} or \mimetype{image}), and \var{_subtype} is the \mailheader{Content-Type} minor type (e.g. \mimetype{plain} or \mimetype{gif}). \var{_params} is a parameter key/value dictionary and is passed directly to \method{Message.add_header()}. The \class{MIMEBase} class always adds a \mailheader{Content-Type} header (based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a \mailheader{MIME-Version} header (always set to \code{1.0}). \end{classdesc} \begin{classdesc}{MIMENonMultipart}{} A subclass of \class{MIMEBase}, this is an intermediate base class for MIME messages that are not \mimetype{multipart}. The primary purpose of this class is to prevent the use of the \method{attach()} method, which only makes sense for \mimetype{multipart} messages. If \method{attach()} is called, a \exception{MultipartConversionError} exception is raised. \versionadded{2.2.2} \end{classdesc} \begin{classdesc}{MIMEMultipart}{\optional{subtype\optional{, boundary\optional{, _subparts\optional{, _params}}}}} A subclass of \class{MIMEBase}, this is an intermediate base class for MIME messages that are \mimetype{multipart}. Optional \var{_subtype} defaults to \mimetype{mixed}, but can be used to specify the subtype of the message. A \mailheader{Content-Type} header of \mimetype{multipart/}\var{_subtype} will be added to the message object. A \mailheader{MIME-Version} header will also be added. Optional \var{boundary} is the multipart boundary string. When \code{None} (the default), the boundary is calculated when needed. \var{_subparts} is a sequence of initial subparts for the payload. It must be possible to convert this sequence to a list. You can always attach new subparts to the message by using the \method{Message.attach()} method. Additional parameters for the \mailheader{Content-Type} header are taken from the keyword arguments, or passed into the \var{_params} argument, which is a keyword dictionary. \versionadded{2.2.2} \end{classdesc} \begin{classdesc}{MIMEAudio}{_audiodata\optional{, _subtype\optional{, _encoder\optional{, **_params}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEAudio} class is used to create MIME message objects of major type \mimetype{audio}. \var{_audiodata} is a string containing the raw audio data. If this data can be decoded by the standard Python module \refmodule{sndhdr}, then the subtype will be automatically included in the \mailheader{Content-Type} header. Otherwise you can explicitly specify the audio subtype via the \var{_subtype} parameter. If the minor type could not be guessed and \var{_subtype} was not given, then \exception{TypeError} is raised. Optional \var{_encoder} is a callable (i.e. function) which will perform the actual encoding of the audio data for transport. This callable takes one argument, which is the \class{MIMEAudio} instance. It should use \method{get_payload()} and \method{set_payload()} to change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message object as necessary. The default encoding is \emph{Base64}. See the \refmodule{email.Encoders} module for a list of the built-in encoders. \var{_params} are passed straight through to the base class constructor. \end{classdesc} \begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{, _encoder\optional{, **_params}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEImage} class is used to create MIME message objects of major type \mimetype{image}. \var{_imagedata} is a string containing the raw image data. If this data can be decoded by the standard Python module \refmodule{imghdr}, then the subtype will be automatically included in the \mailheader{Content-Type} header. Otherwise you can explicitly specify the image subtype via the \var{_subtype} parameter. If the minor type could not be guessed and \var{_subtype} was not given, then \exception{TypeError} is raised. Optional \var{_encoder} is a callable (i.e. function) which will perform the actual encoding of the image data for transport. This callable takes one argument, which is the \class{MIMEImage} instance. It should use \method{get_payload()} and \method{set_payload()} to change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message object as necessary. The default encoding is \emph{Base64}. See the \refmodule{email.Encoders} module for a list of the built-in encoders. \var{_params} are passed straight through to the \class{MIMEBase} constructor. \end{classdesc} \begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}} A subclass of \class{MIMENonMultipart}, the \class{MIMEMessage} class is used to create MIME objects of main type \mimetype{message}. \var{_msg} is used as the payload, and must be an instance of class \class{Message} (or a subclass thereof), otherwise a \exception{TypeError} is raised. Optional \var{_subtype} sets the subtype of the message; it defaults to \mimetype{rfc822}. \end{classdesc} \begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{, _charset\optional{, _encoder}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEText} class is used to create MIME objects of major type \mimetype{text}. \var{_text} is the string for the payload. \var{_subtype} is the minor type and defaults to \mimetype{plain}. \var{_charset} is the character set of the text and is passed as a parameter to the \class{MIMENonMultipart} constructor; it defaults to \code{us-ascii}. No guessing or encoding is performed on the text data, but a newline is appended to \var{_text} if it doesn't already end with a newline. \deprecated{2.2.2}{The \var{_encoding} argument has been deprecated. Encoding now happens implicitly based on the \var{_charset} argument.} \end{classdesc} Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** email.tex 26 Jun 2002 07:51:32 -0000 1.11 --- email.tex 1 Oct 2002 01:05:51 -0000 1.12 *************** *** 1,3 **** ! % Copyright (C) 2001 Python Software Foundation % Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! % Copyright (C) 2001,2002 Python Software Foundation % Author: barry@zope.com (Barry Warsaw) *************** *** 20,30 **** \module{mimecntl}. It is specifically \emph{not} designed to do any sending of email messages to SMTP (\rfc{2821}) servers; that is the ! function of the \refmodule{smtplib} module\footnote{For this reason, ! line endings in the \module{email} package are always native line ! endings. The \module{smtplib} module is responsible for converting ! from native line endings to \rfc{2821} line endings, just as your mail ! server would be responsible for converting from \rfc{2821} line ! endings to native line endings when it stores messages in a local ! mailbox.}. The primary distinguishing feature of the \module{email} package is --- 20,27 ---- \module{mimecntl}. It is specifically \emph{not} designed to do any sending of email messages to SMTP (\rfc{2821}) servers; that is the ! function of the \refmodule{smtplib} module. The \module{email} ! package attempts to be as RFC-compliant as possible, supporting in ! addition to \rfc{2822}, such MIME-related RFCs as ! \rfc{2045}-\rfc{2047}, and \rfc{2231}. The primary distinguishing feature of the \module{email} package is *************** *** 56,61 **** classes you might encounter while using the \module{email} package, some auxiliary utilities, and a few examples. For users of the older ! \module{mimelib} package, from which the \module{email} package is ! descended, a section on differences and porting is provided. \begin{seealso} --- 53,58 ---- classes you might encounter while using the \module{email} package, some auxiliary utilities, and a few examples. For users of the older ! \module{mimelib} package, or previous versions of the \module{email} ! package, a section on differences and porting is provided. \begin{seealso} *************** *** 73,203 **** \subsection{Creating email and MIME objects from scratch} ! Ordinarily, you get a message object tree by passing some text to a ! parser, which parses the text and returns the root of the message ! object tree. However you can also build a complete object tree from ! scratch, or even individual \class{Message} objects by hand. In fact, ! you can also take an existing tree and add new \class{Message} ! objects, move them around, etc. This makes a very convenient ! interface for slicing-and-dicing MIME messages. ! ! You can create a new object tree by creating \class{Message} ! instances, adding payloads and all the appropriate headers manually. ! For MIME messages though, the \module{email} package provides some ! convenient classes to make things easier. Each of these classes ! should be imported from a module with the same name as the class, from ! within the \module{email} package. E.g.: ! ! \begin{verbatim} ! import email.MIMEImage.MIMEImage ! \end{verbatim} ! ! or ! ! \begin{verbatim} ! from email.MIMEText import MIMEText ! \end{verbatim} ! ! Here are the classes: ! ! \begin{classdesc}{MIMEBase}{_maintype, _subtype, **_params} ! This is the base class for all the MIME-specific subclasses of ! \class{Message}. Ordinarily you won't create instances specifically ! of \class{MIMEBase}, although you could. \class{MIMEBase} is provided ! primarily as a convenient base class for more specific MIME-aware ! subclasses. ! ! \var{_maintype} is the \mailheader{Content-Type} major type ! (e.g. \mimetype{text} or \mimetype{image}), and \var{_subtype} is the ! \mailheader{Content-Type} minor type ! (e.g. \mimetype{plain} or \mimetype{gif}). \var{_params} is a parameter ! key/value dictionary and is passed directly to ! \method{Message.add_header()}. ! ! The \class{MIMEBase} class always adds a \mailheader{Content-Type} header ! (based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a ! \mailheader{MIME-Version} header (always set to \code{1.0}). ! \end{classdesc} ! ! \begin{classdesc}{MIMEAudio}{_audiodata\optional{, _subtype\optional{, ! _encoder\optional{, **_params}}}} ! ! A subclass of \class{MIMEBase}, the \class{MIMEAudio} class is used to ! create MIME message objects of major type \mimetype{audio}. ! \var{_audiodata} is a string containing the raw audio data. If this ! data can be decoded by the standard Python module \refmodule{sndhdr}, ! then the subtype will be automatically included in the ! \mailheader{Content-Type} header. Otherwise you can explicitly specify the ! audio subtype via the \var{_subtype} parameter. If the minor type could ! not be guessed and \var{_subtype} was not given, then \exception{TypeError} ! is raised. ! ! Optional \var{_encoder} is a callable (i.e. function) which will ! perform the actual encoding of the audio data for transport. This ! callable takes one argument, which is the \class{MIMEAudio} instance. ! It should use \method{get_payload()} and \method{set_payload()} to ! change the payload to encoded form. It should also add any ! \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the ! \refmodule{email.Encoders} module for a list of the built-in encoders. ! ! \var{_params} are passed straight through to the \class{MIMEBase} ! constructor. ! \end{classdesc} ! ! \begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{, ! _encoder\optional{, **_params}}}} ! ! A subclass of \class{MIMEBase}, the \class{MIMEImage} class is used to ! create MIME message objects of major type \mimetype{image}. ! \var{_imagedata} is a string containing the raw image data. If this ! data can be decoded by the standard Python module \refmodule{imghdr}, ! then the subtype will be automatically included in the ! \mailheader{Content-Type} header. Otherwise you can explicitly specify the ! image subtype via the \var{_subtype} parameter. If the minor type could ! not be guessed and \var{_subtype} was not given, then \exception{TypeError} ! is raised. ! ! Optional \var{_encoder} is a callable (i.e. function) which will ! perform the actual encoding of the image data for transport. This ! callable takes one argument, which is the \class{MIMEImage} instance. ! It should use \method{get_payload()} and \method{set_payload()} to ! change the payload to encoded form. It should also add any ! \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the ! \refmodule{email.Encoders} module for a list of the built-in encoders. ! ! \var{_params} are passed straight through to the \class{MIMEBase} ! constructor. ! \end{classdesc} ! ! \begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{, ! _charset\optional{, _encoder}}}} ! ! A subclass of \class{MIMEBase}, the \class{MIMEText} class is used to ! create MIME objects of major type \mimetype{text}. \var{_text} is the ! string for the payload. \var{_subtype} is the minor type and defaults ! to \mimetype{plain}. \var{_charset} is the character set of the text and is ! passed as a parameter to the \class{MIMEBase} constructor; it defaults ! to \code{us-ascii}. No guessing or encoding is performed on the text ! data, but a newline is appended to \var{_text} if it doesn't already ! end with a newline. ! ! The \var{_encoding} argument is as with the \class{MIMEImage} class ! constructor, except that the default encoding for \class{MIMEText} ! objects is one that doesn't actually modify the payload, but does set ! the \mailheader{Content-Transfer-Encoding} header to \code{7bit} or ! \code{8bit} as appropriate. ! \end{classdesc} ! ! \begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}} ! A subclass of \class{MIMEBase}, the \class{MIMEMessage} class is used to ! create MIME objects of main type \mimetype{message}. \var{_msg} is used as ! the payload, and must be an instance of class \class{Message} (or a ! subclass thereof), otherwise a \exception{TypeError} is raised. ! ! Optional \var{_subtype} sets the subtype of the message; it defaults ! to \mimetype{rfc822}. ! \end{classdesc} \subsection{Encoders} --- 70,77 ---- \subsection{Creating email and MIME objects from scratch} + \input{emailmimebase} ! \subsection{Headers, Character sets, and Internationalization} ! \input{emailheaders} \subsection{Encoders} *************** *** 212,215 **** --- 86,160 ---- \subsection{Iterators} \input{emailiter} + + \subsection{Differences from \module{email} v1 (up to Python 2.2.1)} + + Version 1 of the \module{email} package was bundled with Python + releases up to Python 2.2.1. Version 2 was developed for the Python + 2.3 release, and backported to Python 2.2.2. It was also available as + a separate distutils based package. \module{email} version 2 is + almost entirely backwards compatible with version 1, with the + following differences: + + \begin{itemize} + \item The \module{email.Header} and \module{email.Charset} modules + have been added. + \item The pickle format for \class{Message} instances has changed. + Since this was never (and still isn't) formally defined, this + isn't considered a backwards incompatibility. However if your + application pickles and unpickles \class{Message} instances, be + aware that in \module{email} version 2, \class{Message} + instances now have private variables \var{_charset} and + \var{_default_type}. + \item Several methods in the \class{Message} class have been + deprecated, or their signatures changes. Also, many new methods + have been added. See the documentation for the \class{Message} + class for deatils. The changes should be completely backwards + compatible. + \item The object structure has changed in the face of + \mimetype{message/rfc822} content types. In \module{email} + version 1, such a type would be represented by a scalar payload, + i.e. the container message's \method{is_multipart()} returned + false, \method{get_payload()} was not a list object, and was + actually a \class{Message} instance. + + This structure was inconsistent with the rest of the package, so + the object representation for \mimetype{message/rfc822} content + types was changed. In module{email} version 2, the container + \emph{does} return \code{True} from \method{is_multipart()}, and + \method{get_payload()} returns a list containing a single + \class{Message} item. + + Note that this is one place that backwards compatibility could + not be completely maintained. However, if you're already + testing the return type of \method{get_payload()}, you should be + fine. You just need to make sure your code doesn't do a + \method{set_payload()} with a \class{Message} instance on a + container with a content type of \mimetype{message/rfc822}. + \item The \class{Parser} constructor's \var{strict} argument was + added, and its \method{parse()} and \method{parsestr()} methods + grew a \var{headersonly} argument. The \var{strict} flag was + also added to functions \function{email.message_from_file()} + and \function{email.message_from_string()}. + \item \method{Generator.__call__()} is deprecated; use + \method{Generator.flatten()} instead. The \class{Generator} + class has also grown the \method{clone()} method. + \item The \class{DecodedGenerator} class in the + \module{email.Generator} module was added. + \item The intermediate base classes \class{MIMENonMultipart} and + \class{MIMEMultipart} have been added, and interposed in the + class heirarchy for most of the other MIME-related derived + classes. + \item The \var{_encoder} argument to the \class{MIMEText} constructor + has been deprecated. Encoding now happens implicitly based + on the \var{_charset} argument. + \item The following functions in the \module{email.Utils} module have + been deprecated: \function{dump_address_pairs()}, + \function{decode()}, and \function{encode()}. The following + functions have been added to the module: + \function{make_msgid()}, \function{decode_rfc2231()}, + \function{encode_rfc2231()}, and \function{decode_params()}. + \item The non-public function \function{email.Iterators._structure()} + was added. + \end{itemize} \subsection{Differences from \module{mimelib}} Index: emailencoders.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailencoders.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** emailencoders.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailencoders.tex 1 Oct 2002 01:05:52 -0000 1.3 *************** *** 18,23 **** \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into \emph{Quoted-Printable} form and sets the ! \code{Content-Transfer-Encoding:} header to \code{quoted-printable}\footnote{Note that encoding with \method{encode_quopri()} also encodes all tabs and space characters in --- 18,23 ---- \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into quoted-Printable form and sets the ! \mailheader{Content-Transfer-Encoding} header to \code{quoted-printable}\footnote{Note that encoding with \method{encode_quopri()} also encodes all tabs and space characters in *************** *** 28,36 **** \begin{funcdesc}{encode_base64}{msg} ! Encodes the payload into \emph{Base64} form and sets the \mailheader{Content-Transfer-Encoding} header to \code{base64}. This is a good encoding to use when most of your payload is unprintable data since it is a more compact form than ! Quoted-Printable. The drawback of Base64 encoding is that it renders the text non-human readable. \end{funcdesc} --- 28,36 ---- \begin{funcdesc}{encode_base64}{msg} ! Encodes the payload into base64 form and sets the \mailheader{Content-Transfer-Encoding} header to \code{base64}. This is a good encoding to use when most of your payload is unprintable data since it is a more compact form than ! quoted-printable. The drawback of base64 encoding is that it renders the text non-human readable. \end{funcdesc} Index: emailexc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailexc.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** emailexc.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailexc.tex 1 Oct 2002 01:05:52 -0000 1.3 *************** *** 22,26 **** \method{Parser.parsestr()} methods. ! Situations where it can be raised include finding a \emph{Unix-From} header after the first \rfc{2822} header of the message, finding a continuation line before the first \rfc{2822} header is found, or finding --- 22,26 ---- \method{Parser.parsestr()} methods. ! Situations where it can be raised include finding an envelope header after the first \rfc{2822} header of the message, finding a continuation line before the first \rfc{2822} header is found, or finding *************** *** 36,40 **** Situations where it can be raised include not being able to find the ! starting or terminating boundary in a \mimetype{multipart/*} message. \end{excclassdesc} --- 36,41 ---- Situations where it can be raised include not being able to find the ! starting or terminating boundary in a \mimetype{multipart/*} message ! when strict parsing is used. \end{excclassdesc} *************** *** 46,48 **** --- 47,54 ---- multiply inherits from \exception{MessageError} and the built-in \exception{TypeError}. + + Since \method{Message.add_payload()} is deprecated, this exception is + rarely raised in practice. However the exception may also be raised + if the \method{attach()} method is called on an instance of a class + derived from \class{MIMENonMultipart} (e.g. \class{MIMEImage}). \end{excclassdesc} Index: emailgenerator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailgenerator.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** emailgenerator.tex 5 Nov 2001 01:55:03 -0000 1.3 --- emailgenerator.tex 1 Oct 2002 01:05:52 -0000 1.4 *************** *** 1,10 **** \declaremodule{standard}{email.Generator} ! \modulesynopsis{Generate flat text email messages from a message object tree.} One of the most common tasks is to generate the flat text of the email ! message represented by a message object tree. You will need to do this if you want to send your message via the \refmodule{smtplib} module or the \refmodule{nntplib} module, or print the message on the ! console. Taking a message object tree and producing a flat text document is the job of the \class{Generator} class. --- 1,10 ---- \declaremodule{standard}{email.Generator} ! \modulesynopsis{Generate flat text email messages from a message structure.} One of the most common tasks is to generate the flat text of the email ! message represented by a message object structure. You will need to do this if you want to send your message via the \refmodule{smtplib} module or the \refmodule{nntplib} module, or print the message on the ! console. Taking a message object structure and producing a flat text document is the job of the \class{Generator} class. *************** *** 14,21 **** generate most email in a standards-compliant way, should handle MIME and non-MIME email messages just fine, and is designed so that the ! transformation from flat text, to an object tree via the ! \class{Parser} class, ! and back to flat text, is idempotent (the input is identical to the ! output). Here are the public methods of the \class{Generator} class: --- 14,20 ---- generate most email in a standards-compliant way, should handle MIME and non-MIME email messages just fine, and is designed so that the ! transformation from flat text, to a message structure via the ! \class{Parser} class, and back to flat text, is idempotent (the input ! is identical to the output). Here are the public methods of the \class{Generator} class: *************** *** 28,39 **** Python 2.0 extended print statement. ! Optional \var{mangle_from_} is a flag that, when true, puts a \samp{>} ! character in front of any line in the body that starts exactly as \samp{From } (i.e. \code{From} followed by a space at the front of the line). This is the only guaranteed portable way to avoid having such ! lines be mistaken for \emph{Unix-From} headers (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} {http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html} ! for details). Optional \var{maxheaderlen} specifies the longest length for a --- 27,40 ---- Python 2.0 extended print statement. ! Optional \var{mangle_from_} is a flag that, when \code{True}, puts a ! \samp{>} character in front of any line in the body that starts exactly as \samp{From } (i.e. \code{From} followed by a space at the front of the line). This is the only guaranteed portable way to avoid having such ! lines be mistaken for a Unix mailbox format envelope header separator (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} {http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html} ! for details). \var{mangle_from_} defaults to \code{True}, but you ! might want to set this to \code{False} if you are not writing Unix ! mailbox format files. Optional \var{maxheaderlen} specifies the longest length for a *************** *** 48,53 **** The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{__call__}{msg\optional{, unixfrom}} ! Print the textual representation of the message object tree rooted at \var{msg} to the output file specified when the \class{Generator} instance was created. Sub-objects are visited depth-first and the --- 49,54 ---- The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{flatten()}{msg\optional{, unixfrom}} ! Print the textual representation of the message object structure rooted at \var{msg} to the output file specified when the \class{Generator} instance was created. Sub-objects are visited depth-first and the *************** *** 55,65 **** Optional \var{unixfrom} is a flag that forces the printing of the ! \emph{Unix-From} (a.k.a. envelope header or \code{From_} header) ! delimiter before the first \rfc{2822} header of the root message ! object. If the root object has no \emph{Unix-From} header, a standard ! one is crafted. By default, this is set to 0 to inhibit the printing ! of the \emph{Unix-From} delimiter. ! Note that for sub-objects, no \emph{Unix-From} header is ever printed. \end{methoddesc} --- 56,74 ---- Optional \var{unixfrom} is a flag that forces the printing of the ! envelope header delimiter before the first \rfc{2822} header of the ! root message object. If the root object has no envelope header, a ! standard one is crafted. By default, this is set to \code{False} to ! inhibit the printing of the envelope delimiter. ! Note that for sub-objects, no envelope header is ever printed. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Generator]{clone}{fp} ! Return an independent clone of this \class{Generator} instance with ! the exact same options. ! ! \versionadded{2.2.2} \end{methoddesc} *************** *** 75,76 **** --- 84,131 ---- simplify the generation of a formatted string representation of a message object. For more detail, see \refmodule{email.Message}. + + The \module{email.Generator} module also provides a derived class, + called \class{DecodedGenerator} which is like the \class{Generator} + base class, except that non-\mimetype{text} parts are substituted with + a format string representing the part. + + \begin{classdesc}{DecodedGenerator}{outfp\optional{, mangle_from_\optional{, + maxheaderlen\optional{, fmt}}}} + + This class, derived from \class{Generator} walks through all the + subparts of a message. If the subpart is of main type + \mimetype{text}, then it prints the decoded payload of the subpart. + Optional \var{_mangle_from_} and \var{maxheaderlen} are as with the + \class{Generator} base class. + + If the subpart is not of main type \mimetype{text}, optional \var{fmt} + is a format string that is used instead of the message + payload. \var{fmt} is expanded with the following keywords (in + \samp{\%(keyword)s} format): + + type : Full MIME type of the non-\mimetype{text} part + maintype : Main MIME type of the non-\mimetype{text} part + subtype : Sub-MIME type of the non-\mimetype{text} part + filename : Filename of the non-\mimetype{text} part + description: Description associated with the non-\mimetype{text} part + encoding : Content transfer encoding of the non-\mimetype{text} part + + The default value for \var{fmt} is \code{None}, meaning + + \begin{verbatim} + [Non-text (%(type)s) part of message omitted, filename %(filename)s] + \end{verbatim} + + \versionadded{2.2.2} + \end{classdesc} + + \subsubsection{Deprecated methods} + + The following methods are deprecated in \module{email} version 2. + They are documented here for completeness. + + \begin{methoddesc}[Generator]{__call__}{msg\optional{, unixfrom}} + This method is identical to the \method{flatten()} method. + + \deprecated{2.2.2}{Use the \method{flatten()} method instead.} + \end{methoddesc} Index: emailiter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailiter.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** emailiter.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailiter.tex 1 Oct 2002 01:05:52 -0000 1.3 *************** *** 30,31 **** --- 30,63 ---- \end{funcdesc} + The following function has been added as a useful debugging tool. It + should \emph{not} be considered part of the supported public interface + for the package. + + \begin{funcdesc}{_structure}{msg\optional{, fp\optional{, level}}} + Prints an indented representation of the content types of the + message object structure. For example: + + \begin{verbatim} + >>> msg = email.message_from_file(somefile) + >>> _structure(msg) + multipart/mixed + text/plain + text/plain + multipart/digest + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + text/plain + \end{verbatim} + + Optional \var{fp} is a file-like object to print the output to. It + must be suitable for Python's extended print statement. \var{level} + is used internally. + \end{funcdesc} Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** emailmessage.tex 22 May 2002 20:44:03 -0000 1.5 --- emailmessage.tex 1 Oct 2002 01:05:52 -0000 1.6 *************** *** 13,22 **** Headers are stored and returned in case-preserving form but are ! matched case-insensitively. There may also be a single ! \emph{Unix-From} header, also known as the envelope header or the \code{From_} header. The payload is either a string in the case of ! simple message objects, a list of \class{Message} objects for ! multipart MIME documents, or a single \class{Message} instance for ! \mimetype{message/rfc822} type objects. \class{Message} objects provide a mapping style interface for --- 13,22 ---- Headers are stored and returned in case-preserving form but are ! matched case-insensitively. There may also be a single envelope ! header, also known as the \emph{Unix-From} header or the \code{From_} header. The payload is either a string in the case of ! simple message objects or a list of \class{Message} objects for ! MIME container documents (e.g. \mimetype{multipart/*} and ! \mimetype{message/rfc822}). \class{Message} objects provide a mapping style interface for *************** *** 36,115 **** Return the entire formatted message as a string. Optional \var{unixfrom}, when true, specifies to include the \emph{Unix-From} ! envelope header; it defaults to 0. \end{methoddesc} \begin{methoddesc}[Message]{__str__}{} ! Equivalent to \method{aMessage.as_string(unixfrom=1)}. \end{methoddesc} \begin{methoddesc}[Message]{is_multipart}{} ! Return 1 if the message's payload is a list of sub-\class{Message} ! objects, otherwise return 0. When \method{is_multipart()} returns 0, ! the payload should either be a string object, or a single ! \class{Message} instance. \end{methoddesc} \begin{methoddesc}[Message]{set_unixfrom}{unixfrom} ! Set the \emph{Unix-From} (a.k.a envelope header or \code{From_} ! header) to \var{unixfrom}, which should be a string. \end{methoddesc} \begin{methoddesc}[Message]{get_unixfrom}{} ! Return the \emph{Unix-From} header. Defaults to \code{None} if the ! \emph{Unix-From} header was never set. ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{add_payload}{payload} ! Add \var{payload} to the message object's existing payload. If, prior ! to calling this method, the object's payload was \code{None} ! (i.e. never before set), then after this method is called, the payload ! will be the argument \var{payload}. ! ! If the object's payload was already a list ! (i.e. \method{is_multipart()} returns 1), then \var{payload} is ! appended to the end of the existing payload list. ! ! For any other type of existing payload, \method{add_payload()} will ! transform the new payload into a list consisting of the old payload ! and \var{payload}, but only if the document is already a MIME ! multipart document. This condition is satisfied if the message's ! \mailheader{Content-Type} header's main type is either ! \mimetype{multipart}, or there is no \mailheader{Content-Type} ! header. In any other situation, ! \exception{MultipartConversionError} is raised. \end{methoddesc} \begin{methoddesc}[Message]{attach}{payload} ! Synonymous with \method{add_payload()}. \end{methoddesc} \begin{methoddesc}[Message]{get_payload}{\optional{i\optional{, decode}}} ! Return the current payload, which will be a list of \class{Message} ! objects when \method{is_multipart()} returns 1, or a scalar (either a ! string or a single \class{Message} instance) when ! \method{is_multipart()} returns 0. ! With optional \var{i}, \method{get_payload()} will return the \var{i}-th element of the payload, counting from zero, if ! \method{is_multipart()} returns 1. An \exception{IndexError} will be raised ! if \var{i} is less than 0 or greater than or equal to the number of ! items in the payload. If the payload is scalar ! (i.e. \method{is_multipart()} returns 0) and \var{i} is given, a \exception{TypeError} is raised. Optional \var{decode} is a flag indicating whether the payload should be decoded or not, according to the \mailheader{Content-Transfer-Encoding} header. ! When true and the message is not a multipart, the payload will be decoded if this header's value is \samp{quoted-printable} or \samp{base64}. If some other encoding is used, or \mailheader{Content-Transfer-Encoding} header is missing, the payload is returned as-is (undecoded). If the message is ! a multipart and the \var{decode} flag is true, then \code{None} is ! returned. \end{methoddesc} ! \begin{methoddesc}[Message]{set_payload}{payload} Set the entire message object's payload to \var{payload}. It is the ! client's responsibility to ensure the payload invariants. \end{methoddesc} --- 36,129 ---- Return the entire formatted message as a string. Optional \var{unixfrom}, when true, specifies to include the \emph{Unix-From} ! envelope header; it defaults to \code{False}. \end{methoddesc} \begin{methoddesc}[Message]{__str__}{} ! Equivalent to \method{aMessage.as_string(unixfrom=True)}. \end{methoddesc} \begin{methoddesc}[Message]{is_multipart}{} ! Return \code{True} if the message's payload is a list of ! sub-\class{Message} objects, otherwise return \code{False}. When ! \method{is_multipart()} returns False, the payload should be a string ! object. \end{methoddesc} \begin{methoddesc}[Message]{set_unixfrom}{unixfrom} ! Set the message's envelope header to \var{unixfrom}, which should be a string. \end{methoddesc} \begin{methoddesc}[Message]{get_unixfrom}{} ! Return the message's envelope header. Defaults to \code{None} if the ! envelope header was never set. \end{methoddesc} \begin{methoddesc}[Message]{attach}{payload} ! Add the given payload to the current payload, which must be ! \code{None} or a list of \class{Message} objects before the call. ! After the call, the payload will always be a list of \class{Message} ! objects. If you want to set the payload to a scalar object (e.g. a ! string), use \method{set_payload()} instead. \end{methoddesc} \begin{methoddesc}[Message]{get_payload}{\optional{i\optional{, decode}}} ! Return a reference the current payload, which will be a list of ! \class{Message} objects when \method{is_multipart()} is \code{True}, or a ! string when \method{is_multipart()} is \code{False}. If the ! payload is a list and you mutate the list object, you modify the ! message's payload in place. ! With optional argument \var{i}, \method{get_payload()} will return the \var{i}-th element of the payload, counting from zero, if ! \method{is_multipart()} is \code{True}. An \exception{IndexError} ! will be raised if \var{i} is less than 0 or greater than or equal to ! the number of items in the payload. If the payload is a string ! (i.e. \method{is_multipart()} is \code{False}) and \var{i} is given, a \exception{TypeError} is raised. Optional \var{decode} is a flag indicating whether the payload should be decoded or not, according to the \mailheader{Content-Transfer-Encoding} header. ! When \code{True} and the message is not a multipart, the payload will be decoded if this header's value is \samp{quoted-printable} or \samp{base64}. If some other encoding is used, or \mailheader{Content-Transfer-Encoding} header is missing, the payload is returned as-is (undecoded). If the message is ! a multipart and the \var{decode} flag is \code{True}, then \code{None} is ! returned. The default for \var{decode} is \code{False}. \end{methoddesc} ! \begin{methoddesc}[Message]{set_payload}{payload\optional{, charset}} Set the entire message object's payload to \var{payload}. It is the ! client's responsibility to ensure the payload invariants. Optional ! \var{charset} sets the message's default character set (see ! \method{set_charset()} for details. ! ! \versionchanged[\var{charset} argument added]{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_charset}{charset} ! Set the character set of the payload to \var{charset}, which can ! either be a \class{Charset} instance (see \refmodule{email.Charset}, a ! string naming a character set, ! or \code{None}. If it is a string, it will be converted to a ! \class{Charset} instance. If \var{charset} is \code{None}, the ! \code{charset} parameter will be removed from the ! \mailheader{Content-Type} header. Anything else will generate a ! \exception{TypeError}. ! ! The message will be assumed to be of type \mimetype{text/*} encoded with ! \code{charset.input_charset}. It will be converted to ! \code{charset.output_charset} ! and encoded properly, if needed, when generating the plain text ! representation of the message. MIME headers ! (\mailheader{MIME-Version}, \mailheader{Content-Type}, ! \mailheader{Content-Transfer-Encoding}) will be added as needed. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_charset}{} ! Return the \class{Charset} instance associated with the message's payload. ! \versionadded{2.2.2} \end{methoddesc} *************** *** 124,129 **** toward maximal convenience. ! Note that in all cases, any optional \emph{Unix-From} header the message ! may have is not included in the mapping interface. \begin{methoddesc}[Message]{__len__}{} --- 138,143 ---- toward maximal convenience. ! Note that in all cases, any envelope header present in the message is ! not included in the mapping interface. \begin{methoddesc}[Message]{__len__}{} *************** *** 178,207 **** \begin{methoddesc}[Message]{has_key}{name} ! Return 1 if the message contains a header field named \var{name}, ! otherwise return 0. \end{methoddesc} \begin{methoddesc}[Message]{keys}{} Return a list of all the message's header field names. These keys ! will be sorted in the order in which they were added to the message ! via \method{__setitem__()}, and may contain duplicates. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the header list. \end{methoddesc} \begin{methoddesc}[Message]{values}{} Return a list of all the message's field values. These will be sorted ! in the order in which they were added to the message via ! \method{__setitem__()}, and may contain duplicates. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the header list. \end{methoddesc} \begin{methoddesc}[Message]{items}{} ! Return a list of 2-tuples containing all the message's field headers and ! values. These will be sorted in the order in which they were added to ! the message via \method{__setitem__()}, and may contain duplicates. ! Any fields deleted and then subsequently re-added are always appended ! to the end of the header list. \end{methoddesc} --- 192,221 ---- \begin{methoddesc}[Message]{has_key}{name} ! Return true if the message contains a header field named \var{name}, ! otherwise return false. \end{methoddesc} \begin{methoddesc}[Message]{keys}{} Return a list of all the message's header field names. These keys ! will be sorted in the order in which they appeared in the original ! message, or were added to the message and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} \begin{methoddesc}[Message]{values}{} Return a list of all the message's field values. These will be sorted ! in the order in which they appeared in the original message, or were ! added to the message, and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} \begin{methoddesc}[Message]{items}{} ! Return a list of 2-tuples containing all the message's field headers ! and values. These will be sorted in the order in which they appeared ! in the original message, or were added to the message, and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} *************** *** 216,223 **** \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} Return a list of all the values for the field named \var{name}. These ! will be sorted in the order in which they were added to the message ! via \method{__setitem__()}. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the list. If there are no such named headers in the message, \var{failobj} is --- 230,236 ---- \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} Return a list of all the values for the field named \var{name}. These ! will be sorted in the order in which they appeared in the original ! message, or were added to the message. Any fields deleted and then ! subsequently re-added are always appended to the end of the list. If there are no such named headers in the message, \var{failobj} is *************** *** 228,233 **** Extended header setting. This method is similar to \method{__setitem__()} except that additional header parameters can be ! provided as keyword arguments. \var{_name} is the header to set and ! \var{_value} is the \emph{primary} value for the header. For each item in the keyword argument dictionary \var{_params}, the --- 241,246 ---- Extended header setting. This method is similar to \method{__setitem__()} except that additional header parameters can be ! provided as keyword arguments. \var{_name} is the header field to add ! and \var{_value} is the \emph{primary} value for the header. For each item in the keyword argument dictionary \var{_params}, the *************** *** 250,276 **** \end{methoddesc} ! \begin{methoddesc}[Message]{get_type}{\optional{failobj}} ! Return the message's content type, as a string of the form ! \mimetype{maintype/subtype} as taken from the ! \mailheader{Content-Type} header. ! The returned string is coerced to lowercase. ! If there is no \mailheader{Content-Type} header in the message, ! \var{failobj} is returned (defaults to \code{None}). \end{methoddesc} ! \begin{methoddesc}[Message]{get_main_type}{\optional{failobj}} ! Return the message's \emph{main} content type. This essentially returns the ! \var{maintype} part of the string returned by \method{get_type()}, with the ! same semantics for \var{failobj}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_subtype}{\optional{failobj}} ! Return the message's sub-content type. This essentially returns the ! \var{subtype} part of the string returned by \method{get_type()}, with the ! same semantics for \var{failobj}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_params}{\optional{failobj\optional{, header}}} Return the message's \mailheader{Content-Type} parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as --- 263,327 ---- \end{methoddesc} ! \begin{methoddesc}[Message]{replace_header}{_name, _value} ! Replace a header. Replace the first header found in the message that ! matches \var{_name}, retaining header order and field name case. If ! no matching header was found, a \exception{KeyError} is raised. ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_type}{} ! Return the message's content type. The returned string is coerced to ! lower case of the form \mimetype{maintype/subtype}. If there was no ! \mailheader{Content-Type} header in the message the default type as ! given by \method{get_default_type()} will be returned. Since ! according to \rfc{2045}, messages always have a default type, ! \method{get_content_type()} will always return a value. ! ! \rfc{2045} defines a message's default type to be ! \mimetype{text/plain} unless it appears inside a ! \mimetype{multipart/digest} container, in which case it would be ! \mimetype{message/rfc822}. If the \mailheader{Content-Type} header ! has an invalid type specification, \rfc{2045} mandates that the ! default type be \mimetype{text/plain}. ! ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_maintype}{} ! Return the message's main content type. This is the ! \mimetype{maintype} part of the string returned by ! \method{get_content_type()}. ! ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_subtype}{} ! Return the message's sub-content type. This is the \mimetype{subtype} ! part of the string returned by \method{get_content_type()}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_default_type}{} ! Return the default content type. Most messages have a default content ! type of \mimetype{text/plain}, except for messages that are subparts ! of \mimetype{multipart/digest} containers. Such subparts have a ! default content type of \mimetype{message/rfc822}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_default_type}{ctype} ! Set the default content type. \var{ctype} should either be ! \mimetype{text/plain} or \mimetype{message/rfc822}, although this is ! not enforced. The default content type is not stored in the ! \mailheader{Content-Type} header. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_params}{\optional{failobj\optional{, ! header\optional{, unquote}}}} Return the message's \mailheader{Content-Type} parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as *************** *** 278,290 **** \character{=} is the key, while the right hand side is the value. If there is no \character{=} sign in the parameter the value is the empty ! string. The value is always unquoted with \method{Utils.unquote()}. Optional \var{failobj} is the object to return if there is no \mailheader{Content-Type} header. Optional \var{header} is the header to search instead of \mailheader{Content-Type}. \end{methoddesc} \begin{methoddesc}[Message]{get_param}{param\optional{, ! failobj\optional{, header}}} Return the value of the \mailheader{Content-Type} header's parameter \var{param} as a string. If the message has no \mailheader{Content-Type} --- 329,344 ---- \character{=} is the key, while the right hand side is the value. If there is no \character{=} sign in the parameter the value is the empty ! string, otherwise the value is as described in \method{get_param()} and is ! unquoted if optional \var{unquote} is \code{True} (the default). Optional \var{failobj} is the object to return if there is no \mailheader{Content-Type} header. Optional \var{header} is the header to search instead of \mailheader{Content-Type}. + + \versionchanged[\var{unquote} argument added]{2.2.2} \end{methoddesc} \begin{methoddesc}[Message]{get_param}{param\optional{, ! failobj\optional{, header\optional{, unquote}}}} Return the value of the \mailheader{Content-Type} header's parameter \var{param} as a string. If the message has no \mailheader{Content-Type} *************** *** 294,311 **** Optional \var{header} if given, specifies the message header to use instead of \mailheader{Content-Type}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_charsets}{\optional{failobj}} ! Return a list containing the character set names in the message. If ! the message is a \mimetype{multipart}, then the list will contain one ! element for each subpart in the payload, otherwise, it will be a list ! of length 1. ! Each item in the list will be a string which is the value of the ! \code{charset} parameter in the \mailheader{Content-Type} header for the ! represented subpart. However, if the subpart has no ! \mailheader{Content-Type} header, no \code{charset} parameter, or is not of ! the \mimetype{text} main MIME type, then that item in the returned list ! will be \var{failobj}. \end{methoddesc} --- 348,425 ---- Optional \var{header} if given, specifies the message header to use instead of \mailheader{Content-Type}. + + Parameter keys are always compared case insensitively. The return + value can either be a string, or a 3-tuple if the parameter was + \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of + the form \samp{(CHARSET, LANGUAGE, VALUE)}, where \var{LANGUAGE} may + be the empty string. Your application should be prepared to deal with + 3-tuple return values, which it can convert the parameter to a Unicode + string like so: + + \begin{verbatim} + param = msg.get_param('foo') + if isinstance(param, tuple): + param = unicode(param[2], param[0]) + \end{verbatim} + + In any case, the parameter value (either the returned string, or the + \var{VALUE} item in the 3-tuple) is always unquoted, unless + \var{unquote} is set to \code{False}. + + \versionchanged[\var{unquote} argument added, and 3-tuple return value + possible]{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{set_param}{param, value\optional{, ! header\optional{, requote\optional{, charset\optional{, language}}}}} ! Set a parameter in the \mailheader{Content-Type} header. If the ! parameter already exists in the header, its value will be replaced ! with \var{value}. If the \mailheader{Content-Type} header as not yet ! been defined for this message, it will be set to \mimetype{text/plain} ! and the new parameter value will be appended as per \rfc{2045}. ! ! Optional \var{header} specifies an alternative header to ! \mailheader{Content-Type}, and all parameters will be quoted as ! necessary unless optional \var{requote} is \code{False} (the default ! is \code{True}). ! ! If optional \var{charset} is specified, the parameter will be encoded ! according to \rfc{2231}. Optional \var{language} specifies the RFC ! 2231 language, defaulting to the empty string. Both \var{charset} and ! \var{language} should be strings. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{del_param}{param\optional{, header\optional{, ! requote}}} ! Remove the given parameter completely from the ! \mailheader{Content-Type} header. The header will be re-written in ! place without the parameter or its value. All values will be quoted ! as necessary unless \var{requote} is \code{False} (the default is ! \code{True}). Optional \var{header} specifies an alterative to ! \mailheader{Content-Type}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_type}{type\optional{, header}\optional{, ! requote}} ! Set the main type and subtype for the \mailheader{Content-Type} ! header. \var{type} must be a string in the form ! \mimetype{maintype/subtype}, otherwise a \exception{ValueError} is ! raised. ! ! This method replaces the \mailheader{Content-Type} header, keeping all ! the parameters in place. If \var{requote} is \code{False}, this ! leaves the existing header's quoting as is, otherwise the parameters ! will be quoted (the default). ! ! An alternative header can be specified in the \var{header} argument. ! When the \mailheader{Content-Type} header is set, we'll always also ! add a \mailheader{MIME-Version} header. ! ! \versionadded{2.2.2} \end{methoddesc} *************** *** 341,344 **** --- 455,484 ---- \end{methoddesc} + \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} + Return the \code{charset} parameter of the \mailheader{Content-Type} + header. If there is no \mailheader{Content-Type} header, or if that + header has no \code{charset} parameter, \var{failobj} is returned. + + Note that this method differs from \method{get_charset} which returns + the \class{Charset} instance for the default encoding of the message + body. + + \versionadded{2.2.2} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_charsets}{\optional{failobj}} + Return a list containing the character set names in the message. If + the message is a \mimetype{multipart}, then the list will contain one + element for each subpart in the payload, otherwise, it will be a list + of length 1. + + Each item in the list will be a string which is the value of the + \code{charset} parameter in the \mailheader{Content-Type} header for the + represented subpart. However, if the subpart has no + \mailheader{Content-Type} header, no \code{charset} parameter, or is not of + the \mimetype{text} main MIME type, then that item in the returned list + will be \var{failobj}. + \end{methoddesc} + \begin{methoddesc}[Message]{walk}{} The \method{walk()} method is an all-purpose generator which can be *************** *** 381,385 **** is writing out the plain text representation of a MIME message, and it finds the message has a \var{preamble} attribute, it will write this ! text in the area between the headers and the first boundary. Note that if the message object has no preamble, the --- 521,526 ---- is writing out the plain text representation of a MIME message, and it finds the message has a \var{preamble} attribute, it will write this ! text in the area between the headers and the first boundary. See ! \refmodule{email.Parser} and \refmodule{email.Generator} for details. Note that if the message object has no preamble, the *************** *** 402,403 **** --- 543,600 ---- set the \var{epilogue} to the empty string. \end{datadesc} + + \subsubsection{Deprecated methods} + + The following methods are deprecated in \module{email} version 2. + They are documented here for completeness. + + \begin{methoddesc}[Message]{add_payload}{payload} + Add \var{payload} to the message object's existing payload. If, prior + to calling this method, the object's payload was \code{None} + (i.e. never before set), then after this method is called, the payload + will be the argument \var{payload}. + + If the object's payload was already a list + (i.e. \method{is_multipart()} returns 1), then \var{payload} is + appended to the end of the existing payload list. + + For any other type of existing payload, \method{add_payload()} will + transform the new payload into a list consisting of the old payload + and \var{payload}, but only if the document is already a MIME + multipart document. This condition is satisfied if the message's + \mailheader{Content-Type} header's main type is either + \mimetype{multipart}, or there is no \mailheader{Content-Type} + header. In any other situation, + \exception{MultipartConversionError} is raised. + + \deprecated{2.2.2}{Use the \method{attach()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_type}{\optional{failobj}} + Return the message's content type, as a string of the form + \mimetype{maintype/subtype} as taken from the + \mailheader{Content-Type} header. + The returned string is coerced to lowercase. + + If there is no \mailheader{Content-Type} header in the message, + \var{failobj} is returned (defaults to \code{None}). + + \deprecated{2.2.2}{Use the \method{get_content_type()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_main_type}{\optional{failobj}} + Return the message's \emph{main} content type. This essentially returns the + \var{maintype} part of the string returned by \method{get_type()}, with the + same semantics for \var{failobj}. + + \deprecated{2.2.2}{Use the \method{get_content_maintype()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_subtype}{\optional{failobj}} + Return the message's sub-content type. This essentially returns the + \var{subtype} part of the string returned by \method{get_type()}, with the + same semantics for \var{failobj}. + + \deprecated{2.2.2}{Use the \method{get_content_subtype()} method instead.} + \end{methoddesc} + Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** emailparser.tex 22 Feb 2002 21:24:32 -0000 1.5 --- emailparser.tex 1 Oct 2002 01:05:52 -0000 1.6 *************** *** 1,9 **** \declaremodule{standard}{email.Parser} \modulesynopsis{Parse flat text email messages to produce a message ! object tree.} ! Message object trees can be created in one of two ways: they can be created from whole cloth by instantiating \class{Message} objects and ! stringing them together via \method{add_payload()} and \method{set_payload()} calls, or they can be created by parsing a flat text representation of the email message. --- 1,9 ---- \declaremodule{standard}{email.Parser} \modulesynopsis{Parse flat text email messages to produce a message ! object structure.} ! Message object structures can be created in one of two ways: they can be created from whole cloth by instantiating \class{Message} objects and ! stringing them together via \method{attach()} and \method{set_payload()} calls, or they can be created by parsing a flat text representation of the email message. *************** *** 12,19 **** most email document structures, including MIME documents. You can pass the parser a string or a file object, and the parser will return ! to you the root \class{Message} instance of the object tree. For simple, non-MIME messages the payload of this root object will likely be a string containing the text of the message. For MIME ! messages, the root object will return true from its \method{is_multipart()} method, and the subparts can be accessed via the \method{get_payload()} and \method{walk()} methods. --- 12,19 ---- most email document structures, including MIME documents. You can pass the parser a string or a file object, and the parser will return ! to you the root \class{Message} instance of the object structure. For simple, non-MIME messages the payload of this root object will likely be a string containing the text of the message. For MIME ! messages, the root object will return \code{True} from its \method{is_multipart()} method, and the subparts can be accessed via the \method{get_payload()} and \method{walk()} methods. *************** *** 28,43 **** headers and the payload of the message. In the case of \mimetype{multipart} messages, it will recursively parse the body of ! the container message. The \module{email.Parser} module also provides ! a second class, called \class{HeaderParser} which can be used if ! you're only interested in the headers of the message. ! \class{HeaderParser} can be much faster in this situations, since it ! does not attempt to parse the message body, instead setting the ! payload to the raw body as a string. \class{HeaderParser} has the ! same API as the \class{Parser} class. \subsubsection{Parser class API} ! \begin{classdesc}{Parser}{\optional{_class}} ! The constructor for the \class{Parser} class takes a single optional argument \var{_class}. This must be a callable factory (such as a function or a class), and it is used whenever a sub-message object --- 28,47 ---- headers and the payload of the message. In the case of \mimetype{multipart} messages, it will recursively parse the body of ! the container message. Two modes of parsing are supported, ! \emph{strict} parsing, which will usually reject any non-RFC compliant ! message, and \emph{lax} parsing, which attempts to adjust for common ! MIME formatting problems. ! ! The \module{email.Parser} module also provides a second class, called ! \class{HeaderParser} which can be used if you're only interested in ! the headers of the message. \class{HeaderParser} can be much faster in ! these situations, since it does not attempt to parse the message body, ! instead setting the payload to the raw body as a string. ! \class{HeaderParser} has the same API as the \class{Parser} class. \subsubsection{Parser class API} ! \begin{classdesc}{Parser}{\optional{_class\optional{, strict}}} ! The constructor for the \class{Parser} class takes an optional argument \var{_class}. This must be a callable factory (such as a function or a class), and it is used whenever a sub-message object *************** *** 45,53 **** \refmodule{email.Message}). The factory will be called without arguments. \end{classdesc} The other public \class{Parser} methods are: ! \begin{methoddesc}[Parser]{parse}{fp} Read all the data from the file-like object \var{fp}, parse the resulting text, and return the root message object. \var{fp} must --- 49,71 ---- \refmodule{email.Message}). The factory will be called without arguments. + + The optional \var{strict} flag specifies whether strict or lax parsing + should be performed. Normally, when things like MIME terminating + boundaries are missing, or when messages contain other formatting + problems, the \class{Parser} will raise a + \exception{MessageParseError}. However, when lax parsing is enabled, + the \class{Parser} will attempt to workaround such broken formatting + to produce a usable message structure (this doesn't mean + \exception{MessageParseError}s are never raised; some ill-formatted + messages just can't be parsed). The \var{strict} flag defaults to + \code{False} since lax parsing usually provides the most convenient + behavior. + + \versionchanged[The \var{strict} flag was added]{2.2.2} \end{classdesc} The other public \class{Parser} methods are: ! \begin{methoddesc}[Parser]{parse}{fp\optional{, headersonly}} Read all the data from the file-like object \var{fp}, parse the resulting text, and return the root message object. \var{fp} must *************** *** 57,86 **** The text contained in \var{fp} must be formatted as a block of \rfc{2822} style headers and header continuation lines, optionally preceeded by a ! \emph{Unix-From} header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). \end{methoddesc} ! \begin{methoddesc}[Parser]{parsestr}{text} Similar to the \method{parse()} method, except it takes a string object instead of a file-like object. Calling this method on a string is exactly equivalent to wrapping \var{text} in a \class{StringIO} instance first and calling \method{parse()}. \end{methoddesc} ! Since creating a message object tree from a string or a file object is ! such a common task, two functions are provided as a convenience. They ! are available in the top-level \module{email} package namespace. ! \begin{funcdesc}{message_from_string}{s\optional{, _class}} Return a message object tree from a string. This is exactly ! equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} is ! interpreted as with the \class{Parser} class constructor. \end{funcdesc} ! \begin{funcdesc}{message_from_file}{fp\optional{, _class}} Return a message object tree from an open file object. This is exactly ! equivalent to \code{Parser().parse(fp)}. Optional \var{_class} is ! interpreted as with the \class{Parser} class constructor. \end{funcdesc} --- 75,121 ---- The text contained in \var{fp} must be formatted as a block of \rfc{2822} style headers and header continuation lines, optionally preceeded by a ! envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). + + Optional \var{headersonly} is a flag specifying whether to stop + parsing after reading the headers or not. The default is \code{False}, + meaning it parses the entire contents of the file. + + \versionchanged[The \var{headersonly} flag was added]{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Parser]{parsestr}{text\optional{, headersonly}} Similar to the \method{parse()} method, except it takes a string object instead of a file-like object. Calling this method on a string is exactly equivalent to wrapping \var{text} in a \class{StringIO} instance first and calling \method{parse()}. + + Optional \var{headersonly} is a flag specifying whether to stop + parsing after reading the headers or not. The default is \code{False}, + meaning it parses the entire contents of the file. + + \versionchanged[The \var{headersonly} flag was added]{2.2.2} \end{methoddesc} ! Since creating a message object structure from a string or a file ! object is such a common task, two functions are provided as a ! convenience. They are available in the top-level \module{email} ! package namespace. ! \begin{funcdesc}{message_from_string}{s\optional{, _class\optional{, strict}}} Return a message object tree from a string. This is exactly ! equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} and ! \var{strict} are interpreted as with the \class{Parser} class constructor. ! ! \versionchanged[The \var{strict} flag was added]{2.2.2} \end{funcdesc} ! \begin{funcdesc}{message_from_file}{fp\optional{, _class\optional{, strict}}} Return a message object tree from an open file object. This is exactly ! equivalent to \code{Parser().parse(fp)}. Optional \var{_class} and ! \var{strict} are interpreted as with the \class{Parser} class constructor. ! ! \versionchanged[The \var{strict} flag was added]{2.2.2} \end{funcdesc} *************** *** 100,113 **** \item Most non-\mimetype{multipart} type messages are parsed as a single message object with a string payload. These objects will return ! 0 for \method{is_multipart()}. ! \item One exception is for \mimetype{message/delivery-status} type ! messages. Because the body of such messages consist of ! blocks of headers, \class{Parser} will create a non-multipart ! object containing non-multipart subobjects for each header ! block. ! \item Another exception is for \mimetype{message/*} types (more ! general than \mimetype{message/delivery-status}). These are ! typically \mimetype{message/rfc822} messages, represented as a ! non-multipart object containing a singleton payload which is ! another non-multipart \class{Message} instance. \end{itemize} --- 135,150 ---- \item Most non-\mimetype{multipart} type messages are parsed as a single message object with a string payload. These objects will return ! \code{False} for \method{is_multipart()}. Their ! \method{get_payload()} method will return a string object. ! \item All \mimetype{multipart} type messages will be parsed as a ! container message object with a list of sub-message objects for ! their payload. These messages will return \code{True} for ! \method{is_multipart()} and their \method{get_payload()} method ! will return a list of \class{Message} instances. ! \item Most messages with a content type of \mimetype{message/*} ! (e.g. \mimetype{message/deliver-status} and ! \mimetype{message/rfc822}) will also be parsed as container ! object containing a list payload of length 1. Their ! \method{is_multipart()} method will return \code{True}. The ! single element in the list payload will be a sub-message object. \end{itemize} Index: emailutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailutil.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** emailutil.tex 22 May 2002 01:22:46 -0000 1.6 --- emailutil.tex 1 Oct 2002 01:05:52 -0000 1.7 *************** *** 22,29 **** \emph{realname} and \emph{email address} parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ! \code{(None, None)} is returned. \end{funcdesc} ! \begin{funcdesc}{dump_address_pair}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form \code{(realname, email_address)} and returns the string value suitable --- 22,29 ---- \emph{realname} and \emph{email address} parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ! \code{('', '')} is returned. \end{funcdesc} ! \begin{funcdesc}{formataddr}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form \code{(realname, email_address)} and returns the string value suitable *************** *** 49,73 **** \end{funcdesc} - \begin{funcdesc}{decode}{s} - This method decodes a string according to the rules in \rfc{2047}. It - returns the decoded string as a Python unicode string. - \end{funcdesc} - - \begin{funcdesc}{encode}{s\optional{, charset\optional{, encoding}}} - This method encodes a string according to the rules in \rfc{2047}. It - is not actually the inverse of \function{decode()} since it doesn't - handle multiple character sets or multiple string parts needing - encoding. In fact, the input string \var{s} must already be encoded - in the \var{charset} character set (Python can't reliably guess what - character set a string might be encoded in). The default - \var{charset} is \samp{iso-8859-1}. - - \var{encoding} must be either the letter \character{q} for - Quoted-Printable or \character{b} for Base64 encoding. If - neither, a \exception{ValueError} is raised. Both the \var{charset} and - the \var{encoding} strings are case-insensitive, and coerced to lower - case in the returned string. - \end{funcdesc} - \begin{funcdesc}{parsedate}{date} Attempts to parse a date according to the rules in \rfc{2822}. --- 49,52 ---- *************** *** 117,122 **** otherwise the current time is used. ! Optional \var{localtime} is a flag that when true, interprets \var{timeval}, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. \end{funcdesc} --- 96,142 ---- otherwise the current time is used. ! Optional \var{localtime} is a flag that when \code{True}, interprets \var{timeval}, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. + The default is \code{False} meaning UTC is used. + \end{funcdesc} + + \begin{funcdesc}{make_msgid}{\optional{idstring}} + Returns a string suitable for an \rfc{2822}-compliant + \mailheader{Message-ID} header. Optional \var{idstring} if given, is + a string used to strengthen the uniqueness of the message id. \end{funcdesc} + + \begin{funcdesc}{decode_rfc2231}{s} + Decode the string \var{s} according to \rfc{2231}. + \end{funcdesc} + + \begin{funcdesc}{encode_rfc2231}{s\optional{, charset\optional{, language}}} + Encode the string \var{s} according to \rfc{2231}. Optional + \var{charset} and \var{language}, if given is the character set name + and language name to use. If neither is given, \var{s} is returned + as-is. If \var{charset} is given but \var{language} is not, the + string is encoded using the empty string for \var{language}. + \end{funcdesc} + + \begin{funcdesc}{decode_params}{params} + Decode parameters list according to \rfc{2231}. \var{params} is a + sequence of 2-tuples containing elements of the form + \code{(content-type, string-value)}. + \end{funcdesc} + + The following functions have been deprecated: + + \begin{funcdesc}{dump_address_pair}{pair} + \deprecated{2.2.2}{Use \function{formataddr()} instead.} + \end{funcdesc} + + \begin{funcdesc}{decode}{s} + \deprecated{2.2.2}{Use \method{Header.decode_header()} instead.} + \end{funcdesc} + + + \begin{funcdesc}{encode}{s\optional{, charset\optional{, encoding}}} + \deprecated{2.2.2}{Use \method{Header.encode()} instead.} + \end{funcdesc} + From gvanrossum@users.sourceforge.net Tue Oct 1 05:14:19 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 30 Sep 2002 21:14:19 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils ccompiler.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv13686 Modified Files: ccompiler.py Log Message: Commit fix for SF 603831. Strangely, two out of three patches there seem already committed; but the essential one (get rid of the assert in object_filenames in ccompiler.py) was not yet applied. This makes the build procedure for Twisted work again. This is *not* a backport candidate despite the fact that identical code appears to exist in 2.2.2; Twisted builds fine there, so there must have been a change elsewhere. Index: ccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/ccompiler.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** ccompiler.py 11 Sep 2002 16:31:53 -0000 1.47 --- ccompiler.py 1 Oct 2002 04:14:17 -0000 1.48 *************** *** 877,881 **** def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): ! assert output_dir is not None obj_names = [] for src_name in source_filenames: --- 877,882 ---- def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): ! if output_dir is None: ! output_dir = '' obj_names = [] for src_name in source_filenames: From barry@users.sourceforge.net Tue Oct 1 05:33:19 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 21:33:19 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailcharsets.tex,NONE,1.1 email.tex,1.12,1.13 emailencoders.tex,1.3,1.4 emailgenerator.tex,1.4,1.5 emailheaders.tex,1.1,1.2 emailmessage.tex,1.6,1.7 emailmimebase.tex,1.1,1.2 emailparser.tex,1.6,1.7 emailutil.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18370/lib Modified Files: email.tex emailencoders.tex emailgenerator.tex emailheaders.tex emailmessage.tex emailmimebase.tex emailparser.tex emailutil.tex Added Files: emailcharsets.tex Log Message: Proofread and spell checked, all except the Examples section (which I'll do next). --- NEW FILE: emailcharsets.tex --- \declaremodule{standard}{email.Charset} \modulesynopsis{Character Sets} This module provides a class \class{Charset} for representing character sets and character set conversions in email messages, as well as a character set registry and several convenience methods for manipulating this registry. Instances of \class{Charset} are used in several other modules within the \module{email} package. \versionadded{2.2.2} \begin{classdesc}{Charset}{\optional{input_charset}} Map character sets to their email properties. This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email message in an RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email. Optional \var{input_charset} is as described below. After being alias normalized it is also used as a lookup into the registry of character sets to find out the header encoding, body encoding, and output conversion codec to be used for the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is necessary. If \var{input_charset} is \code{euc-jp}, then headers will be encoded with base64, bodies will not be encoded, but output text will be converted from the \code{euc-jp} character set to the \code{iso-2022-jp} character set. \end{classdesc} \class{Charset} instances have the following data attributes: \begin{datadesc}{input_charset} The initial character set specified. Common aliases are converted to their \emph{official} email names (e.g. \code{latin_1} is converted to \code{iso-8859-1}). Defaults to 7-bit \code{us-ascii}. \end{datadesc} \begin{datadesc}{header_encoding} If the character set must be encoded before it can be used in an email header, this attribute will be set to \code{Charset.QP} (for quoted-printable), \code{Charset.BASE64} (for base64 encoding), or \code{Charset.SHORTEST} for the shortest of QP or BASE64 encoding. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{body_encoding} Same as \var{header_encoding}, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. \code{Charset.SHORTEST} is not allowed for \var{body_encoding}. \end{datadesc} \begin{datadesc}{output_charset} Some character sets must be converted before they can be used in email headers or bodies. If the \var{input_charset} is one of them, this attribute will contain the name of the character set output will be converted to. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{input_codec} The name of the Python codec used to convert the \var{input_charset} to Unicode. If no conversion codec is necessary, this attribute will be \code{None}. \end{datadesc} \begin{datadesc}{output_codec} The name of the Python codec used to convert Unicode to the \var{output_charset}. If no conversion codec is necessary, this attribute will have the same value as the \var{input_codec}. \end{datadesc} \class{Charset} instances also have the following methods: \begin{methoddesc}[Charset]{get_body_encoding}{} Return the content transfer encoding used for body encoding. This is either the string \samp{quoted-printable} or \samp{base64} depending on the encoding used, or it is a function, in which case you should call the function with a single argument, the Message object being encoded. The function should then set the \mailheader{Content-Transfer-Encoding} header itself to whatever is appropriate. Returns the string \samp{quoted-printable} if \var{body_encoding} is \code{QP}, returns the string \samp{base64} if \var{body_encoding} is \code{BASE64}, and returns the string \samp{7bit} otherwise. \end{methoddesc} \begin{methoddesc}{convert}{s} Convert the string \var{s} from the \var{input_codec} to the \var{output_codec}. \end{methoddesc} \begin{methoddesc}{to_splittable}{s} Convert a possibly multibyte string to a safely splittable format. \var{s} is the string to split. Uses the \var{input_codec} to try and convert the string to Unicode, so it can be safely split on character boundaries (even for multibyte characters). Returns the string as-is if it isn't known how to convert \var{s} to Unicode with the \var{input_charset}. Characters that could not be converted to Unicode will be replaced with the Unicode replacement character \character{U+FFFD}. \end{methoddesc} \begin{methoddesc}{from_splittable}{ustr\optional{, to_output}} Convert a splittable string back into an encoded string. \var{ustr} is a Unicode string to ``unsplit''. This method uses the proper codec to try and convert the string from Unicode back into an encoded format. Return the string as-is if it is not Unicode, or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced with an appropriate character (usually \character{?}). If \var{to_output} is \code{True} (the default), uses \var{output_codec} to convert to an encoded format. If \var{to_output} is \code{False}, it uses \var{input_codec}. \end{methoddesc} \begin{methoddesc}{get_output_charset}{} Return the output character set. This is the \var{output_charset} attribute if that is not \code{None}, otherwise it is \var{input_charset}. \end{methoddesc} \begin{methoddesc}{encoded_header_len}{} Return the length of the encoded header string, properly calculating for quoted-printable or base64 encoding. \end{methoddesc} \begin{methoddesc}{header_encode}{s\optional{, convert}} Header-encode the string \var{s}. If \var{convert} is \code{True}, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the higher-level \class{Header} class to deal with these issues (see \refmodule{email.Header}). \var{convert} defaults to \code{False}. The type of encoding (base64 or quoted-printable) will be based on the \var{header_encoding} attribute. \end{methoddesc} \begin{methoddesc}{body_encode}{s\optional{, convert}} Body-encode the string \var{s}. If \var{convert} is \code{True} (the default), the string will be converted from the input charset to output charset automatically. Unlike \method{header_encode()}, there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on the \var{body_encoding} attribute. \end{methoddesc} The \class{Charset} class also provides a number of methods to support standard operations and built-in functions. \begin{methoddesc}[Charset]{__str__}{} Returns \var{input_charset} as a string coerced to lower case. \end{methoddesc} \begin{methoddesc}[Charset]{__eq__}{other} This method allows you to compare two \class{Charset} instances for equality. \end{methoddesc} \begin{methoddesc}[Header]{__ne__}{other} This method allows you to compare two \class{Charset} instances for inequality. \end{methoddesc} The \module{email.Charset} module also provides the following functions for adding new entries to the global character set, alias, and codec registries: \begin{funcdesc}{add_charset}{charset\optional{, header_enc\optional{, body_enc\optional{, output_charset}}}} Add character properties to the global registry. \var{charset} is the input character set, and must be the canonical name of a character set. Optional \var{header_enc} and \var{body_enc} is either \code{Charset.QP} for quoted-printable, \code{Charset.BASE64} for base64 encoding, \code{Charset.SHORTEST} for the shortest of quoted-printable or base64 encoding, or \code{None} for no encoding. \code{SHORTEST} is only valid for \var{header_enc}. The default is \code{None} for no encoding. Optional \var{output_charset} is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method \method{Charset.convert()} is called. The default is to output in the same character set as the input. Both \var{input_charset} and \var{output_charset} must have Unicode codec entries in the module's character set-to-codec mapping; use \function{add_codec()} to add codecs the module does not know about. See the \refmodule{codecs} module's documentation for more information. The global character set registry is kept in the module global dictionary \code{CHARSETS}. \end{funcdesc} \begin{funcdesc}{add_alias}{alias, canonical} Add a character set alias. \var{alias} is the alias name, e.g. \code{latin-1}. \var{canonical} is the character set's canonical name, e.g. \code{iso-8859-1}. The global charset alias registry is kept in the module global dictionary \code{ALIASES}. \end{funcdesc} \begin{funcdesc}{add_codec}{charset, codecname} Add a codec that map characters in the given character set to and from Unicode. \var{charset} is the canonical name of a character set. \var{codecname} is the name of a Python codec, as appropriate for the second argument to the \function{unicode()} built-in, or to the \method{encode()} method of a Unicode string. \end{funcdesc} Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** email.tex 1 Oct 2002 01:05:51 -0000 1.12 --- email.tex 1 Oct 2002 04:33:12 -0000 1.13 *************** *** 40,51 **** \module{email} package. The ordering follows a progression that should be common in applications: an email message is read as flat ! text from a file or other source, the text is parsed to produce an ! object model representation of the email message, this model is ! manipulated, and finally the model is rendered back into ! flat text. ! It is perfectly feasible to create the object model out of whole cloth ! --- i.e. completely from scratch. From there, a similar progression ! can be taken as above. Also included are detailed specifications of all the classes and --- 40,50 ---- \module{email} package. The ordering follows a progression that should be common in applications: an email message is read as flat ! text from a file or other source, the text is parsed to produce the ! object structure of the email message, this structure is manipulated, ! and finally rendered back into flat text. ! It is perfectly feasible to create the object structure out of whole ! cloth --- i.e. completely from scratch. From there, a similar ! progression can be taken as above. Also included are detailed specifications of all the classes and *************** *** 72,78 **** \input{emailmimebase} ! \subsection{Headers, Character sets, and Internationalization} \input{emailheaders} \subsection{Encoders} \input{emailencoders} --- 71,80 ---- \input{emailmimebase} ! \subsection{Internationalized headers} \input{emailheaders} + \subsection{Representing character sets} + \input{emailcharsets} + \subsection{Encoders} \input{emailencoders} *************** *** 93,97 **** 2.3 release, and backported to Python 2.2.2. It was also available as a separate distutils based package. \module{email} version 2 is ! almost entirely backwards compatible with version 1, with the following differences: --- 95,99 ---- 2.3 release, and backported to Python 2.2.2. It was also available as a separate distutils based package. \module{email} version 2 is ! almost entirely backward compatible with version 1, with the following differences: *************** *** 101,105 **** \item The pickle format for \class{Message} instances has changed. Since this was never (and still isn't) formally defined, this ! isn't considered a backwards incompatibility. However if your application pickles and unpickles \class{Message} instances, be aware that in \module{email} version 2, \class{Message} --- 103,107 ---- \item The pickle format for \class{Message} instances has changed. Since this was never (and still isn't) formally defined, this ! isn't considered a backward incompatibility. However if your application pickles and unpickles \class{Message} instances, be aware that in \module{email} version 2, \class{Message} *************** *** 107,113 **** \var{_default_type}. \item Several methods in the \class{Message} class have been ! deprecated, or their signatures changes. Also, many new methods have been added. See the documentation for the \class{Message} ! class for deatils. The changes should be completely backwards compatible. \item The object structure has changed in the face of --- 109,115 ---- \var{_default_type}. \item Several methods in the \class{Message} class have been ! deprecated, or their signatures changed. Also, many new methods have been added. See the documentation for the \class{Message} ! class for details. The changes should be completely backward compatible. \item The object structure has changed in the face of *************** *** 115,129 **** version 1, such a type would be represented by a scalar payload, i.e. the container message's \method{is_multipart()} returned ! false, \method{get_payload()} was not a list object, and was ! actually a \class{Message} instance. This structure was inconsistent with the rest of the package, so the object representation for \mimetype{message/rfc822} content ! types was changed. In module{email} version 2, the container \emph{does} return \code{True} from \method{is_multipart()}, and \method{get_payload()} returns a list containing a single \class{Message} item. ! Note that this is one place that backwards compatibility could not be completely maintained. However, if you're already testing the return type of \method{get_payload()}, you should be --- 117,131 ---- version 1, such a type would be represented by a scalar payload, i.e. the container message's \method{is_multipart()} returned ! false, \method{get_payload()} was not a list object, but a single ! \class{Message} instance. This structure was inconsistent with the rest of the package, so the object representation for \mimetype{message/rfc822} content ! types was changed. In \module{email} version 2, the container \emph{does} return \code{True} from \method{is_multipart()}, and \method{get_payload()} returns a list containing a single \class{Message} item. ! Note that this is one place that backward compatibility could not be completely maintained. However, if you're already testing the return type of \method{get_payload()}, you should be *************** *** 143,147 **** \item The intermediate base classes \class{MIMENonMultipart} and \class{MIMEMultipart} have been added, and interposed in the ! class heirarchy for most of the other MIME-related derived classes. \item The \var{_encoder} argument to the \class{MIMEText} constructor --- 145,149 ---- \item The intermediate base classes \class{MIMENonMultipart} and \class{MIMEMultipart} have been added, and interposed in the ! class hierarchy for most of the other MIME-related derived classes. \item The \var{_encoder} argument to the \class{MIMEText} constructor *************** *** 168,172 **** have also changed. For the most part, any functionality available in \module{mimelib} is still available in the \refmodule{email} package, ! albeit often in a different way. Here is a brief description of the differences between the --- 170,176 ---- have also changed. For the most part, any functionality available in \module{mimelib} is still available in the \refmodule{email} package, ! albeit often in a different way. Backward compatibility between ! the \module{mimelib} package and the \module{email} package was not a ! priority. Here is a brief description of the differences between the Index: emailencoders.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailencoders.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** emailencoders.tex 1 Oct 2002 01:05:52 -0000 1.3 --- emailencoders.tex 1 Oct 2002 04:33:14 -0000 1.4 *************** *** 18,22 **** \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into quoted-Printable form and sets the \mailheader{Content-Transfer-Encoding} header to \code{quoted-printable}\footnote{Note that encoding with --- 18,22 ---- \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into quoted-printable form and sets the \mailheader{Content-Transfer-Encoding} header to \code{quoted-printable}\footnote{Note that encoding with Index: emailgenerator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailgenerator.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** emailgenerator.tex 1 Oct 2002 01:05:52 -0000 1.4 --- emailgenerator.tex 1 Oct 2002 04:33:14 -0000 1.5 *************** *** 25,34 **** object called \var{outfp} for an argument. \var{outfp} must support the \method{write()} method and be usable as the output file in a ! Python 2.0 extended print statement. Optional \var{mangle_from_} is a flag that, when \code{True}, puts a \samp{>} character in front of any line in the body that starts exactly as ! \samp{From } (i.e. \code{From} followed by a space at the front of the ! line). This is the only guaranteed portable way to avoid having such lines be mistaken for a Unix mailbox format envelope header separator (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} --- 25,34 ---- object called \var{outfp} for an argument. \var{outfp} must support the \method{write()} method and be usable as the output file in a ! Python extended print statement. Optional \var{mangle_from_} is a flag that, when \code{True}, puts a \samp{>} character in front of any line in the body that starts exactly as ! \samp{From }, i.e. \code{From} followed by a space at the beginning of the ! line. This is the only guaranteed portable way to avoid having such lines be mistaken for a Unix mailbox format envelope header separator (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} *************** *** 49,56 **** The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{flatten()}{msg\optional{, unixfrom}} Print the textual representation of the message object structure rooted at \var{msg} to the output file specified when the \class{Generator} ! instance was created. Sub-objects are visited depth-first and the resulting text will be properly MIME encoded. --- 49,56 ---- The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{flatten}{msg\optional{, unixfrom}} Print the textual representation of the message object structure rooted at \var{msg} to the output file specified when the \class{Generator} ! instance was created. Subparts are visited depth-first and the resulting text will be properly MIME encoded. *************** *** 61,65 **** inhibit the printing of the envelope delimiter. ! Note that for sub-objects, no envelope header is ever printed. \versionadded{2.2.2} --- 61,65 ---- inhibit the printing of the envelope delimiter. ! Note that for subparts, no envelope header is ever printed. \versionadded{2.2.2} *************** *** 100,113 **** If the subpart is not of main type \mimetype{text}, optional \var{fmt} ! is a format string that is used instead of the message ! payload. \var{fmt} is expanded with the following keywords (in ! \samp{\%(keyword)s} format): ! type : Full MIME type of the non-\mimetype{text} part ! maintype : Main MIME type of the non-\mimetype{text} part ! subtype : Sub-MIME type of the non-\mimetype{text} part ! filename : Filename of the non-\mimetype{text} part ! description: Description associated with the non-\mimetype{text} part ! encoding : Content transfer encoding of the non-\mimetype{text} part The default value for \var{fmt} is \code{None}, meaning --- 100,117 ---- If the subpart is not of main type \mimetype{text}, optional \var{fmt} ! is a format string that is used instead of the message payload. ! \var{fmt} is expanded with the following keywords, \samp{\%(keyword)s} ! format: ! \begin{itemize} ! \item \code{type} -- Full MIME type of the non-\mimetype{text} part ! \item \code{maintype} -- Main MIME type of the non-\mimetype{text} part ! \item \code{subtype} -- Sub-MIME type of the non-\mimetype{text} part ! \item \code{filename} -- Filename of the non-\mimetype{text} part ! \item \code{description} -- Description associated with the ! non-\mimetype{text} part ! \item \code{encoding} -- Content transfer encoding of the ! non-\mimetype{text} part ! \end{itemize} The default value for \var{fmt} is \code{None}, meaning Index: emailheaders.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailheaders.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** emailheaders.tex 1 Oct 2002 01:05:52 -0000 1.1 --- emailheaders.tex 1 Oct 2002 04:33:15 -0000 1.2 *************** *** 4,8 **** \rfc{2822} is the base standard that describes the format of email messages. It derives from the older \rfc{822} standard which came ! into widespread at a time when most email was composed of \ASCII{} characters only. \rfc{2822} is a specification written assuming email contains only 7-bit \ASCII{} characters. --- 4,8 ---- \rfc{2822} is the base standard that describes the format of email messages. It derives from the older \rfc{822} standard which came ! into widespread use at a time when most email was composed of \ASCII{} characters only. \rfc{2822} is a specification written assuming email contains only 7-bit \ASCII{} characters. *************** *** 20,27 **** If you want to include non-\ASCII{} characters in your email headers, say in the \mailheader{Subject} or \mailheader{To} fields, you should ! use the \class{Header} class (in module \module{email.Header} and ! assign the field in the \class{Message} object to an instance of ! \class{Header} instead of using a string for the header value. For ! example: \begin{verbatim} --- 20,26 ---- If you want to include non-\ASCII{} characters in your email headers, say in the \mailheader{Subject} or \mailheader{To} fields, you should ! use the \class{Header} class and assign the field in the ! \class{Message} object to an instance of \class{Header} instead of ! using a string for the header value. For example: \begin{verbatim} *************** *** 51,55 **** \begin{classdesc}{Header}{\optional{s\optional{, charset\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}}}} ! Create a MIME-compliant header that can contain many character sets. Optional \var{s} is the initial header value. If \code{None} (the --- 50,55 ---- \begin{classdesc}{Header}{\optional{s\optional{, charset\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}}}} ! Create a MIME-compliant header that can contain strings in different ! character sets. Optional \var{s} is the initial header value. If \code{None} (the *************** *** 75,79 **** taken into account for the first line of a long, split header. ! Optional \var{continuation_ws} must be RFC 2822 compliant folding whitespace, and is usually either a space or a hard tab character. This character will be prepended to continuation lines. --- 75,79 ---- taken into account for the first line of a long, split header. ! Optional \var{continuation_ws} must be \rfc{2822}-compliant folding whitespace, and is usually either a space or a hard tab character. This character will be prepended to continuation lines. *************** *** 90,94 **** \var{s} may be a byte string or a Unicode string. If it is a byte ! string (i.e. \code{isinstance(s, StringType)} is true), then \var{charset} is the encoding of that byte string, and a \exception{UnicodeError} will be raised if the string cannot be --- 90,94 ---- \var{s} may be a byte string or a Unicode string. If it is a byte ! string (i.e. \code{isinstance(s, str)} is true), then \var{charset} is the encoding of that byte string, and a \exception{UnicodeError} will be raised if the string cannot be *************** *** 114,118 **** \begin{methoddesc}[Header]{__str__}{} A synonym for \method{Header.encode()}. Useful for ! \code{str(aHeader)} calls. \end{methoddesc} --- 114,118 ---- \begin{methoddesc}[Header]{__str__}{} A synonym for \method{Header.encode()}. Useful for ! \code{str(aHeader)}. \end{methoddesc} *************** *** 165,409 **** \var{header_name}, and \var{continuation_ws} are as in the \class{Header} constructor. - \end{funcdesc} - - \declaremodule{standard}{email.Charset} - \modulesynopsis{Character Sets} - - This module provides a class \class{Charset} for representing - character sets and character set conversions in email messages, as - well as a character set registry and several convenience methods for - manipulating this registry. Instances of \class{Charset} are used in - several other modules within the \module{email} package. - - \versionadded{2.2.2} - - \begin{classdesc}{Charset}{\optional{input_charset}} - Map character sets to their email properties. - - This class provides information about the requirements imposed on - email for a specific character set. It also provides convenience - routines for converting between character sets, given the availability - of the applicable codecs. Given a character set, it will do its best - to provide information on how to use that character set in an email - message in an RFC-compliant way. - - Certain character sets must be encoded with quoted-printable or base64 - when used in email headers or bodies. Certain character sets must be - converted outright, and are not allowed in email. - - Optional \var{input_charset} is as described below. After being alias - normalized it is also used as a lookup into the registry of character - sets to find out the header encoding, body encoding, and output - conversion codec to be used for the character set. For example, if - \var{input_charset} is \code{iso-8859-1}, then headers and bodies will - be encoded using quoted-printable and no output conversion codec is - necessary. If \var{input_charset} is \code{euc-jp}, then headers will - be encoded with base64, bodies will not be encoded, but output text - will be converted from the \code{euc-jp} character set to the - \code{iso-2022-jp} character set. - \end{classdesc} - - \class{Charset} instances have the following data attributes: - - \begin{datadesc}{input_charset} - The initial character set specified. Common aliases are converted to - their \emph{official} email names (e.g. \code{latin_1} is converted to - \code{iso-8859-1}). Defaults to 7-bit \code{us-ascii}. - \end{datadesc} - - \begin{datadesc}{header_encoding} - If the character set must be encoded before it can be used in an - email header, this attribute will be set to \code{Charset.QP} (for - quoted-printable), \code{Charset.BASE64} (for base64 encoding), or - \code{Charset.SHORTEST} for the shortest of QP or BASE64 encoding. - Otherwise, it will be \code{None}. - \end{datadesc} - - \begin{datadesc}{body_encoding} - Same as \var{header_encoding}, but describes the encoding for the - mail message's body, which indeed may be different than the header - encoding. \code{Charset.SHORTEST} is not allowed for - \var{body_encoding}. - \end{datadesc} - - \begin{datadesc}{output_charset} - Some character sets must be converted before the can be used in - email headers or bodies. If the \var{input_charset} is one of - them, this attribute will contain the name of the character set - output will be converted to. Otherwise, it will be \code{None}. - \end{datadesc} - - \begin{datadesc}{input_codec} - The name of the Python codec used to convert the \var{input_charset} to - Unicode. If no conversion codec is necessary, this attribute will be - \code{None}. - \end{datadesc} - - \begin{datadesc}{output_codec} - The name of the Python codec used to convert Unicode to the - \var{output_charset}. If no conversion codec is necessary, this - attribute will have the same value as the \var{input_codec}. - \end{datadesc} - - \class{Charset} instances also have the following methods: - - \begin{methoddesc}[Charset]{get_body_encoding}{} - Return the content transfer encoding used for body encoding. - - This is either the string \samp{quoted-printable} or \samp{base64} - depending on the encoding used, or it is a function, in which case you - should call the function with a single argument, the Message object - being encoded. The function should then set the - \mailheader{Content-Transfer-Encoding} header itself to whatever is - appropriate. - - Returns the string \samp{quoted-printable} if - \var{body_encoding} is \code{QP}, returns the string - \samp{base64} if \var{body_encoding} is \code{BASE64}, and returns the - string \samp{7bit} otherwise. - \end{methoddesc} - - \begin{methoddesc}{convert}{s} - Convert the string \var{s} from the \var{input_codec} to the - \var{output_codec}. - \end{methoddesc} - - \begin{methoddesc}{to_splittable}{s} - Convert a possibly multibyte string to a safely splittable format. - \var{s} is the string to split. - - Uses the \var{input_codec} to try and convert the string to Unicode, - so it can be safely split on character boundaries (even for multibyte - characters). - - Returns the string as-is if it isn't known how to convert \var{s} to - Unicode with the \var{input_charset}. - - Characters that could not be converted to Unicode will be replaced - with the Unicode replacement character \character{U+FFFD}. - \end{methoddesc} - - \begin{methoddesc}{from_splittable}{ustr\optional{, to_output}} - Convert a splittable string back into an encoded string. \var{ustr} - is a Unicode string to ``unsplit''. - - This method uses the proper codec to try and convert the string from - Unicode back into an encoded format. Return the string as-is if it is - not Unicode, or if it could not be converted from Unicode. - - Characters that could not be converted from Unicode will be replaced - with an appropriate character (usually \character{?}). - - If \var{to_output} is \code{True} (the default), uses - \var{output_codec} to convert to an - encoded format. If \var{to_output} is \code{False}, it uses - \var{input_codec}. - \end{methoddesc} - - \begin{methoddesc}{get_output_charset}{} - Return the output character set. - - This is the \var{output_charset} attribute if that is not \code{None}, - otherwise it is \var{input_charset}. - \end{methoddesc} - - \begin{methoddesc}{encoded_header_len}{} - Return the length of the encoded header string, properly calculating - for quoted-printable or base64 encoding. - \end{methoddesc} - - \begin{methoddesc}{header_encode}{s\optional{, convert}} - Header-encode the string \var{s}. - - If \var{convert} is \code{True}, the string will be converted from the - input charset to the output charset automatically. This is not useful - for multibyte character sets, which have line length issues (multibyte - characters must be split on a character, not a byte boundary); use the - higher-level \class{Header} class to deal with these issues (see - \refmodule{email.Header}). \var{convert} defaults to \code{False}. - - The type of encoding (base64 or quoted-printable) will be based on - the \var{header_encoding} attribute. - \end{methoddesc} - - \begin{methoddesc}{body_encode}{s\optional{, convert}} - Body-encode the string \var{s}. - - If \var{convert} is \code{True} (the default), the string will be - converted from the input charset to output charset automatically. - Unlike \method{header_encode()}, there are no issues with byte - boundaries and multibyte charsets in email bodies, so this is usually - pretty safe. - - The type of encoding (base64 or quoted-printable) will be based on - the \var{body_encoding} attribute. - \end{methoddesc} - - The \class{Charset} class also provides a number of methods to support - standard operations and built-in functions. - - \begin{methoddesc}[Charset]{__str__}{} - Returns \var{input_charset} as a string coerced to lower case. - \end{methoddesc} - - \begin{methoddesc}[Charset]{__eq__}{other} - This method allows you to compare two \class{Charset} instances for equality. - \end{methoddesc} - - \begin{methoddesc}[Header]{__ne__}{other} - This method allows you to compare two \class{Charset} instances for inequality. - \end{methoddesc} - - The \module{email.Charset} module also provides the following - functions for adding new entries to the global character set, alias, - and codec registries: - - \begin{funcdesc}{add_charset}{charset\optional{, header_enc\optional{, - body_enc\optional{, output_charset}}}} - Add character properties to the global registry. - - \var{charset} is the input character set, and must be the canonical - name of a character set. - - Optional \var{header_enc} and \var{body_enc} is either - \code{Charset.QP} for quoted-printable, \code{Charset.BASE64} for - base64 encoding, \code{Charset.SHORTEST} for the shortest of qp or - base64 encoding, or \code{None} for no encoding. \code{SHORTEST} is - only valid for \var{header_enc}. It describes how message headers and - message bodies in the input charset are to be encoded. Default is no - encoding. - - Optional \var{output_charset} is the character set that the output - should be in. Conversions will proceed from input charset, to - Unicode, to the output charset when the method - \method{Charset.convert()} is called. The default is to output in the - same character set as the input. - - Both \var{input_charset} and \var{output_charset} must have Unicode - codec entries in the module's character set-to-codec mapping; use - \function{add_codec(charset, codecname)} to add codecs the module does - not know about. See the \refmodule{codecs} module's documentation for - more information. - - The global character set registry is kept in the module global - dictionary \code{CHARSETS}. - \end{funcdesc} - - \begin{funcdesc}{add_alias}{alias, canonical} - Add a character set alias. \var{alias} is the alias name, - e.g. \code{latin-1}. \var{canonical} is the character set's canonical - name, e.g. \code{iso-8859-1}. - - The global charset alias registry is kept in the module global - dictionary \code{ALIASES}. - \end{funcdesc} - - \begin{funcdesc}{add_codec}{charset, codecname} - Add a codec that map characters in the given character set to and from - Unicode. - - \var{charset} is the canonical name of a character set. - \var{codecname} is the name of a Python codec, as appropriate for the - second argument to the \function{unicode()} built-in, or to the - \method{encode()} method of a Unicode string. \end{funcdesc} --- 165,167 ---- Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** emailmessage.tex 1 Oct 2002 01:05:52 -0000 1.6 --- emailmessage.tex 1 Oct 2002 04:33:16 -0000 1.7 *************** *** 34,40 **** \begin{methoddesc}[Message]{as_string}{\optional{unixfrom}} ! Return the entire formatted message as a string. Optional ! \var{unixfrom}, when true, specifies to include the \emph{Unix-From} ! envelope header; it defaults to \code{False}. \end{methoddesc} --- 34,40 ---- \begin{methoddesc}[Message]{as_string}{\optional{unixfrom}} ! Return the entire message flatten as a string. When optional ! \var{unixfrom} is \code{True}, the envelope header is included in the ! returned string. \var{unixfrom} defaults to \code{False}. \end{methoddesc} *************** *** 60,64 **** \begin{methoddesc}[Message]{attach}{payload} ! Add the given payload to the current payload, which must be \code{None} or a list of \class{Message} objects before the call. After the call, the payload will always be a list of \class{Message} --- 60,64 ---- \begin{methoddesc}[Message]{attach}{payload} ! Add the given \var{payload} to the current payload, which must be \code{None} or a list of \class{Message} objects before the call. After the call, the payload will always be a list of \class{Message} *************** *** 96,100 **** Set the entire message object's payload to \var{payload}. It is the client's responsibility to ensure the payload invariants. Optional ! \var{charset} sets the message's default character set (see \method{set_charset()} for details. --- 96,100 ---- Set the entire message object's payload to \var{payload}. It is the client's responsibility to ensure the payload invariants. Optional ! \var{charset} sets the message's default character set; see \method{set_charset()} for details. *************** *** 104,108 **** \begin{methoddesc}[Message]{set_charset}{charset} Set the character set of the payload to \var{charset}, which can ! either be a \class{Charset} instance (see \refmodule{email.Charset}, a string naming a character set, or \code{None}. If it is a string, it will be converted to a --- 104,108 ---- \begin{methoddesc}[Message]{set_charset}{charset} Set the character set of the payload to \var{charset}, which can ! either be a \class{Charset} instance (see \refmodule{email.Charset}), a string naming a character set, or \code{None}. If it is a string, it will be converted to a *************** *** 129,140 **** The following methods implement a mapping-like interface for accessing ! the message object's \rfc{2822} headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by ! \method{keys()}, but in a \class{Message} object, there is an explicit ! order. These semantic differences are intentional and are biased ! toward maximal convenience. Note that in all cases, any envelope header present in the message is --- 129,144 ---- The following methods implement a mapping-like interface for accessing ! the message's \rfc{2822} headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by ! \method{keys()}, but in a \class{Message} object, headers are always ! returned in the order they appeared in the original message, or were ! added to the message later. Any header deleted and then re-added are ! always appended to the end of the header list. ! ! These semantic differences are intentional and are biased toward ! maximal convenience. Note that in all cases, any envelope header present in the message is *************** *** 176,181 **** with the same name. If you want to ensure that the new header is the only one present in the message with field name ! \var{name}, first use \method{__delitem__()} to delete all named ! fields, e.g.: \begin{verbatim} --- 180,184 ---- with the same name. If you want to ensure that the new header is the only one present in the message with field name ! \var{name}, delete the field first, e.g.: \begin{verbatim} *************** *** 197,221 **** \begin{methoddesc}[Message]{keys}{} ! Return a list of all the message's header field names. These keys ! will be sorted in the order in which they appeared in the original ! message, or were added to the message and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} \begin{methoddesc}[Message]{values}{} ! Return a list of all the message's field values. These will be sorted ! in the order in which they appeared in the original message, or were ! added to the message, and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} \begin{methoddesc}[Message]{items}{} Return a list of 2-tuples containing all the message's field headers ! and values. These will be sorted in the order in which they appeared ! in the original message, or were added to the message, and may contain ! duplicates. Any fields deleted and then subsequently re-added are ! always appended to the end of the header list. \end{methoddesc} --- 200,213 ---- \begin{methoddesc}[Message]{keys}{} ! Return a list of all the message's header field names. \end{methoddesc} \begin{methoddesc}[Message]{values}{} ! Return a list of all the message's field values. \end{methoddesc} \begin{methoddesc}[Message]{items}{} Return a list of 2-tuples containing all the message's field headers ! and values. \end{methoddesc} *************** *** 229,237 **** \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} ! Return a list of all the values for the field named \var{name}. These ! will be sorted in the order in which they appeared in the original ! message, or were added to the message. Any fields deleted and then ! subsequently re-added are always appended to the end of the list. ! If there are no such named headers in the message, \var{failobj} is returned (defaults to \code{None}). --- 221,225 ---- \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} ! Return a list of all the values for the field named \var{name}. If there are no such named headers in the message, \var{failobj} is returned (defaults to \code{None}). *************** *** 352,359 **** value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \samp{(CHARSET, LANGUAGE, VALUE)}, where \var{LANGUAGE} may be the empty string. Your application should be prepared to deal with ! 3-tuple return values, which it can convert the parameter to a Unicode ! string like so: \begin{verbatim} --- 340,347 ---- value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may be the empty string. Your application should be prepared to deal with ! 3-tuple return values, which it can convert to a Unicode string like ! so: \begin{verbatim} *************** *** 364,368 **** In any case, the parameter value (either the returned string, or the ! \var{VALUE} item in the 3-tuple) is always unquoted, unless \var{unquote} is set to \code{False}. --- 352,356 ---- In any case, the parameter value (either the returned string, or the ! \code{VALUE} item in the 3-tuple) is always unquoted, unless \var{unquote} is set to \code{False}. *************** *** 399,403 **** place without the parameter or its value. All values will be quoted as necessary unless \var{requote} is \code{False} (the default is ! \code{True}). Optional \var{header} specifies an alterative to \mailheader{Content-Type}. --- 387,391 ---- place without the parameter or its value. All values will be quoted as necessary unless \var{requote} is \code{False} (the default is ! \code{True}). Optional \var{header} specifies an alternative to \mailheader{Content-Type}. *************** *** 418,423 **** An alternative header can be specified in the \var{header} argument. ! When the \mailheader{Content-Type} header is set, we'll always also ! add a \mailheader{MIME-Version} header. \versionadded{2.2.2} --- 406,411 ---- An alternative header can be specified in the \var{header} argument. ! When the \mailheader{Content-Type} header is set a ! \mailheader{MIME-Version} header is also added. \versionadded{2.2.2} *************** *** 441,449 **** \begin{methoddesc}[Message]{set_boundary}{boundary} ! Set the \code{boundary} parameter of the \mailheader{Content-Type} header ! to \var{boundary}. \method{set_boundary()} will always quote ! \var{boundary} so you should not quote it yourself. A ! \exception{HeaderParseError} is raised if the message object has no ! \mailheader{Content-Type} header. Note that using this method is subtly different than deleting the old --- 429,436 ---- \begin{methoddesc}[Message]{set_boundary}{boundary} ! Set the \code{boundary} parameter of the \mailheader{Content-Type} ! header to \var{boundary}. \method{set_boundary()} will always quote ! \var{boundary} if necessary. A \exception{HeaderParseError} is raised ! if the message object has no \mailheader{Content-Type} header. Note that using this method is subtly different than deleting the old *************** *** 460,466 **** header has no \code{charset} parameter, \var{failobj} is returned. ! Note that this method differs from \method{get_charset} which returns ! the \class{Charset} instance for the default encoding of the message ! body. \versionadded{2.2.2} --- 447,453 ---- header has no \code{charset} parameter, \var{failobj} is returned. ! Note that this method differs from \method{get_charset()} which ! returns the \class{Charset} instance for the default encoding of the ! message body. \versionadded{2.2.2} *************** *** 485,497 **** used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use ! \method{walk()} as the iterator in a \code{for ... in} loop; each iteration returns the next subpart. ! Here's an example that prints the MIME type of every part of a message ! object tree: \begin{verbatim} >>> for part in msg.walk(): ! >>> print part.get_type('text/plain') multipart/report text/plain --- 472,484 ---- used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use ! \method{walk()} as the iterator in a \code{for} loop; each iteration returns the next subpart. ! Here's an example that prints the MIME type of every part of a ! multipart message structure: \begin{verbatim} >>> for part in msg.walk(): ! >>> print part.get_content_type() multipart/report text/plain Index: emailmimebase.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmimebase.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** emailmimebase.tex 1 Oct 2002 01:05:52 -0000 1.1 --- emailmimebase.tex 1 Oct 2002 04:33:16 -0000 1.2 *************** *** 1,9 **** Ordinarily, you get a message object structure by passing a file or ! some text to a parser, which parses the text and returns the root of ! the message object structure. However you can also build a complete ! object structure from scratch, or even individual \class{Message} ! objects by hand. In fact, you can also take an existing structure and ! add new \class{Message} objects, move them around, etc. This makes a ! very convenient interface for slicing-and-dicing MIME messages. You can create a new object structure by creating \class{Message} --- 1,9 ---- Ordinarily, you get a message object structure by passing a file or ! some text to a parser, which parses the text and returns the root ! message object. However you can also build a complete message ! structure from scratch, or even individual \class{Message} objects by ! hand. In fact, you can also take an existing structure and add new ! \class{Message} objects, move them around, etc. This makes a very ! convenient interface for slicing-and-dicing MIME messages. You can create a new object structure by creating \class{Message} *************** *** 100,104 **** change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the \refmodule{email.Encoders} module for a list of the built-in encoders. --- 100,104 ---- change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is base64. See the \refmodule{email.Encoders} module for a list of the built-in encoders. *************** *** 125,129 **** change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the \refmodule{email.Encoders} module for a list of the built-in encoders. --- 125,129 ---- change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is base64. See the \refmodule{email.Encoders} module for a list of the built-in encoders. Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** emailparser.tex 1 Oct 2002 01:05:52 -0000 1.6 --- emailparser.tex 1 Oct 2002 04:33:16 -0000 1.7 *************** *** 55,59 **** problems, the \class{Parser} will raise a \exception{MessageParseError}. However, when lax parsing is enabled, ! the \class{Parser} will attempt to workaround such broken formatting to produce a usable message structure (this doesn't mean \exception{MessageParseError}s are never raised; some ill-formatted --- 55,59 ---- problems, the \class{Parser} will raise a \exception{MessageParseError}. However, when lax parsing is enabled, ! the \class{Parser} will attempt to work around such broken formatting to produce a usable message structure (this doesn't mean \exception{MessageParseError}s are never raised; some ill-formatted *************** *** 74,85 **** The text contained in \var{fp} must be formatted as a block of \rfc{2822} ! style headers and header continuation lines, optionally preceeded by a envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). ! Optional \var{headersonly} is a flag specifying whether to stop ! parsing after reading the headers or not. The default is \code{False}, ! meaning it parses the entire contents of the file. \versionchanged[The \var{headersonly} flag was added]{2.2.2} --- 74,83 ---- The text contained in \var{fp} must be formatted as a block of \rfc{2822} ! style headers and header continuation lines, optionally preceded by a envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). ! Optional \var{headersonly} is as with the \method{parse()} method. \versionchanged[The \var{headersonly} flag was added]{2.2.2} *************** *** 105,109 **** \begin{funcdesc}{message_from_string}{s\optional{, _class\optional{, strict}}} ! Return a message object tree from a string. This is exactly equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} and \var{strict} are interpreted as with the \class{Parser} class constructor. --- 103,107 ---- \begin{funcdesc}{message_from_string}{s\optional{, _class\optional{, strict}}} ! Return a message object structure from a string. This is exactly equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} and \var{strict} are interpreted as with the \class{Parser} class constructor. *************** *** 113,119 **** \begin{funcdesc}{message_from_file}{fp\optional{, _class\optional{, strict}}} ! Return a message object tree from an open file object. This is exactly ! equivalent to \code{Parser().parse(fp)}. Optional \var{_class} and ! \var{strict} are interpreted as with the \class{Parser} class constructor. \versionchanged[The \var{strict} flag was added]{2.2.2} --- 111,118 ---- \begin{funcdesc}{message_from_file}{fp\optional{, _class\optional{, strict}}} ! Return a message object structure tree from an open file object. This ! is exactly equivalent to \code{Parser().parse(fp)}. Optional ! \var{_class} and \var{strict} are interpreted as with the ! \class{Parser} class constructor. \versionchanged[The \var{strict} flag was added]{2.2.2} *************** *** 139,145 **** \item All \mimetype{multipart} type messages will be parsed as a container message object with a list of sub-message objects for ! their payload. These messages will return \code{True} for ! \method{is_multipart()} and their \method{get_payload()} method ! will return a list of \class{Message} instances. \item Most messages with a content type of \mimetype{message/*} (e.g. \mimetype{message/deliver-status} and --- 138,145 ---- \item All \mimetype{multipart} type messages will be parsed as a container message object with a list of sub-message objects for ! their payload. The outer container message will return ! \code{True} for \method{is_multipart()} and their ! \method{get_payload()} method will return the list of ! \class{Message} subparts. \item Most messages with a content type of \mimetype{message/*} (e.g. \mimetype{message/deliver-status} and Index: emailutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailutil.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** emailutil.tex 1 Oct 2002 01:05:52 -0000 1.7 --- emailutil.tex 1 Oct 2002 04:33:16 -0000 1.8 *************** *** 7,11 **** \begin{funcdesc}{quote}{str} Return a new string with backslashes in \var{str} replaced by two ! backslashes and double quotes replaced by backslash-double quote. \end{funcdesc} --- 7,11 ---- \begin{funcdesc}{quote}{str} Return a new string with backslashes in \var{str} replaced by two ! backslashes, and double quotes replaced by backslash-double quote. \end{funcdesc} *************** *** 86,90 **** \begin{funcdesc}{formatdate}{\optional{timeval\optional{, localtime}}} ! Returns a date string as per Internet standard \rfc{2822}, e.g.: \begin{verbatim} --- 86,90 ---- \begin{funcdesc}{formatdate}{\optional{timeval\optional{, localtime}}} ! Returns a date string as per \rfc{2822}, e.g.: \begin{verbatim} From barry@users.sourceforge.net Tue Oct 1 05:48:09 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 30 Sep 2002 21:48:09 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib email.tex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21417 Modified Files: email.tex Log Message: Cleaned up the examples. Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** email.tex 1 Oct 2002 04:33:12 -0000 1.13 --- email.tex 1 Oct 2002 04:48:06 -0000 1.14 *************** *** 290,302 **** import smtplib ! # Here are the email pacakge modules we'll need ! from email import Encoders from email.MIMEText import MIMEText ! # Open a plain text file for reading ! fp = open(textfile) ! # Create a text/plain message, using Quoted-Printable encoding for non-ASCII ! # characters. ! msg = MIMEText(fp.read(), _encoder=Encoders.encode_quopri) fp.close() --- 290,301 ---- import smtplib ! # Import the email modules we'll need from email.MIMEText import MIMEText ! # Open a plain text file for reading. For this example, assume that ! # the text file contains only ASCII characters. ! fp = open(textfile, 'rb') ! # Create a text/plain message ! msg = MIMEText(fp.read()) fp.close() *************** *** 307,320 **** msg['To'] = you ! # Send the message via our own SMTP server. Use msg.as_string() with ! # unixfrom=0 so as not to confuse SMTP. s = smtplib.SMTP() s.connect() ! s.sendmail(me, [you], msg.as_string(0)) s.close() \end{verbatim} Here's an example of how to send a MIME message containing a bunch of ! family pictures: \begin{verbatim} --- 306,319 ---- msg['To'] = you ! # Send the message via our own SMTP server, but don't include the ! # envelope header. s = smtplib.SMTP() s.connect() ! s.sendmail(me, [you], msg.as_string()) s.close() \end{verbatim} Here's an example of how to send a MIME message containing a bunch of ! family pictures that may be residing in a directory: \begin{verbatim} *************** *** 324,336 **** # Here are the email pacakge modules we'll need from email.MIMEImage import MIMEImage ! from email.MIMEBase import MIMEBase COMMASPACE = ', ' # Create the container (outer) email message. # me == the sender's email address # family = the list of all recipients' email addresses - msg = MIMEBase('multipart', 'mixed') - msg['Subject'] = 'Our family reunion' msg['From'] = me msg['To'] = COMMASPACE.join(family) --- 323,335 ---- # Here are the email pacakge modules we'll need from email.MIMEImage import MIMEImage ! from email.MIMEMultipart import MIMEMultipart COMMASPACE = ', ' # Create the container (outer) email message. + msg = MIMEMultipart() + msg['Subject'] = 'Our family reunion' # me == the sender's email address # family = the list of all recipients' email addresses msg['From'] = me msg['To'] = COMMASPACE.join(family) *************** *** 341,345 **** # Assume we know that the image files are all in PNG format for file in pngfiles: ! # Open the files in binary mode. Let the MIMEIMage class automatically # guess the specific image type. fp = open(file, 'rb') --- 340,344 ---- # Assume we know that the image files are all in PNG format for file in pngfiles: ! # Open the files in binary mode. Let the MIMEImage class automatically # guess the specific image type. fp = open(file, 'rb') *************** *** 351,355 **** s = smtplib.SMTP() s.connect() ! s.sendmail(me, family, msg.as_string(unixfrom=0)) s.close() \end{verbatim} --- 350,354 ---- s = smtplib.SMTP() s.connect() ! s.sendmail(me, family, msg.as_string()) s.close() \end{verbatim} *************** *** 395,399 **** from email.Message import Message from email.MIMEAudio import MIMEAudio ! from email.MIMEBase import MIMEBase from email.MIMEImage import MIMEImage from email.MIMEText import MIMEText --- 394,398 ---- from email.Message import Message from email.MIMEAudio import MIMEAudio ! from email.MIMEMultipart import MIMEMultipart from email.MIMEImage import MIMEImage from email.MIMEText import MIMEText *************** *** 429,433 **** # Create the enclosing (outer) message ! outer = MIMEBase('multipart', 'mixed') outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = COMMASPACE.join(recips) --- 428,432 ---- # Create the enclosing (outer) message ! outer = MIMEMultipart() outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = COMMASPACE.join(recips) *************** *** 441,447 **** if not os.path.isfile(path): continue ! # Guess the Content-Type: based on the file's extension. Encoding # will be ignored, although we should check for simple things like ! # gzip'd or compressed files ctype, encoding = mimetypes.guess_type(path) if ctype is None or encoding is not None: --- 440,446 ---- if not os.path.isfile(path): continue ! # Guess the content type based on the file's extension. Encoding # will be ignored, although we should check for simple things like ! # gzip'd or compressed files. ctype, encoding = mimetypes.guess_type(path) if ctype is None or encoding is not None: *************** *** 466,470 **** fp = open(path, 'rb') msg = MIMEBase(maintype, subtype) ! msg.add_payload(fp.read()) fp.close() # Encode the payload using Base64 --- 465,469 ---- fp = open(path, 'rb') msg = MIMEBase(maintype, subtype) ! msg.set_payload(fp.read()) fp.close() # Encode the payload using Base64 *************** *** 474,485 **** outer.attach(msg) - fp = open('/tmp/debug.pck', 'w') - import cPickle - cPickle.dump(outer, fp) - fp.close() # Now send the message s = smtplib.SMTP() s.connect() ! s.sendmail(sender, recips, outer.as_string(0)) s.close() --- 473,480 ---- outer.attach(msg) # Now send the message s = smtplib.SMTP() s.connect() ! s.sendmail(sender, recips, outer.as_string()) s.close() *************** *** 557,561 **** for part in msg.walk(): # multipart/* are just containers ! if part.get_main_type() == 'multipart': continue # Applications should really sanitize the given filename so that an --- 552,556 ---- for part in msg.walk(): # multipart/* are just containers ! if part.get_content_maintype() == 'multipart': continue # Applications should really sanitize the given filename so that an From fdrake@users.sourceforge.net Tue Oct 1 15:17:20 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 07:17:20 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib email-dir.py,NONE,1.1 email-mime.py,NONE,1.1 email-simple.py,NONE,1.1 email-unpack.py,NONE,1.1 email.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv9580 Modified Files: email.tex Added Files: email-dir.py email-mime.py email-simple.py email-unpack.py Log Message: Split the long email package examples into separate files and use \verbatiminput instead of the verbatim environment -- this does the "right thing" regarding page breaks in long examples for the typeset formats, and has nice benefits for the HTML version as well. --- NEW FILE: email-dir.py --- #!/usr/bin/env python """Send the contents of a directory as a MIME message. Usage: dirmail [options] from to [to ...]* Options: -h / --help Print this message and exit. -d directory --directory=directory Mail the contents of the specified directory, otherwise use the current directory. Only the regular files in the directory are sent, and we don't recurse to subdirectories. `from' is the email address of the sender of the message. `to' is the email address of the recipient of the message, and multiple recipients may be given. The email is sent by forwarding to your local SMTP server, which then does the normal delivery process. Your local machine must be running an SMTP server. """ import sys import os import getopt import smtplib # For guessing MIME type based on file name extension import mimetypes from email import Encoders from email.Message import Message from email.MIMEAudio import MIMEAudio from email.MIMEMultipart import MIMEMultipart from email.MIMEImage import MIMEImage from email.MIMEText import MIMEText COMMASPACE = ', ' def usage(code, msg=''): print >> sys.stderr, __doc__ if msg: print >> sys.stderr, msg sys.exit(code) def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) except getopt.error, msg: usage(1, msg) dir = os.curdir for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--directory'): dir = arg if len(args) < 2: usage(1) sender = args[0] recips = args[1:] # Create the enclosing (outer) message outer = MIMEMultipart() outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = COMMASPACE.join(recips) outer['From'] = sender outer.preamble = 'You will not see this in a MIME-aware mail reader.\n' # To guarantee the message ends with a newline outer.epilogue = '' for filename in os.listdir(dir): path = os.path.join(dir, filename) if not os.path.isfile(path): continue # Guess the content type based on the file's extension. Encoding # will be ignored, although we should check for simple things like # gzip'd or compressed files. ctype, encoding = mimetypes.guess_type(path) if ctype is None or encoding is not None: # No guess could be made, or the file is encoded (compressed), so # use a generic bag-of-bits type. ctype = 'application/octet-stream' maintype, subtype = ctype.split('/', 1) if maintype == 'text': fp = open(path) # Note: we should handle calculating the charset msg = MIMEText(fp.read(), _subtype=subtype) fp.close() elif maintype == 'image': fp = open(path, 'rb') msg = MIMEImage(fp.read(), _subtype=subtype) fp.close() elif maintype == 'audio': fp = open(path, 'rb') msg = MIMEAudio(fp.read(), _subtype=subtype) fp.close() else: fp = open(path, 'rb') msg = MIMEBase(maintype, subtype) msg.set_payload(fp.read()) fp.close() # Encode the payload using Base64 Encoders.encode_base64(msg) # Set the filename parameter msg.add_header('Content-Disposition', 'attachment', filename=filename) outer.attach(msg) # Now send the message s = smtplib.SMTP() s.connect() s.sendmail(sender, recips, outer.as_string()) s.close() if __name__ == '__main__': main() --- NEW FILE: email-mime.py --- # Import smtplib for the actual sending function import smtplib # Here are the email pacakge modules we'll need from email.MIMEImage import MIMEImage from email.MIMEMultipart import MIMEMultipart COMMASPACE = ', ' # Create the container (outer) email message. msg = MIMEMultipart() msg['Subject'] = 'Our family reunion' # me == the sender's email address # family = the list of all recipients' email addresses msg['From'] = me msg['To'] = COMMASPACE.join(family) msg.preamble = 'Our family reunion' # Guarantees the message ends in a newline msg.epilogue = '' # Assume we know that the image files are all in PNG format for file in pngfiles: # Open the files in binary mode. Let the MIMEImage class automatically # guess the specific image type. fp = open(file, 'rb') img = MIMEImage(fp.read()) fp.close() msg.attach(img) # Send the email via our own SMTP server. s = smtplib.SMTP() s.connect() s.sendmail(me, family, msg.as_string()) s.close() --- NEW FILE: email-simple.py --- # Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.MIMEText import MIMEText # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. fp = open(textfile, 'rb') # Create a text/plain message msg = MIMEText(fp.read()) fp.close() # me == the sender's email address # you == the recipient's email address msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP() s.connect() s.sendmail(me, [you], msg.as_string()) s.close() --- NEW FILE: email-unpack.py --- #!/usr/bin/env python """Unpack a MIME message into a directory of files. Usage: unpackmail [options] msgfile Options: -h / --help Print this message and exit. -d directory --directory=directory Unpack the MIME message into the named directory, which will be created if it doesn't already exist. msgfile is the path to the file containing the MIME message. """ import sys import os import getopt import errno import mimetypes import email def usage(code, msg=''): print >> sys.stderr, __doc__ if msg: print >> sys.stderr, msg sys.exit(code) def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) except getopt.error, msg: usage(1, msg) dir = os.curdir for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--directory'): dir = arg try: msgfile = args[0] except IndexError: usage(1) try: os.mkdir(dir) except OSError, e: # Ignore directory exists error if e.errno <> errno.EEXIST: raise fp = open(msgfile) msg = email.message_from_file(fp) fp.close() counter = 1 for part in msg.walk(): # multipart/* are just containers if part.get_content_maintype() == 'multipart': continue # Applications should really sanitize the given filename so that an # email message can't be used to overwrite important files filename = part.get_filename() if not filename: ext = mimetypes.guess_extension(part.get_type()) if not ext: # Use a generic bag-of-bits extension ext = '.bin' filename = 'part-%03d%s' % (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') fp.write(part.get_payload(decode=1)) fp.close() if __name__ == '__main__': main() Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** email.tex 1 Oct 2002 04:48:06 -0000 1.14 --- email.tex 1 Oct 2002 14:17:10 -0000 1.15 *************** *** 286,356 **** First, let's see how to create and send a simple text message: ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Import the email modules we'll need ! from email.MIMEText import MIMEText ! ! # Open a plain text file for reading. For this example, assume that ! # the text file contains only ASCII characters. ! fp = open(textfile, 'rb') ! # Create a text/plain message ! msg = MIMEText(fp.read()) ! fp.close() ! ! # me == the sender's email address ! # you == the recipient's email address ! msg['Subject'] = 'The contents of %s' % textfile ! msg['From'] = me ! msg['To'] = you ! ! # Send the message via our own SMTP server, but don't include the ! # envelope header. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, [you], msg.as_string()) ! s.close() ! \end{verbatim} Here's an example of how to send a MIME message containing a bunch of family pictures that may be residing in a directory: ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Here are the email pacakge modules we'll need ! from email.MIMEImage import MIMEImage ! from email.MIMEMultipart import MIMEMultipart ! ! COMMASPACE = ', ' ! ! # Create the container (outer) email message. ! msg = MIMEMultipart() ! msg['Subject'] = 'Our family reunion' ! # me == the sender's email address ! # family = the list of all recipients' email addresses ! msg['From'] = me ! msg['To'] = COMMASPACE.join(family) ! msg.preamble = 'Our family reunion' ! # Guarantees the message ends in a newline ! msg.epilogue = '' ! ! # Assume we know that the image files are all in PNG format ! for file in pngfiles: ! # Open the files in binary mode. Let the MIMEImage class automatically ! # guess the specific image type. ! fp = open(file, 'rb') ! img = MIMEImage(fp.read()) ! fp.close() ! msg.attach(img) ! ! # Send the email via our own SMTP server. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, family, msg.as_string()) ! s.close() ! \end{verbatim} Here's an example\footnote{Thanks to Matthew Dixon Cowles for the --- 286,295 ---- First, let's see how to create and send a simple text message: ! \verbatiminput{email-simple.py} Here's an example of how to send a MIME message containing a bunch of family pictures that may be residing in a directory: ! \verbatiminput{email-mime.py} Here's an example\footnote{Thanks to Matthew Dixon Cowles for the *************** *** 358,573 **** of a directory as an email message: ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Send the contents of a directory as a MIME message. ! ! Usage: dirmail [options] from to [to ...]* ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Mail the contents of the specified directory, otherwise use the ! current directory. Only the regular files in the directory are sent, ! and we don't recurse to subdirectories. ! ! `from' is the email address of the sender of the message. ! ! `to' is the email address of the recipient of the message, and multiple ! recipients may be given. ! ! The email is sent by forwarding to your local SMTP server, which then does the ! normal delivery process. Your local machine must be running an SMTP server. ! """ ! ! import sys ! import os ! import getopt ! import smtplib ! # For guessing MIME type based on file name extension ! import mimetypes ! ! from email import Encoders ! from email.Message import Message ! from email.MIMEAudio import MIMEAudio ! from email.MIMEMultipart import MIMEMultipart ! from email.MIMEImage import MIMEImage ! from email.MIMEText import MIMEText ! ! COMMASPACE = ', ' ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! if len(args) < 2: ! usage(1) ! ! sender = args[0] ! recips = args[1:] ! ! # Create the enclosing (outer) message ! outer = MIMEMultipart() ! outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) ! outer['To'] = COMMASPACE.join(recips) ! outer['From'] = sender ! outer.preamble = 'You will not see this in a MIME-aware mail reader.\n' ! # To guarantee the message ends with a newline ! outer.epilogue = '' ! ! for filename in os.listdir(dir): ! path = os.path.join(dir, filename) ! if not os.path.isfile(path): ! continue ! # Guess the content type based on the file's extension. Encoding ! # will be ignored, although we should check for simple things like ! # gzip'd or compressed files. ! ctype, encoding = mimetypes.guess_type(path) ! if ctype is None or encoding is not None: ! # No guess could be made, or the file is encoded (compressed), so ! # use a generic bag-of-bits type. ! ctype = 'application/octet-stream' ! maintype, subtype = ctype.split('/', 1) ! if maintype == 'text': ! fp = open(path) ! # Note: we should handle calculating the charset ! msg = MIMEText(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'image': ! fp = open(path, 'rb') ! msg = MIMEImage(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'audio': ! fp = open(path, 'rb') ! msg = MIMEAudio(fp.read(), _subtype=subtype) ! fp.close() ! else: ! fp = open(path, 'rb') ! msg = MIMEBase(maintype, subtype) ! msg.set_payload(fp.read()) ! fp.close() ! # Encode the payload using Base64 ! Encoders.encode_base64(msg) ! # Set the filename parameter ! msg.add_header('Content-Disposition', 'attachment', filename=filename) ! outer.attach(msg) ! ! # Now send the message ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(sender, recips, outer.as_string()) ! s.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} And finally, here's an example of how to unpack a MIME message like the one above, into a directory of files: ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Unpack a MIME message into a directory of files. ! ! Usage: unpackmail [options] msgfile ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Unpack the MIME message into the named directory, which will be ! created if it doesn't already exist. ! ! msgfile is the path to the file containing the MIME message. ! """ ! ! import sys ! import os ! import getopt ! import errno ! import mimetypes ! import email ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! try: ! msgfile = args[0] ! except IndexError: ! usage(1) ! ! try: ! os.mkdir(dir) ! except OSError, e: ! # Ignore directory exists error ! if e.errno <> errno.EEXIST: raise ! ! fp = open(msgfile) ! msg = email.message_from_file(fp) ! fp.close() ! ! counter = 1 ! for part in msg.walk(): ! # multipart/* are just containers ! if part.get_content_maintype() == 'multipart': ! continue ! # Applications should really sanitize the given filename so that an ! # email message can't be used to overwrite important files ! filename = part.get_filename() ! if not filename: ! ext = mimetypes.guess_extension(part.get_type()) ! if not ext: ! # Use a generic bag-of-bits extension ! ext = '.bin' ! filename = 'part-%03d%s' % (counter, ext) ! counter += 1 ! fp = open(os.path.join(dir, filename), 'wb') ! fp.write(part.get_payload(decode=1)) ! fp.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} --- 297,304 ---- of a directory as an email message: ! \verbatiminput{email-dir.py} And finally, here's an example of how to unpack a MIME message like the one above, into a directory of files: ! \verbatiminput{email-unpack.py} From fdrake@users.sourceforge.net Tue Oct 1 15:30:00 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 07:30:00 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15298 Modified Files: emailmessage.tex Log Message: Minor style nit for referring to other attributes of the same class from an attributes description. Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** emailmessage.tex 1 Oct 2002 04:33:16 -0000 1.7 --- emailmessage.tex 1 Oct 2002 14:29:58 -0000 1.8 *************** *** 40,44 **** \begin{methoddesc}[Message]{__str__}{} ! Equivalent to \method{aMessage.as_string(unixfrom=True)}. \end{methoddesc} --- 40,44 ---- \begin{methoddesc}[Message]{__str__}{} ! Equivalent to \method{as_string(unixfrom=True)}. \end{methoddesc} From fdrake@users.sourceforge.net Tue Oct 1 15:38:49 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 07:38:49 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib mimelib.tex,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18923 Added Files: mimelib.tex Log Message: Stub document for the stand-alone email package distribution. Barry, please add a reasonable abstract! --- NEW FILE: mimelib.tex --- \documentclass{howto} \title{email Package Reference} \author{Barry Warsaw} \authoraddress{\email{barry@zope.com}} \date{\today} \release{2.4} % software release, not documentation \setreleaseinfo{} % empty for final release \setshortversion{2.4} % major.minor only for software \begin{document} \maketitle \begin{abstract} The \module{email} package can be used to handle email. \end{abstract} % The ugly "%begin{latexonly}" pseudo-environment supresses the table % of contents for HTML generation. % %begin{latexonly} \tableofcontents %end{latexonly} \input{email} \end{document} From barry@users.sourceforge.net Tue Oct 1 16:13:33 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:13:33 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib mimelib.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv32371 Modified Files: mimelib.tex Log Message: Added an introduction. Index: mimelib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/mimelib.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mimelib.tex 1 Oct 2002 14:38:47 -0000 1.1 --- mimelib.tex 1 Oct 2002 15:13:29 -0000 1.2 *************** *** 15,19 **** \begin{abstract} ! The \module{email} package can be used to handle email. \end{abstract} --- 15,21 ---- \begin{abstract} ! The \module{email} package provides classes and utilities to create, ! parse, generate, and modify email messages, conforming to all the ! relevant email and MIME related RFCs. \end{abstract} *************** *** 24,27 **** --- 26,83 ---- \tableofcontents %end{latexonly} + + \section{Introduction} + The \module{email} package provides classes and utilities to create, + parse, generate, and modify email messages, conforming to all the + relevant email and MIME related RFCs. + + This document describes the current version of the \module{email} + package, which is available to Python programmers in a number of ways. + Python 2.2.2 and 2.3 come with \module{email} version 2, while earlier + versions of Python 2.2.x come with \module{email} version 1. Python + 2.1.x and earlier do not come with any version of the \module{email} + package. + + The \module{email} package is also available as a standalone distutils + package, and is compatible with Python 2.1.3 and beyond. Thus, if + you're using Python 2.1.3 you can download the standalone package and + install it in your \file{site-packages} directory. The standalone + \module{email} package is available on the + \ulink{SourceForge \module{mimelib} project}{http://mimelib.sf.net}. + + The documentation that follows was written for the Python project, so + if you're reading this as part of the standalone \module{email} + package documentation, there are a few notes to be aware of: + + \begin{itemize} + \item Deprecation and ``version added'' notes are relative to the + Python version a feature was added or deprecated. To find out + what version of the \module{email} package a particular item was + added, changed, or removed, refer to the package's + \ulink{\file{NEWS} file}{http://cvs.sf.net/cgi-bin/viewcvs.cgi/mimelib/mimelib/NEWS?rev=1.36&content-type=text/vnd.viewcvs-markup}. + + \item The code samples are written with Python 2.2 in mind. For + Python 2.1.3, some adjustments are necessary. For example, this + code snippet; + + \begin{verbatim} + if isinstance(s, str): + # ... + \end{verbatim} + + would need to be written this way in Python 2.1.3: + + \begin{verbatim} + from types import StringType + # ... + if isinstance(s, StringType): + # ... + \end{verbatim} + + \item If you're reading this documentation as part of the + standalone \module{email} package, some of the internal links to + other sections of the Python standard library may not resolve. + + \end{itemize} \input{email} From fdrake@users.sourceforge.net Tue Oct 1 16:20:22 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:20:22 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv2304/tools Modified Files: mkhowto Log Message: Change the default path to icons so that "mkhowto" does the "right thing" by default when used for 3rd-party docs. This requires the standard Python docs to specify a location, but they are a bit of a special case in sharing one set of icons among several documents. Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mkhowto 27 Aug 2002 16:34:54 -0000 1.32 --- mkhowto 1 Oct 2002 15:20:20 -0000 1.33 *************** *** 16,20 **** --link Specify the number of levels to include on each page. --split, -s Specify a section level for page splitting, default: %(max_split_depth)s. ! --iconserver, -i Specify location of icons (default: ../). --image-type Specify the image type to use in HTML output; values: gif (default), png. --- 16,20 ---- --link Specify the number of levels to include on each page. --split, -s Specify a section level for page splitting, default: %(max_split_depth)s. ! --iconserver, -i Specify location of icons (default: ./). --image-type Specify the image type to use in HTML output; values: gif (default), png. *************** *** 94,98 **** discard_temps = 1 have_temps = 0 ! icon_server = None image_type = "gif" logging = 0 --- 94,98 ---- discard_temps = 1 have_temps = 0 ! icon_server = "." image_type = "gif" logging = 0 From fdrake@users.sourceforge.net Tue Oct 1 16:20:22 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:20:22 -0700 Subject: [Python-checkins] python/dist/src/Doc/perl l2hinit.perl,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv2304/perl Modified Files: l2hinit.perl Log Message: Change the default path to icons so that "mkhowto" does the "right thing" by default when used for 3rd-party docs. This requires the standard Python docs to specify a location, but they are a bit of a special case in sharing one set of icons among several documents. Index: l2hinit.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** l2hinit.perl 23 May 2002 17:59:16 -0000 1.63 --- l2hinit.perl 1 Oct 2002 15:20:19 -0000 1.64 *************** *** 18,22 **** $SHOW_SECTION_NUMBERS = 1; ! $ICONSERVER = '../icons'; $IMAGE_TYPE = 'gif'; --- 18,22 ---- $SHOW_SECTION_NUMBERS = 1; ! $ICONSERVER = '.'; $IMAGE_TYPE = 'gif'; From fdrake@users.sourceforge.net Tue Oct 1 16:20:21 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:20:21 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.245,1.246 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv2304 Modified Files: Makefile Log Message: Change the default path to icons so that "mkhowto" does the "right thing" by default when used for 3rd-party docs. This requires the standard Python docs to specify a location, but they are a bit of a special case in sharing one set of icons among several documents. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** Makefile 9 Aug 2002 20:20:50 -0000 1.245 --- Makefile 1 Oct 2002 15:20:18 -0000 1.246 *************** *** 74,81 **** --- 74,83 ---- MKDVI= $(PYTHON) ../tools/mkhowto --paper=$(PAPER) --dvi MKHTML= $(PYTHON) tools/mkhowto --html --about html/stdabout.dat \ + --iconserver ../icons \ --address $(PYTHONDOCS) --up-link ../index.html \ --up-title "Python Documentation Index" \ --global-module-index "../modindex.html" --dvips-safe MKISILOHTML=$(PYTHON) tools/mkhowto --html --about html/stdabout.dat \ + --iconserver ../icons \ --l2h-init perl/isilo.perl --numeric --split 1 \ --dvips-safe From fdrake@users.sourceforge.net Tue Oct 1 16:24:06 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:24:06 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv3668 Modified Files: mkhowto Log Message: Include the --dir argument in the help text. Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** mkhowto 1 Oct 2002 15:20:20 -0000 1.33 --- mkhowto 1 Oct 2002 15:24:03 -0000 1.34 *************** *** 14,17 **** --- 14,18 ---- HTML options: --address, -a Specify an address for page footers. + --dir Specify the directory for HTML output. --link Specify the number of levels to include on each page. --split, -s Specify a section level for page splitting, default: %(max_split_depth)s. From barry@users.sourceforge.net Tue Oct 1 16:29:11 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:29:11 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib email.tex,1.15,1.16 emailgenerator.tex,1.5,1.6 emailparser.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5163 Modified Files: email.tex emailgenerator.tex emailparser.tex Log Message: nits Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** email.tex 1 Oct 2002 14:17:10 -0000 1.15 --- email.tex 1 Oct 2002 15:29:08 -0000 1.16 *************** *** 101,104 **** --- 101,105 ---- \item The \module{email.Header} and \module{email.Charset} modules have been added. + \item The pickle format for \class{Message} instances has changed. Since this was never (and still isn't) formally defined, this *************** *** 108,111 **** --- 109,113 ---- instances now have private variables \var{_charset} and \var{_default_type}. + \item Several methods in the \class{Message} class have been deprecated, or their signatures changed. Also, many new methods *************** *** 113,116 **** --- 115,119 ---- class for details. The changes should be completely backward compatible. + \item The object structure has changed in the face of \mimetype{message/rfc822} content types. In \module{email} *************** *** 133,136 **** --- 136,140 ---- \method{set_payload()} with a \class{Message} instance on a container with a content type of \mimetype{message/rfc822}. + \item The \class{Parser} constructor's \var{strict} argument was added, and its \method{parse()} and \method{parsestr()} methods *************** *** 138,153 **** --- 142,162 ---- also added to functions \function{email.message_from_file()} and \function{email.message_from_string()}. + \item \method{Generator.__call__()} is deprecated; use \method{Generator.flatten()} instead. The \class{Generator} class has also grown the \method{clone()} method. + \item The \class{DecodedGenerator} class in the \module{email.Generator} module was added. + \item The intermediate base classes \class{MIMENonMultipart} and \class{MIMEMultipart} have been added, and interposed in the class hierarchy for most of the other MIME-related derived classes. + \item The \var{_encoder} argument to the \class{MIMEText} constructor has been deprecated. Encoding now happens implicitly based on the \var{_charset} argument. + \item The following functions in the \module{email.Utils} module have been deprecated: \function{dump_address_pairs()}, *************** *** 156,159 **** --- 165,169 ---- \function{make_msgid()}, \function{decode_rfc2231()}, \function{encode_rfc2231()}, and \function{decode_params()}. + \item The non-public function \function{email.Iterators._structure()} was added. *************** *** 185,190 **** --- 195,202 ---- \item \function{messageFromString()} has been renamed to \function{message_from_string()}. + \item \function{messageFromFile()} has been renamed to \function{message_from_file()}. + \end{itemize} *************** *** 193,207 **** --- 205,227 ---- \begin{itemize} \item The method \method{asString()} was renamed to \method{as_string()}. + \item The method \method{ismultipart()} was renamed to \method{is_multipart()}. + \item The \method{get_payload()} method has grown a \var{decode} optional argument. + \item The method \method{getall()} was renamed to \method{get_all()}. + \item The method \method{addheader()} was renamed to \method{add_header()}. + \item The method \method{gettype()} was renamed to \method{get_type()}. + \item The method\method{getmaintype()} was renamed to \method{get_main_type()}. + \item The method \method{getsubtype()} was renamed to \method{get_subtype()}. + \item The method \method{getparams()} was renamed to \method{get_params()}. *************** *** 210,229 **** --- 230,257 ---- the key/value pairs of the parameters, split on the \character{=} sign. + \item The method \method{getparam()} was renamed to \method{get_param()}. + \item The method \method{getcharsets()} was renamed to \method{get_charsets()}. + \item The method \method{getfilename()} was renamed to \method{get_filename()}. + \item The method \method{getboundary()} was renamed to \method{get_boundary()}. + \item The method \method{setboundary()} was renamed to \method{set_boundary()}. + \item The method \method{getdecodedpayload()} was removed. To get similar functionality, pass the value 1 to the \var{decode} flag of the {get_payload()} method. + \item The method \method{getpayloadastext()} was removed. Similar functionality is supported by the \class{DecodedGenerator} class in the \refmodule{email.Generator} module. + \item The method \method{getbodyastext()} was removed. You can get similar functionality by creating an iterator with *************** *** 252,261 **** --- 280,292 ---- and \var{_minor} have changed to \var{_maintype} and \var{_subtype} respectively. + \item The \code{Image} class/module has been renamed to \code{MIMEImage}. The \var{_minor} argument has been renamed to \var{_subtype}. + \item The \code{Text} class/module has been renamed to \code{MIMEText}. The \var{_minor} argument has been renamed to \var{_subtype}. + \item The \code{MessageRFC822} class/module has been renamed to \code{MIMEMessage}. Note that an earlier version of Index: emailgenerator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailgenerator.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** emailgenerator.tex 1 Oct 2002 04:33:14 -0000 1.5 --- emailgenerator.tex 1 Oct 2002 15:29:09 -0000 1.6 *************** *** 106,116 **** --- 106,122 ---- \begin{itemize} \item \code{type} -- Full MIME type of the non-\mimetype{text} part + \item \code{maintype} -- Main MIME type of the non-\mimetype{text} part + \item \code{subtype} -- Sub-MIME type of the non-\mimetype{text} part + \item \code{filename} -- Filename of the non-\mimetype{text} part + \item \code{description} -- Description associated with the non-\mimetype{text} part + \item \code{encoding} -- Content transfer encoding of the non-\mimetype{text} part + \end{itemize} Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** emailparser.tex 1 Oct 2002 04:33:16 -0000 1.7 --- emailparser.tex 1 Oct 2002 15:29:09 -0000 1.8 *************** *** 136,139 **** --- 136,140 ---- \code{False} for \method{is_multipart()}. Their \method{get_payload()} method will return a string object. + \item All \mimetype{multipart} type messages will be parsed as a container message object with a list of sub-message objects for *************** *** 142,145 **** --- 143,147 ---- \method{get_payload()} method will return the list of \class{Message} subparts. + \item Most messages with a content type of \mimetype{message/*} (e.g. \mimetype{message/deliver-status} and From fdrake@users.sourceforge.net Tue Oct 1 16:30:59 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:30:59 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv5567 Modified Files: mkhowto Log Message: When the HTML output dir is specified using --dir=~/foo, the tilde needs to be expanded by mkhowto, since the shell won't touch it except at the start of the complete argument. Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** mkhowto 1 Oct 2002 15:24:03 -0000 1.34 --- mkhowto 1 Oct 2002 15:30:56 -0000 1.35 *************** *** 206,210 **** if os.sep == "\\": arg = re.sub("/", "\\", arg) ! self.builddir = arg elif opt == "--paper": self.paper = arg --- 206,210 ---- if os.sep == "\\": arg = re.sub("/", "\\", arg) ! self.builddir = os.path.expanduser(arg) elif opt == "--paper": self.paper = arg From barry@users.sourceforge.net Tue Oct 1 16:38:04 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Tue, 01 Oct 2002 08:38:04 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv7534 Modified Files: mkhowto Log Message: build(): Use self.builddir, not self.doc when copying the icons, so they'll end up in the right directory when --dir is used. Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** mkhowto 1 Oct 2002 15:30:56 -0000 1.35 --- mkhowto 1 Oct 2002 15:38:01 -0000 1.36 *************** *** 295,299 **** % `self.options.image_type`) for fn in imgs: ! new_fn = os.path.join(self.doc, os.path.basename(fn)) shutil.copyfile(fn, new_fn) if "text" in formats: --- 295,299 ---- % `self.options.image_type`) for fn in imgs: ! new_fn = os.path.join(self.builddir, os.path.basename(fn)) shutil.copyfile(fn, new_fn) if "text" in formats: From montanaro@users.sourceforge.net Tue Oct 1 18:40:02 2002 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue, 01 Oct 2002 10:40:02 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils ccompiler.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv19762 Modified Files: ccompiler.py Log Message: save the verbose argument as an instance attributes. Subclasses of CCompiler may rely on the presence of self.verbose (SciPy's distutils appears to). Index: ccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/ccompiler.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ccompiler.py 1 Oct 2002 04:14:17 -0000 1.48 --- ccompiler.py 1 Oct 2002 17:39:59 -0000 1.49 *************** *** 83,86 **** --- 83,87 ---- self.dry_run = dry_run self.force = force + self.verbose = verbose # 'output_dir': a common output directory for object, library, From loewis@users.sourceforge.net Tue Oct 1 18:48:34 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 01 Oct 2002 10:48:34 -0700 Subject: [Python-checkins] python/dist/src/Modules _tkinter.c,1.127,1.128 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv22703 Modified Files: _tkinter.c Log Message: Drop support for Tk 8.0 and 8.1. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** _tkinter.c 23 Jul 2002 06:31:14 -0000 1.127 --- _tkinter.c 1 Oct 2002 17:48:31 -0000 1.128 *************** *** 52,57 **** #define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) ! #if TKMAJORMINOR < 8000 ! #error "Tk older than 8.0 not supported" #endif --- 52,57 ---- #define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) ! #if TKMAJORMINOR < 8002 ! #error "Tk older than 8.2 not supported" #endif *************** *** 499,508 **** /** Tcl Eval **/ - #if TKMAJORMINOR >= 8001 - #define USING_OBJECTS - #endif - - #ifdef USING_OBJECTS - static Tcl_Obj* AsObj(PyObject *value) --- 499,502 ---- *************** *** 531,544 **** #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { - #if TKMAJORMINOR <= 8001 - /* In Tcl 8.1 we must use UTF-8 */ - PyObject* utf8 = PyUnicode_AsUTF8String(value); - if (!utf8) - return 0; - result = Tcl_NewStringObj(PyString_AS_STRING(utf8), - PyString_GET_SIZE(utf8)); - Py_DECREF(utf8); - return result; - #else /* TKMAJORMINOR > 8001 */ /* In Tcl 8.2 and later, use Tcl_NewUnicodeObj() */ if (sizeof(Py_UNICODE) != sizeof(Tcl_UniChar)) { --- 525,528 ---- *************** *** 550,554 **** return Tcl_NewUnicodeObj(PyUnicode_AS_UNICODE(value), PyUnicode_GET_SIZE(value)); - #endif /* TKMAJORMINOR > 8001 */ } #endif --- 534,537 ---- *************** *** 664,785 **** } - #else /* !USING_OBJECTS */ - - static PyObject * - Tkapp_Call(PyObject *self, PyObject *args) - { - /* This is copied from Merge() */ - PyObject *tmp = NULL; - char *argvStore[ARGSZ]; - char **argv = NULL; - int fvStore[ARGSZ]; - int *fv = NULL; - int argc = 0, fvc = 0, i; - PyObject *res = NULL; /* except this has a different type */ - Tcl_CmdInfo info; /* and this is added */ - Tcl_Interp *interp = Tkapp_Interp(self); /* and this too */ - - if (!(tmp = PyList_New(0))) - return NULL; - - argv = argvStore; - fv = fvStore; - - if (args == NULL) - argc = 0; - - else if (!PyTuple_Check(args)) { - argc = 1; - fv[0] = 0; - if (!(argv[0] = AsString(args, tmp))) - goto finally; - } - else { - argc = PyTuple_Size(args); - - if (argc > ARGSZ) { - argv = (char **)ckalloc(argc * sizeof(char *)); - fv = (int *)ckalloc(argc * sizeof(int)); - if (argv == NULL || fv == NULL) { - PyErr_NoMemory(); - goto finally; - } - } - - for (i = 0; i < argc; i++) { - PyObject *v = PyTuple_GetItem(args, i); - if (PyTuple_Check(v)) { - fv[i] = 1; - if (!(argv[i] = Merge(v))) - goto finally; - fvc++; - } - else if (v == Py_None) { - argc = i; - break; - } - else { - fv[i] = 0; - if (!(argv[i] = AsString(v, tmp))) - goto finally; - fvc++; - } - } - } - /* End code copied from Merge() */ - - /* All this to avoid a call to Tcl_Merge() and the corresponding call - to Tcl_SplitList() inside Tcl_Eval()... It can save a bundle! */ - if (Py_VerboseFlag >= 2) { - for (i = 0; i < argc; i++) - PySys_WriteStderr("%s ", argv[i]); - } - ENTER_TCL - info.proc = NULL; - if (argc < 1 || - !Tcl_GetCommandInfo(interp, argv[0], &info) || - info.proc == NULL) - { - char *cmd; - cmd = Tcl_Merge(argc, argv); - i = Tcl_Eval(interp, cmd); - ckfree(cmd); - } - else { - Tcl_ResetResult(interp); - i = (*info.proc)(info.clientData, interp, argc, argv); - } - ENTER_OVERLAP - if (info.proc == NULL && Py_VerboseFlag >= 2) - PySys_WriteStderr("... use TclEval "); - if (i == TCL_ERROR) { - if (Py_VerboseFlag >= 2) - PySys_WriteStderr("... error: '%s'\n", - Tcl_GetStringResult(interp)); - Tkinter_Error(self); - } - else { - if (Py_VerboseFlag >= 2) - PySys_WriteStderr("-> '%s'\n", Tcl_GetStringResult(interp)); - res = PyString_FromString(Tcl_GetStringResult(interp)); - } - LEAVE_OVERLAP_TCL - - /* Copied from Merge() again */ - finally: - for (i = 0; i < fvc; i++) - if (fv[i]) { - ckfree(argv[i]); - } - if (argv != argvStore) - ckfree(FREECAST argv); - if (fv != fvStore) - ckfree(FREECAST fv); - - Py_DECREF(tmp); - return res; - } - - #endif /* !USING_OBJECTS */ static PyObject * --- 647,650 ---- From barry@users.sourceforge.net Tue Oct 1 18:57:08 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Tue, 01 Oct 2002 10:57:08 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv25649 Modified Files: test_email.py Log Message: test__all__(): Fix the import list. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_email.py 30 Sep 2002 15:23:17 -0000 1.16 --- test_email.py 1 Oct 2002 17:57:06 -0000 1.17 *************** *** 1605,1612 **** all.sort() self.assertEqual(all, ['Charset', 'Encoders', 'Errors', 'Generator', ! 'Header', 'Iterators', 'MIMEAudio', ! 'MIMEBase', 'MIMEImage', 'MIMEMessage', ! 'MIMEText', 'Message', 'Parser', ! 'Utils', 'base64MIME', 'message_from_file', 'message_from_string', 'quopriMIME']) --- 1605,1612 ---- all.sort() self.assertEqual(all, ['Charset', 'Encoders', 'Errors', 'Generator', ! 'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', ! 'MIMEImage', 'MIMEMessage', 'MIMEMultipart', ! 'MIMENonMultipart', 'MIMEText', 'Message', ! 'Parser', 'Utils', 'base64MIME', 'message_from_file', 'message_from_string', 'quopriMIME']) From loewis@users.sourceforge.net Tue Oct 1 19:08:08 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:08:08 -0700 Subject: [Python-checkins] python/dist/src/Modules _tkinter.c,1.128,1.129 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv29494 Modified Files: _tkinter.c Log Message: Eliminate constness warnings with Tcl 8.4. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** _tkinter.c 1 Oct 2002 17:48:31 -0000 1.128 --- _tkinter.c 1 Oct 2002 18:08:06 -0000 1.129 *************** *** 42,45 **** --- 42,52 ---- #endif + /* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately, + making _tkinter correct for this API means to break earlier + versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and + earlier versions. Once Tcl releases before 8.4 don't need to be supported + anymore, this should go. */ + #define USE_COMPAT_CONST + #ifdef TK_FRAMEWORK #include *************** *** 608,613 **** /* We could request the object result here, but doing so would confuse applications that expect a string. */ ! char *s = Tcl_GetStringResult(interp); ! char *p = s; /* If the result contains any bytes with the top bit set, --- 615,620 ---- /* We could request the object result here, but doing so would confuse applications that expect a string. */ ! const char *s = Tcl_GetStringResult(interp); ! const char *p = s; /* If the result contains any bytes with the top bit set, *************** *** 784,788 **** SetVar(PyObject *self, PyObject *args, int flags) { ! char *name1, *name2, *ok, *s; PyObject *newValue; PyObject *tmp; --- 791,796 ---- SetVar(PyObject *self, PyObject *args, int flags) { ! char *name1, *name2, *s; ! const char *ok; PyObject *newValue; PyObject *tmp; *************** *** 844,848 **** GetVar(PyObject *self, PyObject *args, int flags) { ! char *name1, *name2=NULL, *s; PyObject *res = NULL; --- 852,857 ---- GetVar(PyObject *self, PyObject *args, int flags) { ! char *name1, *name2=NULL; ! const char *s; PyObject *res = NULL; From brianl@real.com Tue Oct 1 19:10:39 2002 From: brianl@real.com (Brian Lenihan) Date: Tue, 01 Oct 2002 11:10:39 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils ccompiler.py,1.47,1.48 In-Reply-To: Message-ID: <5.1.0.14.2.20021001110815.014bc1f8@cowzilla.dev.prognet.com> This also affected mxBase. I believe the other change you are referring to was adding a compiler class to config.py, which mx subclasses in its setup.py Both Twisted and mx attempt to compile conftest.c before doing the normal compiler setup and both stopped at the assert you just removed. Strangely, this assert did not affect Windows installs, probably because of the special case for adding Release and Debug dirs. I got mx to install by adding an output_dir to it's subclassed config.compiler. At 09:14 PM 9/30/2002 -0700, gvanrossum@users.sourceforge.net wrote: >Update of /cvsroot/python/python/dist/src/Lib/distutils >In directory usw-pr-cvs1:/tmp/cvs-serv13686 > >Modified Files: > ccompiler.py >Log Message: >Commit fix for SF 603831. > >Strangely, two out of three patches there seem already committed; but >the essential one (get rid of the assert in object_filenames in >ccompiler.py) was not yet applied. > >This makes the build procedure for Twisted work again. > >This is *not* a backport candidate despite the fact that identical >code appears to exist in 2.2.2; Twisted builds fine there, so there >must have been a change elsewhere. > > >Index: ccompiler.py >=================================================================== >RCS file: /cvsroot/python/python/dist/src/Lib/distutils/ccompiler.py,v >retrieving revision 1.47 >retrieving revision 1.48 >diff -C2 -d -r1.47 -r1.48 >*** ccompiler.py 11 Sep 2002 16:31:53 -0000 1.47 >--- ccompiler.py 1 Oct 2002 04:14:17 -0000 1.48 >*************** >*** 877,881 **** > > def object_filenames(self, source_filenames, strip_dir=0, > output_dir=''): >! assert output_dir is not None > obj_names = [] > for src_name in source_filenames: >--- 877,882 ---- > > def object_filenames(self, source_filenames, strip_dir=0, > output_dir=''): >! if output_dir is None: >! output_dir = '' > obj_names = [] > for src_name in source_filenames: > > > >_______________________________________________ >Python-checkins mailing list >Python-checkins@python.org >http://mail.python.org/mailman/listinfo/python-checkins From gvanrossum@users.sourceforge.net Tue Oct 1 19:19:02 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:19:02 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.490,1.491 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv1568 Modified Files: NEWS Log Message: Mention droped support for Tcl/Tk 8.0 and 8.1. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.490 retrieving revision 1.491 diff -C2 -d -r1.490 -r1.491 *** NEWS 30 Sep 2002 15:23:01 -0000 1.490 --- NEWS 1 Oct 2002 18:18:58 -0000 1.491 *************** *** 285,288 **** --- 285,292 ---- ----------------- + - The _tkinter module (and hence Tkinter) has dropped support for + Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are + supported. + - cPickle.BadPickleGet is now a class. From fdrake@users.sourceforge.net Tue Oct 1 19:20:19 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:20:19 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib mimelib.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv2087 Modified Files: mimelib.tex Log Message: Add a comment to the top of the file explaining why the file is here. Index: mimelib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/mimelib.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mimelib.tex 1 Oct 2002 15:13:29 -0000 1.2 --- mimelib.tex 1 Oct 2002 18:20:16 -0000 1.3 *************** *** 1,2 **** --- 1,9 ---- + % This document is largely a stub used to allow the email package docs + % to be formatted separately from the rest of the Python + % documentation. This allows the documentation to be released + % independently of the rest of Python since the email package is being + % maintained for multiple Python versions, and on an accelerated + % schedule. + \documentclass{howto} From jhylton@users.sourceforge.net Tue Oct 1 19:31:07 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:31:07 -0700 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.7,1.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5977 Modified Files: Tag: ast-branch ast.c Log Message: Properly compute size of return sequence for testlist. If the number of children is oddd e.g. "1 , 2" we must round up. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** ast.c 30 Sep 2002 18:21:45 -0000 1.1.2.7 --- ast.c 1 Oct 2002 18:31:05 -0000 1.1.2.8 *************** *** 330,337 **** seq_for_testlist(const node *n) { asdl_seq *seq; int i; ! seq = asdl_seq_new(NCH(n) / 2); for (i = 0; i < NCH(n); i += 2) { asdl_seq_SET(seq, i / 2, ast_for_expr(CHILD(n, i))); --- 330,338 ---- seq_for_testlist(const node *n) { + /* testlist: test (',' test)* [','] */ asdl_seq *seq; int i; ! seq = asdl_seq_new((NCH(n) + 1) / 2); for (i = 0; i < NCH(n); i += 2) { asdl_seq_SET(seq, i / 2, ast_for_expr(CHILD(n, i))); From jhylton@users.sourceforge.net Tue Oct 1 19:33:49 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:33:49 -0700 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.8,1.1.2.9 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv6799 Modified Files: Tag: ast-branch ast.c Log Message: Fix List handling. Use seq_for_testlist() to compute the sequence elements, rather than ast_for_testlist(). The latter returns a tuple, when we want a sequence. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** ast.c 1 Oct 2002 18:31:05 -0000 1.1.2.8 --- ast.c 1 Oct 2002 18:33:47 -0000 1.1.2.9 *************** *** 570,577 **** REQ(ch, listmaker); if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) { ! asdl_seq *elts = asdl_seq_new(1); ! if (!elts) ! return NULL; ! asdl_seq_SET(elts, 0, ast_for_testlist(ch)); return List(elts, Load); } --- 570,574 ---- REQ(ch, listmaker); if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) { ! asdl_seq *elts = seq_for_testlist(ch); return List(elts, Load); } From loewis@users.sourceforge.net Tue Oct 1 19:50:58 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 01 Oct 2002 11:50:58 -0700 Subject: [Python-checkins] python/dist/src/Modules _tkinter.c,1.129,1.130 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12617 Modified Files: _tkinter.c Log Message: Support UCS-4 builds. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** _tkinter.c 1 Oct 2002 18:08:06 -0000 1.129 --- _tkinter.c 1 Oct 2002 18:50:56 -0000 1.130 *************** *** 63,66 **** --- 63,74 ---- #endif + /* Unicode conversion assumes that Tcl_UniChar is two bytes. + We cannot test this directly, so we test UTF-8 size instead, + expecting that TCL_UTF_MAX is changed if Tcl ever supports + either UTF-16 or UCS-4. */ + #if TCL_UTF_MAX != 3 + #error "unsupported Tcl configuration" + #endif + #if defined(macintosh) /* Sigh, we have to include this to get at the tcl qd pointer */ *************** *** 532,544 **** #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { ! /* In Tcl 8.2 and later, use Tcl_NewUnicodeObj() */ ! if (sizeof(Py_UNICODE) != sizeof(Tcl_UniChar)) { ! /* XXX Should really test this at compile time */ ! PyErr_SetString(PyExc_SystemError, ! "Py_UNICODE and Tcl_UniChar differ in size"); ! return 0; } ! return Tcl_NewUnicodeObj(PyUnicode_AS_UNICODE(value), ! PyUnicode_GET_SIZE(value)); } #endif --- 540,572 ---- #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { ! Py_UNICODE *inbuf = PyUnicode_AS_UNICODE(value); ! int size = PyUnicode_GET_SIZE(value); ! /* This #ifdef assumes that Tcl uses UCS-2. ! See TCL_UTF_MAX test above. */ ! #ifdef Py_UNICODE_WIDE ! Tcl_UniChar *outbuf; ! int i; ! outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar)); ! if (!outbuf) { ! PyErr_NoMemory(); ! return NULL; } ! for (i = 0; i < size; i++) { ! if (inbuf[i] >= 0x10000) { ! /* Tcl doesn't do UTF-16, yet. */ ! PyErr_SetString(PyExc_ValueError, ! "unsupported character"); ! ckfree(FREECAST outbuf); ! return NULL; ! } ! outbuf[i] = inbuf[i]; ! } ! result = Tcl_NewUnicodeObj(outbuf, size); ! ckfree(FREECAST outbuf); ! return result; ! #else ! return Tcl_NewUnicodeObj(inbuf, size); ! #endif ! } #endif From jhylton@users.sourceforge.net Tue Oct 1 20:34:40 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue, 01 Oct 2002 12:34:40 -0700 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.9,1.1.2.10 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27948 Modified Files: Tag: ast-branch ast.c Log Message: Small step towards parsing arglists: Handle simple positional arguments. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** ast.c 1 Oct 2002 18:33:47 -0000 1.1.2.9 --- ast.c 1 Oct 2002 19:34:38 -0000 1.1.2.10 *************** *** 807,812 **** */ REQ(n, arglist); ! return Call(func, NULL, NULL, NULL, NULL); } --- 807,836 ---- */ + int i, nargs; + asdl_seq *args = NULL; + REQ(n, arglist); ! ! nargs = 0; ! for (i = 0; i < NCH(n); i++) ! if (TYPE(CHILD(n, i)) == argument) ! nargs++; ! ! args = asdl_seq_new(nargs); ! for (i = 0; i < NCH(n); i++) { ! node *ch = CHILD(n, i); ! if (TYPE(ch) == argument) { ! expr_ty e; ! if (NCH(ch) == 1) ! e = ast_for_expr(CHILD(ch, 0)); ! else ! e = NULL; ! asdl_seq_SET(args, i / 2, e); ! } ! } ! ! ! /* XXX syntax error if more than 255 arguments */ ! return Call(func, args, NULL, NULL, NULL); } From jhylton@users.sourceforge.net Tue Oct 1 20:35:38 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue, 01 Oct 2002 12:35:38 -0700 Subject: [Python-checkins] python/dist/src/Python newcompile.c,1.1.2.11,1.1.2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28371 Modified Files: Tag: ast-branch newcompile.c Log Message: Emit BUILD_LIST, BUILD_TUPLE, and CALL_FUNCTION; CALL_FUNCTION only handles simple positional arguments. Also extend the debugging output to print the name of the opcode along with the number. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -C2 -d -r1.1.2.11 -r1.1.2.12 *** newcompile.c 30 Sep 2002 22:12:05 -0000 1.1.2.11 --- newcompile.c 1 Oct 2002 19:35:36 -0000 1.1.2.12 *************** *** 82,85 **** --- 82,87 ---- static PyCodeObject *assemble(struct compiler *); + static char *opnames[]; + #define IS_JUMP(I) ((I)->i_jrel || (I)->i_jabs) *************** *** 1022,1025 **** --- 1024,1032 ---- break; case Call_kind: + VISIT(c, expr, e->v.Call.func); + n = asdl_seq_LEN(e->v.Call.args); + /* XXX other args */ + VISIT_SEQ(c, expr, e->v.Call.args); + ADDOP_I(c, CALL_FUNCTION, n); break; case Repr_kind: *************** *** 1060,1066 **** --- 1067,1075 ---- case List_kind: VISIT_SEQ(c, expr, e->v.List.elts); + ADDOP_I(c, BUILD_LIST, asdl_seq_LEN(e->v.List.elts)); break; case Tuple_kind: VISIT_SEQ(c, expr, e->v.Tuple.elts); + ADDOP_I(c, BUILD_TUPLE, asdl_seq_LEN(e->v.Tuple.elts)); break; } *************** *** 1226,1231 **** code = PyString_AS_STRING(a->a_bytecode) + a->a_offset; fprintf(stderr, ! "emit %3d %5d\toffset = %2d\tsize = %d\text = %d\n", ! i->i_opcode, i->i_oparg, a->a_offset, size, ext); a->a_offset += size; if (ext > 0) { --- 1235,1241 ---- code = PyString_AS_STRING(a->a_bytecode) + a->a_offset; fprintf(stderr, ! "emit %3d %-10s %5d\toffset = %2d\tsize = %d\text = %d\n", ! i->i_opcode, opnames[i->i_opcode], ! i->i_oparg, a->a_offset, size, ext); a->a_offset += size; if (ext > 0) { *************** *** 1386,1387 **** --- 1396,1544 ---- return co; } + + static char *opnames[] = { + "STOP_CODE", + "POP_TOP", + "ROT_TWO", + "ROT_THREE", + "DUP_TOP", + "ROT_FOUR", + "<6>", + "<7>", + "<8>", + "<9>", + "UNARY_POSITIVE", + "UNARY_NEGATIVE", + "UNARY_NOT", + "UNARY_CONVERT", + "<14>", + "UNARY_INVERT", + "<16>", + "<17>", + "<18>", + "BINARY_POWER", + "BINARY_MULTIPLY", + "BINARY_DIVIDE", + "BINARY_MODULO", + "BINARY_ADD", + "BINARY_SUBTRACT", + "BINARY_SUBSCR", + "BINARY_FLOOR_DIVIDE", + "BINARY_TRUE_DIVIDE", + "INPLACE_FLOOR_DIVIDE", + "INPLACE_TRUE_DIVIDE", + "SLICE+0", + "SLICE+1", + "SLICE+2", + "SLICE+3", + "<34>", + "<35>", + "<36>", + "<37>", + "<38>", + "<39>", + "STORE_SLICE+0", + "STORE_SLICE+1", + "STORE_SLICE+2", + "STORE_SLICE+3", + "<44>", + "<45>", + "<46>", + "<47>", + "<48>", + "<49>", + "DELETE_SLICE+0", + "DELETE_SLICE+1", + "DELETE_SLICE+2", + "DELETE_SLICE+3", + "<54>", + "INPLACE_ADD", + "INPLACE_SUBTRACT", + "INPLACE_MULTIPLY", + "INPLACE_DIVIDE", + "INPLACE_MODULO", + "STORE_SUBSCR", + "DELETE_SUBSCR", + "BINARY_LSHIFT", + "BINARY_RSHIFT", + "BINARY_AND", + "BINARY_XOR", + "BINARY_OR", + "INPLACE_POWER", + "GET_ITER", + "<69>", + "PRINT_EXPR", + "PRINT_ITEM", + "PRINT_NEWLINE", + "PRINT_ITEM_TO", + "PRINT_NEWLINE_TO", + "INPLACE_LSHIFT", + "INPLACE_RSHIFT", + "INPLACE_AND", + "INPLACE_XOR", + "INPLACE_OR", + "BREAK_LOOP", + "<81>", + "LOAD_LOCALS", + "RETURN_VALUE", + "IMPORT_STAR", + "EXEC_STMT", + "YIELD_VALUE", + "POP_BLOCK", + "END_FINALLY", + "BUILD_CLASS", + "STORE_NAME", + "DELETE_NAME", + "UNPACK_SEQUENCE", + "FOR_ITER", + "<94>", + "STORE_ATTR", + "DELETE_ATTR", + "STORE_GLOBAL", + "DELETE_GLOBAL", + "DUP_TOPX", + "LOAD_CONST", + "LOAD_NAME", + "BUILD_TUPLE", + "BUILD_LIST", + "BUILD_MAP", + "LOAD_ATTR", + "COMPARE_OP", + "IMPORT_NAME", + "IMPORT_FROM", + "<109>", + "JUMP_FORWARD", + "JUMP_IF_FALSE", + "JUMP_IF_TRUE", + "JUMP_ABSOLUTE", + "<114>", + "<115>", + "LOAD_GLOBAL", + "<117>", + "<118>", + "CONTINUE_LOOP", + "SETUP_LOOP", + "SETUP_EXCEPT", + "SETUP_FINALLY", + "<123>", + "LOAD_FAST", + "STORE_FAST", + "DELETE_FAST", + "<127>", + "<128>", + "<129>", + "RAISE_VARARGS", + "CALL_FUNCTION", + "MAKE_FUNCTION", + "BUILD_SLICE", + "MAKE_CLOSURE", + "LOAD_CLOSURE", + "LOAD_DEREF", + "STORE_DEREF", + "<138>", + "<139>", + "CALL_FUNCTION_VAR", + "CALL_FUNCTION_KW", + "CALL_FUNCTION_VAR_KW", + "EXTENDED_ARG", + }; From jhylton@users.sourceforge.net Wed Oct 2 12:47:56 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:47:56 -0700 Subject: [Python-checkins] python/dist/src/Parser Python.asdl,1.1.2.4,1.1.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv8983/Parser Modified Files: Tag: ast-branch Python.asdl Log Message: Experimental change: Add Param to expr_context. It's convenient to represent a function's parameter list as a sequence of expressions, because they can contain names or tuples. Rather than re-using an existing expr_context for the names, make one explicitly for this purpose. There are some downsides: Must cover Param in all switch statements. Param isn't used directly by the AST. Index: Python.asdl =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/Attic/Python.asdl,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** Python.asdl 30 Aug 2002 22:09:38 -0000 1.1.2.4 --- Python.asdl 2 Oct 2002 11:47:54 -0000 1.1.2.5 *************** *** 71,75 **** | Tuple(expr *elts, expr_context ctx) ! expr_context = Load | Store | Del | AugStore slice = Ellipsis | Slice(expr? lower, expr? upper, expr? step) --- 71,75 ---- | Tuple(expr *elts, expr_context ctx) ! expr_context = Load | Store | Del | AugStore | Param slice = Ellipsis | Slice(expr? lower, expr? upper, expr? step) From jhylton@users.sourceforge.net Wed Oct 2 12:48:46 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:48:46 -0700 Subject: [Python-checkins] python/dist/src/Include Python-ast.h,1.1.2.4,1.1.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv9163/Include Modified Files: Tag: ast-branch Python-ast.h Log Message: Experimental change: Add Param to expr_context. It's convenient to represent a function's parameter list as a sequence of expressions, because they can contain names or tuples. Rather than re-using an existing expr_context for the names, make one explicitly for this purpose. There are some downsides: Must cover Param in all switch statements. Param isn't used directly by the AST. Index: Python-ast.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Attic/Python-ast.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** Python-ast.h 13 Sep 2002 14:32:12 -0000 1.1.2.4 --- Python-ast.h 2 Oct 2002 11:48:43 -0000 1.1.2.5 *************** *** 1,3 **** ! /* File automatically generated by Parser/asdl_c.py */ #include "asdl.h" --- 1,3 ---- ! /* File automatically generated by ../Parser/asdl_c.py */ #include "asdl.h" *************** *** 9,13 **** typedef struct _expr *expr_ty; ! typedef enum _expr_context { Load=1, Store=2, Del=3, AugStore=4 } expr_context_ty; --- 9,13 ---- typedef struct _expr *expr_ty; ! typedef enum _expr_context { Load=1, Store=2, Del=3, AugStore=4, Param=5 } expr_context_ty; From jhylton@users.sourceforge.net Wed Oct 2 12:48:46 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:48:46 -0700 Subject: [Python-checkins] python/dist/src/Python Python-ast.c,1.1.2.4,1.1.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9163/Python Modified Files: Tag: ast-branch Python-ast.c Log Message: Experimental change: Add Param to expr_context. It's convenient to represent a function's parameter list as a sequence of expressions, because they can contain names or tuples. Rather than re-using an existing expr_context for the names, make one explicitly for this purpose. There are some downsides: Must cover Param in all switch statements. Param isn't used directly by the AST. Index: Python-ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/Python-ast.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** Python-ast.c 3 Sep 2002 23:18:53 -0000 1.1.2.4 --- Python-ast.c 2 Oct 2002 11:48:44 -0000 1.1.2.5 *************** *** 1508,1511 **** --- 1508,1514 ---- marshal_write_int(buf, off, 4); break; + case Param: + marshal_write_int(buf, off, 5); + break; } return 1; From jhylton@users.sourceforge.net Wed Oct 2 12:49:17 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:49:17 -0700 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.10,1.1.2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9358/Python Modified Files: Tag: ast-branch ast.c Log Message: Experimental change: Add Param to expr_context. It's convenient to represent a function's parameter list as a sequence of expressions, because they can contain names or tuples. Rather than re-using an existing expr_context for the names, make one explicitly for this purpose. There are some downsides: Must cover Param in all switch statements. Param isn't used directly by the AST. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** ast.c 1 Oct 2002 19:34:38 -0000 1.1.2.10 --- ast.c 2 Oct 2002 11:49:15 -0000 1.1.2.11 *************** *** 390,394 **** } if (TYPE(CHILD(ch, 0)) == NAME) ! asdl_seq_APPEND(args, NEW_IDENTIFIER(CHILD(ch, 0))); if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { asdl_seq_APPEND(defaults, ast_for_expr(CHILD(n, i + 2))); --- 390,395 ---- } if (TYPE(CHILD(ch, 0)) == NAME) ! asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)), ! Param)); if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { asdl_seq_APPEND(defaults, ast_for_expr(CHILD(n, i + 2))); From jhylton@users.sourceforge.net Wed Oct 2 12:50:16 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:50:16 -0700 Subject: [Python-checkins] python/dist/src/Python symtable.c,2.10.8.8,2.10.8.9 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9716/Python Modified Files: Tag: ast-branch symtable.c Log Message: Experimental change: Add Param to expr_context. It's convenient to represent a function's parameter list as a sequence of expressions, because they can contain names or tuples. Rather than re-using an existing expr_context for the names, make one explicitly for this purpose. There are some downsides: Must cover Param in all switch statements. Param isn't used directly by the AST. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.8 retrieving revision 2.10.8.9 diff -C2 -d -r2.10.8.8 -r2.10.8.9 *** symtable.c 27 Sep 2002 23:13:38 -0000 2.10.8.8 --- symtable.c 2 Oct 2002 11:50:14 -0000 2.10.8.9 *************** *** 612,616 **** symtable_visit_stmt(struct symtable *st, stmt_ty s) { - fprintf(stderr, "symtable %d %d\n", s->kind, s->lineno); switch (s->kind) { case FunctionDef_kind: --- 612,615 ---- *************** *** 838,842 **** expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { ! assert(arg->v.Name.ctx == Load); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; --- 837,841 ---- expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { ! assert(arg->v.Name.ctx == Param); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; *************** *** 853,859 **** else { /* syntax error */ return 0; } ! } return 1; --- 852,859 ---- else { /* syntax error */ + fprintf(stderr, "unexpected expr in parameter list\n"); return 0; } ! } return 1; *************** *** 872,876 **** if (a->kwarg && !symtable_add_def(st, a->kwarg, DEF_PARAM)) return 0; - return 1; } --- 872,875 ---- From jhylton@users.sourceforge.net Wed Oct 2 12:58:55 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed, 02 Oct 2002 04:58:55 -0700 Subject: [Python-checkins] python/dist/src/Python newcompile.c,1.1.2.12,1.1.2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv12002/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Restructure struct compiler into two parts. Each block needs to store its own state. This state had been stored in struct compiler initially. Now stored in struct compiler_unit. The compiler_unit is changed whenever a block is entered or exited, using c_stack. XXX This makes a lot of code a lot uglier because there are two pointer dereferences. The extra dereference seems preferable to passing it as a separate argument everywhere. Probably need to rework individual functions to use local variable. Function objects are now created, although their code objects are bogus. Also, extend switch statements to handle Param. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -C2 -d -r1.1.2.12 -r1.1.2.13 *** newcompile.c 1 Oct 2002 19:35:36 -0000 1.1.2.12 --- newcompile.c 2 Oct 2002 11:58:53 -0000 1.1.2.13 *************** *** 23,26 **** --- 23,50 ---- }; + /* The following items change on entry and exit of code blocks. + They must be saved and restored when returning to a block. + */ + struct compiler_unit { + PySTEntryObject *u_ste; + + PyObject *u_name; + PyObject *u_consts; + PyObject *u_names; + PyObject *u_varnames; + + int u_argcount; + int u_nblocks; + int u_curblock; + struct basicblock u_entry; + struct basicblock u_exit; + struct basicblock **u_blocks; + + int u_nfblocks; + struct fblockinfo u_fblock[CO_MAXBLOCKS]; + + int u_lineno; + }; + struct compiler { const char *c_filename; *************** *** 31,53 **** int c_interactive; ! /* info that changes for each code block */ ! PySTEntryObject *c_ste; ! ! PyObject *c_name; ! PyObject *c_consts; ! PyObject *c_names; ! PyObject *c_varnames; ! ! int c_argcount; ! int c_nblocks; ! int c_curblock; ! struct basicblock c_entry; ! struct basicblock c_exit; ! struct basicblock **c_blocks; ! ! int c_nfblocks; ! struct fblockinfo c_fblock[CO_MAXBLOCKS]; ! ! int c_lineno; }; --- 55,60 ---- int c_interactive; ! struct compiler_unit *u; ! PyObject *c_stack; }; *************** *** 86,89 **** --- 93,99 ---- #define IS_JUMP(I) ((I)->i_jrel || (I)->i_jabs) + #define BLOCK(U, I) (U)->u_blocks[I] + #define CURBLOCK(U) BLOCK(U, (U)->u_curblock) + int _Py_Mangle(char *p, char *name, char *buffer, size_t maxlen) *************** *** 119,122 **** --- 129,136 ---- memset(c, 0, sizeof(struct compiler)); + c->c_stack = PyList_New(0); + if (!c->c_stack) + return 0; + return 1; } *************** *** 152,156 **** fprintf(stderr, "ast %s\n", filename); - c.c_st = PySymtable_Build(mod, filename, c.c_future); if (c.c_st == NULL) { --- 166,169 ---- *************** *** 173,190 **** compiler_free(struct compiler *c) { - int i; - if (c->c_st) PySymtable_Free(c->c_st); if (c->c_future) PyObject_Free((void *)c->c_future); ! for (i = 0; i < c->c_nblocks; i++) ! PyObject_Free((void *)c->c_blocks[i]); ! if (c->c_blocks) ! PyObject_Free((void *)c->c_blocks); ! Py_XDECREF(c->c_name); ! Py_XDECREF(c->c_consts); ! Py_XDECREF(c->c_names); ! Py_XDECREF(c->c_varnames); } --- 186,194 ---- compiler_free(struct compiler *c) { if (c->c_st) PySymtable_Free(c->c_st); if (c->c_future) PyObject_Free((void *)c->c_future); ! Py_DECREF(c->c_stack); } *************** *** 192,220 **** compiler_enter_scope(struct compiler *c, identifier name, void *key) { ! c->c_ste = PySymtable_Lookup(c->c_st, key); ! if (!c->c_ste) { return 0; } Py_INCREF(name); ! c->c_name = name; ! c->c_varnames = c->c_ste->ste_varnames; ! Py_INCREF(c->c_varnames); fprintf(stderr, "block %s varnames %s\n", PyObject_REPR(name), ! PyObject_REPR(c->c_varnames)); ! c->c_nblocks = 0; ! c->c_blocks = (struct basicblock **)PyObject_Malloc( ! sizeof(struct basicblock *) * DEFAULT_BLOCKS); ! if (!c->c_blocks) return 0; ! memset(c->c_blocks, 0, sizeof(struct basicblock *) * DEFAULT_BLOCKS); ! if (compiler_use_new_block(c) < 0) return 0; ! c->c_consts = PyDict_New(); ! if (!c->c_consts) return 0; ! c->c_names = PyDict_New(); ! if (!c->c_names) return 0; return 1; } --- 196,240 ---- compiler_enter_scope(struct compiler *c, identifier name, void *key) { ! struct compiler_unit *u; ! ! u = PyObject_Malloc(sizeof(struct compiler_unit)); ! u->u_argcount = 0; ! u->u_ste = PySymtable_Lookup(c->c_st, key); ! if (!u->u_ste) { return 0; } Py_INCREF(name); ! u->u_name = name; ! u->u_varnames = u->u_ste->ste_varnames; ! Py_INCREF(u->u_varnames); fprintf(stderr, "block %s varnames %s\n", PyObject_REPR(name), ! PyObject_REPR(u->u_varnames)); ! u->u_nblocks = 0; ! u->u_blocks = (struct basicblock **)PyObject_Malloc( ! sizeof(struct basicblock *) * DEFAULT_BLOCKS); ! if (!u->u_blocks) return 0; ! memset(u->u_blocks, 0, sizeof(struct basicblock *) * DEFAULT_BLOCKS); ! u->u_consts = PyDict_New(); ! if (!u->u_consts) return 0; ! u->u_names = PyDict_New(); ! if (!u->u_names) return 0; ! ! /* Push the old compiler_unit on the stack. */ ! if (c->u) { ! PyObject *wrapper = PyCObject_FromVoidPtr(c->u, NULL); ! if (PyList_Append(c->c_stack, wrapper) < 0) ! return 0; ! Py_DECREF(wrapper); ! fprintf(stderr, "stack = %s\n", PyObject_REPR(c->c_stack)); ! } ! c->u = u; ! ! if (compiler_use_new_block(c) < 0) return 0; + return 1; } *************** *** 223,234 **** compiler_exit_scope(struct compiler *c) { ! Py_DECREF(c->c_name); ! c->c_name = NULL; ! Py_DECREF(c->c_consts); ! c->c_consts = NULL; ! Py_DECREF(c->c_names); ! c->c_names = NULL; ! Py_DECREF(c->c_varnames); ! c->c_varnames = NULL; return 1; /* XXX void? */ } --- 243,272 ---- compiler_exit_scope(struct compiler *c) { ! struct compiler_unit *u = c->u; ! int i, n; ! PyObject *wrapper; ! ! for (i = 0; i < u->u_nblocks; i++) ! PyObject_Free((void *)u->u_blocks[i]); ! if (u->u_blocks) ! PyObject_Free((void *)u->u_blocks); ! Py_XDECREF(u->u_name); ! Py_XDECREF(u->u_consts); ! Py_XDECREF(u->u_names); ! Py_XDECREF(u->u_varnames); ! ! PyObject_Free(u); ! ! /* Restore c->u to the parent unit. */ ! n = PyList_GET_SIZE(c->c_stack) - 1; ! if (n >= 0) { ! wrapper = PyList_GET_ITEM(c->c_stack, n); ! c->u = (struct compiler_unit *)PyCObject_AsVoidPtr(wrapper); ! if (PySequence_DelItem(c->c_stack, n) < 0) ! return 0; ! } ! else ! c->u = NULL; ! return 1; /* XXX void? */ } *************** *** 242,253 **** { struct basicblock *b; int block; ! if (c->c_nblocks && c->c_nblocks % DEFAULT_BLOCKS == 0) { /* XXX should double */ ! int newsize = c->c_nblocks + DEFAULT_BLOCKS; ! c->c_blocks = (struct basicblock **)PyObject_Realloc( ! c->c_blocks, newsize); ! if (c->c_blocks == NULL) return -1; } --- 280,293 ---- { struct basicblock *b; + struct compiler_unit *u; int block; ! u = c->u; ! if (u->u_nblocks && u->u_nblocks % DEFAULT_BLOCKS == 0) { /* XXX should double */ ! int newsize = u->u_nblocks + DEFAULT_BLOCKS; ! u->u_blocks = (struct basicblock **)PyObject_Realloc( ! u->u_blocks, newsize); ! if (u->u_blocks == NULL) return -1; } *************** *** 257,262 **** memset((void *)b, 0, sizeof(struct basicblock)); b->b_ialloc = DEFAULT_BLOCK_SIZE; ! block = c->c_nblocks++; ! c->c_blocks[block] = b; return block; } --- 297,302 ---- memset((void *)b, 0, sizeof(struct basicblock)); b->b_ialloc = DEFAULT_BLOCK_SIZE; ! block = u->u_nblocks++; ! u->u_blocks[block] = b; return block; } *************** *** 265,271 **** compiler_use_block(struct compiler *c, int block) { ! assert(block < c->c_nblocks); ! c->c_curblock = block; ! assert(c->c_blocks[block]); } --- 305,311 ---- compiler_use_block(struct compiler *c, int block) { ! assert(block < c->u->u_nblocks); ! c->u->u_curblock = block; ! assert(c->u->u_blocks[block]); } *************** *** 276,280 **** if (block < 0) return 0; ! c->c_curblock = block; return block; } --- 316,320 ---- if (block < 0) return 0; ! c->u->u_curblock = block; return block; } *************** *** 286,291 **** if (block < 0) return 0; ! c->c_blocks[c->c_curblock]->b_next = block; ! c->c_curblock = block; return block; } --- 326,331 ---- if (block < 0) return 0; ! c->u->u_blocks[c->u->u_curblock]->b_next = block; ! c->u->u_curblock = block; return block; } *************** *** 294,301 **** compiler_use_next_block(struct compiler *c, int block) { ! assert(block < c->c_nblocks); ! c->c_blocks[c->c_curblock]->b_next = block; ! assert(c->c_blocks[block]); ! c->c_curblock = block; return block; } --- 334,341 ---- compiler_use_next_block(struct compiler *c, int block) { ! assert(block < c->u->u_nblocks); ! c->u->u_blocks[c->u->u_curblock]->b_next = block; ! assert(c->u->u_blocks[block]); ! c->u->u_curblock = block; return block; } *************** *** 310,315 **** { struct basicblock *b; ! assert(block < c->c_nblocks); ! b = c->c_blocks[block]; assert(b); if (b->b_iused == b->b_ialloc) { --- 350,355 ---- { struct basicblock *b; ! assert(block < c->u->u_nblocks); ! b = c->u->u_blocks[block]; assert(b); if (b->b_iused == b->b_ialloc) { *************** *** 324,328 **** return -1; if (ptr != (void *)b) ! c->c_blocks[block] = (struct basicblock *)ptr; } return b->b_iused++; --- 364,368 ---- return -1; if (ptr != (void *)b) ! c->u->u_blocks[block] = (struct basicblock *)ptr; } return b->b_iused++; *************** *** 338,345 **** struct instr *i; int off; ! off = compiler_next_instr(c, c->c_curblock); if (off < 0) return 0; ! i = &c->c_blocks[c->c_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_hasarg = 0; --- 378,385 ---- struct instr *i; int off; ! off = compiler_next_instr(c, c->u->u_curblock); if (off < 0) return 0; ! i = &c->u->u_blocks[c->u->u_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_hasarg = 0; *************** *** 380,387 **** struct instr *i; int off; ! off = compiler_next_instr(c, c->c_curblock); if (off < 0) return 0; ! i = &c->c_blocks[c->c_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_oparg = oparg; --- 420,427 ---- struct instr *i; int off; ! off = compiler_next_instr(c, c->u->u_curblock); if (off < 0) return 0; ! i = &c->u->u_blocks[c->u->u_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_oparg = oparg; *************** *** 395,402 **** struct instr *i; int off; ! off = compiler_next_instr(c, c->c_curblock); if (off < 0) return 0; ! i = &c->c_blocks[c->c_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_oparg = block; --- 435,442 ---- struct instr *i; int off; ! off = compiler_next_instr(c, c->u->u_curblock); if (off < 0) return 0; ! i = &c->u->u_blocks[c->u->u_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_oparg = block; *************** *** 432,436 **** #define ADDOP_O(C, OP, O, TYPE) { \ ! if (!compiler_addop_o((C), (OP), (C)->c_ ## TYPE, (O))) \ return 0; \ } --- 472,476 ---- #define ADDOP_O(C, OP, O, TYPE) { \ ! if (!compiler_addop_o((C), (OP), (C)->u->u_ ## TYPE, (O))) \ return 0; \ } *************** *** 518,527 **** if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! ndefs += asdl_seq_LEN(args->args); ! c->c_argcount = ndefs; ! if (args->vararg) ! ndefs++; ! if (args->kwarg) ! ndefs++; VISIT_SEQ(c, stmt, s->v.FunctionDef.body); co = assemble(c); --- 558,562 ---- if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! c->u->u_argcount = ndefs; VISIT_SEQ(c, stmt, s->v.FunctionDef.body); co = assemble(c); *************** *** 601,605 **** elif = 1; s = t; ! c->c_lineno = t->lineno; } } --- 636,640 ---- elif = 1; s = t; ! c->u->u_lineno = t->lineno; } } *************** *** 689,707 **** int i; ! if (!c->c_nfblocks) return compiler_error(c, "'continue' outside loop"); ! i = c->c_nfblocks - 1; ! switch (c->c_fblock[i].fb_type) { case LOOP: ! ADDOP_JABS(c, JUMP_ABSOLUTE, c->c_fblock[i].fb_block); NEW_BLOCK(c); break; case EXCEPT: case FINALLY_TRY: ! while (--i > 0 && c->c_fblock[i].fb_type != LOOP) ; if (i == -1) return compiler_error(c, "'continue' outside loop"); ! ADDOP_I(c, CONTINUE_LOOP, c->c_fblock[i].fb_block); NEW_BLOCK(c); break; --- 724,742 ---- int i; ! if (!c->u->u_nfblocks) return compiler_error(c, "'continue' outside loop"); ! i = c->u->u_nfblocks - 1; ! switch (c->u->u_fblock[i].fb_type) { case LOOP: ! ADDOP_JABS(c, JUMP_ABSOLUTE, c->u->u_fblock[i].fb_block); NEW_BLOCK(c); break; case EXCEPT: case FINALLY_TRY: ! while (--i > 0 && c->u->u_fblock[i].fb_type != LOOP) ; if (i == -1) return compiler_error(c, "'continue' outside loop"); ! ADDOP_I(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block); NEW_BLOCK(c); break; *************** *** 722,726 **** fprintf(stderr, "compile stmt %d lineno %d\n", s->kind, s->lineno); ! c->c_lineno = s->lineno; /* XXX this isn't right */ switch (s->kind) { case FunctionDef_kind: --- 757,761 ---- fprintf(stderr, "compile stmt %d lineno %d\n", s->kind, s->lineno); ! c->u->u_lineno = s->lineno; /* XXX this isn't right */ switch (s->kind) { case FunctionDef_kind: *************** *** 822,826 **** break; case Break_kind: ! if (!c->c_nfblocks) return compiler_error(c, "'break' outside loop"); ADDOP(c, BREAK_LOOP); --- 857,861 ---- break; case Break_kind: ! if (!c->u->u_nfblocks) return compiler_error(c, "'break' outside loop"); ADDOP(c, BREAK_LOOP); *************** *** 893,897 **** op = 0; optype = OP_NAME; ! scope = PyST_GetScope(c->c_ste, name); switch (scope) { case FREE: --- 928,932 ---- op = 0; optype = OP_NAME; ! scope = PyST_GetScope(c->u->u_ste, name); switch (scope) { case FREE: *************** *** 900,908 **** break; case LOCAL: ! if (c->c_ste->ste_type == FunctionBlock) optype = OP_FAST; break; case GLOBAL_IMPLICIT: ! if (c->c_ste->ste_optimized) optype = OP_GLOBAL; break; --- 935,943 ---- break; case LOCAL: ! if (c->u->u_ste->ste_type == FunctionBlock) optype = OP_FAST; break; case GLOBAL_IMPLICIT: ! if (c->u->u_ste->ste_optimized) optype = OP_GLOBAL; break; *************** *** 920,923 **** --- 955,959 ---- break; case Del: + case Param: assert(0); /* impossible */ } *************** *** 929,932 **** --- 965,970 ---- case AugStore: break; + case Param: + assert(0); /* impossible */ } case OP_GLOBAL: *************** *** 937,940 **** --- 975,980 ---- case AugStore: break; + case Param: + assert(0); /* impossible */ } case OP_NAME: *************** *** 945,948 **** --- 985,990 ---- case AugStore: break; + case Param: + assert(0); /* impossible */ } } *************** *** 1055,1058 **** --- 1097,1103 ---- /* XXX */ break; + case Param: + assert(0); + break; } break; *************** *** 1081,1087 **** { struct fblockinfo *f; ! if (c->c_nfblocks >= CO_MAXBLOCKS) return 0; ! f = &c->c_fblock[c->c_nfblocks++]; f->fb_type = t; f->fb_block = b; --- 1126,1132 ---- { struct fblockinfo *f; ! if (c->u->u_nfblocks >= CO_MAXBLOCKS) return 0; ! f = &c->u->u_fblock[c->u->u_nfblocks++]; f->fb_type = t; f->fb_block = b; *************** *** 1092,1099 **** compiler_pop_fblock(struct compiler *c, enum fblocktype t, int b) { ! assert(c->c_nfblocks > 0); ! c->c_nfblocks--; ! assert(c->c_fblock[c->c_nfblocks].fb_type == t); ! assert(c->c_fblock[c->c_nfblocks].fb_block == b); } --- 1137,1145 ---- compiler_pop_fblock(struct compiler *c, enum fblocktype t, int b) { ! struct compiler_unit *u = c->u; ! assert(u->u_nfblocks > 0); ! u->u_nfblocks--; ! assert(u->u_fblock[u->u_nfblocks].fb_type == t); ! assert(u->u_fblock[u->u_nfblocks].fb_block == b); } *************** *** 1108,1117 **** PyObject *u = NULL, *v = NULL; ! loc = PyErr_ProgramText(c->c_filename, c->c_lineno); if (!loc) { Py_INCREF(Py_None); loc = Py_None; } ! u = Py_BuildValue("(ziOO)", c->c_filename, c->c_lineno, Py_None, loc); if (!u) goto exit; --- 1154,1164 ---- PyObject *u = NULL, *v = NULL; ! loc = PyErr_ProgramText(c->c_filename, c->u->u_lineno); if (!loc) { Py_INCREF(Py_None); loc = Py_None; } ! u = Py_BuildValue("(ziOO)", c->c_filename, c->u->u_lineno, ! Py_None, loc); if (!u) goto exit; *************** *** 1146,1152 **** struct instr *instr = NULL; ! if (block >= c->c_nblocks) return; ! b = c->c_blocks[block]; if (b->b_seen) return; --- 1193,1199 ---- struct instr *instr = NULL; ! if (block >= c->u->u_nblocks) return; ! b = c->u->u_blocks[block]; if (b->b_seen) return; *************** *** 1235,1239 **** code = PyString_AS_STRING(a->a_bytecode) + a->a_offset; fprintf(stderr, ! "emit %3d %-10s %5d\toffset = %2d\tsize = %d\text = %d\n", i->i_opcode, opnames[i->i_opcode], i->i_oparg, a->a_offset, size, ext); --- 1282,1286 ---- code = PyString_AS_STRING(a->a_bytecode) + a->a_offset; fprintf(stderr, ! "emit %3d %-15s %5d\toffset = %2d\tsize = %d\text = %d\n", i->i_opcode, opnames[i->i_opcode], i->i_oparg, a->a_offset, size, ext); *************** *** 1270,1279 **** for (i = a->a_nblocks - 1; i >= 0; i--) { int block = a->a_postorder[i]; ! bsize = blocksize(c->c_blocks[block]); blockoff[block] = totsize; totsize += bsize; } ! for (i = 0; i < c->c_nblocks; i++) { ! struct basicblock *b = c->c_blocks[i]; bsize = blockoff[i]; for (j = 0; j < b->b_iused; j++) { --- 1317,1326 ---- for (i = a->a_nblocks - 1; i >= 0; i--) { int block = a->a_postorder[i]; ! bsize = blocksize(c->u->u_blocks[block]); blockoff[block] = totsize; totsize += bsize; } ! for (i = 0; i < c->u->u_nblocks; i++) { ! struct basicblock *b = c->u->u_blocks[i]; bsize = blockoff[i]; for (j = 0; j < b->b_iused; j++) { *************** *** 1325,1335 **** PyObject *nil = PyTuple_New(0); ! consts = dict_keys_inorder(c->c_consts, 0); if (!consts) goto error; ! names = dict_keys_inorder(c->c_names, 0); if (!names) goto error; ! varnames = PySequence_Tuple(c->c_varnames); if (!varnames) goto error; --- 1372,1382 ---- PyObject *nil = PyTuple_New(0); ! consts = dict_keys_inorder(c->u->u_consts, 0); if (!consts) goto error; ! names = dict_keys_inorder(c->u->u_names, 0); if (!names) goto error; ! varnames = PySequence_Tuple(c->u->u_varnames); if (!varnames) goto error; *************** *** 1338,1345 **** goto error; ! co = PyCode_New(c->c_argcount, 0, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, nil, nil, ! filename, c->c_name, 0, filename); /* XXX lnotab */ --- 1385,1392 ---- goto error; ! co = PyCode_New(c->u->u_argcount, 0, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, nil, nil, ! filename, c->u->u_name, 0, filename); /* XXX lnotab */ *************** *** 1369,1373 **** ADDOP(c, RETURN_VALUE); ! if (!assemble_init(&a, c->c_nblocks)) goto error; dfs(c, 0, &a); --- 1416,1420 ---- ADDOP(c, RETURN_VALUE); ! if (!assemble_init(&a, c->u->u_nblocks)) goto error; dfs(c, 0, &a); *************** *** 1379,1383 **** /* Emit code in reverse postorder from dfs. */ for (i = a.a_nblocks - 1; i >= 0; i--) { ! struct basicblock *b = c->c_blocks[a.a_postorder[i]]; fprintf(stderr, "block %d(%d): used=%d alloc=%d\n", i, a.a_postorder[i], b->b_iused, b->b_ialloc); --- 1426,1430 ---- /* Emit code in reverse postorder from dfs. */ for (i = a.a_nblocks - 1; i >= 0; i--) { ! struct basicblock *b = c->u->u_blocks[a.a_postorder[i]]; fprintf(stderr, "block %d(%d): used=%d alloc=%d\n", i, a.a_postorder[i], b->b_iused, b->b_ialloc); *************** *** 1387,1390 **** --- 1434,1438 ---- } } + fprintf(stderr, "\n"); if (_PyString_Resize(&a.a_bytecode, a.a_offset) < 0) From mwh@users.sourceforge.net Wed Oct 2 14:13:48 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Wed, 02 Oct 2002 06:13:48 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_trace.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1712/src/Lib/test Modified Files: test_trace.py Log Message: Fix for the recursion_level bug Armin Rigo reported in sf patch #617312, both on the trunk and the 22-maint branch. Also added a test case, and ported the test_trace I wrote for HEAD to 2.2.2 (with all those horrible extra 'line' events ;-). Index: test_trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_trace.py 11 Sep 2002 15:36:32 -0000 1.3 --- test_trace.py 2 Oct 2002 13:13:46 -0000 1.4 *************** *** 178,183 **** --- 178,203 ---- self.run_test2(settrace_and_raise) + class RaisingTraceFuncTestCase(unittest.TestCase): + def test_it(self): + def tr(frame, event, arg): + raise ValueError # just something that isn't RuntimeError + def f(): + return 1 + try: + for i in xrange(sys.getrecursionlimit() + 1): + sys.settrace(tr) + try: + f() + except ValueError: + pass + else: + self.fail("exception not thrown!") + except RuntimeError: + self.fail("recursion counter not reset") + + def test_main(): test_support.run_unittest(TraceTestCase) + test_support.run_unittest(RaisingTraceFuncTestCase) if __name__ == "__main__": From mwh@users.sourceforge.net Wed Oct 2 14:13:48 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Wed, 02 Oct 2002 06:13:48 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.336,2.337 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1712/src/Python Modified Files: ceval.c Log Message: Fix for the recursion_level bug Armin Rigo reported in sf patch #617312, both on the trunk and the 22-maint branch. Also added a test case, and ported the test_trace I wrote for HEAD to 2.2.2 (with all those horrible extra 'line' events ;-). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.336 retrieving revision 2.337 diff -C2 -d -r2.336 -r2.337 *** ceval.c 11 Sep 2002 15:36:31 -0000 2.336 --- ceval.c 2 Oct 2002 13:13:46 -0000 2.337 *************** *** 637,640 **** --- 637,642 ---- f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ + --tstate->recursion_depth; + tstate->frame = f->f_back; return NULL; } *************** *** 647,650 **** --- 649,654 ---- f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ + --tstate->recursion_depth; + tstate->frame = f->f_back; return NULL; } From mwh@users.sourceforge.net Wed Oct 2 14:13:49 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Wed, 02 Oct 2002 06:13:49 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.301.4.4,2.301.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1712/src-22x/Python Modified Files: Tag: release22-maint ceval.c Log Message: Fix for the recursion_level bug Armin Rigo reported in sf patch #617312, both on the trunk and the 22-maint branch. Also added a test case, and ported the test_trace I wrote for HEAD to 2.2.2 (with all those horrible extra 'line' events ;-). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.301.4.4 retrieving revision 2.301.4.5 diff -C2 -d -r2.301.4.4 -r2.301.4.5 *** ceval.c 5 Aug 2002 14:46:29 -0000 2.301.4.4 --- ceval.c 2 Oct 2002 13:13:47 -0000 2.301.4.5 *************** *** 613,616 **** --- 613,618 ---- f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ + --tstate->recursion_depth; + tstate->frame = f->f_back; return NULL; } *************** *** 623,626 **** --- 625,630 ---- f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ + --tstate->recursion_depth; + tstate->frame = f->f_back; return NULL; } From mwh@users.sourceforge.net Wed Oct 2 14:13:49 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Wed, 02 Oct 2002 06:13:49 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_trace.py,NONE,1.4.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1712/src-22x/Lib/test Added Files: Tag: release22-maint test_trace.py Log Message: Fix for the recursion_level bug Armin Rigo reported in sf patch #617312, both on the trunk and the 22-maint branch. Also added a test case, and ported the test_trace I wrote for HEAD to 2.2.2 (with all those horrible extra 'line' events ;-). --- NEW FILE: test_trace.py --- # Testing the line trace facility. import test_support import unittest import sys import difflib # A very basic example. If this fails, we're in deep trouble. def basic(): return 1 basic.events = [(0, 'call'), (0, 'line'), (1, 'line'), (1, 'return')] # Armin Rigo's failing example: def arigo_example(): x = 1 del x while 0: pass x = 1 arigo_example.events = [(0, 'call'), (0, 'line'), (1, 'line'), (2, 'line'), (3, 'line'), (3, 'line'), (5, 'line'), (5, 'return')] # check that lines consisting of just one instruction get traced: def one_instr_line(): x = 1 del x x = 1 one_instr_line.events = [(0, 'call'), (0, 'line'), (1, 'line'), (2, 'line'), (3, 'line'), (3, 'return')] def no_pop_tops(): # 0 x = 1 # 1 for a in range(2): # 2 if a: # 3 x = 1 # 4 else: # 5 x = 1 # 6 no_pop_tops.events = [(0, 'call'), (0, 'line'), (1, 'line'), (2, 'line'), (2, 'line'), (3, 'line'), (6, 'line'), (2, 'line'), (3, 'line'), (4, 'line'), (2, 'line'), (2, 'return')] def no_pop_blocks(): while 0: bla x = 1 no_pop_blocks.events = [(0, 'call'), (0, 'line'), (1, 'line'), (1, 'line'), (3, 'line'), (3, 'return')] def called(): # line -3 x = 1 def call(): # line 0 called() call.events = [(0, 'call'), (0, 'line'), (1, 'line'), (-3, 'call'), (-3, 'line'), (-2, 'line'), (-2, 'return'), (1, 'return')] def raises(): raise Exception def test_raise(): try: raises() except Exception, exc: x = 1 test_raise.events = [(0, 'call'), (0, 'line'), (1, 'line'), (2, 'line'), (-3, 'call'), (-3, 'line'), (-2, 'line'), (-2, 'exception'), (2, 'exception'), (3, 'line'), (4, 'line'), (4, 'return')] def _settrace_and_return(tracefunc): sys.settrace(tracefunc) sys._getframe().f_back.f_trace = tracefunc def settrace_and_return(tracefunc): _settrace_and_return(tracefunc) settrace_and_return.events = [(1, 'return')] def _settrace_and_raise(tracefunc): sys.settrace(tracefunc) sys._getframe().f_back.f_trace = tracefunc raise RuntimeError def settrace_and_raise(tracefunc): try: _settrace_and_raise(tracefunc) except RuntimeError, exc: pass settrace_and_raise.events = [(2, 'exception'), (3, 'line'), (4, 'line'), (4, 'return')] class Tracer: def __init__(self): self.events = [] def trace(self, frame, event, arg): self.events.append((frame.f_lineno, event)) return self.trace class TraceTestCase(unittest.TestCase): def compare_events(self, line_offset, events, expected_events): events = [(l - line_offset, e) for (l, e) in events] if events != expected_events: self.fail( "events did not match expectation:\n" + "\n".join(difflib.ndiff(map(str, expected_events), map(str, events)))) def run_test(self, func): tracer = Tracer() sys.settrace(tracer.trace) func() sys.settrace(None) self.compare_events(func.func_code.co_firstlineno, tracer.events, func.events) def run_test2(self, func): tracer = Tracer() func(tracer.trace) sys.settrace(None) self.compare_events(func.func_code.co_firstlineno, tracer.events, func.events) def test_1_basic(self): self.run_test(basic) def test_2_arigo(self): self.run_test(arigo_example) def test_3_one_instr(self): self.run_test(one_instr_line) def test_4_no_pop_blocks(self): self.run_test(no_pop_blocks) def test_5_no_pop_tops(self): self.run_test(no_pop_tops) def test_6_call(self): self.run_test(call) def test_7_raise(self): self.run_test(test_raise) def test_8_settrace_and_return(self): self.run_test2(settrace_and_return) def test_9_settrace_and_raise(self): self.run_test2(settrace_and_raise) class RaisingTraceFuncTestCase(unittest.TestCase): def test_it(self): def tr(frame, event, arg): raise ValueError # just something that isn't RuntimeError def f(): return 1 try: for i in xrange(sys.getrecursionlimit() + 1): sys.settrace(tr) try: f() except ValueError: pass else: self.fail("exception not thrown!") except RuntimeError: self.fail("recursion counter not reset") def test_main(): test_support.run_unittest(TraceTestCase) test_support.run_unittest(RaisingTraceFuncTestCase) if __name__ == "__main__": test_main() From gvanrossum@users.sourceforge.net Wed Oct 2 16:47:07 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 02 Oct 2002 08:47:07 -0700 Subject: [Python-checkins] python/dist/src/Lib textwrap.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26720 Modified Files: textwrap.py Log Message: Fix an endcase bug: initial_indent was ignored when the text was short enough to fit in one line. Index: textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** textwrap.py 22 Aug 2002 21:28:00 -0000 1.15 --- textwrap.py 2 Oct 2002 15:47:05 -0000 1.16 *************** *** 238,243 **** """ text = self._munge_whitespace(text) ! if len(text) <= self.width: ! return [text] chunks = self._split(text) if self.fix_sentence_endings: --- 238,244 ---- """ text = self._munge_whitespace(text) ! indent = self.initial_indent ! if len(text) + len(indent) <= self.width: ! return [indent + text] chunks = self._split(text) if self.fix_sentence_endings: From gvanrossum@users.sourceforge.net Wed Oct 2 16:47:34 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 02 Oct 2002 08:47:34 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26905 Modified Files: test_textwrap.py Log Message: Fix an endcase bug: initial_indent was ignored when the text was short enough to fit in one line. Index: test_textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_textwrap.py 22 Aug 2002 21:27:05 -0000 1.14 --- test_textwrap.py 2 Oct 2002 15:47:32 -0000 1.15 *************** *** 34,42 **** self.show(expect), self.show(result))) ! def check_wrap (self, text, width, expect): ! result = wrap(text, width) self.check(result, expect) ! def check_split (self, wrapper, text, expect): result = wrapper._split(text) self.assertEquals(result, expect, --- 34,42 ---- self.show(expect), self.show(result))) ! def check_wrap(self, text, width, expect, **kwargs): ! result = wrap(text, width, **kwargs) self.check(result, expect) ! def check_split(self, wrapper, text, expect): result = wrapper._split(text) self.assertEquals(result, expect, *************** *** 100,103 **** --- 100,113 ---- "paragraph."]) self.check_wrap(text, 40, ["This is a short paragraph."]) + + + def test_wrap_short_1line(self): + # Test endcases + + text = "This is a short line." + + self.check_wrap(text, 30, ["This is a short line."]) + self.check_wrap(text, 30, ["(1) This is a short line."], + initial_indent="(1) ") From mhammond@users.sourceforge.net Thu Oct 3 06:10:40 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:40 -0700 Subject: [Python-checkins] python/dist/src/Include pyerrors.h,2.60,2.61 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv29768/Include Modified Files: pyerrors.h Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.60 retrieving revision 2.61 diff -C2 -d -r2.60 -r2.61 *** pyerrors.h 15 Sep 2002 14:09:21 -0000 2.60 --- pyerrors.h 3 Oct 2002 05:10:38 -0000 2.61 *************** *** 82,95 **** PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) Py_GCC_ATTRIBUTE((format(printf, 2, 3))); #ifdef MS_WINDOWS ! PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyObject *,int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); ! #endif /* Export the old function so that the existing API remains available: */ --- 82,116 ---- PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); + PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( + PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); + #ifdef Py_WIN_WIDE_FILENAMES + PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( + PyObject *, Py_UNICODE *); + #endif /* Py_WIN_WIDE_FILENAMES */ + PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) Py_GCC_ATTRIBUTE((format(printf, 2, 3))); + #ifdef MS_WINDOWS ! PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject( ! int, const char *); ! PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( ! int, const char *); ! #ifdef Py_WIN_WIDE_FILENAMES ! PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( ! int, const Py_UNICODE *); ! #endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); + PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( + PyObject *,int, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyObject *,int, const char *); + #ifdef Py_WIN_WIDE_FILENAMES + PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( + PyObject *,int, const Py_UNICODE *); + #endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); ! #endif /* MS_WINDOWS */ /* Export the old function so that the existing API remains available: */ From mhammond@users.sourceforge.net Thu Oct 3 06:10:40 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:40 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode_file.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv29768/Lib/test Modified Files: test_unicode_file.py Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: test_unicode_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode_file.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_unicode_file.py 23 Jul 2002 19:04:08 -0000 1.5 --- test_unicode_file.py 3 Oct 2002 05:10:38 -0000 1.6 *************** *** 41,44 **** --- 41,48 ---- # Test rename + try: + os.unlink(TESTFN_ENCODED + ".new") + except os.error: + pass os.rename(TESTFN_ENCODED, TESTFN_ENCODED + ".new") os.rename(TESTFN_UNICODE+".new", TESTFN_ENCODED) From mhammond@users.sourceforge.net Thu Oct 3 06:10:41 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:41 -0700 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv29768/PC Modified Files: pyconfig.h Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pyconfig.h 19 Jul 2002 06:55:41 -0000 1.14 --- pyconfig.h 3 Oct 2002 05:10:39 -0000 1.15 *************** *** 401,404 **** --- 401,408 ---- #if Py_UNICODE_SIZE == 2 #define HAVE_USABLE_WCHAR_T + + /* Define to indicate that the Python Unicode representation can be passed + as-is to Win32 Wide API. */ + #define Py_WIN_WIDE_FILENAMES #endif From mhammond@users.sourceforge.net Thu Oct 3 06:10:41 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:41 -0700 Subject: [Python-checkins] python/dist/src/Python errors.c,2.71,2.72 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv29768/Python Modified Files: errors.c Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.71 retrieving revision 2.72 diff -C2 -d -r2.71 -r2.72 *** errors.c 29 Jul 2002 14:27:41 -0000 2.71 --- errors.c 3 Oct 2002 05:10:39 -0000 2.72 *************** *** 260,264 **** PyObject * ! PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) { PyObject *v; --- 260,264 ---- PyObject * ! PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject) { PyObject *v; *************** *** 315,320 **** #endif /* Unix/Windows */ #endif /* PLAN 9*/ ! if (filename != NULL) ! v = Py_BuildValue("(iss)", i, s, filename); else v = Py_BuildValue("(is)", i, s); --- 315,320 ---- #endif /* Unix/Windows */ #endif /* PLAN 9*/ ! if (filenameObject != NULL) ! v = Py_BuildValue("(isO)", i, s, filenameObject); else v = Py_BuildValue("(is)", i, s); *************** *** 331,345 **** PyObject * PyErr_SetFromErrno(PyObject *exc) { ! return PyErr_SetFromErrnoWithFilename(exc, NULL); } #ifdef MS_WINDOWS /* Windows specific error code handling */ ! PyObject *PyErr_SetExcFromWindowsErrWithFilename( PyObject *exc, int ierr, ! const char *filename) { int len; --- 331,367 ---- PyObject * + PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) + { + PyObject *name = filename ? PyString_FromString(filename) : NULL; + PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); + Py_DECREF(name); + return result; + } + + #ifdef Py_WIN_WIDE_FILENAMES + PyObject * + PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, Py_UNICODE *filename) + { + PyObject *name = filename ? + PyUnicode_FromUnicode(filename, wcslen(filename)) : + NULL; + PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); + Py_XDECREF(name); + return result; + } + #endif /* Py_WIN_WIDE_FILENAMES */ + + PyObject * PyErr_SetFromErrno(PyObject *exc) { ! return PyErr_SetFromErrnoWithFilenameObject(exc, NULL); } #ifdef MS_WINDOWS /* Windows specific error code handling */ ! PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject( PyObject *exc, int ierr, ! PyObject *filenameObject) { int len; *************** *** 363,368 **** while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) s[--len] = '\0'; ! if (filename != NULL) ! v = Py_BuildValue("(iss)", err, s, filename); else v = Py_BuildValue("(is)", err, s); --- 385,390 ---- while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) s[--len] = '\0'; ! if (filenameObject != NULL) ! v = Py_BuildValue("(isO)", err, s, filenameObject); else v = Py_BuildValue("(is)", err, s); *************** *** 375,378 **** --- 397,430 ---- } + PyObject *PyErr_SetExcFromWindowsErrWithFilename( + PyObject *exc, + int ierr, + const char *filename) + { + PyObject *name = filename ? PyString_FromString(filename) : NULL; + PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc, + ierr, + name); + Py_XDECREF(name); + return ret; + } + + #ifdef Py_WIN_WIDE_FILENAMES + PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename( + PyObject *exc, + int ierr, + const Py_UNICODE *filename) + { + PyObject *name = filename ? + PyUnicode_FromUnicode(filename, wcslen(filename)) : + NULL; + PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc, + ierr, + name); + Py_XDECREF(name); + return ret; + } + #endif /* Py_WIN_WIDE_FILENAMES */ + PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr) { *************** *** 389,395 **** const char *filename) { ! return PyErr_SetExcFromWindowsErrWithFilename(PyExc_WindowsError, ! ierr, filename); } #endif /* MS_WINDOWS */ --- 441,467 ---- const char *filename) { ! PyObject *name = filename ? PyString_FromString(filename) : NULL; ! PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject( ! PyExc_WindowsError, ! ierr, name); ! Py_XDECREF(result); ! return result; } + + #ifdef Py_WIN_WIDE_FILENAMES + PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( + int ierr, + const Py_UNICODE *filename) + { + PyObject *name = filename ? + PyUnicode_FromUnicode(filename, wcslen(filename)) : + NULL; + PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject( + PyExc_WindowsError, + ierr, name); + Py_XDECREF(result); + return result; + } + #endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */ From mhammond@users.sourceforge.net Thu Oct 3 06:10:41 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:41 -0700 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.168,2.169 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv29768/Objects Modified Files: fileobject.c Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.168 retrieving revision 2.169 diff -C2 -d -r2.168 -r2.169 *** fileobject.c 14 Aug 2002 21:01:41 -0000 2.168 --- fileobject.c 3 Oct 2002 05:10:39 -0000 2.169 *************** *** 16,19 **** --- 16,25 ---- #endif + #ifdef _MSC_VER + /* Need GetVersion to see if on NT so safe to use _wfopen */ + #define WIN32_LEAN_AND_MEAN + #include + #endif /* _MSC_VER */ + #ifdef macintosh #ifdef USE_GUSI *************** *** 103,107 **** static PyObject * fill_file_fields(PyFileObject *f, FILE *fp, char *name, char *mode, ! int (*close)(FILE *)) { assert(f != NULL); --- 109,113 ---- static PyObject * fill_file_fields(PyFileObject *f, FILE *fp, char *name, char *mode, ! int (*close)(FILE *), PyObject *wname) { assert(f != NULL); *************** *** 111,115 **** Py_DECREF(f->f_name); Py_DECREF(f->f_mode); ! f->f_name = PyString_FromString(name); f->f_mode = PyString_FromString(mode); --- 117,124 ---- Py_DECREF(f->f_name); Py_DECREF(f->f_mode); ! if (wname) ! f->f_name = PyUnicode_FromObject(wname); ! else ! f->f_name = PyString_FromString(name); f->f_mode = PyString_FromString(mode); *************** *** 136,140 **** --- 145,154 ---- assert(f != NULL); assert(PyFile_Check(f)); + #ifdef MS_WINDOWS + /* windows ignores the passed name in order to support Unicode */ + assert(f->f_name != NULL); + #else assert(name != NULL); + #endif assert(mode != NULL); assert(f->f_fp == NULL); *************** *** 157,161 **** #endif { - Py_BEGIN_ALLOW_THREADS #ifdef WITH_UNIVERSAL_NEWLINES if (strcmp(mode, "U") == 0 || strcmp(mode, "rU") == 0) --- 171,174 ---- *************** *** 169,174 **** mode = "r"; #endif ! f->f_fp = fopen(name, mode); ! Py_END_ALLOW_THREADS } if (f->f_fp == NULL) { --- 182,205 ---- mode = "r"; #endif ! #ifdef MS_WINDOWS ! if (PyUnicode_Check(f->f_name)) { ! PyObject *wmode; ! wmode = PyUnicode_DecodeASCII(mode, strlen(mode), NULL); ! if (f->f_name && wmode) { ! Py_BEGIN_ALLOW_THREADS ! /* PyUnicode_AS_UNICODE OK without thread ! lock as it is a simple dereference. */ ! f->f_fp = _wfopen(PyUnicode_AS_UNICODE(f->f_name), ! PyUnicode_AS_UNICODE(wmode)); ! Py_END_ALLOW_THREADS ! } ! Py_XDECREF(wmode); ! } ! #endif ! if (NULL == f->f_fp && NULL != name) { ! Py_BEGIN_ALLOW_THREADS ! f->f_fp = fopen(name, mode); ! Py_END_ALLOW_THREADS ! } } if (f->f_fp == NULL) { *************** *** 202,206 **** --- 233,241 ---- mode); else + #ifdef MS_WINDOWS + PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, f->f_name); + #else PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); + #endif /* MS_WINDOWS */ f = NULL; } *************** *** 216,220 **** NULL, NULL); if (f != NULL) { ! if (fill_file_fields(f, fp, name, mode, close) == NULL) { Py_DECREF(f); f = NULL; --- 251,255 ---- NULL, NULL); if (f != NULL) { ! if (fill_file_fields(f, fp, name, mode, close, NULL) == NULL) { Py_DECREF(f); f = NULL; *************** *** 294,302 **** file_repr(PyFileObject *f) { ! return PyString_FromFormat("<%s file '%s', mode '%s' at %p>", f->f_fp == NULL ? "closed" : "open", PyString_AsString(f->f_name), PyString_AsString(f->f_mode), f); } --- 329,350 ---- file_repr(PyFileObject *f) { ! if (PyUnicode_Check(f->f_name)) { ! PyObject *ret = NULL; ! PyObject *name; ! name = PyUnicode_AsUnicodeEscapeString(f->f_name); ! ret = PyString_FromFormat("<%s file u'%s', mode '%s' at %p>", ! f->f_fp == NULL ? "closed" : "open", ! PyString_AsString(name), ! PyString_AsString(f->f_mode), ! f); ! Py_XDECREF(name); ! return ret; ! } else { ! return PyString_FromFormat("<%s file '%s', mode '%s' at %p>", f->f_fp == NULL ? "closed" : "open", PyString_AsString(f->f_name), PyString_AsString(f->f_mode), f); + } } *************** *** 1767,1770 **** --- 1815,1819 ---- char *mode = "r"; int bufsize = -1; + int wideargument = 0; assert(PyFile_Check(self)); *************** *** 1777,1786 **** } ! if (!PyArg_ParseTupleAndKeywords(args, kwds, "et|si:file", kwlist, ! Py_FileSystemDefaultEncoding, &name, ! &mode, &bufsize)) ! return -1; ! if (fill_file_fields(foself, NULL, name, mode, fclose) == NULL) ! goto Error; if (open_the_file(foself, name, mode) == NULL) goto Error; --- 1826,1856 ---- } ! #ifdef Py_WIN_WIDE_FILENAMES ! if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ ! PyObject *po; ! if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file", ! kwlist, &po, &mode, &bufsize)) { ! wideargument = 1; ! if (fill_file_fields(foself, NULL, name, mode, ! fclose, po) == NULL) ! goto Error; ! } else { ! /* Drop the argument parsing error as narrow ! strings are also valid. */ ! PyErr_Clear(); ! } ! } ! #endif ! ! if (!wideargument) { ! if (!PyArg_ParseTupleAndKeywords(args, kwds, "et|si:file", kwlist, ! Py_FileSystemDefaultEncoding, ! &name, ! &mode, &bufsize)) ! return -1; ! if (fill_file_fields(foself, NULL, name, mode, ! fclose, NULL) == NULL) ! goto Error; ! } if (open_the_file(foself, name, mode) == NULL) goto Error; From mhammond@users.sourceforge.net Thu Oct 3 06:10:41 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Wed, 02 Oct 2002 22:10:41 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.260,2.261 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv29768/Modules Modified Files: posixmodule.c Log Message: Patch 594001: PEP 277 - Unicode file name support for Windows NT. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.260 retrieving revision 2.261 diff -C2 -d -r2.260 -r2.261 *** posixmodule.c 19 Sep 2002 08:03:20 -0000 2.260 --- posixmodule.c 3 Oct 2002 05:10:38 -0000 2.261 *************** *** 368,371 **** --- 368,380 ---- } + #ifdef Py_WIN_WIDE_FILENAMES + static PyObject * + posix_error_with_unicode_filename(Py_UNICODE* name) + { + return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name); + } + #endif /* Py_WIN_WIDE_FILENAMES */ + + static PyObject * posix_error_with_allocated_filename(char* name) *************** *** 391,394 **** --- 400,437 ---- return PyErr_SetFromWindowsErr(errno); } + + #ifdef Py_WIN_WIDE_FILENAMES + static PyObject * + win32_error_unicode(char* function, Py_UNICODE* filename) + { + /* XXX - see win32_error for comments on 'function' */ + errno = GetLastError(); + if (filename) + return PyErr_SetFromWindowsErrWithUnicodeFilename(errno, filename); + else + return PyErr_SetFromWindowsErr(errno); + } + + static PyObject *_PyUnicode_FromFileSystemEncodedObject(register PyObject *obj) + { + /* XXX Perhaps we should make this API an alias of + PyObject_Unicode() instead ?! */ + if (PyUnicode_CheckExact(obj)) { + Py_INCREF(obj); + return obj; + } + if (PyUnicode_Check(obj)) { + /* For a Unicode subtype that's not a Unicode object, + return a true Unicode object with the same data. */ + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(obj), + PyUnicode_GET_SIZE(obj)); + } + return PyUnicode_FromEncodedObject(obj, + Py_FileSystemDefaultEncoding, + "strict"); + } + + #endif /* Py_WIN_WIDE_FILENAMES */ + #endif *************** *** 488,496 **** } static PyObject * ! posix_1str(PyObject *args, char *format, int (*func)(const char*)) { char *path1 = NULL; int res; if (!PyArg_ParseTuple(args, format, Py_FileSystemDefaultEncoding, &path1)) --- 531,578 ---- } + #ifdef Py_WIN_WIDE_FILENAMES + static int + unicode_file_names(void) + { + static int canusewide = -1; + if (canusewide == -1) { + /* As per doc for ::GetVersion(), this is the correct test for + the Windows NT family. */ + canusewide = (GetVersion() < 0x80000000) ? 1 : 0; + } + return canusewide; + } + #endif + static PyObject * ! posix_1str(PyObject *args, char *format, int (*func)(const char*), ! char *wformat, int (*wfunc)(const Py_UNICODE*)) { char *path1 = NULL; int res; + #ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, wformat, &po)) { + Py_BEGIN_ALLOW_THREADS + /* PyUnicode_AS_UNICODE OK without thread + lock as it is a simple dereference. */ + res = (*wfunc)(PyUnicode_AS_UNICODE(po)); + Py_END_ALLOW_THREADS + if (res < 0) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; + } + /* Drop the argument parsing error as narrow + strings are also valid. */ + PyErr_Clear(); + } + #else + /* Platforms that don't support Unicode filenames + shouldn't be passing these extra params */ + assert(wformat==NULL && wfunc == NULL); + #endif + if (!PyArg_ParseTuple(args, format, Py_FileSystemDefaultEncoding, &path1)) *************** *** 507,515 **** static PyObject * ! posix_2str(PyObject *args, char *format, ! int (*func)(const char *, const char *)) { char *path1 = NULL, *path2 = NULL; int res; if (!PyArg_ParseTuple(args, format, Py_FileSystemDefaultEncoding, &path1, --- 589,640 ---- static PyObject * ! posix_2str(PyObject *args, ! char *format, ! int (*func)(const char *, const char *), ! char *wformat, ! int (*wfunc)(const Py_UNICODE *, const Py_UNICODE *)) { char *path1 = NULL, *path2 = NULL; int res; + #ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { + PyObject *po1; + PyObject *po2; + if (PyArg_ParseTuple(args, wformat, &po1, &po2)) { + if (PyUnicode_Check(po1) || PyUnicode_Check(po2)) { + PyObject *wpath1; + PyObject *wpath2; + wpath1 = _PyUnicode_FromFileSystemEncodedObject(po1); + wpath2 = _PyUnicode_FromFileSystemEncodedObject(po2); + if (!wpath1 || !wpath2) { + Py_XDECREF(wpath1); + Py_XDECREF(wpath2); + return NULL; + } + Py_BEGIN_ALLOW_THREADS + /* PyUnicode_AS_UNICODE OK without thread + lock as it is a simple dereference. */ + res = (*wfunc)(PyUnicode_AS_UNICODE(wpath1), + PyUnicode_AS_UNICODE(wpath2)); + Py_END_ALLOW_THREADS + Py_XDECREF(wpath1); + Py_XDECREF(wpath2); + if (res != 0) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; + } + /* Else flow through as neither is Unicode. */ + } + /* Drop the argument parsing error as narrow + strings are also valid. */ + PyErr_Clear(); + } + #else + /* Platforms that don't support Unicode filenames + shouldn't be passing these extra params */ + assert(wformat==NULL && wfunc == NULL); + #endif + if (!PyArg_ParseTuple(args, format, Py_FileSystemDefaultEncoding, &path1, *************** *** 693,698 **** static PyObject * ! posix_do_stat(PyObject *self, PyObject *args, char *format, ! int (*statfunc)(const char *, STRUCT_STAT *)) { STRUCT_STAT st; --- 818,826 ---- static PyObject * ! posix_do_stat(PyObject *self, PyObject *args, ! char *format, ! int (*statfunc)(const char *, STRUCT_STAT *), ! char *wformat, ! int (*wstatfunc)(const Py_UNICODE *, STRUCT_STAT *)) { STRUCT_STAT st; *************** *** 706,709 **** --- 834,881 ---- #endif /* MS_WINDOWS */ + + #ifdef Py_WIN_WIDE_FILENAMES + /* If on wide-character-capable OS see if argument + is Unicode and if so use wide API. */ + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, wformat, &po)) { + Py_UNICODE wpath[MAX_PATH+1]; + pathlen = wcslen(PyUnicode_AS_UNICODE(po)); + /* the library call can blow up if the file name is too long! */ + if (pathlen > MAX_PATH) { + errno = ENAMETOOLONG; + return posix_error(); + } + wcscpy(wpath, PyUnicode_AS_UNICODE(po)); + /* Remove trailing slash or backslash, unless it's the current + drive root (/ or \) or a specific drive's root (like c:\ or c:/). + */ + if (pathlen > 0 && + (wpath[pathlen-1]== L'\\' || wpath[pathlen-1] == L'/')) { + /* It does end with a slash -- exempt the root drive cases. */ + /* XXX UNC root drives should also be exempted? */ + if (pathlen == 1 || (pathlen == 3 && wpath[1] == L':')) + /* leave it alone */; + else { + /* nuke the trailing backslash */ + wpath[pathlen-1] = L'\0'; + } + } + Py_BEGIN_ALLOW_THREADS + /* PyUnicode_AS_UNICODE result OK without + thread lock as it is a simple dereference. */ + res = wstatfunc(wpath, &st); + Py_END_ALLOW_THREADS + if (res != 0) + return posix_error_with_unicode_filename(wpath); + return _pystat_fromstructstat(st); + } + /* Drop the argument parsing error as narrow strings + are also valid. */ + PyErr_Clear(); + } + #endif + if (!PyArg_ParseTuple(args, format, Py_FileSystemDefaultEncoding, &path)) *************** *** 840,847 **** posix_chdir(PyObject *self, PyObject *args) { ! #if defined(PYOS_OS2) && defined(PYCC_GCC) ! return posix_1str(args, "et:chdir", _chdir2); #else ! return posix_1str(args, "et:chdir", chdir); #endif } --- 1012,1021 ---- posix_chdir(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS ! return posix_1str(args, "et:chdir", chdir, "U:chdir", _wchdir); ! #elif defined(PYOS_OS2) && defined(PYCC_GCC) ! return posix_1str(args, "et:chdir", _chdir2, NULL, NULL); #else ! return posix_1str(args, "et:chdir", chdir, NULL, NULL); #endif } *************** *** 893,897 **** posix_chroot(PyObject *self, PyObject *args) { ! return posix_1str(args, "et:chroot", chroot); } #endif --- 1067,1071 ---- posix_chroot(PyObject *self, PyObject *args) { ! return posix_1str(args, "et:chroot", chroot, NULL, NULL); } #endif *************** *** 1005,1008 **** --- 1179,1219 ---- return PyString_FromString(buf); } + + PyDoc_STRVAR(posix_getcwdu__doc__, + "getcwdu() -> path\n\n\ + Return a unicode string representing the current working directory."); + + static PyObject * + posix_getcwdu(PyObject *self, PyObject *args) + { + char buf[1026]; + char *res; + if (!PyArg_ParseTuple(args, ":getcwd")) + return NULL; + + #ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { + wchar_t *wres; + wchar_t wbuf[1026]; + Py_BEGIN_ALLOW_THREADS + wres = _wgetcwd(wbuf, sizeof wbuf/ sizeof wbuf[0]); + Py_END_ALLOW_THREADS + if (wres == NULL) + return posix_error(); + return PyUnicode_FromWideChar(wbuf, wcslen(wbuf)); + } + #endif + + Py_BEGIN_ALLOW_THREADS + #if defined(PYOS_OS2) && defined(PYCC_GCC) + res = _getcwd2(buf, sizeof buf); + #else + res = getcwd(buf, sizeof buf); + #endif + Py_END_ALLOW_THREADS + if (res == NULL) + return posix_error(); + return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"strict"); + } #endif *************** *** 1016,1020 **** posix_link(PyObject *self, PyObject *args) { ! return posix_2str(args, "etet:link", link); } #endif /* HAVE_LINK */ --- 1227,1231 ---- posix_link(PyObject *self, PyObject *args) { ! return posix_2str(args, "etet:link", link, NULL, NULL); } #endif /* HAVE_LINK */ *************** *** 1045,1048 **** --- 1256,1319 ---- int len = sizeof(namebuf)/sizeof(namebuf[0]); + #ifdef Py_WIN_WIDE_FILENAMES + /* If on wide-character-capable OS see if argument + is Unicode and if so use wide API. */ + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, "U:listdir", &po)) { + WIN32_FIND_DATAW wFileData; + Py_UNICODE wnamebuf[MAX_PATH*2+5]; + Py_UNICODE wch; + wcsncpy(wnamebuf, PyUnicode_AS_UNICODE(po), MAX_PATH); + wnamebuf[MAX_PATH] = L'\0'; + len = wcslen(wnamebuf); + wch = (len > 0) ? wnamebuf[len-1] : L'\0'; + if (wch != L'/' && wch != L'\\' && wch != L':') + wnamebuf[len++] = L'/'; + wcscpy(wnamebuf + len, L"*.*"); + if ((d = PyList_New(0)) == NULL) + return NULL; + hFindFile = FindFirstFileW(wnamebuf, &wFileData); + if (hFindFile == INVALID_HANDLE_VALUE) { + errno = GetLastError(); + if (errno == ERROR_FILE_NOT_FOUND) { + return d; + } + Py_DECREF(d); + return win32_error_unicode("FindFirstFileW", wnamebuf); + } + do { + if (wFileData.cFileName[0] == L'.' && + (wFileData.cFileName[1] == L'\0' || + wFileData.cFileName[1] == L'.' && + wFileData.cFileName[2] == L'\0')) + continue; + v = PyUnicode_FromUnicode(wFileData.cFileName, wcslen(wFileData.cFileName)); + if (v == NULL) { + Py_DECREF(d); + d = NULL; + break; + } + if (PyList_Append(d, v) != 0) { + Py_DECREF(v); + Py_DECREF(d); + d = NULL; + break; + } + Py_DECREF(v); + } while (FindNextFileW(hFindFile, &wFileData) == TRUE); + + if (FindClose(hFindFile) == FALSE) { + Py_DECREF(d); + return win32_error_unicode("FindClose", wnamebuf); + } + return d; + } + /* Drop the argument parsing error as narrow strings + are also valid. */ + PyErr_Clear(); + } + #endif + if (!PyArg_ParseTuple(args, "et#:listdir", Py_FileSystemDefaultEncoding, &bufptr, &len)) *************** *** 1062,1066 **** errno = GetLastError(); if (errno == ERROR_FILE_NOT_FOUND) ! return PyList_New(0); return win32_error("FindFirstFile", namebuf); } --- 1333,1338 ---- errno = GetLastError(); if (errno == ERROR_FILE_NOT_FOUND) ! return d; ! Py_DECREF(d); return win32_error("FindFirstFile", namebuf); } *************** *** 1086,1091 **** } while (FindNextFile(hFindFile, &FileData) == TRUE); ! if (FindClose(hFindFile) == FALSE) return win32_error("FindClose", namebuf); return d; --- 1358,1365 ---- } while (FindNextFile(hFindFile, &FileData) == TRUE); ! if (FindClose(hFindFile) == FALSE) { ! Py_DECREF(d); return win32_error("FindClose", namebuf); + } return d; *************** *** 1214,1217 **** --- 1488,1508 ---- char outbuf[MAX_PATH*2]; char *temp; + #ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) { + Py_UNICODE woutbuf[MAX_PATH*2]; + Py_UNICODE *wtemp; + if (!GetFullPathNameW(PyUnicode_AS_UNICODE(po), + sizeof(woutbuf)/sizeof(woutbuf[0]), + woutbuf, &wtemp)) + return win32_error("GetFullPathName", ""); + return PyUnicode_FromUnicode(woutbuf, wcslen(woutbuf)); + } + /* Drop the argument parsing error as narrow strings + are also valid. */ + PyErr_Clear(); + } + #endif if (!PyArg_ParseTuple (args, "et#:_getfullpathname", Py_FileSystemDefaultEncoding, &inbufp, *************** *** 1235,1238 **** --- 1526,1550 ---- char *path = NULL; int mode = 0777; + + #ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, "U|i:mkdir", &po)) { + Py_BEGIN_ALLOW_THREADS + /* PyUnicode_AS_UNICODE OK without thread lock as + it is a simple dereference. */ + res = _wmkdir(PyUnicode_AS_UNICODE(po)); + Py_END_ALLOW_THREADS + if (res < 0) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; + } + /* Drop the argument parsing error as narrow strings + are also valid. */ + PyErr_Clear(); + } + #endif + if (!PyArg_ParseTuple(args, "et|i:mkdir", Py_FileSystemDefaultEncoding, &path, &mode)) *************** *** 1303,1307 **** posix_rename(PyObject *self, PyObject *args) { ! return posix_2str(args, "etet:rename", rename); } --- 1615,1623 ---- posix_rename(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS ! return posix_2str(args, "etet:rename", rename, "OO:rename", _wrename); ! #else ! return posix_2str(args, "etet:rename", rename, NULL, NULL); ! #endif } *************** *** 1314,1318 **** posix_rmdir(PyObject *self, PyObject *args) { ! return posix_1str(args, "et:rmdir", rmdir); } --- 1630,1638 ---- posix_rmdir(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS ! return posix_1str(args, "et:rmdir", rmdir, "U:rmdir", _wrmdir); ! #else ! return posix_1str(args, "et:rmdir", rmdir, NULL, NULL); ! #endif } *************** *** 1325,1329 **** posix_stat(PyObject *self, PyObject *args) { ! return posix_do_stat(self, args, "et:stat", STAT); } --- 1645,1653 ---- posix_stat(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:stat", STAT, "U:stat", _wstati64); ! #else ! return posix_do_stat(self, args, "et:stat", STAT, NULL, NULL); ! #endif } *************** *** 1377,1381 **** posix_unlink(PyObject *self, PyObject *args) { ! return posix_1str(args, "et:remove", unlink); } --- 1701,1709 ---- posix_unlink(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS ! return posix_1str(args, "et:remove", unlink, "U:remove", _wunlink); ! #else ! return posix_1str(args, "et:remove", unlink, NULL, NULL); ! #endif } *************** *** 4151,4157 **** { #ifdef HAVE_LSTAT ! return posix_do_stat(self, args, "et:lstat", lstat); #else /* !HAVE_LSTAT */ ! return posix_do_stat(self, args, "et:lstat", STAT); #endif /* !HAVE_LSTAT */ } --- 4479,4489 ---- { #ifdef HAVE_LSTAT ! return posix_do_stat(self, args, "et:lstat", lstat, NULL, NULL); #else /* !HAVE_LSTAT */ ! #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:lstat", STAT, "u:lstat", _wstati64); ! #else ! return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); ! #endif #endif /* !HAVE_LSTAT */ } *************** *** 4189,4193 **** posix_symlink(PyObject *self, PyObject *args) { ! return posix_2str(args, "etet:symlink", symlink); } #endif /* HAVE_SYMLINK */ --- 4521,4525 ---- posix_symlink(PyObject *self, PyObject *args) { ! return posix_2str(args, "etet:symlink", symlink, NULL, NULL); } #endif /* HAVE_SYMLINK */ *************** *** 4370,4373 **** --- 4702,4725 ---- int mode = 0777; int fd; + + #ifdef MS_WINDOWS + if (unicode_file_names()) { + PyUnicodeObject *po; + if (PyArg_ParseTuple(args, "Ui|i:mkdir", &po, &flag, &mode)) { + Py_BEGIN_ALLOW_THREADS + /* PyUnicode_AS_UNICODE OK without thread + lock as it is a simple dereference. */ + fd = _wopen(PyUnicode_AS_UNICODE(po), flag, mode); + Py_END_ALLOW_THREADS + if (fd < 0) + return posix_error(); + return PyInt_FromLong((long)fd); + } + /* Drop the argument parsing error as narrow strings + are also valid. */ + PyErr_Clear(); + } + #endif + if (!PyArg_ParseTuple(args, "eti|i", Py_FileSystemDefaultEncoding, &file, *************** *** 6342,6345 **** --- 6694,6698 ---- #ifdef HAVE_GETCWD {"getcwd", posix_getcwd, METH_VARARGS, posix_getcwd__doc__}, + {"getcwdu", posix_getcwdu, METH_VARARGS, posix_getcwdu__doc__}, #endif #ifdef HAVE_LINK From mhammond@users.sourceforge.net Thu Oct 3 08:24:51 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Thu, 03 Oct 2002 00:24:51 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.261,2.262 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12496 Modified Files: posixmodule.c Log Message: Trivial fix to the pep277 checkin: ensure that exceptions always have a filename attribute (previously did only when string filenames were passed, but not when unicode) Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.261 retrieving revision 2.262 diff -C2 -d -r2.261 -r2.262 *** posixmodule.c 3 Oct 2002 05:10:38 -0000 2.261 --- posixmodule.c 3 Oct 2002 07:24:48 -0000 2.262 *************** *** 561,565 **** Py_END_ALLOW_THREADS if (res < 0) ! return posix_error(); Py_INCREF(Py_None); return Py_None; --- 561,565 ---- Py_END_ALLOW_THREADS if (res < 0) ! return posix_error_with_unicode_filename(PyUnicode_AS_UNICODE(po)); Py_INCREF(Py_None); return Py_None; From mwh@users.sourceforge.net Thu Oct 3 10:42:04 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu, 03 Oct 2002 02:42:04 -0700 Subject: [Python-checkins] python/dist/src/Lib symbol.py,1.14,1.15 token.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28019 Modified Files: symbol.py token.py Log Message: Updates to track Grammar changes. The patch to token.py loosens the regexp to allow "testlist1" to be snagged. Index: symbol.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/symbol.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** symbol.py 17 Oct 2001 13:13:04 -0000 1.14 --- symbol.py 3 Oct 2002 09:42:01 -0000 1.15 *************** *** 77,80 **** --- 77,82 ---- list_for = 320 list_if = 321 + testlist1 = 322 + encoding_decl = 323 #--end constants-- Index: token.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/token.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** token.py 13 Aug 2001 15:48:06 -0000 1.12 --- token.py 3 Oct 2002 09:42:01 -0000 1.13 *************** *** 99,103 **** fp.close() prog = re.compile( ! "#define[ \t][ \t]*([A-Z][A-Z_]*)[ \t][ \t]*([0-9][0-9]*)", re.IGNORECASE) tokens = {} --- 99,103 ---- fp.close() prog = re.compile( ! "#define[ \t][ \t]*([A-Z0-9][A-Z0-9_]*)[ \t][ \t]*([0-9][0-9]*)", re.IGNORECASE) tokens = {} From mwh@users.sourceforge.net Thu Oct 3 10:50:49 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu, 03 Oct 2002 02:50:49 -0700 Subject: [Python-checkins] python/dist/src/Python compile.c,2.263,2.264 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv607/Python Modified Files: compile.c Log Message: Clamp code objects' tp_compare result to [-1, 1]. Bugfix candidate. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.263 retrieving revision 2.264 diff -C2 -d -r2.263 -r2.264 *** compile.c 30 Aug 2002 13:09:51 -0000 2.263 --- compile.c 3 Oct 2002 09:50:47 -0000 2.264 *************** *** 197,205 **** if (cmp) return cmp; cmp = co->co_argcount - cp->co_argcount; ! if (cmp) return cmp; cmp = co->co_nlocals - cp->co_nlocals; ! if (cmp) return cmp; cmp = co->co_flags - cp->co_flags; ! if (cmp) return cmp; cmp = PyObject_Compare(co->co_code, cp->co_code); if (cmp) return cmp; --- 197,205 ---- if (cmp) return cmp; cmp = co->co_argcount - cp->co_argcount; ! if (cmp) return (cmp<0)?-1:1; cmp = co->co_nlocals - cp->co_nlocals; ! if (cmp) return (cmp<0)?-1:1; cmp = co->co_flags - cp->co_flags; ! if (cmp) return (cmp<0)?-1:1; cmp = PyObject_Compare(co->co_code, cp->co_code); if (cmp) return cmp; From mwh@users.sourceforge.net Thu Oct 3 10:53:13 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu, 03 Oct 2002 02:53:13 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.337,2.338 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1097/Python Modified Files: ceval.c Log Message: One last tweak to the tracing machinery: this actually computes what I intended all along. Before instr_lb tended to be too high. I don't think this actually makes any difference, given what the compiler produces, but it makes me a bit happier. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.337 retrieving revision 2.338 diff -C2 -d -r2.337 -r2.338 *** ceval.c 2 Oct 2002 13:13:46 -0000 2.337 --- ceval.c 3 Oct 2002 09:53:11 -0000 2.338 *************** *** 2967,2973 **** --- 2967,2975 ---- break; addr += *p++; + if (*p) *instr_lb = addr; line += *p++; --size; } + if (addr == frame->f_lasti) { frame->f_lineno = line; *************** *** 2975,2979 **** PyTrace_LINE, Py_None); } ! *instr_lb = addr; if (size > 0) { while (--size >= 0) { --- 2977,2981 ---- PyTrace_LINE, Py_None); } ! if (size > 0) { while (--size >= 0) { From neal@metaslash.com Thu Oct 3 14:02:11 2002 From: neal@metaslash.com (Neal Norwitz) Date: Thu, 3 Oct 2002 09:02:11 -0400 Subject: [Python-checkins] python/dist/src/Python errors.c,2.71,2.72 In-Reply-To: References: Message-ID: <20021003130211.GA27448@epoch.metaslash.com> On Wed, Oct 02, 2002 at 10:10:41PM -0700, mhammond@users.sourceforge.net wrote: > > PyObject * > + PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) > + { > + PyObject *name = filename ? PyString_FromString(filename) : NULL; > + PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); > + Py_DECREF(name); Should be Py_XDECREF(). > --- 441,467 ---- > const char *filename) > { > ! PyObject *name = filename ? PyString_FromString(filename) : NULL; > ! PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject( > ! PyExc_WindowsError, > ! ierr, name); > ! Py_XDECREF(result); > ! return result; Should be DECREFing name, right? > + > + #ifdef Py_WIN_WIDE_FILENAMES > + PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( > + int ierr, > + const Py_UNICODE *filename) > + { > + PyObject *name = filename ? > + PyUnicode_FromUnicode(filename, wcslen(filename)) : > + NULL; > + PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject( > + PyExc_WindowsError, > + ierr, name); > + Py_XDECREF(result); > + return result; Should be DECREFing name here too? Neal From montanaro@users.sourceforge.net Thu Oct 3 15:56:11 2002 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu, 03 Oct 2002 07:56:11 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.38.10.4,1.38.10.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13419 Modified Files: Tag: release22-maint ConfigParser.py Log Message: Python 2.2 doesn't have basestring. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.38.10.4 retrieving revision 1.38.10.5 diff -C2 -d -r1.38.10.4 -r1.38.10.5 *** ConfigParser.py 27 Sep 2002 16:34:30 -0000 1.38.10.4 --- ConfigParser.py 3 Oct 2002 14:56:08 -0000 1.38.10.5 *************** *** 223,227 **** filename may also be given. """ ! if isinstance(filenames, basestring): filenames = [filenames] for filename in filenames: --- 223,227 ---- filename may also be given. """ ! if isinstance(filenames, (str, unicode)): filenames = [filenames] for filename in filenames: From guido@python.org Thu Oct 3 16:17:29 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 03 Oct 2002 11:17:29 -0400 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.38.10.4,1.38.10.5 In-Reply-To: Your message of "Thu, 03 Oct 2002 07:56:11 PDT." References: Message-ID: <200210031517.g93FHTU20390@odiug.zope.com> > Index: ConfigParser.py > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v > retrieving revision 1.38.10.4 > retrieving revision 1.38.10.5 > diff -C2 -d -r1.38.10.4 -r1.38.10.5 > *** ConfigParser.py 27 Sep 2002 16:34:30 -0000 1.38.10.4 > --- ConfigParser.py 3 Oct 2002 14:56:08 -0000 1.38.10.5 > *************** > *** 223,227 **** > filename may also be given. > """ > ! if isinstance(filenames, basestring): > filenames = [filenames] > for filename in filenames: > --- 223,227 ---- > filename may also be given. > """ > ! if isinstance(filenames, (str, unicode)): > filenames = [filenames] > for filename in filenames: The correct idiom for this is to use types.StringTypes. --Guido van Rossum (home page: http://www.python.org/~guido/) From montanaro@users.sourceforge.net Thu Oct 3 16:27:49 2002 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu, 03 Oct 2002 08:27:49 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.38.10.5,1.38.10.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2108 Modified Files: Tag: release22-maint ConfigParser.py Log Message: use types.StringTypes instead of (str, unicode) Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.38.10.5 retrieving revision 1.38.10.6 diff -C2 -d -r1.38.10.5 -r1.38.10.6 *** ConfigParser.py 3 Oct 2002 14:56:08 -0000 1.38.10.5 --- ConfigParser.py 3 Oct 2002 15:27:47 -0000 1.38.10.6 *************** *** 85,88 **** --- 85,89 ---- import re + import types __all__ = ["NoSectionError","DuplicateSectionError","NoOptionError", *************** *** 223,227 **** filename may also be given. """ ! if isinstance(filenames, (str, unicode)): filenames = [filenames] for filename in filenames: --- 224,228 ---- filename may also be given. """ ! if isinstance(filenames, types.StringTypes): filenames = [filenames] for filename in filenames: From neal@metaslash.com Thu Oct 3 23:36:52 2002 From: neal@metaslash.com (Neal Norwitz) Date: Thu, 3 Oct 2002 18:36:52 -0400 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.168,2.169 In-Reply-To: References: Message-ID: <20021003223651.GD27448@epoch.metaslash.com> > --- 329,350 ---- > file_repr(PyFileObject *f) > { > ! if (PyUnicode_Check(f->f_name)) { > ! PyObject *ret = NULL; > ! PyObject *name; > ! name = PyUnicode_AsUnicodeEscapeString(f->f_name); Doesn't name need to be checked here for NULL? It's passed to PyString_AsString on the line below. > ! ret = PyString_FromFormat("<%s file u'%s', mode '%s' at %p>", > ! f->f_fp == NULL ? "closed" : "open", > ! PyString_AsString(name), > ! PyString_AsString(f->f_mode), > ! f); > ! Py_XDECREF(name); > ! return ret; > --- 1826,1856 ---- > } > > ! #ifdef Py_WIN_WIDE_FILENAMES > ! if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ Did you mean 'no wide' instead of 'so wide'? Neal From neal@metaslash.com Fri Oct 4 00:07:26 2002 From: neal@metaslash.com (Neal Norwitz) Date: Thu, 3 Oct 2002 19:07:26 -0400 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.260,2.261 In-Reply-To: References: Message-ID: <20021003230726.GE27448@epoch.metaslash.com> > + static PyObject * > + posix_getcwdu(PyObject *self, PyObject *args) > + { > + char buf[1026]; > + char *res; > + if (!PyArg_ParseTuple(args, ":getcwd")) > + return NULL; Don't need to check args if posix_getcwdu is METH_NOARGS. > + if (v == NULL) { > + Py_DECREF(d); > + d = NULL; > + break; > + } > + if (PyList_Append(d, v) != 0) { > + Py_DECREF(v); > + Py_DECREF(d); > + d = NULL; > + break; > + } > + Py_DECREF(v); > + } while (FindNextFileW(hFindFile, &wFileData) == TRUE); > + > + if (FindClose(hFindFile) == FALSE) { > + Py_DECREF(d); Should be XDECREF? d will be set to NULL if an error occured. Not sure if FindClose() == FALSE if there's an error. This is around line 1307. > --- 1358,1365 ---- > } while (FindNextFile(hFindFile, &FileData) == TRUE); > > ! if (FindClose(hFindFile) == FALSE) { > ! Py_DECREF(d); Should be XDECREF? d could be set to NULL about 10 lines up (not in context). > *************** > *** 1235,1238 **** > --- 1526,1550 ---- > char *path = NULL; > int mode = 0777; > + > + #ifdef Py_WIN_WIDE_FILENAMES > + if (unicode_file_names()) { > + PyUnicodeObject *po; > + if (PyArg_ParseTuple(args, "U|i:mkdir", &po)) { Do you need another variable to capture i? (U|i) PyArg_ParseTuple() about line 1493 has U|: is the | useful? > *************** > *** 1377,1381 **** > posix_unlink(PyObject *self, PyObject *args) > { > ! return posix_1str(args, "et:remove", unlink); > } > > --- 1701,1709 ---- > posix_unlink(PyObject *self, PyObject *args) > { > ! #ifdef MS_WINDOWS > ! return posix_1str(args, "et:remove", unlink, "U:remove", _wunlink); > ! #else > ! return posix_1str(args, "et:remove", unlink, NULL, NULL); > ! #endif > } Should that be :remove or :unlink? > *************** > *** 4370,4373 **** > --- 4702,4725 ---- > int mode = 0777; > int fd; > + > + #ifdef MS_WINDOWS > + if (unicode_file_names()) { > + PyUnicodeObject *po; > + if (PyArg_ParseTuple(args, "Ui|i:mkdir", &po, &flag, &mode)) { Should be :open instead of :mkdir? > {"getcwd", posix_getcwd, METH_VARARGS, posix_getcwd__doc__}, > + {"getcwdu", posix_getcwdu, METH_VARARGS, posix_getcwdu__doc__}, Can be METH_NOARGS (same note as above). Same w/getcwd. Neal From mhammond@users.sourceforge.net Fri Oct 4 00:14:12 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Thu, 03 Oct 2002 16:14:12 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_pep277,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv30020/output Added Files: test_pep277 Log Message: Tests for pep277 - Unicode file names on Windows NT. --- NEW FILE: test_pep277 --- test_pep277 u'F:\\src\\python-cvs\\Lib\\test\\@test\\Gr\xfc\xdf-\u66e8\u66e9\u66eb\\\xdf-\u66e8\u66e9\u66eb' ['???', '???', '??????', '????????????', '????G\xdf', 'Ge??-sa?', 'Gr\xfc\xdf-Gott', 'abc', 'ascii'] [u'Gr\xfc\xdf-Gott', u'abc', u'ascii', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb'] From mhammond@users.sourceforge.net Fri Oct 4 00:14:12 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Thu, 03 Oct 2002 16:14:12 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_pep277.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30020 Added Files: test_pep277.py Log Message: Tests for pep277 - Unicode file names on Windows NT. --- NEW FILE: test_pep277.py --- # -*- coding: utf-8 -*- # Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os, unittest from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite try: from nt import _getfullpathname except ImportError: raise TestSkipped, "test works only on NT" filenames = [ "abc", unicode("ascii","utf-8"), unicode("Grüß-Gott","utf-8"), unicode("Γειά-σας","utf-8"), unicode("ЗдравÑтвуйте","utf-8"), unicode("ã«ã½ã‚“","utf-8"), unicode("השקצץס","utf-8"), unicode("曨曩曫","utf-8"), unicode("曨שんдΓß","utf-8"), ] class UnicodeFileTests(unittest.TestCase): def setUp(self): self.files = [os.path.join(TESTFN, f) for f in filenames] try: os.mkdir(TESTFN) except OSError: pass for name in self.files: f = open(name, 'w') f.write((name+'\n').encode("utf-8")) f.close() os.stat(name) def tearDown(self): for name in self.files: os.unlink(name) os.rmdir(TESTFN) def _apply_failure(self, fn, filename, expected_exception, check_fn_in_exception = True): try: fn(filename) raise TestFailed("Expected to fail calling '%s(%r)'" % (fn.__name__, filename)) except expected_exception, details: if check_fn_in_exception and details.filename != filename: raise TestFailed("Function '%s(%r) failed with " "bad filename in the exception: %r" % (fn.__name__, filename, details.filename)) def test_failures(self): # Pass non-existing Unicode filenames all over the place. for name in self.files: name = "not_" + name self._apply_failure(open, name, IOError) self._apply_failure(os.stat, name, OSError) self._apply_failure(os.chdir, name, OSError) self._apply_failure(os.rmdir, name, OSError) self._apply_failure(os.remove, name, OSError) # listdir may append a wildcard to the filename, so dont check self._apply_failure(os.listdir, name, OSError, False) def test_open(self): for name in self.files: f = open(name, 'w') f.write((name+'\n').encode("utf-8")) f.close() os.stat(name) def test_listdir(self): f1 = os.listdir(TESTFN) f1.sort() f2 = os.listdir(unicode(TESTFN,"mbcs")) f2.sort() print f1 print f2 def test_rename(self): for name in self.files: os.rename(name,"tmp") os.rename("tmp",name) def test_directory(self): dirname = unicode(os.path.join(TESTFN,"Grüß-曨曩曫"),"utf-8") filename = unicode("ß-曨曩曫","utf-8") oldwd = os.getcwd() os.mkdir(dirname) os.chdir(dirname) f = open(filename, 'w') f.write((filename + '\n').encode("utf-8")) f.close() print repr(_getfullpathname(filename)) os.remove(filename) os.chdir(oldwd) os.rmdir(dirname) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UnicodeFileTests)) run_suite(suite) if __name__ == "__main__": test_main() From mhammond@users.sourceforge.net Fri Oct 4 01:09:40 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Thu, 03 Oct 2002 17:09:40 -0700 Subject: [Python-checkins] python/dist/src/Python errors.c,2.72,2.73 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv14776 Modified Files: errors.c Log Message: Fix errors to pep277 checkin identified by Neal Norwitz. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.72 retrieving revision 2.73 diff -C2 -d -r2.72 -r2.73 *** errors.c 3 Oct 2002 05:10:39 -0000 2.72 --- errors.c 4 Oct 2002 00:09:38 -0000 2.73 *************** *** 335,339 **** PyObject *name = filename ? PyString_FromString(filename) : NULL; PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); ! Py_DECREF(name); return result; } --- 335,339 ---- PyObject *name = filename ? PyString_FromString(filename) : NULL; PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); ! Py_XDECREF(name); return result; } *************** *** 445,449 **** PyExc_WindowsError, ierr, name); ! Py_XDECREF(result); return result; } --- 445,449 ---- PyExc_WindowsError, ierr, name); ! Py_XDECREF(name); return result; } *************** *** 460,464 **** PyExc_WindowsError, ierr, name); ! Py_XDECREF(result); return result; } --- 460,464 ---- PyExc_WindowsError, ierr, name); ! Py_XDECREF(name); return result; } From mhammond@users.sourceforge.net Fri Oct 4 01:13:05 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Thu, 03 Oct 2002 17:13:05 -0700 Subject: [Python-checkins] python/dist/src/Python errors.c,2.73,2.74 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv15788 Modified Files: errors.c Log Message: Fix [ 616716 ] Bug in PyErr_SetExcFromWindows Ensure that even if FormatMessage fails we (a) don't crash, and (b) provide something useful. Bugfix candidate. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.73 retrieving revision 2.74 diff -C2 -d -r2.73 -r2.74 *** errors.c 4 Oct 2002 00:09:38 -0000 2.73 --- errors.c 4 Oct 2002 00:13:02 -0000 2.74 *************** *** 270,273 **** --- 270,274 ---- #ifdef MS_WINDOWS char *s_buf = NULL; + char s_small_buf[28]; /* Room for "Windows Error 0xFFFFFFFF" */ #endif #ifdef EINTR *************** *** 307,314 **** 0, /* size not used */ NULL); /* no args */ ! s = s_buf; ! /* remove trailing cr/lf and dots */ ! while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) ! s[--len] = '\0'; } } --- 308,323 ---- 0, /* size not used */ NULL); /* no args */ ! if (len==0) { ! /* Only ever seen this in out-of-mem ! situations */ ! sprintf(s_small_buf, "Windows Error 0x%X", i); ! s = s_small_buf; ! s_buf = NULL; ! } else { ! s = s_buf; ! /* remove trailing cr/lf and dots */ ! while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) ! s[--len] = '\0'; ! } } } *************** *** 367,370 **** --- 376,381 ---- int len; char *s; + char *s_buf = NULL; /* Free via LocalFree */ + char s_small_buf[28]; /* Room for "Windows Error 0xFFFFFFFF" */ PyObject *v; DWORD err = (DWORD)ierr; *************** *** 379,388 **** MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ ! (LPTSTR) &s, 0, /* size not used */ NULL); /* no args */ ! /* remove trailing cr/lf and dots */ ! while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) ! s[--len] = '\0'; if (filenameObject != NULL) v = Py_BuildValue("(isO)", err, s, filenameObject); --- 390,407 ---- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ ! (LPTSTR) &s_buf, 0, /* size not used */ NULL); /* no args */ ! if (len==0) { ! /* Only seen this in out of mem situations */ ! sprintf(s_small_buf, "Windows Error 0x%X", err); ! s = s_small_buf; ! s_buf = NULL; ! } else { ! s = s_buf; ! /* remove trailing cr/lf and dots */ ! while (len > 0 && (s[len-1] <= ' ' || s[len-1] == '.')) ! s[--len] = '\0'; ! } if (filenameObject != NULL) v = Py_BuildValue("(isO)", err, s, filenameObject); *************** *** 393,397 **** Py_DECREF(v); } ! LocalFree(s); return NULL; } --- 412,416 ---- Py_DECREF(v); } ! LocalFree(s_buf); return NULL; } From loewis@users.sourceforge.net Fri Oct 4 08:21:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 04 Oct 2002 00:21:26 -0700 Subject: [Python-checkins] python/dist/src/Python thread_pthread.h,2.40,2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv31341/Python Modified Files: thread_pthread.h Log Message: Patch #618347: Work around Solaris 2.6 pthread.h bug. Will backport to 2.2. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** thread_pthread.h 17 Mar 2002 17:19:00 -0000 2.40 --- thread_pthread.h 4 Oct 2002 07:21:24 -0000 2.41 *************** *** 4,12 **** #include #include ! #ifdef __APPLE__ #define destructor xxdestructor #endif #include ! #ifdef __APPLE__ #undef destructor #endif --- 4,12 ---- #include #include ! #if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #define destructor xxdestructor #endif #include ! #if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #undef destructor #endif From loewis@users.sourceforge.net Fri Oct 4 08:21:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 04 Oct 2002 00:21:26 -0700 Subject: [Python-checkins] python/dist/src configure,1.338,1.339 configure.in,1.349,1.350 pyconfig.h.in,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv31341 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #618347: Work around Solaris 2.6 pthread.h bug. Will backport to 2.2. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.338 retrieving revision 1.339 diff -C2 -d -r1.338 -r1.339 *** configure 30 Sep 2002 16:19:47 -0000 1.338 --- configure 4 Oct 2002 07:21:21 -0000 1.339 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.348 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.349 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 10886,10889 **** --- 10886,10900 ---- esac fi + + if test "$posix_threads" = yes -a \ + "$ac_sys_system" = "SunOS" -a \ + "$ac_sys_release" = "5.6"; then + + cat >>confdefs.h <<\_ACEOF + #define HAVE_PTHREAD_DESTRUCTOR 1 + _ACEOF + + fi + fi Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.349 retrieving revision 1.350 diff -C2 -d -r1.349 -r1.350 *** configure.in 30 Sep 2002 16:19:47 -0000 1.349 --- configure.in 4 Oct 2002 07:21:24 -0000 1.350 *************** *** 1327,1330 **** --- 1327,1338 ---- esac fi + + if test "$posix_threads" = yes -a \ + "$ac_sys_system" = "SunOS" -a \ + "$ac_sys_release" = "5.6"; then + AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, + [Defined for Solaris 2.6 bug in pthread header.]) + fi + fi Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** pyconfig.h.in 10 Sep 2002 09:16:13 -0000 1.49 --- pyconfig.h.in 4 Oct 2002 07:21:24 -0000 1.50 *************** *** 305,308 **** --- 305,311 ---- #undef HAVE_PTH + /* Defined for Solaris 2.6 bug in pthread header. */ + #undef HAVE_PTHREAD_DESTRUCTOR + /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H From lemburg@users.sourceforge.net Fri Oct 4 10:23:46 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 02:23:46 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command __init__.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv28397 Modified Files: __init__.py Log Message: Pulling Mark Alexander's contribution from CVS. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/__init__.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** __init__.py 17 Apr 2002 20:30:09 -0000 1.15 --- __init__.py 4 Oct 2002 09:23:44 -0000 1.16 *************** *** 22,27 **** 'bdist_rpm', 'bdist_wininst', ! 'bdist_sdux', ! 'bdist_pkgtool', # Note: # bdist_packager is not included because it only provides --- 22,28 ---- 'bdist_rpm', 'bdist_wininst', ! # These two are reserved for future use: ! #'bdist_sdux', ! #'bdist_pkgtool', # Note: # bdist_packager is not included because it only provides From lemburg@users.sourceforge.net Fri Oct 4 10:25:20 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 02:25:20 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command bdist_packager.py,1.7,NONE bdist_pkgtool.py,1.8,NONE bdist_sdux.py,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv29817 Removed Files: bdist_packager.py bdist_pkgtool.py bdist_sdux.py Log Message: Pulling Mark Alexander's contribution from CVS. --- bdist_packager.py DELETED --- --- bdist_pkgtool.py DELETED --- --- bdist_sdux.py DELETED --- From lemburg@users.sourceforge.net Fri Oct 4 10:30:08 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 02:30:08 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command bdist.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv800/command Modified Files: bdist.py Log Message: Pulling Mark Alexander's contribution from CVS. Index: bdist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** bdist.py 17 Apr 2002 20:30:10 -0000 1.25 --- bdist.py 4 Oct 2002 09:30:06 -0000 1.26 *************** *** 53,57 **** # The following commands do not take a format option from bdist ! no_format_option = ('bdist_rpm', 'bdist_sdux', 'bdist_pkgtool') # This won't do in reality: will need to distinguish RPM-ish Linux, --- 53,59 ---- # The following commands do not take a format option from bdist ! no_format_option = ('bdist_rpm', ! #'bdist_sdux', 'bdist_pkgtool' ! ) # This won't do in reality: will need to distinguish RPM-ish Linux, *************** *** 63,71 **** # Establish the preferred order (for the --help-formats option). format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar', ! 'wininst', 'zip', 'pkgtool', 'sdux'] # And the real information. format_command = { 'rpm': ('bdist_rpm', "RPM distribution"), ! 'zip': ('bdist_dumb', "ZIP file"), 'gztar': ('bdist_dumb', "gzip'ed tar file"), 'bztar': ('bdist_dumb', "bzip2'ed tar file"), 'ztar': ('bdist_dumb', "compressed tar file"), --- 65,76 ---- # Establish the preferred order (for the --help-formats option). format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar', ! 'wininst', 'zip', ! #'pkgtool', 'sdux' ! ] # And the real information. format_command = { 'rpm': ('bdist_rpm', "RPM distribution"), ! 'zip': ('bdist_dumb', "ZIP file"), ! 'gztar': ('bdist_dumb', "gzip'ed tar file"), 'bztar': ('bdist_dumb', "bzip2'ed tar file"), 'ztar': ('bdist_dumb', "compressed tar file"), *************** *** 74,80 **** "Windows executable installer"), 'zip': ('bdist_dumb', "ZIP file"), ! 'pkgtool': ('bdist_pkgtool', ! "Solaris pkgtool distribution"), ! 'sdux': ('bdist_sdux', "HP-UX swinstall depot"), } --- 79,85 ---- "Windows executable installer"), 'zip': ('bdist_dumb', "ZIP file"), ! #'pkgtool': ('bdist_pkgtool', ! # "Solaris pkgtool distribution"), ! #'sdux': ('bdist_sdux', "HP-UX swinstall depot"), } From loewis@users.sourceforge.net Fri Oct 4 11:16:31 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 04 Oct 2002 03:16:31 -0700 Subject: [Python-checkins] python/dist/src configure,1.279.6.12,1.279.6.13 configure.in,1.288.6.12,1.288.6.13 pyconfig.h.in,1.20.8.1,1.20.8.2 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv28942 Modified Files: Tag: release22-maint configure configure.in pyconfig.h.in Log Message: Patch #618347: Work around Solaris pthread.h bug. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.279.6.12 retrieving revision 1.279.6.13 diff -C2 -d -r1.279.6.12 -r1.279.6.13 *** configure 30 Sep 2002 16:17:54 -0000 1.279.6.12 --- configure 4 Oct 2002 10:16:24 -0000 1.279.6.13 *************** *** 4383,4391 **** esac fi fi # Check for enable-ipv6 echo $ac_n "checking if --enable-ipv6 is specified""... $ac_c" 1>&6 ! echo "configure:4390: checking if --enable-ipv6 is specified" >&5 # Check whether --enable-ipv6 or --disable-ipv6 was given. if test "${enable_ipv6+set}" = set; then --- 4383,4401 ---- [...2375 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7577,7581 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7580: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7587,7591 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7590: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.288.6.12 retrieving revision 1.288.6.13 diff -C2 -d -r1.288.6.12 -r1.288.6.13 *** configure.in 30 Sep 2002 16:16:11 -0000 1.288.6.12 --- configure.in 4 Oct 2002 10:16:27 -0000 1.288.6.13 *************** *** 1171,1174 **** --- 1171,1182 ---- esac fi + + if test "$posix_threads" = yes -a \ + "$ac_sys_system" = "SunOS" -a \ + "$ac_sys_release" = "5.6"; then + AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, + [Defined for Solaris 2.6 bug in pthread header.]) + fi + fi Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.20.8.1 retrieving revision 1.20.8.2 diff -C2 -d -r1.20.8.1 -r1.20.8.2 *** pyconfig.h.in 30 Sep 2002 10:10:22 -0000 1.20.8.1 --- pyconfig.h.in 4 Oct 2002 10:16:27 -0000 1.20.8.2 *************** *** 751,754 **** --- 751,758 ---- #undef HAVE_LIBIEEE + /* Defined for Solaris 2.6 bug in pthread header. */ + #undef HAVE_PTHREAD_DESTRUCTOR + + #ifdef __CYGWIN__ #ifdef USE_DL_IMPORT From loewis@users.sourceforge.net Fri Oct 4 11:16:29 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 04 Oct 2002 03:16:29 -0700 Subject: [Python-checkins] python/dist/src/Python thread_pthread.h,2.36.8.1,2.36.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28942/Python Modified Files: Tag: release22-maint thread_pthread.h Log Message: Patch #618347: Work around Solaris pthread.h bug. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.36.8.1 retrieving revision 2.36.8.2 diff -C2 -d -r2.36.8.1 -r2.36.8.2 *** thread_pthread.h 23 Feb 2002 08:43:03 -0000 2.36.8.1 --- thread_pthread.h 4 Oct 2002 10:16:27 -0000 2.36.8.2 *************** *** 4,12 **** #include #include ! #ifdef __APPLE__ #define destructor xxdestructor #endif #include ! #ifdef __APPLE__ #undef destructor #endif --- 4,12 ---- #include #include ! #if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #define destructor xxdestructor #endif #include ! #if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #undef destructor #endif From loewis@users.sourceforge.net Fri Oct 4 11:22:04 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 04 Oct 2002 03:22:04 -0700 Subject: [Python-checkins] python/dist/src configure,1.339,1.340 configure.in,1.350,1.351 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv29982 Modified Files: configure configure.in Log Message: Disable LFS if Solaris/gcc bug is detected. Fixes #618095. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.339 retrieving revision 1.340 diff -C2 -d -r1.339 -r1.340 *** configure 4 Oct 2002 07:21:21 -0000 1.339 --- configure 4 Oct 2002 10:21:59 -0000 1.340 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.349 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.350 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 4424,4427 **** --- 4424,4485 ---- fi + # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in + # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are + # defined, but the compiler does not support pragma redefine_extname, + # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit + # structures (such as rlimit64) without declaring them. As a + # work-around, disable LFS on such configurations + + use_lfs=yes + echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 + echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #define _LARGEFILE_SOURCE 1 + #define _FILE_OFFSET_BITS 64 + #include + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + struct rlimit foo; + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + sol_lfs_bug=no + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + sol_lfs_bug=yes + fi + rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 + echo "${ECHO_T}$sol_lfs_bug" >&6 + if test "$sol_lfs_bug" = "yes"; then + use_lfs=no + fi + + if test "$use_lfs" = "yes"; then # Two defines needed to enable largefile support on various platforms # These may affect some typedefs *************** *** 4436,4439 **** --- 4494,4498 ---- _ACEOF + fi # Add some code to confdefs.h so that the test for off_t works on SCO Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.350 retrieving revision 1.351 diff -C2 -d -r1.350 -r1.351 *** configure.in 4 Oct 2002 07:21:24 -0000 1.350 --- configure.in 4 Oct 2002 10:22:02 -0000 1.351 *************** *** 655,658 **** --- 655,678 ---- fi + # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in + # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are + # defined, but the compiler does not support pragma redefine_extname, + # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit + # structures (such as rlimit64) without declaring them. As a + # work-around, disable LFS on such configurations + + use_lfs=yes + AC_MSG_CHECKING(Solaris LFS bug) + AC_TRY_COMPILE([ + #define _LARGEFILE_SOURCE 1 + #define _FILE_OFFSET_BITS 64 + #include + ],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes) + AC_MSG_RESULT($sol_lfs_bug) + if test "$sol_lfs_bug" = "yes"; then + use_lfs=no + fi + + if test "$use_lfs" = "yes"; then # Two defines needed to enable largefile support on various platforms # These may affect some typedefs *************** *** 661,664 **** --- 681,685 ---- AC_DEFINE(_FILE_OFFSET_BITS, 64, [This must be set to 64 on some systems to enable large file support.]) + fi # Add some code to confdefs.h so that the test for off_t works on SCO From lemburg@users.sourceforge.net Fri Oct 4 12:45:40 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 04:45:40 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings __init__.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv20044/Lib/encodings Modified Files: __init__.py Log Message: Extending the encoding name normalization to handle more non-alphanumeric characters. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/__init__.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** __init__.py 8 Aug 2002 20:19:18 -0000 1.11 --- __init__.py 4 Oct 2002 11:45:38 -0000 1.12 *************** *** 4,10 **** directory. ! Codec modules must have names corresponding to standard lower-case ! encoding names with hyphens mapped to underscores, e.g. 'utf-8' is ! implemented by the module 'utf_8.py'. Each codec module must export the following interface: --- 4,10 ---- directory. ! Codec modules must have names corresponding to normalized encoding ! names as defined in the normalize_encoding() function below, e.g. ! 'utf-8' must be implemented by the module 'utf_8.py'. Each codec module must export the following interface: *************** *** 19,25 **** * getaliases() -> sequence of encoding name strings to use as aliases ! Alias names returned by getaliases() must be standard encoding ! names as defined above (lower-case, hyphens converted to ! underscores). Written by Marc-Andre Lemburg (mal@lemburg.com). --- 19,24 ---- * getaliases() -> sequence of encoding name strings to use as aliases ! Alias names returned by getaliases() must be normalized encoding ! names as defined by normalize_encoding(). Written by Marc-Andre Lemburg (mal@lemburg.com). *************** *** 29,37 **** """#" ! import codecs,exceptions _cache = {} _unknown = '--unknown--' _import_tail = ['*'] class CodecRegistryError(exceptions.LookupError, --- 28,37 ---- """#" ! import codecs, exceptions, re _cache = {} _unknown = '--unknown--' _import_tail = ['*'] + _norm_encoding_RE = re.compile('[^a-zA-Z0-9.]') class CodecRegistryError(exceptions.LookupError, *************** *** 39,42 **** --- 39,54 ---- pass + def normalize_encoding(encoding): + + """ Normalize an encoding name. + + Normalization works as follows: all non-alphanumeric + characters except the dot used for Python package names are + collapsed and replaced with a single underscore, e.g. ' -;#' + becomes '_'. + + """ + return '_'.join(_norm_encoding_RE.split(encoding)) + def search_function(encoding): *************** *** 52,56 **** # default import module lookup scheme with the alias name. # ! modname = encoding.replace('-', '_') try: mod = __import__('encodings.' + modname, --- 64,68 ---- # default import module lookup scheme with the alias name. # ! modname = normalize_encoding(encoding) try: mod = __import__('encodings.' + modname, From lemburg@users.sourceforge.net Fri Oct 4 12:51:41 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 04:51:41 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv22095/Lib/encodings Modified Files: aliases.py Log Message: Adapt lookup names to new more general encoding name normalization scheme. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** aliases.py 26 Sep 2002 20:08:23 -0000 1.15 --- aliases.py 4 Oct 2002 11:51:39 -0000 1.16 *************** *** 33,37 **** 'ibm367' : 'ascii', 'iso646_us' : 'ascii', ! 'iso_646.irv:1991' : 'ascii', 'iso_ir_6' : 'ascii', 'us' : 'ascii', --- 33,37 ---- 'ibm367' : 'ascii', 'iso646_us' : 'ascii', ! 'iso_646.irv_1991' : 'ascii', 'iso_ir_6' : 'ascii', 'us' : 'ascii', *************** *** 172,176 **** 'csisolatin6' : 'iso8859_10', 'iso_8859_10' : 'iso8859_10', ! 'iso_8859_10:1992' : 'iso8859_10', 'iso_ir_157' : 'iso8859_10', 'l6' : 'iso8859_10', --- 172,176 ---- 'csisolatin6' : 'iso8859_10', 'iso_8859_10' : 'iso8859_10', ! 'iso_8859_10_1992' : 'iso8859_10', 'iso_ir_157' : 'iso8859_10', 'l6' : 'iso8859_10', *************** *** 182,186 **** # iso8859_14 codec 'iso_8859_14' : 'iso8859_14', ! 'iso_8859_14:1998' : 'iso8859_14', 'iso_celtic' : 'iso8859_14', 'iso_ir_199' : 'iso8859_14', --- 182,186 ---- # iso8859_14 codec 'iso_8859_14' : 'iso8859_14', ! 'iso_8859_14_1998' : 'iso8859_14', 'iso_celtic' : 'iso8859_14', 'iso_ir_199' : 'iso8859_14', *************** *** 194,198 **** 'csisolatin2' : 'iso8859_2', 'iso_8859_2' : 'iso8859_2', ! 'iso_8859_2:1987' : 'iso8859_2', 'iso_ir_101' : 'iso8859_2', 'l2' : 'iso8859_2', --- 194,198 ---- 'csisolatin2' : 'iso8859_2', 'iso_8859_2' : 'iso8859_2', ! 'iso_8859_2_1987' : 'iso8859_2', 'iso_ir_101' : 'iso8859_2', 'l2' : 'iso8859_2', *************** *** 202,206 **** 'csisolatin3' : 'iso8859_3', 'iso_8859_3' : 'iso8859_3', ! 'iso_8859_3:1988' : 'iso8859_3', 'iso_ir_109' : 'iso8859_3', 'l3' : 'iso8859_3', --- 202,206 ---- 'csisolatin3' : 'iso8859_3', 'iso_8859_3' : 'iso8859_3', ! 'iso_8859_3_1988' : 'iso8859_3', 'iso_ir_109' : 'iso8859_3', 'l3' : 'iso8859_3', *************** *** 210,214 **** 'csisolatin4' : 'iso8859_4', 'iso_8859_4' : 'iso8859_4', ! 'iso_8859_4:1988' : 'iso8859_4', 'iso_ir_110' : 'iso8859_4', 'l4' : 'iso8859_4', --- 210,214 ---- 'csisolatin4' : 'iso8859_4', 'iso_8859_4' : 'iso8859_4', ! 'iso_8859_4_1988' : 'iso8859_4', 'iso_ir_110' : 'iso8859_4', 'l4' : 'iso8859_4', *************** *** 219,223 **** 'cyrillic' : 'iso8859_5', 'iso_8859_5' : 'iso8859_5', ! 'iso_8859_5:1988' : 'iso8859_5', 'iso_ir_144' : 'iso8859_5', --- 219,223 ---- 'cyrillic' : 'iso8859_5', 'iso_8859_5' : 'iso8859_5', ! 'iso_8859_5_1988' : 'iso8859_5', 'iso_ir_144' : 'iso8859_5', *************** *** 228,232 **** 'ecma_114' : 'iso8859_6', 'iso_8859_6' : 'iso8859_6', ! 'iso_8859_6:1987' : 'iso8859_6', 'iso_ir_127' : 'iso8859_6', --- 228,232 ---- 'ecma_114' : 'iso8859_6', 'iso_8859_6' : 'iso8859_6', ! 'iso_8859_6_1987' : 'iso8859_6', 'iso_ir_127' : 'iso8859_6', *************** *** 238,242 **** 'greek8' : 'iso8859_7', 'iso_8859_7' : 'iso8859_7', ! 'iso_8859_7:1987' : 'iso8859_7', 'iso_ir_126' : 'iso8859_7', --- 238,242 ---- 'greek8' : 'iso8859_7', 'iso_8859_7' : 'iso8859_7', ! 'iso_8859_7_1987' : 'iso8859_7', 'iso_ir_126' : 'iso8859_7', *************** *** 245,249 **** 'hebrew' : 'iso8859_8', 'iso_8859_8' : 'iso8859_8', ! 'iso_8859_8:1988' : 'iso8859_8', 'iso_ir_138' : 'iso8859_8', --- 245,249 ---- 'hebrew' : 'iso8859_8', 'iso_8859_8' : 'iso8859_8', ! 'iso_8859_8_1988' : 'iso8859_8', 'iso_ir_138' : 'iso8859_8', *************** *** 251,255 **** 'csisolatin5' : 'iso8859_9', 'iso_8859_9' : 'iso8859_9', ! 'iso_8859_9:1989' : 'iso8859_9', 'iso_ir_148' : 'iso8859_9', 'l5' : 'iso8859_9', --- 251,255 ---- 'csisolatin5' : 'iso8859_9', 'iso_8859_9' : 'iso8859_9', ! 'iso_8859_9_1989' : 'iso8859_9', 'iso_ir_148' : 'iso8859_9', 'l5' : 'iso8859_9', *************** *** 270,274 **** 'iso8859' : 'latin_1', 'iso_8859_1' : 'latin_1', ! 'iso_8859_1:1987' : 'latin_1', 'iso_ir_100' : 'latin_1', 'l1' : 'latin_1', --- 270,274 ---- 'iso8859' : 'latin_1', 'iso_8859_1' : 'latin_1', ! 'iso_8859_1_1987' : 'latin_1', 'iso_ir_100' : 'latin_1', 'l1' : 'latin_1', *************** *** 329,334 **** 'utf' : 'utf_8', 'utf8' : 'utf_8', ! 'utf8@ucs2' : 'utf_8', ! 'utf8@ucs4' : 'utf_8', # uu_codec codec --- 329,334 ---- 'utf' : 'utf_8', 'utf8' : 'utf_8', ! 'utf8_ucs2' : 'utf_8', ! 'utf8_ucs4' : 'utf_8', # uu_codec codec From lemburg@users.sourceforge.net Fri Oct 4 12:55:24 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 04:55:24 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.491,1.492 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23167/Misc Modified Files: NEWS Log Message: News item about the new encoding normalization scheme. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.491 retrieving revision 1.492 diff -C2 -d -r1.491 -r1.492 *** NEWS 1 Oct 2002 18:18:58 -0000 1.491 --- NEWS 4 Oct 2002 11:55:21 -0000 1.492 *************** *** 341,344 **** --- 341,350 ---- ------- + - Encoding name normalization was generalized to not only + replace hyphens with underscores, but also all other non-alphanumeric + characters (with the exception of the dot which is used for Python + package names during lookup). The aliases.py mapping was updated + to the new standard. + - mimetypes has two new functions: guess_all_extensions() which returns a list of all known extensions for a mime type, and From lemburg@users.sourceforge.net Fri Oct 4 12:58:27 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 04:58:27 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv23918/Lib/encodings Modified Files: aliases.py Log Message: Fix doc-string. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** aliases.py 4 Oct 2002 11:51:39 -0000 1.16 --- aliases.py 4 Oct 2002 11:58:24 -0000 1.17 *************** *** 4,10 **** map encodings names to module names. ! Note that the search function converts the encoding names to lower ! case and replaces hyphens with underscores *before* performing the ! lookup. Contents: --- 4,10 ---- map encodings names to module names. ! Note that the search function normalizes the encoding names before ! doing the lookup, so the mapping will have to map normalized ! encoding names to module names. Contents: From nnorwitz@users.sourceforge.net Fri Oct 4 13:35:19 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 04 Oct 2002 05:35:19 -0700 Subject: [Python-checkins] python/dist/src/Include cStringIO.h,2.15,2.15.18.1 descrobject.h,2.8,2.8.8.1 iterobject.h,1.3,1.3.20.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv3044/Include Modified Files: Tag: release22-maint cStringIO.h descrobject.h iterobject.h Log Message: Backport patch (also pointed out in SF #607253): date: 2002/03/30 08:57:12; author: loewis; Patch #536908: Add missing #include guards/extern "C". Index: cStringIO.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/cStringIO.h,v retrieving revision 2.15 retrieving revision 2.15.18.1 diff -C2 -d -r2.15 -r2.15.18.1 *** cStringIO.h 9 Jun 2001 07:59:43 -0000 2.15 --- cStringIO.h 4 Oct 2002 12:35:17 -0000 2.15.18.1 *************** *** 1,4 **** --- 1,7 ---- #ifndef CSTRINGIO_INCLUDED #define CSTRINGIO_INCLUDED + #ifdef __cplusplus + extern "C" { + #endif /* *************** *** 129,131 **** --- 132,137 ---- PycStringIO=(struct PycStringIO_CAPI*)xxxPyCObject_Import("cStringIO", "cStringIO_CAPI") + #ifdef __cplusplus + } + #endif #endif /* CSTRINGIO_INCLUDED */ Index: descrobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/descrobject.h,v retrieving revision 2.8 retrieving revision 2.8.8.1 diff -C2 -d -r2.8 -r2.8.8.1 *** descrobject.h 22 Oct 2001 00:43:43 -0000 2.8 --- descrobject.h 4 Oct 2002 12:35:17 -0000 2.8.8.1 *************** *** 1,3 **** --- 1,8 ---- /* Descriptors */ + #ifndef Py_DESCROBJECT_H + #define Py_DESCROBJECT_H + #ifdef __cplusplus + extern "C" { + #endif typedef PyObject *(*getter)(PyObject *, void *); *************** *** 79,80 **** --- 84,90 ---- extern DL_IMPORT(PyTypeObject) PyProperty_Type; + #ifdef __cplusplus + } + #endif + #endif /* !Py_DESCROBJECT_H */ + Index: iterobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/iterobject.h,v retrieving revision 1.3 retrieving revision 1.3.20.1 diff -C2 -d -r1.3 -r1.3.20.1 *** iterobject.h 23 Apr 2001 14:08:49 -0000 1.3 --- iterobject.h 4 Oct 2002 12:35:17 -0000 1.3.20.1 *************** *** 1,3 **** --- 1,8 ---- + #ifndef Py_ITEROBJECT_H + #define Py_ITEROBJECT_H /* Iterators (the basic kind, over a sequence) */ + #ifdef __cplusplus + extern "C" { + #endif extern DL_IMPORT(PyTypeObject) PySeqIter_Type; *************** *** 12,13 **** --- 17,23 ---- extern DL_IMPORT(PyObject *) PyCallIter_New(PyObject *, PyObject *); + #ifdef __cplusplus + } + #endif + #endif /* !Py_ITEROBJECT_H */ + From nnorwitz@users.sourceforge.net Fri Oct 4 13:43:05 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 04 Oct 2002 05:43:05 -0700 Subject: [Python-checkins] python/dist/src/Include complexobject.h,2.10,2.11 cStringIO.h,2.18,2.19 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv5162/Include Modified Files: complexobject.h cStringIO.h Log Message: SF # 607253, header file problems by Ralf W. Grosse-Kunstleve Don't pollute the namespace when protecting against multiple header inclusion. Prefix with Py_ and use standard naming convention Py_FILENAME_H. Index: complexobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/complexobject.h,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** complexobject.h 12 Aug 2002 07:21:56 -0000 2.10 --- complexobject.h 4 Oct 2002 12:43:02 -0000 2.11 *************** *** 1,6 **** /* Complex number structure */ ! #ifndef COMPLEXOBJECT_H ! #define COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { --- 1,6 ---- /* Complex number structure */ ! #ifndef Py_COMPLEXOBJECT_H ! #define Py_COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { *************** *** 56,58 **** } #endif ! #endif /* !COMPLEXOBJECT_H */ --- 56,58 ---- } #endif ! #endif /* !Py_COMPLEXOBJECT_H */ Index: cStringIO.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/cStringIO.h,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** cStringIO.h 5 Aug 2002 18:20:01 -0000 2.18 --- cStringIO.h 4 Oct 2002 12:43:02 -0000 2.19 *************** *** 1,4 **** ! #ifndef CSTRINGIO_INCLUDED ! #define CSTRINGIO_INCLUDED #ifdef __cplusplus extern "C" { --- 1,4 ---- ! #ifndef Py_CSTRINGIO_H ! #define Py_CSTRINGIO_H #ifdef __cplusplus extern "C" { *************** *** 61,63 **** } #endif ! #endif /* CSTRINGIO_INCLUDED */ --- 61,63 ---- } #endif ! #endif /* !Py_CSTRINGIO_H */ From nnorwitz@users.sourceforge.net Fri Oct 4 13:50:14 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 04 Oct 2002 05:50:14 -0700 Subject: [Python-checkins] python/dist/src/Include complexobject.h,2.9,2.9.12.1 cStringIO.h,2.15.18.1,2.15.18.2 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv7686/Include Modified Files: Tag: release22-maint complexobject.h cStringIO.h Log Message: Backport last checkin: SF # 607253, header file problems, reported by Ralf W. Grosse-Kunstleve Don't pollute the namespace when protecting against multiple header inclusion. Prefix with Py_ and use standard naming convention Py_FILENAME_H. Index: complexobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/complexobject.h,v retrieving revision 2.9 retrieving revision 2.9.12.1 diff -C2 -d -r2.9 -r2.9.12.1 *** complexobject.h 12 Sep 2001 19:12:48 -0000 2.9 --- complexobject.h 4 Oct 2002 12:50:11 -0000 2.9.12.1 *************** *** 1,6 **** /* Complex number structure */ ! #ifndef COMPLEXOBJECT_H ! #define COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { --- 1,6 ---- /* Complex number structure */ ! #ifndef Py_COMPLEXOBJECT_H ! #define Py_COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { *************** *** 56,58 **** } #endif ! #endif /* !COMPLEXOBJECT_H */ --- 56,58 ---- } #endif ! #endif /* !Py_COMPLEXOBJECT_H */ Index: cStringIO.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/cStringIO.h,v retrieving revision 2.15.18.1 retrieving revision 2.15.18.2 diff -C2 -d -r2.15.18.1 -r2.15.18.2 *** cStringIO.h 4 Oct 2002 12:35:17 -0000 2.15.18.1 --- cStringIO.h 4 Oct 2002 12:50:12 -0000 2.15.18.2 *************** *** 1,4 **** ! #ifndef CSTRINGIO_INCLUDED ! #define CSTRINGIO_INCLUDED #ifdef __cplusplus extern "C" { --- 1,4 ---- ! #ifndef Py_CSTRINGIO_H ! #define Py_CSTRINGIO_H #ifdef __cplusplus extern "C" { *************** *** 135,137 **** } #endif ! #endif /* CSTRINGIO_INCLUDED */ --- 135,137 ---- } #endif ! #endif /* !Py_CSTRINGIO_H */ From lemburg@users.sourceforge.net Fri Oct 4 16:57:05 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 08:57:05 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv8657/Lib/encodings Modified Files: aliases.py Log Message: Remove unneeded alias. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** aliases.py 4 Oct 2002 11:58:24 -0000 1.17 --- aliases.py 4 Oct 2002 15:57:03 -0000 1.18 *************** *** 28,32 **** 'ansi_x3.4_1968' : 'ascii', 'ansi_x3.4_1986' : 'ascii', - 'ansi_x3_4_1968' : 'ascii', 'cp367' : 'ascii', 'csascii' : 'ascii', --- 28,31 ---- From lemburg@users.sourceforge.net Fri Oct 4 17:31:00 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Fri, 04 Oct 2002 09:31:00 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv21695/Lib/encodings Modified Files: aliases.py Log Message: Undo the removal. Guido mentioned that the encoding name is in active by some email headers. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** aliases.py 4 Oct 2002 15:57:03 -0000 1.18 --- aliases.py 4 Oct 2002 16:30:42 -0000 1.19 *************** *** 27,30 **** --- 27,31 ---- '646' : 'ascii', 'ansi_x3.4_1968' : 'ascii', + 'ansi_x3_4_1968' : 'ascii', # some email headers use this non-standard name 'ansi_x3.4_1986' : 'ascii', 'cp367' : 'ascii', From barry@users.sourceforge.net Fri Oct 4 18:24:26 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:24:26 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_email_codecs.py,NONE,1.5.2.1 regrtest.py,1.70.4.2,1.70.4.3 test_email.py,1.24.4.2,1.24.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11766/Lib/test Modified Files: Tag: release22-maint regrtest.py test_email.py Added Files: Tag: release22-maint test_email_codecs.py Log Message: Backporting of email 2.4 from Python 2.3. Many newly added modules, some updated modules, updated documentation, and updated tests. Note that Lib/test/regrtest.py added test_email_codecs to the expected skips for all platforms. Also note that test_email_codecs.py differs slightly from its Python 2.3 counterpart due to the difference in package location for TestSkipped. --- NEW FILE: test_email_codecs.py --- # Copyright (C) 2002 Python Software Foundation # email package unit tests for (optional) Asian codecs import unittest # The specific tests now live in Lib/email/test from email.test.test_email_codecs import suite if __name__ == '__main__': unittest.main(defaultTest='suite') Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.70.4.2 retrieving revision 1.70.4.3 diff -C2 -d -r1.70.4.2 -r1.70.4.3 *** regrtest.py 30 Sep 2002 16:16:12 -0000 1.70.4.2 --- regrtest.py 4 Oct 2002 17:24:24 -0000 1.70.4.3 *************** *** 485,488 **** --- 485,489 ---- test_dbm test_dl + test_email_codecs test_fcntl test_fork1 *************** *** 512,515 **** --- 513,517 ---- test_curses test_dl + test_email_codecs test_gl test_imgfile *************** *** 535,538 **** --- 537,541 ---- test_dbm test_dl + test_email_codecs test_fcntl test_fork1 *************** *** 568,571 **** --- 571,575 ---- test_cl test_dl + test_email_codecs test_gl test_imgfile *************** *** 592,595 **** --- 596,600 ---- test_cl test_dl + test_email_codecs test_gl test_imgfile *************** *** 617,620 **** --- 622,626 ---- test_cl test_dl + test_email_codecs test_fork1 test_gettext *************** *** 653,656 **** --- 659,663 ---- test_dbm test_dl + test_email_codecs test_fcntl test_fork1 *************** *** 691,694 **** --- 698,702 ---- test_curses test_dl + test_email_codecs test_gdbm test_gl Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.24.4.2 retrieving revision 1.24.4.3 diff -C2 -d -r1.24.4.2 -r1.24.4.3 *** test_email.py 22 Mar 2002 16:19:30 -0000 1.24.4.2 --- test_email.py 4 Oct 2002 17:24:24 -0000 1.24.4.3 *************** *** 2,1132 **** # email package unit tests - import os - import time import unittest ! import base64 ! from cStringIO import StringIO ! from types import StringType ! ! import email [...1112 lines suppressed...] - def test_main(): - from test_support import run_suite - run_suite(suite()) - if __name__ == '__main__': ! test_main() --- 2,11 ---- # email package unit tests import unittest ! # The specific tests now live in Lib/email/test ! from email.test.test_email import suite if __name__ == '__main__': ! unittest.main(defaultTest='suite') From barry@users.sourceforge.net Fri Oct 4 18:24:26 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:24:26 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib email-dir.py,NONE,1.1.2.1 email-mime.py,NONE,1.1.2.1 email-simple.py,NONE,1.1.2.1 email-unpack.py,NONE,1.1.2.1 emailcharsets.tex,NONE,1.1.2.1 emailheaders.tex,NONE,1.2.2.1 emailmimebase.tex,NONE,1.2.2.1 email.tex,1.9.6.2,1.9.6.3 emailencoders.tex,1.2,1.2.12.1 emailexc.tex,1.2,1.2.12.1 emailgenerator.tex,1.3,1.3.8.1 emailiter.tex,1.2,1.2.12.1 emailmessage.tex,1.4,1.4.8.1 emailparser.tex,1.4.10.1,1.4.10.2 emailutil.tex,1.5.8.1,1.5.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11766/Doc/lib Modified Files: Tag: release22-maint email.tex emailencoders.tex emailexc.tex emailgenerator.tex emailiter.tex emailmessage.tex emailparser.tex emailutil.tex Added Files: Tag: release22-maint email-dir.py email-mime.py email-simple.py email-unpack.py emailcharsets.tex emailheaders.tex emailmimebase.tex Log Message: Backporting of email 2.4 from Python 2.3. Many newly added modules, some updated modules, updated documentation, and updated tests. Note that Lib/test/regrtest.py added test_email_codecs to the expected skips for all platforms. Also note that test_email_codecs.py differs slightly from its Python 2.3 counterpart due to the difference in package location for TestSkipped. --- NEW FILE: email-dir.py --- #!/usr/bin/env python """Send the contents of a directory as a MIME message. Usage: dirmail [options] from to [to ...]* Options: -h / --help Print this message and exit. -d directory --directory=directory Mail the contents of the specified directory, otherwise use the current directory. Only the regular files in the directory are sent, and we don't recurse to subdirectories. `from' is the email address of the sender of the message. `to' is the email address of the recipient of the message, and multiple recipients may be given. The email is sent by forwarding to your local SMTP server, which then does the normal delivery process. Your local machine must be running an SMTP server. """ import sys import os import getopt import smtplib # For guessing MIME type based on file name extension import mimetypes from email import Encoders from email.Message import Message from email.MIMEAudio import MIMEAudio from email.MIMEMultipart import MIMEMultipart from email.MIMEImage import MIMEImage from email.MIMEText import MIMEText COMMASPACE = ', ' def usage(code, msg=''): print >> sys.stderr, __doc__ if msg: print >> sys.stderr, msg sys.exit(code) def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) except getopt.error, msg: usage(1, msg) dir = os.curdir for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--directory'): dir = arg if len(args) < 2: usage(1) sender = args[0] recips = args[1:] # Create the enclosing (outer) message outer = MIMEMultipart() outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = COMMASPACE.join(recips) outer['From'] = sender outer.preamble = 'You will not see this in a MIME-aware mail reader.\n' # To guarantee the message ends with a newline outer.epilogue = '' for filename in os.listdir(dir): path = os.path.join(dir, filename) if not os.path.isfile(path): continue # Guess the content type based on the file's extension. Encoding # will be ignored, although we should check for simple things like # gzip'd or compressed files. ctype, encoding = mimetypes.guess_type(path) if ctype is None or encoding is not None: # No guess could be made, or the file is encoded (compressed), so # use a generic bag-of-bits type. ctype = 'application/octet-stream' maintype, subtype = ctype.split('/', 1) if maintype == 'text': fp = open(path) # Note: we should handle calculating the charset msg = MIMEText(fp.read(), _subtype=subtype) fp.close() elif maintype == 'image': fp = open(path, 'rb') msg = MIMEImage(fp.read(), _subtype=subtype) fp.close() elif maintype == 'audio': fp = open(path, 'rb') msg = MIMEAudio(fp.read(), _subtype=subtype) fp.close() else: fp = open(path, 'rb') msg = MIMEBase(maintype, subtype) msg.set_payload(fp.read()) fp.close() # Encode the payload using Base64 Encoders.encode_base64(msg) # Set the filename parameter msg.add_header('Content-Disposition', 'attachment', filename=filename) outer.attach(msg) # Now send the message s = smtplib.SMTP() s.connect() s.sendmail(sender, recips, outer.as_string()) s.close() if __name__ == '__main__': main() --- NEW FILE: email-mime.py --- # Import smtplib for the actual sending function import smtplib # Here are the email pacakge modules we'll need from email.MIMEImage import MIMEImage from email.MIMEMultipart import MIMEMultipart COMMASPACE = ', ' # Create the container (outer) email message. msg = MIMEMultipart() msg['Subject'] = 'Our family reunion' # me == the sender's email address # family = the list of all recipients' email addresses msg['From'] = me msg['To'] = COMMASPACE.join(family) msg.preamble = 'Our family reunion' # Guarantees the message ends in a newline msg.epilogue = '' # Assume we know that the image files are all in PNG format for file in pngfiles: # Open the files in binary mode. Let the MIMEImage class automatically # guess the specific image type. fp = open(file, 'rb') img = MIMEImage(fp.read()) fp.close() msg.attach(img) # Send the email via our own SMTP server. s = smtplib.SMTP() s.connect() s.sendmail(me, family, msg.as_string()) s.close() --- NEW FILE: email-simple.py --- # Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.MIMEText import MIMEText # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. fp = open(textfile, 'rb') # Create a text/plain message msg = MIMEText(fp.read()) fp.close() # me == the sender's email address # you == the recipient's email address msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP() s.connect() s.sendmail(me, [you], msg.as_string()) s.close() --- NEW FILE: email-unpack.py --- #!/usr/bin/env python """Unpack a MIME message into a directory of files. Usage: unpackmail [options] msgfile Options: -h / --help Print this message and exit. -d directory --directory=directory Unpack the MIME message into the named directory, which will be created if it doesn't already exist. msgfile is the path to the file containing the MIME message. """ import sys import os import getopt import errno import mimetypes import email def usage(code, msg=''): print >> sys.stderr, __doc__ if msg: print >> sys.stderr, msg sys.exit(code) def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) except getopt.error, msg: usage(1, msg) dir = os.curdir for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--directory'): dir = arg try: msgfile = args[0] except IndexError: usage(1) try: os.mkdir(dir) except OSError, e: # Ignore directory exists error if e.errno <> errno.EEXIST: raise fp = open(msgfile) msg = email.message_from_file(fp) fp.close() counter = 1 for part in msg.walk(): # multipart/* are just containers if part.get_content_maintype() == 'multipart': continue # Applications should really sanitize the given filename so that an # email message can't be used to overwrite important files filename = part.get_filename() if not filename: ext = mimetypes.guess_extension(part.get_type()) if not ext: # Use a generic bag-of-bits extension ext = '.bin' filename = 'part-%03d%s' % (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') fp.write(part.get_payload(decode=1)) fp.close() if __name__ == '__main__': main() --- NEW FILE: emailcharsets.tex --- \declaremodule{standard}{email.Charset} \modulesynopsis{Character Sets} This module provides a class \class{Charset} for representing character sets and character set conversions in email messages, as well as a character set registry and several convenience methods for manipulating this registry. Instances of \class{Charset} are used in several other modules within the \module{email} package. \versionadded{2.2.2} \begin{classdesc}{Charset}{\optional{input_charset}} Map character sets to their email properties. This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email message in an RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email. Optional \var{input_charset} is as described below. After being alias normalized it is also used as a lookup into the registry of character sets to find out the header encoding, body encoding, and output conversion codec to be used for the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is necessary. If \var{input_charset} is \code{euc-jp}, then headers will be encoded with base64, bodies will not be encoded, but output text will be converted from the \code{euc-jp} character set to the \code{iso-2022-jp} character set. \end{classdesc} \class{Charset} instances have the following data attributes: \begin{datadesc}{input_charset} The initial character set specified. Common aliases are converted to their \emph{official} email names (e.g. \code{latin_1} is converted to \code{iso-8859-1}). Defaults to 7-bit \code{us-ascii}. \end{datadesc} \begin{datadesc}{header_encoding} If the character set must be encoded before it can be used in an email header, this attribute will be set to \code{Charset.QP} (for quoted-printable), \code{Charset.BASE64} (for base64 encoding), or \code{Charset.SHORTEST} for the shortest of QP or BASE64 encoding. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{body_encoding} Same as \var{header_encoding}, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. \code{Charset.SHORTEST} is not allowed for \var{body_encoding}. \end{datadesc} \begin{datadesc}{output_charset} Some character sets must be converted before they can be used in email headers or bodies. If the \var{input_charset} is one of them, this attribute will contain the name of the character set output will be converted to. Otherwise, it will be \code{None}. \end{datadesc} \begin{datadesc}{input_codec} The name of the Python codec used to convert the \var{input_charset} to Unicode. If no conversion codec is necessary, this attribute will be \code{None}. \end{datadesc} \begin{datadesc}{output_codec} The name of the Python codec used to convert Unicode to the \var{output_charset}. If no conversion codec is necessary, this attribute will have the same value as the \var{input_codec}. \end{datadesc} \class{Charset} instances also have the following methods: \begin{methoddesc}[Charset]{get_body_encoding}{} Return the content transfer encoding used for body encoding. This is either the string \samp{quoted-printable} or \samp{base64} depending on the encoding used, or it is a function, in which case you should call the function with a single argument, the Message object being encoded. The function should then set the \mailheader{Content-Transfer-Encoding} header itself to whatever is appropriate. Returns the string \samp{quoted-printable} if \var{body_encoding} is \code{QP}, returns the string \samp{base64} if \var{body_encoding} is \code{BASE64}, and returns the string \samp{7bit} otherwise. \end{methoddesc} \begin{methoddesc}{convert}{s} Convert the string \var{s} from the \var{input_codec} to the \var{output_codec}. \end{methoddesc} \begin{methoddesc}{to_splittable}{s} Convert a possibly multibyte string to a safely splittable format. \var{s} is the string to split. Uses the \var{input_codec} to try and convert the string to Unicode, so it can be safely split on character boundaries (even for multibyte characters). Returns the string as-is if it isn't known how to convert \var{s} to Unicode with the \var{input_charset}. Characters that could not be converted to Unicode will be replaced with the Unicode replacement character \character{U+FFFD}. \end{methoddesc} \begin{methoddesc}{from_splittable}{ustr\optional{, to_output}} Convert a splittable string back into an encoded string. \var{ustr} is a Unicode string to ``unsplit''. This method uses the proper codec to try and convert the string from Unicode back into an encoded format. Return the string as-is if it is not Unicode, or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced with an appropriate character (usually \character{?}). If \var{to_output} is \code{True} (the default), uses \var{output_codec} to convert to an encoded format. If \var{to_output} is \code{False}, it uses \var{input_codec}. \end{methoddesc} \begin{methoddesc}{get_output_charset}{} Return the output character set. This is the \var{output_charset} attribute if that is not \code{None}, otherwise it is \var{input_charset}. \end{methoddesc} \begin{methoddesc}{encoded_header_len}{} Return the length of the encoded header string, properly calculating for quoted-printable or base64 encoding. \end{methoddesc} \begin{methoddesc}{header_encode}{s\optional{, convert}} Header-encode the string \var{s}. If \var{convert} is \code{True}, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the higher-level \class{Header} class to deal with these issues (see \refmodule{email.Header}). \var{convert} defaults to \code{False}. The type of encoding (base64 or quoted-printable) will be based on the \var{header_encoding} attribute. \end{methoddesc} \begin{methoddesc}{body_encode}{s\optional{, convert}} Body-encode the string \var{s}. If \var{convert} is \code{True} (the default), the string will be converted from the input charset to output charset automatically. Unlike \method{header_encode()}, there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on the \var{body_encoding} attribute. \end{methoddesc} The \class{Charset} class also provides a number of methods to support standard operations and built-in functions. \begin{methoddesc}[Charset]{__str__}{} Returns \var{input_charset} as a string coerced to lower case. \end{methoddesc} \begin{methoddesc}[Charset]{__eq__}{other} This method allows you to compare two \class{Charset} instances for equality. \end{methoddesc} \begin{methoddesc}[Header]{__ne__}{other} This method allows you to compare two \class{Charset} instances for inequality. \end{methoddesc} The \module{email.Charset} module also provides the following functions for adding new entries to the global character set, alias, and codec registries: \begin{funcdesc}{add_charset}{charset\optional{, header_enc\optional{, body_enc\optional{, output_charset}}}} Add character properties to the global registry. \var{charset} is the input character set, and must be the canonical name of a character set. Optional \var{header_enc} and \var{body_enc} is either \code{Charset.QP} for quoted-printable, \code{Charset.BASE64} for base64 encoding, \code{Charset.SHORTEST} for the shortest of quoted-printable or base64 encoding, or \code{None} for no encoding. \code{SHORTEST} is only valid for \var{header_enc}. The default is \code{None} for no encoding. Optional \var{output_charset} is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method \method{Charset.convert()} is called. The default is to output in the same character set as the input. Both \var{input_charset} and \var{output_charset} must have Unicode codec entries in the module's character set-to-codec mapping; use \function{add_codec()} to add codecs the module does not know about. See the \refmodule{codecs} module's documentation for more information. The global character set registry is kept in the module global dictionary \code{CHARSETS}. \end{funcdesc} \begin{funcdesc}{add_alias}{alias, canonical} Add a character set alias. \var{alias} is the alias name, e.g. \code{latin-1}. \var{canonical} is the character set's canonical name, e.g. \code{iso-8859-1}. The global charset alias registry is kept in the module global dictionary \code{ALIASES}. \end{funcdesc} \begin{funcdesc}{add_codec}{charset, codecname} Add a codec that map characters in the given character set to and from Unicode. \var{charset} is the canonical name of a character set. \var{codecname} is the name of a Python codec, as appropriate for the second argument to the \function{unicode()} built-in, or to the \method{encode()} method of a Unicode string. \end{funcdesc} --- NEW FILE: emailheaders.tex --- \declaremodule{standard}{email.Header} \modulesynopsis{Representing non-ASCII headers} \rfc{2822} is the base standard that describes the format of email messages. It derives from the older \rfc{822} standard which came into widespread use at a time when most email was composed of \ASCII{} characters only. \rfc{2822} is a specification written assuming email contains only 7-bit \ASCII{} characters. Of course, as email has been deployed worldwide, it has become internationalized, such that language specific character sets can now be used in email messages. The base standard still requires email messages to be transfered using only 7-bit \ASCII{} characters, so a slew of RFCs have been written describing how to encode email containing non-\ASCII{} characters into \rfc{2822}-compliant format. These RFCs include \rfc{2045}, \rfc{2046}, \rfc{2047}, and \rfc{2231}. The \module{email} package supports these standards in its \module{email.Header} and \module{email.Charset} modules. If you want to include non-\ASCII{} characters in your email headers, say in the \mailheader{Subject} or \mailheader{To} fields, you should use the \class{Header} class and assign the field in the \class{Message} object to an instance of \class{Header} instead of using a string for the header value. For example: \begin{verbatim} >>> from email.Message import Message >>> from email.Header import Header >>> msg = Message() >>> h = Header('p\xf6stal', 'iso-8859-1') >>> msg['Subject'] = h >>> print msg.as_string() Subject: =?iso-8859-1?q?p=F6stal?= \end{verbatim} Notice here how we wanted the \mailheader{Subject} field to contain a non-\ASCII{} character? We did this by creating a \class{Header} instance and passing in the character set that the byte string was encoded in. When the subsequent \class{Message} instance was flattened, the \mailheader{Subject} field was properly \rfc{2047} encoded. MIME-aware mail readers would show this header using the embedded ISO-8859-1 character. \versionadded{2.2.2} Here is the \class{Header} class description: \begin{classdesc}{Header}{\optional{s\optional{, charset\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}}}} Create a MIME-compliant header that can contain strings in different character sets. Optional \var{s} is the initial header value. If \code{None} (the default), the initial header value is not set. You can later append to the header with \method{append()} method calls. \var{s} may be a byte string or a Unicode string, but see the \method{append()} documentation for semantics. Optional \var{charset} serves two purposes: it has the same meaning as the \var{charset} argument to the \method{append()} method. It also sets the default character set for all subsequent \method{append()} calls that omit the \var{charset} argument. If \var{charset} is not provided in the constructor (the default), the \code{us-ascii} character set is used both as \var{s}'s initial charset and as the default for subsequent \method{append()} calls. The maximum line length can be specified explicit via \var{maxlinelen}. For splitting the first line to a shorter value (to account for the field header which isn't included in \var{s}, e.g. \mailheader{Subject}) pass in the name of the field in \var{header_name}. The default \var{maxlinelen} is 76, and the default value for \var{header_name} is \code{None}, meaning it is not taken into account for the first line of a long, split header. Optional \var{continuation_ws} must be \rfc{2822}-compliant folding whitespace, and is usually either a space or a hard tab character. This character will be prepended to continuation lines. \end{classdesc} \begin{methoddesc}[Header]{append}{s\optional{, charset}} Append the string \var{s} to the MIME header. Optional \var{charset}, if given, should be a \class{Charset} instance (see \refmodule{email.Charset}) or the name of a character set, which will be converted to a \class{Charset} instance. A value of \code{None} (the default) means that the \var{charset} given in the constructor is used. \var{s} may be a byte string or a Unicode string. If it is a byte string (i.e. \code{isinstance(s, str)} is true), then \var{charset} is the encoding of that byte string, and a \exception{UnicodeError} will be raised if the string cannot be decoded with that character set. If \var{s} is a Unicode string, then \var{charset} is a hint specifying the character set of the characters in the string. In this case, when producing an \rfc{2822}-compliant header using \rfc{2047} rules, the Unicode string will be encoded using the following charsets in order: \code{us-ascii}, the \var{charset} hint, \code{utf-8}. The first character set to not provoke a \exception{UnicodeError} is used. \end{methoddesc} \begin{methoddesc}[Header]{encode}{} Encode a message header into an RFC-compliant format, possibly wrapping long lines and encapsulating non-\ASCII{} parts in base64 or quoted-printable encodings. \end{methoddesc} The \class{Header} class also provides a number of methods to support standard operators and built-in functions. \begin{methoddesc}[Header]{__str__}{} A synonym for \method{Header.encode()}. Useful for \code{str(aHeader)}. \end{methoddesc} \begin{methoddesc}[Header]{__unicode__}{} A helper for the built-in \function{unicode()} function. Returns the header as a Unicode string. \end{methoddesc} \begin{methoddesc}[Header]{__eq__}{other} This method allows you to compare two \class{Header} instances for equality. \end{methoddesc} \begin{methoddesc}[Header]{__ne__}{other} This method allows you to compare two \class{Header} instances for inequality. \end{methoddesc} The \module{email.Header} module also provides the following convenient functions. \begin{funcdesc}{decode_header}{header} Decode a message header value without converting the character set. The header value is in \var{header}. This function returns a list of \code{(decoded_string, charset)} pairs containing each of the decoded parts of the header. \var{charset} is \code{None} for non-encoded parts of the header, otherwise a lower case string containing the name of the character set specified in the encoded string. Here's an example: \begin{verbatim} >>> from email.Header import decode_header >>> decode_header('=?iso-8859-1?q?p=F6stal?=') [('p\\xf6stal', 'iso-8859-1')] \end{verbatim} \end{funcdesc} \begin{funcdesc}{make_header}{decoded_seq\optional{, maxlinelen\optional{, header_name\optional{, continuation_ws}}}} Create a \class{Header} instance from a sequence of pairs as returned by \function{decode_header()}. \function{decode_header()} takes a header value string and returns a sequence of pairs of the format \code{(decoded_string, charset)} where \var{charset} is the name of the character set. This function takes one of those sequence of pairs and returns a \class{Header} instance. Optional \var{maxlinelen}, \var{header_name}, and \var{continuation_ws} are as in the \class{Header} constructor. \end{funcdesc} --- NEW FILE: emailmimebase.tex --- Ordinarily, you get a message object structure by passing a file or some text to a parser, which parses the text and returns the root message object. However you can also build a complete message structure from scratch, or even individual \class{Message} objects by hand. In fact, you can also take an existing structure and add new \class{Message} objects, move them around, etc. This makes a very convenient interface for slicing-and-dicing MIME messages. You can create a new object structure by creating \class{Message} instances, adding attachments and all the appropriate headers manually. For MIME messages though, the \module{email} package provides some convenient subclasses to make things easier. Each of these classes should be imported from a module with the same name as the class, from within the \module{email} package. E.g.: \begin{verbatim} import email.MIMEImage.MIMEImage \end{verbatim} or \begin{verbatim} from email.MIMEText import MIMEText \end{verbatim} Here are the classes: \begin{classdesc}{MIMEBase}{_maintype, _subtype, **_params} This is the base class for all the MIME-specific subclasses of \class{Message}. Ordinarily you won't create instances specifically of \class{MIMEBase}, although you could. \class{MIMEBase} is provided primarily as a convenient base class for more specific MIME-aware subclasses. \var{_maintype} is the \mailheader{Content-Type} major type (e.g. \mimetype{text} or \mimetype{image}), and \var{_subtype} is the \mailheader{Content-Type} minor type (e.g. \mimetype{plain} or \mimetype{gif}). \var{_params} is a parameter key/value dictionary and is passed directly to \method{Message.add_header()}. The \class{MIMEBase} class always adds a \mailheader{Content-Type} header (based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a \mailheader{MIME-Version} header (always set to \code{1.0}). \end{classdesc} \begin{classdesc}{MIMENonMultipart}{} A subclass of \class{MIMEBase}, this is an intermediate base class for MIME messages that are not \mimetype{multipart}. The primary purpose of this class is to prevent the use of the \method{attach()} method, which only makes sense for \mimetype{multipart} messages. If \method{attach()} is called, a \exception{MultipartConversionError} exception is raised. \versionadded{2.2.2} \end{classdesc} \begin{classdesc}{MIMEMultipart}{\optional{subtype\optional{, boundary\optional{, _subparts\optional{, _params}}}}} A subclass of \class{MIMEBase}, this is an intermediate base class for MIME messages that are \mimetype{multipart}. Optional \var{_subtype} defaults to \mimetype{mixed}, but can be used to specify the subtype of the message. A \mailheader{Content-Type} header of \mimetype{multipart/}\var{_subtype} will be added to the message object. A \mailheader{MIME-Version} header will also be added. Optional \var{boundary} is the multipart boundary string. When \code{None} (the default), the boundary is calculated when needed. \var{_subparts} is a sequence of initial subparts for the payload. It must be possible to convert this sequence to a list. You can always attach new subparts to the message by using the \method{Message.attach()} method. Additional parameters for the \mailheader{Content-Type} header are taken from the keyword arguments, or passed into the \var{_params} argument, which is a keyword dictionary. \versionadded{2.2.2} \end{classdesc} \begin{classdesc}{MIMEAudio}{_audiodata\optional{, _subtype\optional{, _encoder\optional{, **_params}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEAudio} class is used to create MIME message objects of major type \mimetype{audio}. \var{_audiodata} is a string containing the raw audio data. If this data can be decoded by the standard Python module \refmodule{sndhdr}, then the subtype will be automatically included in the \mailheader{Content-Type} header. Otherwise you can explicitly specify the audio subtype via the \var{_subtype} parameter. If the minor type could not be guessed and \var{_subtype} was not given, then \exception{TypeError} is raised. Optional \var{_encoder} is a callable (i.e. function) which will perform the actual encoding of the audio data for transport. This callable takes one argument, which is the \class{MIMEAudio} instance. It should use \method{get_payload()} and \method{set_payload()} to change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message object as necessary. The default encoding is base64. See the \refmodule{email.Encoders} module for a list of the built-in encoders. \var{_params} are passed straight through to the base class constructor. \end{classdesc} \begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{, _encoder\optional{, **_params}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEImage} class is used to create MIME message objects of major type \mimetype{image}. \var{_imagedata} is a string containing the raw image data. If this data can be decoded by the standard Python module \refmodule{imghdr}, then the subtype will be automatically included in the \mailheader{Content-Type} header. Otherwise you can explicitly specify the image subtype via the \var{_subtype} parameter. If the minor type could not be guessed and \var{_subtype} was not given, then \exception{TypeError} is raised. Optional \var{_encoder} is a callable (i.e. function) which will perform the actual encoding of the image data for transport. This callable takes one argument, which is the \class{MIMEImage} instance. It should use \method{get_payload()} and \method{set_payload()} to change the payload to encoded form. It should also add any \mailheader{Content-Transfer-Encoding} or other headers to the message object as necessary. The default encoding is base64. See the \refmodule{email.Encoders} module for a list of the built-in encoders. \var{_params} are passed straight through to the \class{MIMEBase} constructor. \end{classdesc} \begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}} A subclass of \class{MIMENonMultipart}, the \class{MIMEMessage} class is used to create MIME objects of main type \mimetype{message}. \var{_msg} is used as the payload, and must be an instance of class \class{Message} (or a subclass thereof), otherwise a \exception{TypeError} is raised. Optional \var{_subtype} sets the subtype of the message; it defaults to \mimetype{rfc822}. \end{classdesc} \begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{, _charset\optional{, _encoder}}}} A subclass of \class{MIMENonMultipart}, the \class{MIMEText} class is used to create MIME objects of major type \mimetype{text}. \var{_text} is the string for the payload. \var{_subtype} is the minor type and defaults to \mimetype{plain}. \var{_charset} is the character set of the text and is passed as a parameter to the \class{MIMENonMultipart} constructor; it defaults to \code{us-ascii}. No guessing or encoding is performed on the text data, but a newline is appended to \var{_text} if it doesn't already end with a newline. \deprecated{2.2.2}{The \var{_encoding} argument has been deprecated. Encoding now happens implicitly based on the \var{_charset} argument.} \end{classdesc} Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.9.6.2 retrieving revision 1.9.6.3 diff -C2 -d -r1.9.6.2 -r1.9.6.3 *** email.tex 26 Jun 2002 07:52:41 -0000 1.9.6.2 --- email.tex 4 Oct 2002 17:24:23 -0000 1.9.6.3 *************** *** 1,3 **** ! % Copyright (C) 2001 Python Software Foundation % Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! % Copyright (C) 2001,2002 Python Software Foundation % Author: barry@zope.com (Barry Warsaw) *************** *** 20,30 **** \module{mimecntl}. It is specifically \emph{not} designed to do any sending of email messages to SMTP (\rfc{2821}) servers; that is the ! function of the \refmodule{smtplib} module\footnote{For this reason, ! line endings in the \module{email} package are always native line ! endings. The \module{smtplib} module is responsible for converting ! from native line endings to \rfc{2821} line endings, just as your mail ! server would be responsible for converting from \rfc{2821} line ! endings to native line endings when it stores messages in a local ! mailbox.}. The primary distinguishing feature of the \module{email} package is --- 20,27 ---- \module{mimecntl}. It is specifically \emph{not} designed to do any sending of email messages to SMTP (\rfc{2821}) servers; that is the ! function of the \refmodule{smtplib} module. The \module{email} ! package attempts to be as RFC-compliant as possible, supporting in ! addition to \rfc{2822}, such MIME-related RFCs as ! \rfc{2045}-\rfc{2047}, and \rfc{2231}. The primary distinguishing feature of the \module{email} package is *************** *** 43,54 **** \module{email} package. The ordering follows a progression that should be common in applications: an email message is read as flat ! text from a file or other source, the text is parsed to produce an ! object model representation of the email message, this model is ! manipulated, and finally the model is rendered back into ! flat text. ! It is perfectly feasible to create the object model out of whole cloth ! --- i.e. completely from scratch. From there, a similar progression ! can be taken as above. Also included are detailed specifications of all the classes and --- 40,50 ---- \module{email} package. The ordering follows a progression that should be common in applications: an email message is read as flat ! text from a file or other source, the text is parsed to produce the ! object structure of the email message, this structure is manipulated, ! and finally rendered back into flat text. ! It is perfectly feasible to create the object structure out of whole ! cloth --- i.e. completely from scratch. From there, a similar ! progression can be taken as above. Also included are detailed specifications of all the classes and *************** *** 56,61 **** classes you might encounter while using the \module{email} package, some auxiliary utilities, and a few examples. For users of the older ! \module{mimelib} package, from which the \module{email} package is ! descended, a section on differences and porting is provided. \begin{seealso} --- 52,57 ---- classes you might encounter while using the \module{email} package, some auxiliary utilities, and a few examples. For users of the older ! \module{mimelib} package, or previous versions of the \module{email} ! package, a section on differences and porting is provided. \begin{seealso} *************** *** 73,215 **** \subsection{Creating email and MIME objects from scratch} ! Ordinarily, you get a message object tree by passing some text to a ! parser, which parses the text and returns the root of the message ! object tree. However you can also build a complete object tree from ! scratch, or even individual \class{Message} objects by hand. In fact, ! you can also take an existing tree and add new \class{Message} ! objects, move them around, etc. This makes a very convenient ! interface for slicing-and-dicing MIME messages. ! ! You can create a new object tree by creating \class{Message} ! instances, adding payloads and all the appropriate headers manually. ! For MIME messages though, the \module{email} package provides some ! convenient classes to make things easier. Each of these classes ! should be imported from a module with the same name as the class, from ! within the \module{email} package. E.g.: ! ! \begin{verbatim} ! import email.MIMEImage.MIMEImage ! \end{verbatim} ! ! or ! ! \begin{verbatim} ! from email.MIMEText import MIMEText ! \end{verbatim} ! ! Here are the classes: ! \begin{classdesc}{MIMEBase}{_maintype, _subtype, **_params} ! This is the base class for all the MIME-specific subclasses of ! \class{Message}. Ordinarily you won't create instances specifically ! of \class{MIMEBase}, although you could. \class{MIMEBase} is provided ! primarily as a convenient base class for more specific MIME-aware ! subclasses. ! \var{_maintype} is the \mailheader{Content-Type} major type ! (e.g. \mimetype{text} or \mimetype{image}), and \var{_subtype} is the ! \mailheader{Content-Type} minor type ! (e.g. \mimetype{plain} or \mimetype{gif}). \var{_params} is a parameter ! key/value dictionary and is passed directly to ! \method{Message.add_header()}. ! The \class{MIMEBase} class always adds a \mailheader{Content-Type} header ! (based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a ! \mailheader{MIME-Version} header (always set to \code{1.0}). ! \end{classdesc} ! \begin{classdesc}{MIMEAudio}{_audiodata\optional{, _subtype\optional{, ! _encoder\optional{, **_params}}}} ! A subclass of \class{MIMEBase}, the \class{MIMEAudio} class is used to ! create MIME message objects of major type \mimetype{audio}. ! \var{_audiodata} is a string containing the raw audio data. If this ! data can be decoded by the standard Python module \refmodule{sndhdr}, ! then the subtype will be automatically included in the ! \mailheader{Content-Type} header. Otherwise you can explicitly specify the ! audio subtype via the \var{_subtype} parameter. If the minor type could ! not be guessed and \var{_subtype} was not given, then \exception{TypeError} ! is raised. ! Optional \var{_encoder} is a callable (i.e. function) which will ! perform the actual encoding of the audio data for transport. This ! callable takes one argument, which is the \class{MIMEAudio} instance. ! It should use \method{get_payload()} and \method{set_payload()} to ! change the payload to encoded form. It should also add any ! \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the ! \refmodule{email.Encoders} module for a list of the built-in encoders. ! \var{_params} are passed straight through to the \class{MIMEBase} ! constructor. ! \end{classdesc} ! \begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{, ! _encoder\optional{, **_params}}}} ! A subclass of \class{MIMEBase}, the \class{MIMEImage} class is used to ! create MIME message objects of major type \mimetype{image}. ! \var{_imagedata} is a string containing the raw image data. If this ! data can be decoded by the standard Python module \refmodule{imghdr}, ! then the subtype will be automatically included in the ! \mailheader{Content-Type} header. Otherwise you can explicitly specify the ! image subtype via the \var{_subtype} parameter. If the minor type could ! not be guessed and \var{_subtype} was not given, then \exception{TypeError} ! is raised. ! Optional \var{_encoder} is a callable (i.e. function) which will ! perform the actual encoding of the image data for transport. This ! callable takes one argument, which is the \class{MIMEImage} instance. ! It should use \method{get_payload()} and \method{set_payload()} to ! change the payload to encoded form. It should also add any ! \mailheader{Content-Transfer-Encoding} or other headers to the message ! object as necessary. The default encoding is \emph{Base64}. See the ! \refmodule{email.Encoders} module for a list of the built-in encoders. ! \var{_params} are passed straight through to the \class{MIMEBase} ! constructor. ! \end{classdesc} ! \begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{, ! _charset\optional{, _encoder}}}} ! A subclass of \class{MIMEBase}, the \class{MIMEText} class is used to ! create MIME objects of major type \mimetype{text}. \var{_text} is the ! string for the payload. \var{_subtype} is the minor type and defaults ! to \mimetype{plain}. \var{_charset} is the character set of the text and is ! passed as a parameter to the \class{MIMEBase} constructor; it defaults ! to \code{us-ascii}. No guessing or encoding is performed on the text ! data, but a newline is appended to \var{_text} if it doesn't already ! end with a newline. ! The \var{_encoding} argument is as with the \class{MIMEImage} class ! constructor, except that the default encoding for \class{MIMEText} ! objects is one that doesn't actually modify the payload, but does set ! the \mailheader{Content-Transfer-Encoding} header to \code{7bit} or ! \code{8bit} as appropriate. ! \end{classdesc} ! \begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}} ! A subclass of \class{MIMEBase}, the \class{MIMEMessage} class is used to ! create MIME objects of main type \mimetype{message}. \var{_msg} is used as ! the payload, and must be an instance of class \class{Message} (or a ! subclass thereof), otherwise a \exception{TypeError} is raised. ! Optional \var{_subtype} sets the subtype of the message; it defaults ! to \mimetype{rfc822}. ! \end{classdesc} ! \subsection{Encoders} ! \input{emailencoders} ! \subsection{Exception classes} ! \input{emailexc} ! \subsection{Miscellaneous utilities} ! \input{emailutil} ! \subsection{Iterators} ! \input{emailiter} \subsection{Differences from \module{mimelib}} --- 69,172 ---- \subsection{Creating email and MIME objects from scratch} + \input{emailmimebase} ! \subsection{Internationalized headers} ! \input{emailheaders} ! \subsection{Representing character sets} ! \input{emailcharsets} ! \subsection{Encoders} ! \input{emailencoders} ! \subsection{Exception classes} ! \input{emailexc} ! \subsection{Miscellaneous utilities} ! \input{emailutil} ! \subsection{Iterators} ! \input{emailiter} ! \subsection{Differences from \module{email} v1 (up to Python 2.2.1)} ! Version 1 of the \module{email} package was bundled with Python ! releases up to Python 2.2.1. Version 2 was developed for the Python ! 2.3 release, and backported to Python 2.2.2. It was also available as ! a separate distutils based package. \module{email} version 2 is ! almost entirely backward compatible with version 1, with the ! following differences: ! \begin{itemize} ! \item The \module{email.Header} and \module{email.Charset} modules ! have been added. ! \item The pickle format for \class{Message} instances has changed. ! Since this was never (and still isn't) formally defined, this ! isn't considered a backward incompatibility. However if your ! application pickles and unpickles \class{Message} instances, be ! aware that in \module{email} version 2, \class{Message} ! instances now have private variables \var{_charset} and ! \var{_default_type}. ! \item Several methods in the \class{Message} class have been ! deprecated, or their signatures changed. Also, many new methods ! have been added. See the documentation for the \class{Message} ! class for details. The changes should be completely backward ! compatible. ! \item The object structure has changed in the face of ! \mimetype{message/rfc822} content types. In \module{email} ! version 1, such a type would be represented by a scalar payload, ! i.e. the container message's \method{is_multipart()} returned ! false, \method{get_payload()} was not a list object, but a single ! \class{Message} instance. ! This structure was inconsistent with the rest of the package, so ! the object representation for \mimetype{message/rfc822} content ! types was changed. In \module{email} version 2, the container ! \emph{does} return \code{True} from \method{is_multipart()}, and ! \method{get_payload()} returns a list containing a single ! \class{Message} item. ! Note that this is one place that backward compatibility could ! not be completely maintained. However, if you're already ! testing the return type of \method{get_payload()}, you should be ! fine. You just need to make sure your code doesn't do a ! \method{set_payload()} with a \class{Message} instance on a ! container with a content type of \mimetype{message/rfc822}. ! \item The \class{Parser} constructor's \var{strict} argument was ! added, and its \method{parse()} and \method{parsestr()} methods ! grew a \var{headersonly} argument. The \var{strict} flag was ! also added to functions \function{email.message_from_file()} ! and \function{email.message_from_string()}. ! \item \method{Generator.__call__()} is deprecated; use ! \method{Generator.flatten()} instead. The \class{Generator} ! class has also grown the \method{clone()} method. ! \item The \class{DecodedGenerator} class in the ! \module{email.Generator} module was added. ! \item The intermediate base classes \class{MIMENonMultipart} and ! \class{MIMEMultipart} have been added, and interposed in the ! class hierarchy for most of the other MIME-related derived ! classes. ! \item The \var{_encoder} argument to the \class{MIMEText} constructor ! has been deprecated. Encoding now happens implicitly based ! on the \var{_charset} argument. ! \item The following functions in the \module{email.Utils} module have ! been deprecated: \function{dump_address_pairs()}, ! \function{decode()}, and \function{encode()}. The following ! functions have been added to the module: ! \function{make_msgid()}, \function{decode_rfc2231()}, ! \function{encode_rfc2231()}, and \function{decode_params()}. ! \item The non-public function \function{email.Iterators._structure()} ! was added. ! \end{itemize} \subsection{Differences from \module{mimelib}} *************** *** 223,227 **** have also changed. For the most part, any functionality available in \module{mimelib} is still available in the \refmodule{email} package, ! albeit often in a different way. Here is a brief description of the differences between the --- 180,186 ---- have also changed. For the most part, any functionality available in \module{mimelib} is still available in the \refmodule{email} package, ! albeit often in a different way. Backward compatibility between ! the \module{mimelib} package and the \module{email} package was not a ! priority. Here is a brief description of the differences between the *************** *** 236,241 **** --- 195,202 ---- \item \function{messageFromString()} has been renamed to \function{message_from_string()}. + \item \function{messageFromFile()} has been renamed to \function{message_from_file()}. + \end{itemize} *************** *** 244,258 **** --- 205,227 ---- \begin{itemize} \item The method \method{asString()} was renamed to \method{as_string()}. + \item The method \method{ismultipart()} was renamed to \method{is_multipart()}. + \item The \method{get_payload()} method has grown a \var{decode} optional argument. + \item The method \method{getall()} was renamed to \method{get_all()}. + \item The method \method{addheader()} was renamed to \method{add_header()}. + \item The method \method{gettype()} was renamed to \method{get_type()}. + \item The method\method{getmaintype()} was renamed to \method{get_main_type()}. + \item The method \method{getsubtype()} was renamed to \method{get_subtype()}. + \item The method \method{getparams()} was renamed to \method{get_params()}. *************** *** 261,280 **** --- 230,257 ---- the key/value pairs of the parameters, split on the \character{=} sign. + \item The method \method{getparam()} was renamed to \method{get_param()}. + \item The method \method{getcharsets()} was renamed to \method{get_charsets()}. + \item The method \method{getfilename()} was renamed to \method{get_filename()}. + \item The method \method{getboundary()} was renamed to \method{get_boundary()}. + \item The method \method{setboundary()} was renamed to \method{set_boundary()}. + \item The method \method{getdecodedpayload()} was removed. To get similar functionality, pass the value 1 to the \var{decode} flag of the {get_payload()} method. + \item The method \method{getpayloadastext()} was removed. Similar functionality is supported by the \class{DecodedGenerator} class in the \refmodule{email.Generator} module. + \item The method \method{getbodyastext()} was removed. You can get similar functionality by creating an iterator with *************** *** 303,312 **** --- 280,292 ---- and \var{_minor} have changed to \var{_maintype} and \var{_subtype} respectively. + \item The \code{Image} class/module has been renamed to \code{MIMEImage}. The \var{_minor} argument has been renamed to \var{_subtype}. + \item The \code{Text} class/module has been renamed to \code{MIMEText}. The \var{_minor} argument has been renamed to \var{_subtype}. + \item The \code{MessageRFC822} class/module has been renamed to \code{MIMEMessage}. Note that an earlier version of *************** *** 337,408 **** First, let's see how to create and send a simple text message: ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Here are the email pacakge modules we'll need ! from email import Encoders ! from email.MIMEText import MIMEText ! ! # Open a plain text file for reading ! fp = open(textfile) ! # Create a text/plain message, using Quoted-Printable encoding for non-ASCII ! # characters. ! msg = MIMEText(fp.read(), _encoder=Encoders.encode_quopri) ! fp.close() ! ! # me == the sender's email address ! # you == the recipient's email address ! msg['Subject'] = 'The contents of %s' % textfile ! msg['From'] = me ! msg['To'] = you ! ! # Send the message via our own SMTP server. Use msg.as_string() with ! # unixfrom=0 so as not to confuse SMTP. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, [you], msg.as_string(0)) ! s.close() ! \end{verbatim} Here's an example of how to send a MIME message containing a bunch of ! family pictures: ! ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Here are the email pacakge modules we'll need ! from email.MIMEImage import MIMEImage ! from email.MIMEBase import MIMEBase ! ! COMMASPACE = ', ' ! ! # Create the container (outer) email message. ! # me == the sender's email address ! # family = the list of all recipients' email addresses ! msg = MIMEBase('multipart', 'mixed') ! msg['Subject'] = 'Our family reunion' ! msg['From'] = me ! msg['To'] = COMMASPACE.join(family) ! msg.preamble = 'Our family reunion' ! # Guarantees the message ends in a newline ! msg.epilogue = '' ! ! # Assume we know that the image files are all in PNG format ! for file in pngfiles: ! # Open the files in binary mode. Let the MIMEIMage class automatically ! # guess the specific image type. ! fp = open(file, 'rb') ! img = MIMEImage(fp.read()) ! fp.close() ! msg.attach(img) ! # Send the email via our own SMTP server. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, family, msg.as_string(unixfrom=0)) ! s.close() ! \end{verbatim} Here's an example\footnote{Thanks to Matthew Dixon Cowles for the --- 317,326 ---- First, let's see how to create and send a simple text message: ! \verbatiminput{email-simple.py} Here's an example of how to send a MIME message containing a bunch of ! family pictures that may be residing in a directory: ! \verbatiminput{email-mime.py} Here's an example\footnote{Thanks to Matthew Dixon Cowles for the *************** *** 410,629 **** of a directory as an email message: ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Send the contents of a directory as a MIME message. ! ! Usage: dirmail [options] from to [to ...]* ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Mail the contents of the specified directory, otherwise use the ! current directory. Only the regular files in the directory are sent, ! and we don't recurse to subdirectories. ! ! `from' is the email address of the sender of the message. ! ! `to' is the email address of the recipient of the message, and multiple ! recipients may be given. ! ! The email is sent by forwarding to your local SMTP server, which then does the ! normal delivery process. Your local machine must be running an SMTP server. ! """ ! ! import sys ! import os ! import getopt ! import smtplib ! # For guessing MIME type based on file name extension ! import mimetypes ! ! from email import Encoders ! from email.Message import Message ! from email.MIMEAudio import MIMEAudio ! from email.MIMEBase import MIMEBase ! from email.MIMEImage import MIMEImage ! from email.MIMEText import MIMEText ! ! COMMASPACE = ', ' ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! if len(args) < 2: ! usage(1) ! ! sender = args[0] ! recips = args[1:] ! ! # Create the enclosing (outer) message ! outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) ! outer['To'] = COMMASPACE.join(recips) ! outer['From'] = sender ! outer.preamble = 'You will not see this in a MIME-aware mail reader.\n' ! # To guarantee the message ends with a newline ! outer.epilogue = '' ! ! for filename in os.listdir(dir): ! path = os.path.join(dir, filename) ! if not os.path.isfile(path): ! continue ! # Guess the Content-Type: based on the file's extension. Encoding ! # will be ignored, although we should check for simple things like ! # gzip'd or compressed files ! ctype, encoding = mimetypes.guess_type(path) ! if ctype is None or encoding is not None: ! # No guess could be made, or the file is encoded (compressed), so ! # use a generic bag-of-bits type. ! ctype = 'application/octet-stream' ! maintype, subtype = ctype.split('/', 1) ! if maintype == 'text': ! fp = open(path) ! # Note: we should handle calculating the charset ! msg = MIMEText(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'image': ! fp = open(path, 'rb') ! msg = MIMEImage(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'audio': ! fp = open(path, 'rb') ! msg = MIMEAudio(fp.read(), _subtype=subtype) ! fp.close() ! else: ! fp = open(path, 'rb') ! msg = MIMEBase(maintype, subtype) ! msg.add_payload(fp.read()) ! fp.close() ! # Encode the payload using Base64 ! Encoders.encode_base64(msg) ! # Set the filename parameter ! msg.add_header('Content-Disposition', 'attachment', filename=filename) ! outer.attach(msg) ! ! fp = open('/tmp/debug.pck', 'w') ! import cPickle ! cPickle.dump(outer, fp) ! fp.close() ! # Now send the message ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(sender, recips, outer.as_string(0)) ! s.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} And finally, here's an example of how to unpack a MIME message like the one above, into a directory of files: ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Unpack a MIME message into a directory of files. ! ! Usage: unpackmail [options] msgfile ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Unpack the MIME message into the named directory, which will be ! created if it doesn't already exist. ! ! msgfile is the path to the file containing the MIME message. ! """ ! ! import sys ! import os ! import getopt ! import errno ! import mimetypes ! import email ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! try: ! msgfile = args[0] ! except IndexError: ! usage(1) ! ! try: ! os.mkdir(dir) ! except OSError, e: ! # Ignore directory exists error ! if e.errno <> errno.EEXIST: raise ! ! fp = open(msgfile) ! msg = email.message_from_file(fp) ! fp.close() ! ! counter = 1 ! for part in msg.walk(): ! # multipart/* are just containers ! if part.get_main_type() == 'multipart': ! continue ! # Applications should really sanitize the given filename so that an ! # email message can't be used to overwrite important files ! filename = part.get_filename() ! if not filename: ! ext = mimetypes.guess_extension(part.get_type()) ! if not ext: ! # Use a generic bag-of-bits extension ! ext = '.bin' ! filename = 'part-%03d%s' % (counter, ext) ! counter += 1 ! fp = open(os.path.join(dir, filename), 'wb') ! fp.write(part.get_payload(decode=1)) ! fp.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} --- 328,335 ---- of a directory as an email message: ! \verbatiminput{email-dir.py} And finally, here's an example of how to unpack a MIME message like the one above, into a directory of files: ! \verbatiminput{email-unpack.py} Index: emailencoders.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailencoders.tex,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** emailencoders.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailencoders.tex 4 Oct 2002 17:24:23 -0000 1.2.12.1 *************** *** 18,23 **** \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into \emph{Quoted-Printable} form and sets the ! \code{Content-Transfer-Encoding:} header to \code{quoted-printable}\footnote{Note that encoding with \method{encode_quopri()} also encodes all tabs and space characters in --- 18,23 ---- \begin{funcdesc}{encode_quopri}{msg} ! Encodes the payload into quoted-printable form and sets the ! \mailheader{Content-Transfer-Encoding} header to \code{quoted-printable}\footnote{Note that encoding with \method{encode_quopri()} also encodes all tabs and space characters in *************** *** 28,36 **** \begin{funcdesc}{encode_base64}{msg} ! Encodes the payload into \emph{Base64} form and sets the \mailheader{Content-Transfer-Encoding} header to \code{base64}. This is a good encoding to use when most of your payload is unprintable data since it is a more compact form than ! Quoted-Printable. The drawback of Base64 encoding is that it renders the text non-human readable. \end{funcdesc} --- 28,36 ---- \begin{funcdesc}{encode_base64}{msg} ! Encodes the payload into base64 form and sets the \mailheader{Content-Transfer-Encoding} header to \code{base64}. This is a good encoding to use when most of your payload is unprintable data since it is a more compact form than ! quoted-printable. The drawback of base64 encoding is that it renders the text non-human readable. \end{funcdesc} Index: emailexc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailexc.tex,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** emailexc.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailexc.tex 4 Oct 2002 17:24:23 -0000 1.2.12.1 *************** *** 22,26 **** \method{Parser.parsestr()} methods. ! Situations where it can be raised include finding a \emph{Unix-From} header after the first \rfc{2822} header of the message, finding a continuation line before the first \rfc{2822} header is found, or finding --- 22,26 ---- \method{Parser.parsestr()} methods. ! Situations where it can be raised include finding an envelope header after the first \rfc{2822} header of the message, finding a continuation line before the first \rfc{2822} header is found, or finding *************** *** 36,40 **** Situations where it can be raised include not being able to find the ! starting or terminating boundary in a \mimetype{multipart/*} message. \end{excclassdesc} --- 36,41 ---- Situations where it can be raised include not being able to find the ! starting or terminating boundary in a \mimetype{multipart/*} message ! when strict parsing is used. \end{excclassdesc} *************** *** 46,48 **** --- 47,54 ---- multiply inherits from \exception{MessageError} and the built-in \exception{TypeError}. + + Since \method{Message.add_payload()} is deprecated, this exception is + rarely raised in practice. However the exception may also be raised + if the \method{attach()} method is called on an instance of a class + derived from \class{MIMENonMultipart} (e.g. \class{MIMEImage}). \end{excclassdesc} Index: emailgenerator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailgenerator.tex,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** emailgenerator.tex 5 Nov 2001 01:55:03 -0000 1.3 --- emailgenerator.tex 4 Oct 2002 17:24:23 -0000 1.3.8.1 *************** *** 1,10 **** \declaremodule{standard}{email.Generator} ! \modulesynopsis{Generate flat text email messages from a message object tree.} One of the most common tasks is to generate the flat text of the email ! message represented by a message object tree. You will need to do this if you want to send your message via the \refmodule{smtplib} module or the \refmodule{nntplib} module, or print the message on the ! console. Taking a message object tree and producing a flat text document is the job of the \class{Generator} class. --- 1,10 ---- \declaremodule{standard}{email.Generator} ! \modulesynopsis{Generate flat text email messages from a message structure.} One of the most common tasks is to generate the flat text of the email ! message represented by a message object structure. You will need to do this if you want to send your message via the \refmodule{smtplib} module or the \refmodule{nntplib} module, or print the message on the ! console. Taking a message object structure and producing a flat text document is the job of the \class{Generator} class. *************** *** 14,21 **** generate most email in a standards-compliant way, should handle MIME and non-MIME email messages just fine, and is designed so that the ! transformation from flat text, to an object tree via the ! \class{Parser} class, ! and back to flat text, is idempotent (the input is identical to the ! output). Here are the public methods of the \class{Generator} class: --- 14,20 ---- generate most email in a standards-compliant way, should handle MIME and non-MIME email messages just fine, and is designed so that the ! transformation from flat text, to a message structure via the ! \class{Parser} class, and back to flat text, is idempotent (the input ! is identical to the output). Here are the public methods of the \class{Generator} class: *************** *** 26,39 **** object called \var{outfp} for an argument. \var{outfp} must support the \method{write()} method and be usable as the output file in a ! Python 2.0 extended print statement. ! Optional \var{mangle_from_} is a flag that, when true, puts a \samp{>} ! character in front of any line in the body that starts exactly as ! \samp{From } (i.e. \code{From} followed by a space at the front of the ! line). This is the only guaranteed portable way to avoid having such ! lines be mistaken for \emph{Unix-From} headers (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} {http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html} ! for details). Optional \var{maxheaderlen} specifies the longest length for a --- 25,40 ---- object called \var{outfp} for an argument. \var{outfp} must support the \method{write()} method and be usable as the output file in a ! Python extended print statement. ! Optional \var{mangle_from_} is a flag that, when \code{True}, puts a ! \samp{>} character in front of any line in the body that starts exactly as ! \samp{From }, i.e. \code{From} followed by a space at the beginning of the ! line. This is the only guaranteed portable way to avoid having such ! lines be mistaken for a Unix mailbox format envelope header separator (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} {http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html} ! for details). \var{mangle_from_} defaults to \code{True}, but you ! might want to set this to \code{False} if you are not writing Unix ! mailbox format files. Optional \var{maxheaderlen} specifies the longest length for a *************** *** 48,65 **** The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{__call__}{msg\optional{, unixfrom}} ! Print the textual representation of the message object tree rooted at \var{msg} to the output file specified when the \class{Generator} ! instance was created. Sub-objects are visited depth-first and the resulting text will be properly MIME encoded. Optional \var{unixfrom} is a flag that forces the printing of the ! \emph{Unix-From} (a.k.a. envelope header or \code{From_} header) ! delimiter before the first \rfc{2822} header of the root message ! object. If the root object has no \emph{Unix-From} header, a standard ! one is crafted. By default, this is set to 0 to inhibit the printing ! of the \emph{Unix-From} delimiter. ! Note that for sub-objects, no \emph{Unix-From} header is ever printed. \end{methoddesc} --- 49,74 ---- The other public \class{Generator} methods are: ! \begin{methoddesc}[Generator]{flatten}{msg\optional{, unixfrom}} ! Print the textual representation of the message object structure rooted at \var{msg} to the output file specified when the \class{Generator} ! instance was created. Subparts are visited depth-first and the resulting text will be properly MIME encoded. Optional \var{unixfrom} is a flag that forces the printing of the ! envelope header delimiter before the first \rfc{2822} header of the ! root message object. If the root object has no envelope header, a ! standard one is crafted. By default, this is set to \code{False} to ! inhibit the printing of the envelope delimiter. ! Note that for subparts, no envelope header is ever printed. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Generator]{clone}{fp} ! Return an independent clone of this \class{Generator} instance with ! the exact same options. ! ! \versionadded{2.2.2} \end{methoddesc} *************** *** 75,76 **** --- 84,141 ---- simplify the generation of a formatted string representation of a message object. For more detail, see \refmodule{email.Message}. + + The \module{email.Generator} module also provides a derived class, + called \class{DecodedGenerator} which is like the \class{Generator} + base class, except that non-\mimetype{text} parts are substituted with + a format string representing the part. + + \begin{classdesc}{DecodedGenerator}{outfp\optional{, mangle_from_\optional{, + maxheaderlen\optional{, fmt}}}} + + This class, derived from \class{Generator} walks through all the + subparts of a message. If the subpart is of main type + \mimetype{text}, then it prints the decoded payload of the subpart. + Optional \var{_mangle_from_} and \var{maxheaderlen} are as with the + \class{Generator} base class. + + If the subpart is not of main type \mimetype{text}, optional \var{fmt} + is a format string that is used instead of the message payload. + \var{fmt} is expanded with the following keywords, \samp{\%(keyword)s} + format: + + \begin{itemize} + \item \code{type} -- Full MIME type of the non-\mimetype{text} part + + \item \code{maintype} -- Main MIME type of the non-\mimetype{text} part + + \item \code{subtype} -- Sub-MIME type of the non-\mimetype{text} part + + \item \code{filename} -- Filename of the non-\mimetype{text} part + + \item \code{description} -- Description associated with the + non-\mimetype{text} part + + \item \code{encoding} -- Content transfer encoding of the + non-\mimetype{text} part + + \end{itemize} + + The default value for \var{fmt} is \code{None}, meaning + + \begin{verbatim} + [Non-text (%(type)s) part of message omitted, filename %(filename)s] + \end{verbatim} + + \versionadded{2.2.2} + \end{classdesc} + + \subsubsection{Deprecated methods} + + The following methods are deprecated in \module{email} version 2. + They are documented here for completeness. + + \begin{methoddesc}[Generator]{__call__}{msg\optional{, unixfrom}} + This method is identical to the \method{flatten()} method. + + \deprecated{2.2.2}{Use the \method{flatten()} method instead.} + \end{methoddesc} Index: emailiter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailiter.tex,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** emailiter.tex 26 Sep 2001 22:21:52 -0000 1.2 --- emailiter.tex 4 Oct 2002 17:24:23 -0000 1.2.12.1 *************** *** 30,31 **** --- 30,63 ---- \end{funcdesc} + The following function has been added as a useful debugging tool. It + should \emph{not} be considered part of the supported public interface + for the package. + + \begin{funcdesc}{_structure}{msg\optional{, fp\optional{, level}}} + Prints an indented representation of the content types of the + message object structure. For example: + + \begin{verbatim} + >>> msg = email.message_from_file(somefile) + >>> _structure(msg) + multipart/mixed + text/plain + text/plain + multipart/digest + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + message/rfc822 + text/plain + text/plain + \end{verbatim} + + Optional \var{fp} is a file-like object to print the output to. It + must be suitable for Python's extended print statement. \var{level} + is used internally. + \end{funcdesc} Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** emailmessage.tex 5 Nov 2001 01:55:03 -0000 1.4 --- emailmessage.tex 4 Oct 2002 17:24:23 -0000 1.4.8.1 *************** *** 13,22 **** Headers are stored and returned in case-preserving form but are ! matched case-insensitively. There may also be a single ! \emph{Unix-From} header, also known as the envelope header or the \code{From_} header. The payload is either a string in the case of ! simple message objects, a list of \class{Message} objects for ! multipart MIME documents, or a single \class{Message} instance for ! \mimetype{message/rfc822} type objects. \class{Message} objects provide a mapping style interface for --- 13,22 ---- Headers are stored and returned in case-preserving form but are ! matched case-insensitively. There may also be a single envelope ! header, also known as the \emph{Unix-From} header or the \code{From_} header. The payload is either a string in the case of ! simple message objects or a list of \class{Message} objects for ! MIME container documents (e.g. \mimetype{multipart/*} and ! \mimetype{message/rfc822}). \class{Message} objects provide a mapping style interface for *************** *** 34,129 **** \begin{methoddesc}[Message]{as_string}{\optional{unixfrom}} ! Return the entire formatted message as a string. Optional ! \var{unixfrom}, when true, specifies to include the \emph{Unix-From} ! envelope header; it defaults to 0. \end{methoddesc} ! \begin{methoddesc}[Message]{__str__()}{} ! Equivalent to \method{aMessage.as_string(unixfrom=1)}. \end{methoddesc} \begin{methoddesc}[Message]{is_multipart}{} ! Return 1 if the message's payload is a list of sub-\class{Message} ! objects, otherwise return 0. When \method{is_multipart()} returns 0, ! the payload should either be a string object, or a single ! \class{Message} instance. \end{methoddesc} \begin{methoddesc}[Message]{set_unixfrom}{unixfrom} ! Set the \emph{Unix-From} (a.k.a envelope header or \code{From_} ! header) to \var{unixfrom}, which should be a string. \end{methoddesc} \begin{methoddesc}[Message]{get_unixfrom}{} ! Return the \emph{Unix-From} header. Defaults to \code{None} if the ! \emph{Unix-From} header was never set. ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{add_payload}{payload} ! Add \var{payload} to the message object's existing payload. If, prior ! to calling this method, the object's payload was \code{None} ! (i.e. never before set), then after this method is called, the payload ! will be the argument \var{payload}. ! ! If the object's payload was already a list ! (i.e. \method{is_multipart()} returns 1), then \var{payload} is ! appended to the end of the existing payload list. ! ! For any other type of existing payload, \method{add_payload()} will ! transform the new payload into a list consisting of the old payload ! and \var{payload}, but only if the document is already a MIME ! multipart document. This condition is satisfied if the message's ! \mailheader{Content-Type} header's main type is either ! \mimetype{multipart}, or there is no \mailheader{Content-Type} ! header. In any other situation, ! \exception{MultipartConversionError} is raised. \end{methoddesc} \begin{methoddesc}[Message]{attach}{payload} ! Synonymous with \method{add_payload()}. \end{methoddesc} \begin{methoddesc}[Message]{get_payload}{\optional{i\optional{, decode}}} ! Return the current payload, which will be a list of \class{Message} ! objects when \method{is_multipart()} returns 1, or a scalar (either a ! string or a single \class{Message} instance) when ! \method{is_multipart()} returns 0. ! With optional \var{i}, \method{get_payload()} will return the \var{i}-th element of the payload, counting from zero, if ! \method{is_multipart()} returns 1. An \exception{IndexError} will be raised ! if \var{i} is less than 0 or greater than or equal to the number of ! items in the payload. If the payload is scalar ! (i.e. \method{is_multipart()} returns 0) and \var{i} is given, a \exception{TypeError} is raised. Optional \var{decode} is a flag indicating whether the payload should be decoded or not, according to the \mailheader{Content-Transfer-Encoding} header. ! When true and the message is not a multipart, the payload will be decoded if this header's value is \samp{quoted-printable} or \samp{base64}. If some other encoding is used, or \mailheader{Content-Transfer-Encoding} header is missing, the payload is returned as-is (undecoded). If the message is ! a multipart and the \var{decode} flag is true, then \code{None} is ! returned. \end{methoddesc} ! \begin{methoddesc}[Message]{set_payload}{payload} Set the entire message object's payload to \var{payload}. It is the ! client's responsibility to ensure the payload invariants. \end{methoddesc} The following methods implement a mapping-like interface for accessing ! the message object's \rfc{2822} headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by ! \method{keys()}, but in a \class{Message} object, there is an explicit ! order. These semantic differences are intentional and are biased ! toward maximal convenience. ! Note that in all cases, any optional \emph{Unix-From} header the message ! may have is not included in the mapping interface. \begin{methoddesc}[Message]{__len__}{} --- 34,147 ---- \begin{methoddesc}[Message]{as_string}{\optional{unixfrom}} ! Return the entire message flatten as a string. When optional ! \var{unixfrom} is \code{True}, the envelope header is included in the ! returned string. \var{unixfrom} defaults to \code{False}. \end{methoddesc} ! \begin{methoddesc}[Message]{__str__}{} ! Equivalent to \method{as_string(unixfrom=True)}. \end{methoddesc} \begin{methoddesc}[Message]{is_multipart}{} ! Return \code{True} if the message's payload is a list of ! sub-\class{Message} objects, otherwise return \code{False}. When ! \method{is_multipart()} returns False, the payload should be a string ! object. \end{methoddesc} \begin{methoddesc}[Message]{set_unixfrom}{unixfrom} ! Set the message's envelope header to \var{unixfrom}, which should be a string. \end{methoddesc} \begin{methoddesc}[Message]{get_unixfrom}{} ! Return the message's envelope header. Defaults to \code{None} if the ! envelope header was never set. \end{methoddesc} \begin{methoddesc}[Message]{attach}{payload} ! Add the given \var{payload} to the current payload, which must be ! \code{None} or a list of \class{Message} objects before the call. ! After the call, the payload will always be a list of \class{Message} ! objects. If you want to set the payload to a scalar object (e.g. a ! string), use \method{set_payload()} instead. \end{methoddesc} \begin{methoddesc}[Message]{get_payload}{\optional{i\optional{, decode}}} ! Return a reference the current payload, which will be a list of ! \class{Message} objects when \method{is_multipart()} is \code{True}, or a ! string when \method{is_multipart()} is \code{False}. If the ! payload is a list and you mutate the list object, you modify the ! message's payload in place. ! With optional argument \var{i}, \method{get_payload()} will return the \var{i}-th element of the payload, counting from zero, if ! \method{is_multipart()} is \code{True}. An \exception{IndexError} ! will be raised if \var{i} is less than 0 or greater than or equal to ! the number of items in the payload. If the payload is a string ! (i.e. \method{is_multipart()} is \code{False}) and \var{i} is given, a \exception{TypeError} is raised. Optional \var{decode} is a flag indicating whether the payload should be decoded or not, according to the \mailheader{Content-Transfer-Encoding} header. ! When \code{True} and the message is not a multipart, the payload will be decoded if this header's value is \samp{quoted-printable} or \samp{base64}. If some other encoding is used, or \mailheader{Content-Transfer-Encoding} header is missing, the payload is returned as-is (undecoded). If the message is ! a multipart and the \var{decode} flag is \code{True}, then \code{None} is ! returned. The default for \var{decode} is \code{False}. \end{methoddesc} ! \begin{methoddesc}[Message]{set_payload}{payload\optional{, charset}} Set the entire message object's payload to \var{payload}. It is the ! client's responsibility to ensure the payload invariants. Optional ! \var{charset} sets the message's default character set; see ! \method{set_charset()} for details. ! ! \versionchanged[\var{charset} argument added]{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_charset}{charset} ! Set the character set of the payload to \var{charset}, which can ! either be a \class{Charset} instance (see \refmodule{email.Charset}), a ! string naming a character set, ! or \code{None}. If it is a string, it will be converted to a ! \class{Charset} instance. If \var{charset} is \code{None}, the ! \code{charset} parameter will be removed from the ! \mailheader{Content-Type} header. Anything else will generate a ! \exception{TypeError}. ! ! The message will be assumed to be of type \mimetype{text/*} encoded with ! \code{charset.input_charset}. It will be converted to ! \code{charset.output_charset} ! and encoded properly, if needed, when generating the plain text ! representation of the message. MIME headers ! (\mailheader{MIME-Version}, \mailheader{Content-Type}, ! \mailheader{Content-Transfer-Encoding}) will be added as needed. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_charset}{} ! Return the \class{Charset} instance associated with the message's payload. ! \versionadded{2.2.2} \end{methoddesc} The following methods implement a mapping-like interface for accessing ! the message's \rfc{2822} headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by ! \method{keys()}, but in a \class{Message} object, headers are always ! returned in the order they appeared in the original message, or were ! added to the message later. Any header deleted and then re-added are ! always appended to the end of the header list. ! These semantic differences are intentional and are biased toward ! maximal convenience. ! ! Note that in all cases, any envelope header present in the message is ! not included in the mapping interface. \begin{methoddesc}[Message]{__len__}{} *************** *** 162,167 **** with the same name. If you want to ensure that the new header is the only one present in the message with field name ! \var{name}, first use \method{__delitem__()} to delete all named ! fields, e.g.: \begin{verbatim} --- 180,184 ---- with the same name. If you want to ensure that the new header is the only one present in the message with field name ! \var{name}, delete the field first, e.g.: \begin{verbatim} *************** *** 178,207 **** \begin{methoddesc}[Message]{has_key}{name} ! Return 1 if the message contains a header field named \var{name}, ! otherwise return 0. \end{methoddesc} \begin{methoddesc}[Message]{keys}{} ! Return a list of all the message's header field names. These keys ! will be sorted in the order in which they were added to the message ! via \method{__setitem__()}, and may contain duplicates. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the header list. \end{methoddesc} \begin{methoddesc}[Message]{values}{} ! Return a list of all the message's field values. These will be sorted ! in the order in which they were added to the message via ! \method{__setitem__()}, and may contain duplicates. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the header list. \end{methoddesc} \begin{methoddesc}[Message]{items}{} ! Return a list of 2-tuples containing all the message's field headers and ! values. These will be sorted in the order in which they were added to ! the message via \method{__setitem__()}, and may contain duplicates. ! Any fields deleted and then subsequently re-added are always appended ! to the end of the header list. \end{methoddesc} --- 195,213 ---- \begin{methoddesc}[Message]{has_key}{name} ! Return true if the message contains a header field named \var{name}, ! otherwise return false. \end{methoddesc} \begin{methoddesc}[Message]{keys}{} ! Return a list of all the message's header field names. \end{methoddesc} \begin{methoddesc}[Message]{values}{} ! Return a list of all the message's field values. \end{methoddesc} \begin{methoddesc}[Message]{items}{} ! Return a list of 2-tuples containing all the message's field headers ! and values. \end{methoddesc} *************** *** 215,224 **** \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} ! Return a list of all the values for the field named \var{name}. These ! will be sorted in the order in which they were added to the message ! via \method{__setitem__()}. Any fields ! deleted and then subsequently re-added are always appended to the end ! of the list. ! If there are no such named headers in the message, \var{failobj} is returned (defaults to \code{None}). --- 221,225 ---- \begin{methoddesc}[Message]{get_all}{name\optional{, failobj}} ! Return a list of all the values for the field named \var{name}. If there are no such named headers in the message, \var{failobj} is returned (defaults to \code{None}). *************** *** 228,233 **** Extended header setting. This method is similar to \method{__setitem__()} except that additional header parameters can be ! provided as keyword arguments. \var{_name} is the header to set and ! \var{_value} is the \emph{primary} value for the header. For each item in the keyword argument dictionary \var{_params}, the --- 229,234 ---- Extended header setting. This method is similar to \method{__setitem__()} except that additional header parameters can be ! provided as keyword arguments. \var{_name} is the header field to add ! and \var{_value} is the \emph{primary} value for the header. For each item in the keyword argument dictionary \var{_params}, the *************** *** 250,276 **** \end{methoddesc} ! \begin{methoddesc}[Message]{get_type}{\optional{failobj}} ! Return the message's content type, as a string of the form ! \mimetype{maintype/subtype} as taken from the ! \mailheader{Content-Type} header. ! The returned string is coerced to lowercase. ! If there is no \mailheader{Content-Type} header in the message, ! \var{failobj} is returned (defaults to \code{None}). \end{methoddesc} ! \begin{methoddesc}[Message]{get_main_type}{\optional{failobj}} ! Return the message's \emph{main} content type. This essentially returns the ! \var{maintype} part of the string returned by \method{get_type()}, with the ! same semantics for \var{failobj}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_subtype}{\optional{failobj}} ! Return the message's sub-content type. This essentially returns the ! \var{subtype} part of the string returned by \method{get_type()}, with the ! same semantics for \var{failobj}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_params}{\optional{failobj\optional{, header}}} Return the message's \mailheader{Content-Type} parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as --- 251,315 ---- \end{methoddesc} ! \begin{methoddesc}[Message]{replace_header}{_name, _value} ! Replace a header. Replace the first header found in the message that ! matches \var{_name}, retaining header order and field name case. If ! no matching header was found, a \exception{KeyError} is raised. ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_type}{} ! Return the message's content type. The returned string is coerced to ! lower case of the form \mimetype{maintype/subtype}. If there was no ! \mailheader{Content-Type} header in the message the default type as ! given by \method{get_default_type()} will be returned. Since ! according to \rfc{2045}, messages always have a default type, ! \method{get_content_type()} will always return a value. ! ! \rfc{2045} defines a message's default type to be ! \mimetype{text/plain} unless it appears inside a ! \mimetype{multipart/digest} container, in which case it would be ! \mimetype{message/rfc822}. If the \mailheader{Content-Type} header ! has an invalid type specification, \rfc{2045} mandates that the ! default type be \mimetype{text/plain}. ! ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_maintype}{} ! Return the message's main content type. This is the ! \mimetype{maintype} part of the string returned by ! \method{get_content_type()}. ! ! \versionadded{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{get_content_subtype}{} ! Return the message's sub-content type. This is the \mimetype{subtype} ! part of the string returned by \method{get_content_type()}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_default_type}{} ! Return the default content type. Most messages have a default content ! type of \mimetype{text/plain}, except for messages that are subparts ! of \mimetype{multipart/digest} containers. Such subparts have a ! default content type of \mimetype{message/rfc822}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_default_type}{ctype} ! Set the default content type. \var{ctype} should either be ! \mimetype{text/plain} or \mimetype{message/rfc822}, although this is ! not enforced. The default content type is not stored in the ! \mailheader{Content-Type} header. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{get_params}{\optional{failobj\optional{, ! header\optional{, unquote}}}} Return the message's \mailheader{Content-Type} parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as *************** *** 278,290 **** \character{=} is the key, while the right hand side is the value. If there is no \character{=} sign in the parameter the value is the empty ! string. The value is always unquoted with \method{Utils.unquote()}. Optional \var{failobj} is the object to return if there is no \mailheader{Content-Type} header. Optional \var{header} is the header to search instead of \mailheader{Content-Type}. \end{methoddesc} \begin{methoddesc}[Message]{get_param}{param\optional{, ! failobj\optional{, header}}} Return the value of the \mailheader{Content-Type} header's parameter \var{param} as a string. If the message has no \mailheader{Content-Type} --- 317,332 ---- \character{=} is the key, while the right hand side is the value. If there is no \character{=} sign in the parameter the value is the empty ! string, otherwise the value is as described in \method{get_param()} and is ! unquoted if optional \var{unquote} is \code{True} (the default). Optional \var{failobj} is the object to return if there is no \mailheader{Content-Type} header. Optional \var{header} is the header to search instead of \mailheader{Content-Type}. + + \versionchanged[\var{unquote} argument added]{2.2.2} \end{methoddesc} \begin{methoddesc}[Message]{get_param}{param\optional{, ! failobj\optional{, header\optional{, unquote}}}} Return the value of the \mailheader{Content-Type} header's parameter \var{param} as a string. If the message has no \mailheader{Content-Type} *************** *** 294,311 **** Optional \var{header} if given, specifies the message header to use instead of \mailheader{Content-Type}. \end{methoddesc} ! \begin{methoddesc}[Message]{get_charsets}{\optional{failobj}} ! Return a list containing the character set names in the message. If ! the message is a \mimetype{multipart}, then the list will contain one ! element for each subpart in the payload, otherwise, it will be a list ! of length 1. ! Each item in the list will be a string which is the value of the ! \code{charset} parameter in the \mailheader{Content-Type} header for the ! represented subpart. However, if the subpart has no ! \mailheader{Content-Type} header, no \code{charset} parameter, or is not of ! the \mimetype{text} main MIME type, then that item in the returned list ! will be \var{failobj}. \end{methoddesc} --- 336,413 ---- Optional \var{header} if given, specifies the message header to use instead of \mailheader{Content-Type}. + + Parameter keys are always compared case insensitively. The return + value can either be a string, or a 3-tuple if the parameter was + \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of + the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may + be the empty string. Your application should be prepared to deal with + 3-tuple return values, which it can convert to a Unicode string like + so: + + \begin{verbatim} + param = msg.get_param('foo') + if isinstance(param, tuple): + param = unicode(param[2], param[0]) + \end{verbatim} + + In any case, the parameter value (either the returned string, or the + \code{VALUE} item in the 3-tuple) is always unquoted, unless + \var{unquote} is set to \code{False}. + + \versionchanged[\var{unquote} argument added, and 3-tuple return value + possible]{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Message]{set_param}{param, value\optional{, ! header\optional{, requote\optional{, charset\optional{, language}}}}} ! Set a parameter in the \mailheader{Content-Type} header. If the ! parameter already exists in the header, its value will be replaced ! with \var{value}. If the \mailheader{Content-Type} header as not yet ! been defined for this message, it will be set to \mimetype{text/plain} ! and the new parameter value will be appended as per \rfc{2045}. ! ! Optional \var{header} specifies an alternative header to ! \mailheader{Content-Type}, and all parameters will be quoted as ! necessary unless optional \var{requote} is \code{False} (the default ! is \code{True}). ! ! If optional \var{charset} is specified, the parameter will be encoded ! according to \rfc{2231}. Optional \var{language} specifies the RFC ! 2231 language, defaulting to the empty string. Both \var{charset} and ! \var{language} should be strings. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{del_param}{param\optional{, header\optional{, ! requote}}} ! Remove the given parameter completely from the ! \mailheader{Content-Type} header. The header will be re-written in ! place without the parameter or its value. All values will be quoted ! as necessary unless \var{requote} is \code{False} (the default is ! \code{True}). Optional \var{header} specifies an alternative to ! \mailheader{Content-Type}. ! ! \versionadded{2.2.2} ! \end{methoddesc} ! ! \begin{methoddesc}[Message]{set_type}{type\optional{, header}\optional{, ! requote}} ! Set the main type and subtype for the \mailheader{Content-Type} ! header. \var{type} must be a string in the form ! \mimetype{maintype/subtype}, otherwise a \exception{ValueError} is ! raised. ! ! This method replaces the \mailheader{Content-Type} header, keeping all ! the parameters in place. If \var{requote} is \code{False}, this ! leaves the existing header's quoting as is, otherwise the parameters ! will be quoted (the default). ! ! An alternative header can be specified in the \var{header} argument. ! When the \mailheader{Content-Type} header is set a ! \mailheader{MIME-Version} header is also added. ! ! \versionadded{2.2.2} \end{methoddesc} *************** *** 327,335 **** \begin{methoddesc}[Message]{set_boundary}{boundary} ! Set the \code{boundary} parameter of the \mailheader{Content-Type} header ! to \var{boundary}. \method{set_boundary()} will always quote ! \var{boundary} so you should not quote it yourself. A ! \exception{HeaderParseError} is raised if the message object has no ! \mailheader{Content-Type} header. Note that using this method is subtly different than deleting the old --- 429,436 ---- \begin{methoddesc}[Message]{set_boundary}{boundary} ! Set the \code{boundary} parameter of the \mailheader{Content-Type} ! header to \var{boundary}. \method{set_boundary()} will always quote ! \var{boundary} if necessary. A \exception{HeaderParseError} is raised ! if the message object has no \mailheader{Content-Type} header. Note that using this method is subtly different than deleting the old *************** *** 341,357 **** \end{methoddesc} \begin{methoddesc}[Message]{walk}{} The \method{walk()} method is an all-purpose generator which can be used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use ! \method{walk()} as the iterator in a \code{for ... in} loop; each iteration returns the next subpart. ! Here's an example that prints the MIME type of every part of a message ! object tree: \begin{verbatim} >>> for part in msg.walk(): ! >>> print part.get_type('text/plain') multipart/report text/plain --- 442,484 ---- \end{methoddesc} + \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} + Return the \code{charset} parameter of the \mailheader{Content-Type} + header. If there is no \mailheader{Content-Type} header, or if that + header has no \code{charset} parameter, \var{failobj} is returned. + + Note that this method differs from \method{get_charset()} which + returns the \class{Charset} instance for the default encoding of the + message body. + + \versionadded{2.2.2} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_charsets}{\optional{failobj}} + Return a list containing the character set names in the message. If + the message is a \mimetype{multipart}, then the list will contain one + element for each subpart in the payload, otherwise, it will be a list + of length 1. + + Each item in the list will be a string which is the value of the + \code{charset} parameter in the \mailheader{Content-Type} header for the + represented subpart. However, if the subpart has no + \mailheader{Content-Type} header, no \code{charset} parameter, or is not of + the \mimetype{text} main MIME type, then that item in the returned list + will be \var{failobj}. + \end{methoddesc} + \begin{methoddesc}[Message]{walk}{} The \method{walk()} method is an all-purpose generator which can be used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use ! \method{walk()} as the iterator in a \code{for} loop; each iteration returns the next subpart. ! Here's an example that prints the MIME type of every part of a ! multipart message structure: \begin{verbatim} >>> for part in msg.walk(): ! >>> print part.get_content_type() multipart/report text/plain *************** *** 381,385 **** is writing out the plain text representation of a MIME message, and it finds the message has a \var{preamble} attribute, it will write this ! text in the area between the headers and the first boundary. Note that if the message object has no preamble, the --- 508,513 ---- is writing out the plain text representation of a MIME message, and it finds the message has a \var{preamble} attribute, it will write this ! text in the area between the headers and the first boundary. See ! \refmodule{email.Parser} and \refmodule{email.Generator} for details. Note that if the message object has no preamble, the *************** *** 402,403 **** --- 530,587 ---- set the \var{epilogue} to the empty string. \end{datadesc} + + \subsubsection{Deprecated methods} + + The following methods are deprecated in \module{email} version 2. + They are documented here for completeness. + + \begin{methoddesc}[Message]{add_payload}{payload} + Add \var{payload} to the message object's existing payload. If, prior + to calling this method, the object's payload was \code{None} + (i.e. never before set), then after this method is called, the payload + will be the argument \var{payload}. + + If the object's payload was already a list + (i.e. \method{is_multipart()} returns 1), then \var{payload} is + appended to the end of the existing payload list. + + For any other type of existing payload, \method{add_payload()} will + transform the new payload into a list consisting of the old payload + and \var{payload}, but only if the document is already a MIME + multipart document. This condition is satisfied if the message's + \mailheader{Content-Type} header's main type is either + \mimetype{multipart}, or there is no \mailheader{Content-Type} + header. In any other situation, + \exception{MultipartConversionError} is raised. + + \deprecated{2.2.2}{Use the \method{attach()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_type}{\optional{failobj}} + Return the message's content type, as a string of the form + \mimetype{maintype/subtype} as taken from the + \mailheader{Content-Type} header. + The returned string is coerced to lowercase. + + If there is no \mailheader{Content-Type} header in the message, + \var{failobj} is returned (defaults to \code{None}). + + \deprecated{2.2.2}{Use the \method{get_content_type()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_main_type}{\optional{failobj}} + Return the message's \emph{main} content type. This essentially returns the + \var{maintype} part of the string returned by \method{get_type()}, with the + same semantics for \var{failobj}. + + \deprecated{2.2.2}{Use the \method{get_content_maintype()} method instead.} + \end{methoddesc} + + \begin{methoddesc}[Message]{get_subtype}{\optional{failobj}} + Return the message's sub-content type. This essentially returns the + \var{subtype} part of the string returned by \method{get_type()}, with the + same semantics for \var{failobj}. + + \deprecated{2.2.2}{Use the \method{get_content_subtype()} method instead.} + \end{methoddesc} + Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.4.10.1 retrieving revision 1.4.10.2 diff -C2 -d -r1.4.10.1 -r1.4.10.2 *** emailparser.tex 22 Feb 2002 21:26:49 -0000 1.4.10.1 --- emailparser.tex 4 Oct 2002 17:24:23 -0000 1.4.10.2 *************** *** 1,9 **** \declaremodule{standard}{email.Parser} \modulesynopsis{Parse flat text email messages to produce a message ! object tree.} ! Message object trees can be created in one of two ways: they can be created from whole cloth by instantiating \class{Message} objects and ! stringing them together via \method{add_payload()} and \method{set_payload()} calls, or they can be created by parsing a flat text representation of the email message. --- 1,9 ---- \declaremodule{standard}{email.Parser} \modulesynopsis{Parse flat text email messages to produce a message ! object structure.} ! Message object structures can be created in one of two ways: they can be created from whole cloth by instantiating \class{Message} objects and ! stringing them together via \method{attach()} and \method{set_payload()} calls, or they can be created by parsing a flat text representation of the email message. *************** *** 12,19 **** most email document structures, including MIME documents. You can pass the parser a string or a file object, and the parser will return ! to you the root \class{Message} instance of the object tree. For simple, non-MIME messages the payload of this root object will likely be a string containing the text of the message. For MIME ! messages, the root object will return true from its \method{is_multipart()} method, and the subparts can be accessed via the \method{get_payload()} and \method{walk()} methods. --- 12,19 ---- most email document structures, including MIME documents. You can pass the parser a string or a file object, and the parser will return ! to you the root \class{Message} instance of the object structure. For simple, non-MIME messages the payload of this root object will likely be a string containing the text of the message. For MIME ! messages, the root object will return \code{True} from its \method{is_multipart()} method, and the subparts can be accessed via the \method{get_payload()} and \method{walk()} methods. *************** *** 28,43 **** headers and the payload of the message. In the case of \mimetype{multipart} messages, it will recursively parse the body of ! the container message. The \module{email.Parser} module also provides ! a second class, called \class{HeaderParser} which can be used if ! you're only interested in the headers of the message. ! \class{HeaderParser} can be much faster in this situations, since it ! does not attempt to parse the message body, instead setting the ! payload to the raw body as a string. \class{HeaderParser} has the ! same API as the \class{Parser} class. \subsubsection{Parser class API} ! \begin{classdesc}{Parser}{\optional{_class}} ! The constructor for the \class{Parser} class takes a single optional argument \var{_class}. This must be a callable factory (such as a function or a class), and it is used whenever a sub-message object --- 28,47 ---- headers and the payload of the message. In the case of \mimetype{multipart} messages, it will recursively parse the body of ! the container message. Two modes of parsing are supported, ! \emph{strict} parsing, which will usually reject any non-RFC compliant ! message, and \emph{lax} parsing, which attempts to adjust for common ! MIME formatting problems. ! ! The \module{email.Parser} module also provides a second class, called ! \class{HeaderParser} which can be used if you're only interested in ! the headers of the message. \class{HeaderParser} can be much faster in ! these situations, since it does not attempt to parse the message body, ! instead setting the payload to the raw body as a string. ! \class{HeaderParser} has the same API as the \class{Parser} class. \subsubsection{Parser class API} ! \begin{classdesc}{Parser}{\optional{_class\optional{, strict}}} ! The constructor for the \class{Parser} class takes an optional argument \var{_class}. This must be a callable factory (such as a function or a class), and it is used whenever a sub-message object *************** *** 45,53 **** \refmodule{email.Message}). The factory will be called without arguments. \end{classdesc} The other public \class{Parser} methods are: ! \begin{methoddesc}[Parser]{parse}{fp} Read all the data from the file-like object \var{fp}, parse the resulting text, and return the root message object. \var{fp} must --- 49,71 ---- \refmodule{email.Message}). The factory will be called without arguments. + + The optional \var{strict} flag specifies whether strict or lax parsing + should be performed. Normally, when things like MIME terminating + boundaries are missing, or when messages contain other formatting + problems, the \class{Parser} will raise a + \exception{MessageParseError}. However, when lax parsing is enabled, + the \class{Parser} will attempt to work around such broken formatting + to produce a usable message structure (this doesn't mean + \exception{MessageParseError}s are never raised; some ill-formatted + messages just can't be parsed). The \var{strict} flag defaults to + \code{False} since lax parsing usually provides the most convenient + behavior. + + \versionchanged[The \var{strict} flag was added]{2.2.2} \end{classdesc} The other public \class{Parser} methods are: ! \begin{methoddesc}[Parser]{parse}{fp\optional{, headersonly}} Read all the data from the file-like object \var{fp}, parse the resulting text, and return the root message object. \var{fp} must *************** *** 56,86 **** The text contained in \var{fp} must be formatted as a block of \rfc{2822} ! style headers and header continuation lines, optionally preceeded by a ! \emph{Unix-From} header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). \end{methoddesc} ! \begin{methoddesc}[Parser]{parsestr}{text} Similar to the \method{parse()} method, except it takes a string object instead of a file-like object. Calling this method on a string is exactly equivalent to wrapping \var{text} in a \class{StringIO} instance first and calling \method{parse()}. \end{methoddesc} ! Since creating a message object tree from a string or a file object is ! such a common task, two functions are provided as a convenience. They ! are available in the top-level \module{email} package namespace. ! \begin{funcdesc}{message_from_string}{s\optional{, _class}} ! Return a message object tree from a string. This is exactly ! equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} is ! interpreted as with the \class{Parser} class constructor. \end{funcdesc} ! \begin{funcdesc}{message_from_file}{fp\optional{, _class}} ! Return a message object tree from an open file object. This is exactly ! equivalent to \code{Parser().parse(fp)}. Optional \var{_class} is ! interpreted as with the \class{Parser} class constructor. \end{funcdesc} --- 74,120 ---- The text contained in \var{fp} must be formatted as a block of \rfc{2822} ! style headers and header continuation lines, optionally preceded by a ! envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts). + + Optional \var{headersonly} is as with the \method{parse()} method. + + \versionchanged[The \var{headersonly} flag was added]{2.2.2} \end{methoddesc} ! \begin{methoddesc}[Parser]{parsestr}{text\optional{, headersonly}} Similar to the \method{parse()} method, except it takes a string object instead of a file-like object. Calling this method on a string is exactly equivalent to wrapping \var{text} in a \class{StringIO} instance first and calling \method{parse()}. + + Optional \var{headersonly} is a flag specifying whether to stop + parsing after reading the headers or not. The default is \code{False}, + meaning it parses the entire contents of the file. + + \versionchanged[The \var{headersonly} flag was added]{2.2.2} \end{methoddesc} ! Since creating a message object structure from a string or a file ! object is such a common task, two functions are provided as a ! convenience. They are available in the top-level \module{email} ! package namespace. ! \begin{funcdesc}{message_from_string}{s\optional{, _class\optional{, strict}}} ! Return a message object structure from a string. This is exactly ! equivalent to \code{Parser().parsestr(s)}. Optional \var{_class} and ! \var{strict} are interpreted as with the \class{Parser} class constructor. ! ! \versionchanged[The \var{strict} flag was added]{2.2.2} \end{funcdesc} ! \begin{funcdesc}{message_from_file}{fp\optional{, _class\optional{, strict}}} ! Return a message object structure tree from an open file object. This ! is exactly equivalent to \code{Parser().parse(fp)}. Optional ! \var{_class} and \var{strict} are interpreted as with the ! \class{Parser} class constructor. ! ! \versionchanged[The \var{strict} flag was added]{2.2.2} \end{funcdesc} *************** *** 100,113 **** \item Most non-\mimetype{multipart} type messages are parsed as a single message object with a string payload. These objects will return ! 0 for \method{is_multipart()}. ! \item One exception is for \mimetype{message/delivery-status} type ! messages. Because the body of such messages consist of ! blocks of headers, \class{Parser} will create a non-multipart ! object containing non-multipart subobjects for each header ! block. ! \item Another exception is for \mimetype{message/*} types (more ! general than \mimetype{message/delivery-status}). These are ! typically \mimetype{message/rfc822} messages, represented as a ! non-multipart object containing a singleton payload which is ! another non-multipart \class{Message} instance. \end{itemize} --- 134,152 ---- \item Most non-\mimetype{multipart} type messages are parsed as a single message object with a string payload. These objects will return ! \code{False} for \method{is_multipart()}. Their ! \method{get_payload()} method will return a string object. ! ! \item All \mimetype{multipart} type messages will be parsed as a ! container message object with a list of sub-message objects for ! their payload. The outer container message will return ! \code{True} for \method{is_multipart()} and their ! \method{get_payload()} method will return the list of ! \class{Message} subparts. ! ! \item Most messages with a content type of \mimetype{message/*} ! (e.g. \mimetype{message/deliver-status} and ! \mimetype{message/rfc822}) will also be parsed as container ! object containing a list payload of length 1. Their ! \method{is_multipart()} method will return \code{True}. The ! single element in the list payload will be a sub-message object. \end{itemize} Index: emailutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailutil.tex,v retrieving revision 1.5.8.1 retrieving revision 1.5.8.2 diff -C2 -d -r1.5.8.1 -r1.5.8.2 *** emailutil.tex 23 Aug 2002 16:08:38 -0000 1.5.8.1 --- emailutil.tex 4 Oct 2002 17:24:23 -0000 1.5.8.2 *************** *** 7,11 **** \begin{funcdesc}{quote}{str} Return a new string with backslashes in \var{str} replaced by two ! backslashes and double quotes replaced by backslash-double quote. \end{funcdesc} --- 7,11 ---- \begin{funcdesc}{quote}{str} Return a new string with backslashes in \var{str} replaced by two ! backslashes, and double quotes replaced by backslash-double quote. \end{funcdesc} *************** *** 22,29 **** \emph{realname} and \emph{email address} parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ! \code{(None, None)} is returned. \end{funcdesc} ! \begin{funcdesc}{dump_address_pair}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form \code{(realname, email_address)} and returns the string value suitable --- 22,29 ---- \emph{realname} and \emph{email address} parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ! \code{('', '')} is returned. \end{funcdesc} ! \begin{funcdesc}{formataddr}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form \code{(realname, email_address)} and returns the string value suitable *************** *** 49,73 **** \end{funcdesc} - \begin{funcdesc}{decode}{s} - This method decodes a string according to the rules in \rfc{2047}. It - returns the decoded string as a Python unicode string. - \end{funcdesc} - - \begin{funcdesc}{encode}{s\optional{, charset\optional{, encoding}}} - This method encodes a string according to the rules in \rfc{2047}. It - is not actually the inverse of \function{decode()} since it doesn't - handle multiple character sets or multiple string parts needing - encoding. In fact, the input string \var{s} must already be encoded - in the \var{charset} character set (Python can't reliably guess what - character set a string might be encoded in). The default - \var{charset} is \samp{iso-8859-1}. - - \var{encoding} must be either the letter \character{q} for - Quoted-Printable or \character{b} for Base64 encoding. If - neither, a \exception{ValueError} is raised. Both the \var{charset} and - the \var{encoding} strings are case-insensitive, and coerced to lower - case in the returned string. - \end{funcdesc} - \begin{funcdesc}{parsedate}{date} Attempts to parse a date according to the rules in \rfc{2822}. --- 49,52 ---- *************** *** 107,111 **** \begin{funcdesc}{formatdate}{\optional{timeval\optional{, localtime}}} ! Returns a date string as per Internet standard \rfc{2822}, e.g.: \begin{verbatim} --- 86,90 ---- \begin{funcdesc}{formatdate}{\optional{timeval\optional{, localtime}}} ! Returns a date string as per \rfc{2822}, e.g.: \begin{verbatim} *************** *** 117,122 **** otherwise the current time is used. ! Optional \var{localtime} is a flag that when true, interprets \var{timeval}, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. \end{funcdesc} --- 96,142 ---- otherwise the current time is used. ! Optional \var{localtime} is a flag that when \code{True}, interprets \var{timeval}, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. + The default is \code{False} meaning UTC is used. + \end{funcdesc} + + \begin{funcdesc}{make_msgid}{\optional{idstring}} + Returns a string suitable for an \rfc{2822}-compliant + \mailheader{Message-ID} header. Optional \var{idstring} if given, is + a string used to strengthen the uniqueness of the message id. + \end{funcdesc} + + \begin{funcdesc}{decode_rfc2231}{s} + Decode the string \var{s} according to \rfc{2231}. + \end{funcdesc} + + \begin{funcdesc}{encode_rfc2231}{s\optional{, charset\optional{, language}}} + Encode the string \var{s} according to \rfc{2231}. Optional + \var{charset} and \var{language}, if given is the character set name + and language name to use. If neither is given, \var{s} is returned + as-is. If \var{charset} is given but \var{language} is not, the + string is encoded using the empty string for \var{language}. + \end{funcdesc} + + \begin{funcdesc}{decode_params}{params} + Decode parameters list according to \rfc{2231}. \var{params} is a + sequence of 2-tuples containing elements of the form + \code{(content-type, string-value)}. + \end{funcdesc} + + The following functions have been deprecated: + + \begin{funcdesc}{dump_address_pair}{pair} + \deprecated{2.2.2}{Use \function{formataddr()} instead.} + \end{funcdesc} + + \begin{funcdesc}{decode}{s} + \deprecated{2.2.2}{Use \method{Header.decode_header()} instead.} \end{funcdesc} + + + \begin{funcdesc}{encode}{s\optional{, charset\optional{, encoding}}} + \deprecated{2.2.2}{Use \method{Header.encode()} instead.} + \end{funcdesc} + From barry@users.sourceforge.net Fri Oct 4 18:24:26 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:24:26 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,NONE,1.7.2.1 Header.py,NONE,1.13.2.1 MIMEMultipart.py,NONE,1.3.2.1 MIMENonMultipart.py,NONE,1.2.2.1 _compat21.py,NONE,1.4.2.1 _compat22.py,NONE,1.4.2.1 base64MIME.py,NONE,1.5.2.1 quopriMIME.py,NONE,1.4.2.1 Encoders.py,1.4,1.4.10.1 Errors.py,1.3,1.3.10.1 Generator.py,1.6.10.1,1.6.10.2 Iterators.py,1.5,1.5.10.1 MIMEAudio.py,1.2,1.2.6.1 MIMEBase.py,1.4,1.4.10.1 MIMEImage.py,1.3,1.3.10.1 MIMEMessage.py,1.3,1.3.10.1 MIMEText.py,1.3,1.3.10.1 Message.py,1.9,1.9.6.1 Parser.py,1.5.10.1,1.5.10.2 Utils.py,1.9,1.9.6.1 __init__.py,1.4,1.4.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv11766/Lib/email Modified Files: Tag: release22-maint Encoders.py Errors.py Generator.py Iterators.py MIMEAudio.py MIMEBase.py MIMEImage.py MIMEMessage.py MIMEText.py Message.py Parser.py Utils.py __init__.py Added Files: Tag: release22-maint Charset.py Header.py MIMEMultipart.py MIMENonMultipart.py _compat21.py _compat22.py base64MIME.py quopriMIME.py Log Message: Backporting of email 2.4 from Python 2.3. Many newly added modules, some updated modules, updated documentation, and updated tests. Note that Lib/test/regrtest.py added test_email_codecs to the expected skips for all platforms. Also note that test_email_codecs.py differs slightly from its Python 2.3 counterpart due to the difference in package location for TestSkipped. --- NEW FILE: Charset.py --- # Copyright (C) 2001,2002 Python Software Foundation # Author: che@debian.org (Ben Gertzfield), barry@zope.com (Barry Warsaw) from types import UnicodeType from email.Encoders import encode_7or8bit import email.base64MIME import email.quopriMIME def _isunicode(s): return isinstance(s, UnicodeType) # Python 2.2.1 and beyond has these symbols try: True, False except NameError: True = 1 False = 0 # Flags for types of header encodings QP = 1 # Quoted-Printable BASE64 = 2 # Base64 SHORTEST = 3 # the shorter of QP and base64, but only for headers # In "=?charset?q?hello_world?=", the =?, ?q?, and ?= add up to 7 MISC_LEN = 7 DEFAULT_CHARSET = 'us-ascii' # Defaults CHARSETS = { # input header enc body enc output conv 'iso-8859-1': (QP, QP, None), 'iso-8859-2': (QP, QP, None), 'us-ascii': (None, None, None), 'big5': (BASE64, BASE64, None), 'gb2312': (BASE64, BASE64, None), 'euc-jp': (BASE64, None, 'iso-2022-jp'), 'shift_jis': (BASE64, None, 'iso-2022-jp'), 'iso-2022-jp': (BASE64, None, None), 'koi8-r': (BASE64, BASE64, None), 'utf-8': (SHORTEST, BASE64, 'utf-8'), } # Aliases for other commonly-used names for character sets. Map # them to the real ones used in email. ALIASES = { 'latin_1': 'iso-8859-1', 'latin-1': 'iso-8859-1', 'ascii': 'us-ascii', } # Map charsets to their Unicode codec strings. Note that the Japanese # examples included below do not (yet) come with Python! They are available # from http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/ # The Chinese and Korean codecs are available from SourceForge: # # http://sourceforge.net/projects/python-codecs/ # # although you'll need to check them out of cvs since they haven't been file # released yet. You might also try to use # # http://www.freshports.org/port-description.php3?port=6702 # # if you can get logged in. AFAICT, both the Chinese and Korean codecs are # fairly experimental at this point. CODEC_MAP = { 'euc-jp': 'japanese.euc-jp', 'iso-2022-jp': 'japanese.iso-2022-jp', 'shift_jis': 'japanese.shift_jis', 'gb2132': 'eucgb2312_cn', 'big5': 'big5_tw', 'utf-8': 'utf-8', # Hack: We don't want *any* conversion for stuff marked us-ascii, as all # sorts of garbage might be sent to us in the guise of 7-bit us-ascii. # Let that stuff pass through without conversion to/from Unicode. 'us-ascii': None, } # Convenience functions for extending the above mappings def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): """Add character set properties to the global registry. charset is the input character set, and must be the canonical name of a character set. Optional header_enc and body_enc is either Charset.QP for quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for the shortest of qp or base64 encoding, or None for no encoding. SHORTEST is only valid for header_enc. It describes how message headers and message bodies in the input charset are to be encoded. Default is no encoding. Optional output_charset is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method Charset.convert() is called. The default is to output in the same character set as the input. Both input_charset and output_charset must have Unicode codec entries in the module's charset-to-codec mapping; use add_codec(charset, codecname) to add codecs the module does not know about. See the codecs module's documentation for more information. """ if body_enc == SHORTEST: raise ValueError, 'SHORTEST not allowed for body_enc' CHARSETS[charset] = (header_enc, body_enc, output_charset) def add_alias(alias, canonical): """Add a character set alias. alias is the alias name, e.g. latin-1 canonical is the character set's canonical name, e.g. iso-8859-1 """ ALIASES[alias] = canonical def add_codec(charset, codecname): """Add a codec that map characters in the given charset to/from Unicode. charset is the canonical name of a character set. codecname is the name of a Python codec, as appropriate for the second argument to the unicode() built-in, or to the encode() method of a Unicode string. """ CODEC_MAP[charset] = codecname class Charset: """Map character sets to their email properties. This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email in an RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email. Instances of this module expose the following information about a character set: input_charset: The initial character set specified. Common aliases are converted to their `official' email names (e.g. latin_1 is converted to iso-8859-1). Defaults to 7-bit us-ascii. header_encoding: If the character set must be encoded before it can be used in an email header, this attribute will be set to Charset.QP (for quoted-printable), Charset.BASE64 (for base64 encoding), or Charset.SHORTEST for the shortest of QP or BASE64 encoding. Otherwise, it will be None. body_encoding: Same as header_encoding, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. Charset.SHORTEST is not allowed for body_encoding. output_charset: Some character sets must be converted before the can be used in email headers or bodies. If the input_charset is one of them, this attribute will contain the name of the charset output will be converted to. Otherwise, it will be None. input_codec: The name of the Python codec used to convert the input_charset to Unicode. If no conversion codec is necessary, this attribute will be None. output_codec: The name of the Python codec used to convert Unicode to the output_charset. If no conversion codec is necessary, this attribute will have the same value as the input_codec. """ def __init__(self, input_charset=DEFAULT_CHARSET): # Set the input charset after filtering through the aliases self.input_charset = ALIASES.get(input_charset, input_charset) # We can try to guess which encoding and conversion to use by the # charset_map dictionary. Try that first, but let the user override # it. henc, benc, conv = CHARSETS.get(self.input_charset, (SHORTEST, SHORTEST, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc self.body_encoding = benc self.output_charset = ALIASES.get(conv, conv) # Now set the codecs. If one isn't defined for input_charset, # guess and try a Unicode codec with the same name as input_codec. self.input_codec = CODEC_MAP.get(self.input_charset, self.input_charset) self.output_codec = CODEC_MAP.get(self.output_charset, self.input_codec) def __str__(self): return self.input_charset.lower() def __eq__(self, other): return str(self) == str(other).lower() def __ne__(self, other): return not self.__eq__(other) def get_body_encoding(self): """Return the content-transfer-encoding used for body encoding. This is either the string `quoted-printable' or `base64' depending on the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being encoded. The function should then set the Content-Transfer-Encoding header itself to whatever is appropriate. Returns "quoted-printable" if self.body_encoding is QP. Returns "base64" if self.body_encoding is BASE64. Returns "7bit" otherwise. """ assert self.body_encoding <> SHORTEST if self.body_encoding == QP: return 'quoted-printable' elif self.body_encoding == BASE64: return 'base64' else: return encode_7or8bit def convert(self, s): """Convert a string from the input_codec to the output_codec.""" if self.input_codec <> self.output_codec: return unicode(s, self.input_codec).encode(self.output_codec) else: return s def to_splittable(self, s): """Convert a possibly multibyte string to a safely splittable format. Uses the input_codec to try and convert the string to Unicode, so it can be safely split on character boundaries (even for multibyte characters). Returns the string as-is if it isn't known how to convert it to Unicode with the input_charset. Characters that could not be converted to Unicode will be replaced with the Unicode replacement character U+FFFD. """ if _isunicode(s) or self.input_codec is None: return s try: return unicode(s, self.input_codec, 'replace') except LookupError: # Input codec not installed on system, so return the original # string unchanged. return s def from_splittable(self, ustr, to_output=True): """Convert a splittable string back into an encoded string. Uses the proper codec to try and convert the string from Unicode back into an encoded format. Return the string as-is if it is not Unicode, or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced with an appropriate character (usually '?'). If to_output is True (the default), uses output_codec to convert to an encoded format. If to_output is False, uses input_codec. """ if to_output: codec = self.output_codec else: codec = self.input_codec if not _isunicode(ustr) or codec is None: return ustr try: return ustr.encode(codec, 'replace') except LookupError: # Output codec not installed return ustr def get_output_charset(self): """Return the output character set. This is self.output_charset if that is not None, otherwise it is self.input_charset. """ return self.output_charset or self.input_charset def encoded_header_len(self, s): """Return the length of the encoded header string.""" cset = self.get_output_charset() # The len(s) of a 7bit encoding is len(s) if self.header_encoding == BASE64: return email.base64MIME.base64_len(s) + len(cset) + MISC_LEN elif self.header_encoding == QP: return email.quopriMIME.header_quopri_len(s) + len(cset) + MISC_LEN elif self.header_encoding == SHORTEST: lenb64 = email.base64MIME.base64_len(s) lenqp = email.quopriMIME.header_quopri_len(s) return min(lenb64, lenqp) + len(cset) + MISC_LEN else: return len(s) def header_encode(self, s, convert=False): """Header-encode a string, optionally converting it to output_charset. If convert is True, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the high-level Header class to deal with these issues. convert defaults to False. The type of encoding (base64 or quoted-printable) will be based on self.header_encoding. """ cset = self.get_output_charset() if convert: s = self.convert(s) # 7bit/8bit encodings return the string unchanged (modulo conversions) if self.header_encoding == BASE64: return email.base64MIME.header_encode(s, cset) elif self.header_encoding == QP: return email.quopriMIME.header_encode(s, cset) elif self.header_encoding == SHORTEST: lenb64 = email.base64MIME.base64_len(s) lenqp = email.quopriMIME.header_quopri_len(s) if lenb64 < lenqp: return email.base64MIME.header_encode(s, cset) else: return email.quopriMIME.header_encode(s, cset) else: return s def body_encode(self, s, convert=True): """Body-encode a string and convert it to output_charset. If convert is True (the default), the string will be converted from the input charset to output charset automatically. Unlike header_encode(), there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on self.body_encoding. """ if convert: s = self.convert(s) # 7bit/8bit encodings return the string unchanged (module conversions) if self.body_encoding is BASE64: return email.base64MIME.body_encode(s) elif self.header_encoding is QP: return email.quopriMIME.body_encode(s) else: return s --- NEW FILE: Header.py --- # Copyright (C) 2002 Python Software Foundation # Author: che@debian.org (Ben Gertzfield), barry@zope.com (Barry Warsaw) """Header encoding and decoding functionality.""" import re from types import StringType, UnicodeType import email.quopriMIME import email.base64MIME from email.Charset import Charset try: from email._compat22 import _floordiv except SyntaxError: # Python 2.1 spells integer division differently from email._compat21 import _floordiv try: True, False except NameError: True = 1 False = 0 CRLFSPACE = '\r\n ' CRLF = '\r\n' NL = '\n' SPACE8 = ' ' * 8 EMPTYSTRING = '' MAXLINELEN = 76 ENCODE = 1 DECODE = 2 USASCII = Charset('us-ascii') UTF8 = Charset('utf-8') # Match encoded-word strings in the form =?charset?q?Hello_World?= ecre = re.compile(r''' =\? # literal =? (?P[^?]*?) # non-greedy up to the next ? is the charset \? # literal ? (?P[qb]) # either a "q" or a "b", case insensitive \? # literal ? (?P.*?) # non-greedy up to the next ?= is the encoded string \?= # literal ?= ''', re.VERBOSE | re.IGNORECASE) # Helpers _max_append = email.quopriMIME._max_append def decode_header(header): """Decode a message header value without converting charset. Returns a list of (decoded_string, charset) pairs containing each of the decoded parts of the header. Charset is None for non-encoded parts of the header, otherwise a lower-case string containing the name of the character set specified in the encoded string. """ # If no encoding, just return the header header = str(header) if not ecre.search(header): return [(header, None)] decoded = [] dec = '' for line in header.splitlines(): # This line might not have an encoding in it if not ecre.search(line): decoded.append((line, None)) continue parts = ecre.split(line) while parts: unenc = parts.pop(0).strip() if unenc: # Should we continue a long line? if decoded and decoded[-1][1] is None: decoded[-1] = (decoded[-1][0] + dec, None) else: decoded.append((unenc, None)) if parts: charset, encoding = [s.lower() for s in parts[0:2]] encoded = parts[2] dec = '' if encoding == 'q': dec = email.quopriMIME.header_decode(encoded) elif encoding == 'b': dec = email.base64MIME.decode(encoded) else: dec = encoded if decoded and decoded[-1][1] == charset: decoded[-1] = (decoded[-1][0] + dec, decoded[-1][1]) else: decoded.append((dec, charset)) del parts[0:3] return decoded def make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a Header from a sequence of pairs as returned by decode_header() decode_header() takes a header value string and returns a sequence of pairs of the format (decoded_string, charset) where charset is the string name of the character set. This function takes one of those sequence of pairs and returns a Header instance. Optional maxlinelen, header_name, and continuation_ws are as in the Header constructor. """ h = Header(maxlinelen=maxlinelen, header_name=header_name, continuation_ws=continuation_ws) for s, charset in decoded_seq: # None means us-ascii but we can simply pass it on to h.append() if charset is not None and not isinstance(charset, Charset): charset = Charset(charset) h.append(s, charset) return h class Header: def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a MIME-compliant header that can contain many character sets. Optional s is the initial header value. If None, the initial header value is not set. You can later append to the header with .append() method calls. s may be a byte string or a Unicode string, but see the .append() documentation for semantics. Optional charset serves two purposes: it has the same meaning as the charset argument to the .append() method. It also sets the default character set for all subsequent .append() calls that omit the charset argument. If charset is not provided in the constructor, the us-ascii charset is used both as s's initial charset and as the default for subsequent .append() calls. The maximum line length can be specified explicit via maxlinelen. For splitting the first line to a shorter value (to account for the field header which isn't included in s, e.g. `Subject') pass in the name of the field in header_name. The default maxlinelen is 76. continuation_ws must be RFC 2822 compliant folding whitespace (usually either a space or a hard tab) which will be prepended to continuation lines. """ if charset is None: charset = USASCII self._charset = charset self._continuation_ws = continuation_ws cws_expanded_len = len(continuation_ws.replace('\t', SPACE8)) # BAW: I believe `chunks' and `maxlinelen' should be non-public. self._chunks = [] if s is not None: self.append(s, charset) if maxlinelen is None: maxlinelen = MAXLINELEN if header_name is None: # We don't know anything about the field header so the first line # is the same length as subsequent lines. self._firstlinelen = maxlinelen else: # The first line should be shorter to take into account the field # header. Also subtract off 2 extra for the colon and space. self._firstlinelen = maxlinelen - len(header_name) - 2 # Second and subsequent lines should subtract off the length in # columns of the continuation whitespace prefix. self._maxlinelen = maxlinelen - cws_expanded_len def __str__(self): """A synonym for self.encode().""" return self.encode() def __unicode__(self): """Helper for the built-in unicode function.""" # charset item is a Charset instance so we need to stringify it. uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) # Rich comparison operators for equality only. BAW: does it make sense to # have or explicitly disable <, <=, >, >= operators? def __eq__(self, other): # other may be a Header or a string. Both are fine so coerce # ourselves to a string, swap the args and do another comparison. return other == self.encode() def __ne__(self, other): return not self == other def append(self, s, charset=None): """Append a string to the MIME header. Optional charset, if given, should be a Charset instance or the name of a character set (which will be converted to a Charset instance). A value of None (the default) means that the charset given in the constructor is used. s may be a byte string or a Unicode string. If it is a byte string (i.e. isinstance(s, StringType) is true), then charset is the encoding of that byte string, and a UnicodeError will be raised if the string cannot be decoded with that charset. If s is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In this case, when producing an RFC 2822 compliant header using RFC 2047 rules, the Unicode string will be encoded using the following charsets in order: us-ascii, the charset hint, utf-8. The first character set not to provoke a UnicodeError is used. """ if charset is None: charset = self._charset elif not isinstance(charset, Charset): charset = Charset(charset) # Normalize and check the string if isinstance(s, StringType): # Possibly raise UnicodeError if it can't e encoded unicode(s, charset.get_output_charset()) elif isinstance(s, UnicodeType): # Convert Unicode to byte string for later concatenation for charset in USASCII, charset, UTF8: try: s = s.encode(charset.get_output_charset()) break except UnicodeError: pass else: assert False, 'Could not encode to utf-8' self._chunks.append((s, charset)) def _split(self, s, charset, firstline=False): # Split up a header safely for use with encode_chunks. BAW: this # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) elen = charset.encoded_header_len(encoded) if elen <= self._maxlinelen: return [(encoded, charset)] # BAW: I'm not sure what the right test here is. What we're trying to # do is be faithful to RFC 2822's recommendation that ($2.2.3): # # "Note: Though structured field bodies are defined in such a way that # folding can take place between many of the lexical tokens (and even # within some of the lexical tokens), folding SHOULD be limited to # placing the CRLF at higher-level syntactic breaks." # # For now, I can only imagine doing this when the charset is us-ascii, # although it's possible that other charsets may also benefit from the # higher-level syntactic breaks. # elif charset == 'us-ascii': return self._ascii_split(s, charset, firstline) # BAW: should we use encoded? elif elen == len(s): # We can split on _maxlinelen boundaries because we know that the # encoding won't change the size of the string splitpnt = self._maxlinelen first = charset.from_splittable(splittable[:splitpnt], False) last = charset.from_splittable(splittable[splitpnt:], False) else: # Divide and conquer. halfway = _floordiv(len(splittable), 2) first = charset.from_splittable(splittable[:halfway], False) last = charset.from_splittable(splittable[halfway:], False) # Do the split return self._split(first, charset, firstline) + \ self._split(last, charset) def _ascii_split(self, s, charset, firstline): # Attempt to split the line at the highest-level syntactic break # possible. Note that we don't have a lot of smarts about field # syntax; we just try to break on semi-colons, then whitespace. rtn = [] lines = s.splitlines() while lines: line = lines.pop(0) if firstline: maxlinelen = self._firstlinelen firstline = False else: #line = line.lstrip() maxlinelen = self._maxlinelen # Short lines can remain unchanged if len(line.replace('\t', SPACE8)) <= maxlinelen: rtn.append(line) else: oldlen = len(line) # Try to break the line on semicolons, but if that doesn't # work, try to split on folding whitespace. while len(line) > maxlinelen: i = line.rfind(';', 0, maxlinelen) if i < 0: break rtn.append(line[:i] + ';') line = line[i+1:] # Is the remaining stuff still longer than maxlinelen? if len(line) <= maxlinelen: # Splitting on semis worked rtn.append(line) continue # Splitting on semis didn't finish the job. If it did any # work at all, stick the remaining junk on the front of the # `lines' sequence and let the next pass do its thing. if len(line) <> oldlen: lines.insert(0, line) continue # Otherwise, splitting on semis didn't help at all. parts = re.split(r'(\s+)', line) if len(parts) == 1 or (len(parts) == 3 and parts[0].endswith(':')): # This line can't be split on whitespace. There's now # little we can do to get this into maxlinelen. BAW: # We're still potentially breaking the RFC by possibly # allowing lines longer than the absolute maximum of 998 # characters. For now, let it slide. # # len(parts) will be 1 if this line has no `Field: ' # prefix, otherwise it will be len(3). rtn.append(line) continue # There is whitespace we can split on. first = parts.pop(0) sublines = [first] acc = len(first) while parts: len0 = len(parts[0]) len1 = len(parts[1]) if acc + len0 + len1 <= maxlinelen: sublines.append(parts.pop(0)) sublines.append(parts.pop(0)) acc += len0 + len1 else: # Split it here, but don't forget to ignore the # next whitespace-only part if first <> '': rtn.append(EMPTYSTRING.join(sublines)) del parts[0] first = parts.pop(0) sublines = [first] acc = len(first) rtn.append(EMPTYSTRING.join(sublines)) return [(chunk, charset) for chunk in rtn] def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. Given a list of pairs (string, charset), return a MIME-encoded string suitable for use in a header field. Each pair may have different charsets and/or encodings, and the resulting header will accurately reflect each setting. Each encoding can be email.Utils.QP (quoted-printable, for ASCII-like character sets like iso-8859-1), email.Utils.BASE64 (Base64, for non-ASCII like character sets like KOI8-R and iso-2022-jp), or None (no encoding). Each pair will be represented on a separate line; the resulting string will be in the format: "=?charset1?q?Mar=EDa_Gonz=E1lez_Alonso?=\n =?charset2?b?SvxyZ2VuIEL2aW5n?=" """ chunks = [] for header, charset in self._chunks: if charset is None or charset.header_encoding is None: # There's no encoding for this chunk's charsets _max_append(chunks, header, self._maxlinelen) else: _max_append(chunks, charset.header_encode(header), self._maxlinelen, ' ') joiner = NL + self._continuation_ws return joiner.join(chunks) def encode(self): """Encode a message header into an RFC-compliant format. There are many issues involved in converting a given string for use in an email header. Only certain character sets are readable in most email clients, and as header strings can only contain a subset of 7-bit ASCII, care must be taken to properly convert and encode (with Base64 or quoted-printable) header strings. In addition, there is a 75-character length limit on any given encoded header field, so line-wrapping must be performed, even with double-byte character sets. This method will do its best to convert the string to the correct character set used in email, and encode and line wrap it safely with the appropriate scheme for that character set. If the given charset is not known or an error occurs during conversion, this function will return the header untouched. """ newchunks = [] for s, charset in self._chunks: newchunks += self._split(s, charset, True) self._chunks = newchunks return self._encode_chunks() --- NEW FILE: MIMEMultipart.py --- # Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Base class for MIME multipart/* type messages. """ from email import MIMEBase class MIMEMultipart(MIMEBase.MIMEBase): """Base class for MIME multipart/* type messages.""" def __init__(self, _subtype='mixed', boundary=None, *_subparts, **_params): """Creates a multipart/* type message. By default, creates a multipart/mixed message, with proper Content-Type and MIME-Version headers. _subtype is the subtype of the multipart content type, defaulting to `mixed'. boundary is the multipart boundary string. By default it is calculated as needed. _subparts is a sequence of initial subparts for the payload. It must be possible to convert this sequence to a list. You can always attach new subparts to the message by using the attach() method. Additional parameters for the Content-Type header are taken from the keyword arguments (or passed into the _params argument). """ MIMEBase.MIMEBase.__init__(self, 'multipart', _subtype, **_params) if _subparts: self.attach(*list(_subparts)) if boundary: self.set_boundary(boundary) --- NEW FILE: MIMENonMultipart.py --- # Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Base class for MIME type messages that are not multipart. """ from email import Errors from email import MIMEBase class MIMENonMultipart(MIMEBase.MIMEBase): """Base class for MIME multipart/* type messages.""" __pychecker__ = 'unusednames=payload' def attach(self, payload): # The public API prohibits attaching multiple subparts to MIMEBase # derived subtypes since none of them are, by definition, of content # type multipart/* raise Errors.MultipartConversionError( 'Cannot attach additional subparts to non-multipart/*') del __pychecker__ --- NEW FILE: _compat21.py --- # Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com """Module containing compatibility functions for Python 2.1. """ from cStringIO import StringIO from types import StringType, UnicodeType # This function will become a method of the Message class def walk(self): """Walk over the message tree, yielding each subpart. The walk is performed in depth-first order. This method is a generator. """ parts = [] parts.append(self) if self.is_multipart(): for subpart in self.get_payload(): parts.extend(subpart.walk()) return parts # Python 2.2 spells floor division // def _floordiv(i, j): """Do a floor division, i/j.""" return i / j def _isstring(obj): return isinstance(obj, StringType) or isinstance(obj, UnicodeType) # These two functions are imported into the Iterators.py interface module. # The Python 2.2 version uses generators for efficiency. def body_line_iterator(msg): """Iterate over the parts, returning string payloads line-by-line.""" lines = [] for subpart in msg.walk(): payload = subpart.get_payload() if _isstring(payload): for line in StringIO(payload).readlines(): lines.append(line) return lines def typed_subpart_iterator(msg, maintype='text', subtype=None): """Iterate over the subparts with a given MIME type. Use `maintype' as the main MIME type to match against; this defaults to "text". Optional `subtype' is the MIME subtype to match against; if omitted, only the main type is matched. """ parts = [] for subpart in msg.walk(): if subpart.get_main_type('text') == maintype: if subtype is None or subpart.get_subtype('plain') == subtype: parts.append(subpart) return parts --- NEW FILE: _compat22.py --- # Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com """Module containing compatibility functions for Python 2.1. """ from __future__ import generators from __future__ import division from cStringIO import StringIO from types import StringTypes # This function will become a method of the Message class def walk(self): """Walk over the message tree, yielding each subpart. The walk is performed in depth-first order. This method is a generator. """ yield self if self.is_multipart(): for subpart in self.get_payload(): for subsubpart in subpart.walk(): yield subsubpart # Python 2.2 spells floor division // def _floordiv(i, j): """Do a floor division, i/j.""" return i // j def _isstring(obj): return isinstance(obj, StringTypes) # These two functions are imported into the Iterators.py interface module. # The Python 2.2 version uses generators for efficiency. def body_line_iterator(msg): """Iterate over the parts, returning string payloads line-by-line.""" for subpart in msg.walk(): payload = subpart.get_payload() if _isstring(payload): for line in StringIO(payload): yield line def typed_subpart_iterator(msg, maintype='text', subtype=None): """Iterate over the subparts with a given MIME type. Use `maintype' as the main MIME type to match against; this defaults to "text". Optional `subtype' is the MIME subtype to match against; if omitted, only the main type is matched. """ for subpart in msg.walk(): if subpart.get_main_type('text') == maintype: if subtype is None or subpart.get_subtype('plain') == subtype: yield subpart --- NEW FILE: base64MIME.py --- # Copyright (C) 2002 Python Software Foundation # Author: che@debian.org (Ben Gertzfield) """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit characters encoding known as Base64. It is used in the MIME standards for email to attach images, audio, and text using some 8-bit character sets to messages. This module provides an interface to encode and decode both headers and bodies with Base64 encoding. RFC 2045 defines a method for including character set information in an `encoded-word' in a header. This method is commonly used for 8-bit real names in To:, From:, Cc:, etc. fields, as well as Subject: lines. This module does not do the line wrapping or end-of-line character conversion necessary for proper internationalized headers; it only does dumb encoding and decoding. To deal with the various line wrapping issues, use the email.Header module. """ import re from binascii import b2a_base64, a2b_base64 from email.Utils import fix_eols try: from email._compat22 import _floordiv except SyntaxError: # Python 2.1 spells integer division differently from email._compat21 import _floordiv CRLF = '\r\n' NL = '\n' EMPTYSTRING = '' # See also Charset.py MISC_LEN = 7 try: True, False except NameError: True = 1 False = 0 # Helpers def base64_len(s): """Return the length of s when it is encoded with base64.""" groups_of_3, leftover = divmod(len(s), 3) # 4 bytes out for each 3 bytes (or nonzero fraction thereof) in. # Thanks, Tim! n = groups_of_3 * 4 if leftover: n += 4 return n def header_encode(header, charset='iso-8859-1', keep_eols=False, maxlinelen=76, eol=NL): """Encode a single header line with Base64 encoding in a given charset. Defined in RFC 2045, this Base64 encoding is identical to normal Base64 encoding, except that each line must be intelligently wrapped (respecting the Base64 encoding), and subsequent lines must start with a space. charset names the character set to use to encode the header. It defaults to iso-8859-1. End-of-line characters (\\r, \\n, \\r\\n) will be automatically converted to the canonical email line separator \\r\\n unless the keep_eols parameter is True (the default is False). Each line of the header will be terminated in the value of eol, which defaults to "\\n". Set this to "\\r\\n" if you are using the result of this function directly in email. The resulting string will be in the form: "=?charset?b?WW/5ciBtYXp66XLrIHf8eiBhIGhhbXBzdGHuciBBIFlv+XIgbWF6euly?=\\n =?charset?b?6yB3/HogYSBoYW1wc3Rh7nIgQkMgWW/5ciBtYXp66XLrIHf8eiBhIGhh?=" with each line wrapped at, at most, maxlinelen characters (defaults to 76 characters). """ # Return empty headers unchanged if not header: return header if not keep_eols: header = fix_eols(header) # Base64 encode each line, in encoded chunks no greater than maxlinelen in # length, after the RFC chrome is added in. base64ed = [] max_encoded = maxlinelen - len(charset) - MISC_LEN max_unencoded = _floordiv(max_encoded * 3, 4) # BAW: Ben's original code used a step of max_unencoded, but I think it # ought to be max_encoded. Otherwise, where's max_encoded used? I'm # still not sure what the for i in range(0, len(header), max_unencoded): base64ed.append(b2a_base64(header[i:i+max_unencoded])) # Now add the RFC chrome to each encoded chunk lines = [] for line in base64ed: # Ignore the last character of each line if it is a newline if line.endswith(NL): line = line[:-1] # Add the chrome lines.append('=?%s?b?%s?=' % (charset, line)) # Glue the lines together and return it. BAW: should we be able to # specify the leading whitespace in the joiner? joiner = eol + ' ' return joiner.join(lines) def encode(s, binary=True, maxlinelen=76, eol=NL): """Encode a string with base64. Each line will be wrapped at, at most, maxlinelen characters (defaults to 76 characters). If binary is False, end-of-line characters will be converted to the canonical email end-of-line sequence \\r\\n. Otherwise they will be left verbatim (this is the default). Each line of encoded text will end with eol, which defaults to "\\n". Set this to "\r\n" if you will be using the result of this function directly in an email. """ if not s: return s if not binary: s = fix_eols(s) encvec = [] max_unencoded = _floordiv(maxlinelen * 3, 4) for i in range(0, len(s), max_unencoded): # BAW: should encode() inherit b2a_base64()'s dubious behavior in # adding a newline to the encoded string? enc = b2a_base64(s[i:i + max_unencoded]) if enc.endswith(NL) and eol <> NL: enc = enc[:-1] + eol encvec.append(enc) return EMPTYSTRING.join(encvec) # For convenience and backwards compatibility w/ standard base64 module body_encode = encode encodestring = encode def decode(s, convert_eols=None): """Decode a raw base64 string. If convert_eols is set to a string value, all canonical email linefeeds, e.g. "\\r\\n", in the decoded text will be converted to the value of convert_eols. os.linesep is a good choice for convert_eols if you are decoding a text attachment. This function does not parse a full MIME header value encoded with base64 (like =?iso-8895-1?b?bmloISBuaWgh?=) -- please use the high level email.Header class for that functionality. """ if not s: return s dec = a2b_base64(s) if convert_eols: return dec.replace(CRLF, convert_eols) return dec # For convenience and backwards compatibility w/ standard base64 module body_decode = decode decodestring = decode --- NEW FILE: quopriMIME.py --- # Copyright (C) 2001,2002 Python Software Foundation # Author: che@debian.org (Ben Gertzfield) """Quoted-printable content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode US ASCII-like 8-bit data called `quoted-printable'. It is used to safely encode text that is in a character set similar to the 7-bit US ASCII character set, but that includes some 8-bit characters that are normally not allowed in email bodies or headers. Quoted-printable is very space-inefficient for encoding binary files; use the email.base64MIME module for that instead. This module provides an interface to encode and decode both headers and bodies with quoted-printable encoding. RFC 2045 defines a method for including character set information in an `encoded-word' in a header. This method is commonly used for 8-bit real names in To:/From:/Cc: etc. fields, as well as Subject: lines. This module does not do the line wrapping or end-of-line character conversion necessary for proper internationalized headers; it only does dumb encoding and decoding. To deal with the various line wrapping issues, use the email.Header module. """ import re from string import hexdigits from email.Utils import fix_eols CRLF = '\r\n' NL = '\n' # See also Charset.py MISC_LEN = 7 hqre = re.compile(r'[^-a-zA-Z0-9!*+/ ]') bqre = re.compile(r'[^ !-<>-~\t]') try: True, False except NameError: True = 1 False = 0 # Helpers def header_quopri_check(c): """Return True if the character should be escaped with header quopri.""" return hqre.match(c) and True def body_quopri_check(c): """Return True if the character should be escaped with body quopri.""" return bqre.match(c) and True def header_quopri_len(s): """Return the length of str when it is encoded with header quopri.""" count = 0 for c in s: if hqre.match(c): count += 3 else: count += 1 return count def body_quopri_len(str): """Return the length of str when it is encoded with body quopri.""" count = 0 for c in str: if bqre.match(c): count += 3 else: count += 1 return count def _max_append(L, s, maxlen, extra=''): if not L: L.append(s.lstrip()) elif len(L[-1]) + len(s) < maxlen: L[-1] += extra + s else: L.append(s.lstrip()) def unquote(s): """Turn a string in the form =AB to the ASCII character with value 0xab""" return chr(int(s[1:3], 16)) def quote(c): return "=%02X" % ord(c) def header_encode(header, charset="iso-8859-1", keep_eols=False, maxlinelen=76, eol=NL): """Encode a single header line with quoted-printable (like) encoding. Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but used specifically for email header fields to allow charsets with mostly 7 bit characters (and some 8 bit) to remain more or less readable in non-RFC 2045 aware mail clients. charset names the character set to use to encode the header. It defaults to iso-8859-1. The resulting string will be in the form: "=?charset?q?I_f=E2rt_in_your_g=E8n=E8ral_dire=E7tion?\\n =?charset?q?Silly_=C8nglish_Kn=EEghts?=" with each line wrapped safely at, at most, maxlinelen characters (defaults to 76 characters). End-of-line characters (\\r, \\n, \\r\\n) will be automatically converted to the canonical email line separator \\r\\n unless the keep_eols parameter is True (the default is False). Each line of the header will be terminated in the value of eol, which defaults to "\\n". Set this to "\\r\\n" if you are using the result of this function directly in email. """ # Return empty headers unchanged if not header: return header if not keep_eols: header = fix_eols(header) # Quopri encode each line, in encoded chunks no greater than maxlinelen in # lenght, after the RFC chrome is added in. quoted = [] max_encoded = maxlinelen - len(charset) - MISC_LEN for c in header: # Space may be represented as _ instead of =20 for readability if c == ' ': _max_append(quoted, '_', max_encoded) # These characters can be included verbatim elif not hqre.match(c): _max_append(quoted, c, max_encoded) # Otherwise, replace with hex value like =E2 else: _max_append(quoted, "=%02X" % ord(c), max_encoded) # Now add the RFC chrome to each encoded chunk and glue the chunks # together. BAW: should we be able to specify the leading whitespace in # the joiner? joiner = eol + ' ' return joiner.join(['=?%s?q?%s?=' % (charset, line) for line in quoted]) def encode(body, binary=False, maxlinelen=76, eol=NL): """Encode with quoted-printable, wrapping at maxlinelen characters. If binary is False (the default), end-of-line characters will be converted to the canonical email end-of-line sequence \\r\\n. Otherwise they will be left verbatim. Each line of encoded text will end with eol, which defaults to "\\n". Set this to "\\r\\n" if you will be using the result of this function directly in an email. Each line will be wrapped at, at most, maxlinelen characters (defaults to 76 characters). Long lines will have the `soft linefeed' quoted-printable character "=" appended to them, so the decoded text will be identical to the original text. """ if not body: return body if not binary: body = fix_eols(body) # BAW: We're accumulating the body text by string concatenation. That # can't be very efficient, but I don't have time now to rewrite it. It # just feels like this algorithm could be more efficient. encoded_body = '' lineno = -1 # Preserve line endings here so we can check later to see an eol needs to # be added to the output later. lines = body.splitlines(1) for line in lines: # But strip off line-endings for processing this line. if line.endswith(CRLF): line = line[:-2] elif line[-1] in CRLF: line = line[:-1] lineno += 1 encoded_line = '' prev = None linelen = len(line) # Now we need to examine every character to see if it needs to be # quopri encoded. BAW: again, string concatenation is inefficient. for j in range(linelen): c = line[j] prev = c if bqre.match(c): c = quote(c) elif j+1 == linelen: # Check for whitespace at end of line; special case if c not in ' \t': encoded_line += c prev = c continue # Check to see to see if the line has reached its maximum length if len(encoded_line) + len(c) >= maxlinelen: encoded_body += encoded_line + '=' + eol encoded_line = '' encoded_line += c # Now at end of line.. if prev and prev in ' \t': # Special case for whitespace at end of file if lineno + 1 == len(lines): prev = quote(prev) if len(encoded_line) + len(prev) > maxlinelen: encoded_body += encoded_line + '=' + eol + prev else: encoded_body += encoded_line + prev # Just normal whitespace at end of line else: encoded_body += encoded_line + prev + '=' + eol encoded_line = '' # Now look at the line we just finished and it has a line ending, we # need to add eol to the end of the line. if lines[lineno].endswith(CRLF) or lines[lineno][-1] in CRLF: encoded_body += encoded_line + eol else: encoded_body += encoded_line encoded_line = '' return encoded_body # For convenience and backwards compatibility w/ standard base64 module body_encode = encode encodestring = encode # BAW: I'm not sure if the intent was for the signature of this function to be # the same as base64MIME.decode() or not... def decode(encoded, eol=NL): """Decode a quoted-printable string. Lines are separated with eol, which defaults to \\n. """ if not encoded: return encoded # BAW: see comment in encode() above. Again, we're building up the # decoded string with string concatenation, which could be done much more # efficiently. decoded = '' for line in encoded.splitlines(): line = line.rstrip() if not line: decoded += eol continue i = 0 n = len(line) while i < n: c = line[i] if c <> '=': decoded += c i += 1 # Otherwise, c == "=". Are we at the end of the line? If so, add # a soft line break. elif i+1 == n: i += 1 continue # Decode if in form =AB elif i+2 < n and line[i+1] in hexdigits and line[i+2] in hexdigits: decoded += unquote(line[i:i+3]) i += 3 # Otherwise, not in form =AB, pass literally else: decoded += c i += 1 if i == n: decoded += eol # Special case if original string did not end with eol if not encoded.endswith(eol) and decoded.endswith(eol): decoded = decoded[:-1] return decoded # For convenience and backwards compatibility w/ standard base64 module body_decode = decode decodestring = decode def _unquote_match(match): """Turn a match in the form =AB to the ASCII character with value 0xab""" s = match.group(0) return unquote(s) # Header decoding is done a bit differently def header_decode(s): """Decode a string encoded with RFC 2045 MIME header `Q' encoding. This function does not parse a full MIME header value encoded with quoted-printable (like =?iso-8895-1?q?Hello_World?=) -- please use the high level email.Header class for that functionality. """ s = s.replace('_', ' ') return re.sub(r'=\w{2}', _unquote_match, s) Index: Encoders.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Encoders.py,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** Encoders.py 4 Oct 2001 17:05:11 -0000 1.4 --- Encoders.py 4 Oct 2002 17:24:23 -0000 1.4.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 6,16 **** import base64 - from quopri import encodestring as _encodestring # Helpers ! def _qencode(s): ! return _encodestring(s, quotetabs=1) --- 6,37 ---- import base64 # Helpers ! try: ! from quopri import encodestring as _encodestring ! ! def _qencode(s): ! enc = _encodestring(s, quotetabs=1) ! # Must encode spaces, which quopri.encodestring() doesn't do ! return enc.replace(' ', '=20') ! except ImportError: ! # Python 2.1 doesn't have quopri.encodestring() ! from cStringIO import StringIO ! import quopri as _quopri ! ! def _qencode(s): ! if not s: ! return s ! hasnewline = (s[-1] == '\n') ! infp = StringIO(s) ! outfp = StringIO() ! _quopri.encode(infp, outfp, quotetabs=1) ! # Python 2.x's encode() doesn't encode spaces even when quotetabs==1 ! value = outfp.getvalue().replace(' ', '=20') ! if not hasnewline and value[-1] == '\n': ! return value[:-1] ! return value *************** *** 31,35 **** """Encode the message's payload in Base64. ! Also, add an appropriate Content-Transfer-Encoding: header. """ orig = msg.get_payload() --- 52,56 ---- """Encode the message's payload in Base64. ! Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() *************** *** 41,47 **** def encode_quopri(msg): ! """Encode the message's payload in Quoted-Printable. ! Also, add an appropriate Content-Transfer-Encoding: header. """ orig = msg.get_payload() --- 62,68 ---- def encode_quopri(msg): ! """Encode the message's payload in quoted-printable. ! Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() *************** *** 53,58 **** def encode_7or8bit(msg): ! """Set the Content-Transfer-Encoding: header to 7bit or 8bit.""" orig = msg.get_payload() # We play a trick to make this go fast. If encoding to ASCII succeeds, we # know the data must be 7bit, otherwise treat it as 8bit. --- 74,83 ---- def encode_7or8bit(msg): ! """Set the Content-Transfer-Encoding header to 7bit or 8bit.""" orig = msg.get_payload() + if orig is None: + # There's no payload. For backwards compatibility we use 7bit + msg['Content-Transfer-Encoding'] = '7bit' + return # We play a trick to make this go fast. If encoding to ASCII succeeds, we # know the data must be 7bit, otherwise treat it as 8bit. Index: Errors.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Errors.py,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** Errors.py 4 Oct 2001 17:05:11 -0000 1.3 --- Errors.py 4 Oct 2002 17:24:23 -0000 1.3.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 8,12 **** class MessageError(Exception): ! """Base class for errors in this module.""" --- 8,12 ---- class MessageError(Exception): ! """Base class for errors in the email package.""" Index: Generator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Generator.py,v retrieving revision 1.6.10.1 retrieving revision 1.6.10.2 diff -C2 -d -r1.6.10.1 -r1.6.10.2 *** Generator.py 22 Mar 2002 16:21:56 -0000 1.6.10.1 --- Generator.py 4 Oct 2002 17:24:23 -0000 1.6.10.2 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 9,18 **** import random ! from types import ListType, StringType from cStringIO import StringIO ! # Intrapackage imports ! import Message ! import Errors EMPTYSTRING = '' --- 9,27 ---- import random ! from types import ListType from cStringIO import StringIO ! from email.Header import Header ! ! try: ! from email._compat22 import _isstring ! except SyntaxError: ! from email._compat21 import _isstring ! ! try: ! True, False ! except NameError: ! True = 1 ! False = 0 EMPTYSTRING = '' *************** *** 39,43 **** # ! def __init__(self, outfp, mangle_from_=1, maxheaderlen=78): """Create the generator for message flattening. --- 48,52 ---- # ! def __init__(self, outfp, mangle_from_=True, maxheaderlen=78): """Create the generator for message flattening. *************** *** 45,50 **** must have a write() method. ! Optional mangle_from_ is a flag that, when true, escapes From_ lines ! in the body of the message by putting a `>' in front of them. Optional maxheaderlen specifies the longest length for a non-continued --- 54,60 ---- must have a write() method. ! Optional mangle_from_ is a flag that, when True (the default), escapes ! From_ lines in the body of the message by putting a `>' in front of ! them. Optional maxheaderlen specifies the longest length for a non-continued *************** *** 58,62 **** self._fp = outfp self._mangle_from_ = mangle_from_ - self.__first = 1 self.__maxheaderlen = maxheaderlen --- 68,71 ---- *************** *** 65,69 **** self._fp.write(s) ! def __call__(self, msg, unixfrom=0): """Print the message object tree rooted at msg to the output file specified when the Generator instance was created. --- 74,78 ---- self._fp.write(s) ! def flatten(self, msg, unixfrom=False): """Print the message object tree rooted at msg to the output file specified when the Generator instance was created. *************** *** 72,76 **** before the first object in the message tree. If the original message has no From_ delimiter, a `standard' one is crafted. By default, this ! is 0 to inhibit the printing of any From_ delimiter. Note that for subobjects, no From_ line is printed. --- 81,85 ---- before the first object in the message tree. If the original message has no From_ delimiter, a `standard' one is crafted. By default, this ! is False to inhibit the printing of any From_ delimiter. Note that for subobjects, no From_ line is printed. *************** *** 83,86 **** --- 92,102 ---- self._write(msg) + # For backwards compatibility, but this is slower + __call__ = flatten + + def clone(self, fp): + """Clone this generator with the exact same options.""" + return self.__class__(fp, self._mangle_from_, self.__maxheaderlen) + # # Protected interface - undocumented ;/ *************** *** 116,136 **** def _dispatch(self, msg): # Get the Content-Type: for the message, then try to dispatch to ! # self._handle_maintype_subtype(). If there's no handler for the full ! # MIME type, then dispatch to self._handle_maintype(). If that's ! # missing too, then dispatch to self._writeBody(). ! ctype = msg.get_type() ! if ctype is None: ! # No Content-Type: header so try the default handler ! self._writeBody(msg) ! else: ! # We do have a Content-Type: header. ! specific = UNDERSCORE.join(ctype.split('/')).replace('-', '_') ! meth = getattr(self, '_handle_' + specific, None) if meth is None: ! generic = msg.get_main_type().replace('-', '_') ! meth = getattr(self, '_handle_' + generic, None) ! if meth is None: ! meth = self._writeBody ! meth(msg) # --- 132,148 ---- def _dispatch(self, msg): # Get the Content-Type: for the message, then try to dispatch to ! # self._handle__(). If there's no handler for the ! # full MIME type, then dispatch to self._handle_(). If ! # that's missing too, then dispatch to self._writeBody(). ! main = msg.get_content_maintype() ! sub = msg.get_content_subtype() ! specific = UNDERSCORE.join((main, sub)).replace('-', '_') ! meth = getattr(self, '_handle_' + specific, None) ! if meth is None: ! generic = main.replace('-', '_') ! meth = getattr(self, '_handle_' + generic, None) if meth is None: ! meth = self._writeBody ! meth(msg) # *************** *** 140,149 **** def _write_headers(self, msg): for h, v in msg.items(): - # We only write the MIME-Version: header for the outermost - # container message. Unfortunately, we can't use same technique - # as for the Unix-From above because we don't know when - # MIME-Version: will occur. - if h.lower() == 'mime-version' and not self.__first: - continue # RFC 2822 says that lines SHOULD be no more than maxheaderlen # characters wide, so we're well within our rights to split long --- 152,155 ---- *************** *** 161,165 **** # maxheaderlen characters wide. There could be continuation lines # that actually shorten it. Also, replace hard tabs with 8 spaces. ! lines = [s.replace('\t', SPACE8) for s in text.split('\n')] for line in lines: if len(line) > maxheaderlen: --- 167,171 ---- # maxheaderlen characters wide. There could be continuation lines # that actually shorten it. Also, replace hard tabs with 8 spaces. ! lines = [s.replace('\t', SPACE8) for s in text.splitlines()] for line in lines: if len(line) > maxheaderlen: *************** *** 169,218 **** # just return the original unchanged. return text ! rtn = [] ! for line in text.split('\n'): ! # Short lines can remain unchanged ! if len(line.replace('\t', SPACE8)) <= maxheaderlen: ! rtn.append(line) ! SEMINLTAB.join(rtn) ! else: ! oldlen = len(text) ! # Try to break the line on semicolons, but if that doesn't ! # work, try to split on folding whitespace. ! while len(text) > maxheaderlen: ! i = text.rfind(';', 0, maxheaderlen) ! if i < 0: ! break ! rtn.append(text[:i]) ! text = text[i+1:].lstrip() ! if len(text) <> oldlen: ! # Splitting on semis worked ! rtn.append(text) ! return SEMINLTAB.join(rtn) ! # Splitting on semis didn't help, so try to split on ! # whitespace. ! parts = re.split(r'(\s+)', text) ! # Watch out though for "Header: longnonsplittableline" ! if parts[0].endswith(':') and len(parts) == 3: ! return text ! first = parts.pop(0) ! sublines = [first] ! acc = len(first) ! while parts: ! len0 = len(parts[0]) ! len1 = len(parts[1]) ! if acc + len0 + len1 < maxheaderlen: ! sublines.append(parts.pop(0)) ! sublines.append(parts.pop(0)) ! acc += len0 + len1 ! else: ! # Split it here, but don't forget to ignore the ! # next whitespace-only part ! rtn.append(EMPTYSTRING.join(sublines)) ! del parts[0] ! first = parts.pop(0) ! sublines = [first] ! acc = len(first) ! rtn.append(EMPTYSTRING.join(sublines)) ! return NLTAB.join(rtn) # --- 175,184 ---- # just return the original unchanged. return text ! # The `text' argument already has the field name prepended, so don't ! # provide it here or the first line will get folded too short. ! h = Header(text, maxlinelen=maxheaderlen, ! # For backwards compatibility, we use a hard tab here ! continuation_ws='\t') ! return h.encode() # *************** *** 224,228 **** if payload is None: return ! if not isinstance(payload, StringType): raise TypeError, 'string payload expected: %s' % type(payload) if self._mangle_from_: --- 190,197 ---- if payload is None: return ! cset = msg.get_charset() ! if cset is not None: ! payload = cset.body_encode(payload) ! if not _isstring(payload): raise TypeError, 'string payload expected: %s' % type(payload) if self._mangle_from_: *************** *** 233,246 **** _writeBody = _handle_text ! def _handle_multipart(self, msg, isdigest=0): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] - # BAW: kludge for broken add_payload() semantics; watch out for - # multipart/* MIME types with None or scalar payloads. subparts = msg.get_payload() if subparts is None: ! # Nothing has every been attached boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary --- 202,213 ---- _writeBody = _handle_text ! def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: ! # Nothing has ever been attached boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary *************** *** 248,251 **** --- 215,222 ---- print >> self._fp, '--' + boundary + '--' return + elif _isstring(subparts): + # e.g. a non-strict parse of a message with no starting boundary. + self._fp.write(subparts) + return elif not isinstance(subparts, ListType): # Scalar payload *************** *** 253,258 **** for part in subparts: s = StringIO() ! g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) ! g(part, unixfrom=0) msgtexts.append(s.getvalue()) # Now make sure the boundary we've selected doesn't appear in any of --- 224,229 ---- for part in subparts: s = StringIO() ! g = self.clone(s) ! g.flatten(part, unixfrom=False) msgtexts.append(s.getvalue()) # Now make sure the boundary we've selected doesn't appear in any of *************** *** 275,286 **** # newline. print >> self._fp, '--' + boundary - if isdigest: - print >> self._fp # Join and write the individual parts joiner = '\n--' + boundary + '\n' - if isdigest: - # multipart/digest types effectively add an extra newline between - # the boundary and the body part. - joiner += '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--', --- 246,251 ---- *************** *** 291,297 **** self._fp.write(msg.epilogue) - def _handle_multipart_digest(self, msg): - self._handle_multipart(msg, isdigest=1) - def _handle_message_delivery_status(self, msg): # We can't just write the headers directly to self's file object --- 256,259 ---- *************** *** 301,306 **** for part in msg.get_payload(): s = StringIO() ! g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) ! g(part, unixfrom=0) text = s.getvalue() lines = text.split('\n') --- 263,268 ---- for part in msg.get_payload(): s = StringIO() ! g = self.clone(s) ! g.flatten(part, unixfrom=False) text = s.getvalue() lines = text.split('\n') *************** *** 317,325 **** def _handle_message(self, msg): s = StringIO() ! g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) ! # A message/rfc822 should contain a scalar payload which is another ! # Message object. Extract that object, stringify it, and write that ! # out. ! g(msg.get_payload(), unixfrom=0) self._fp.write(s.getvalue()) --- 279,288 ---- def _handle_message(self, msg): s = StringIO() ! g = self.clone(s) ! # The payload of a message/rfc822 part should be a multipart sequence ! # of length 1. The zeroth element of the list should be the Message ! # object for the subpart. Extract that object, stringify it, and ! # write it out. ! g.flatten(msg.get_payload(0), unixfrom=False) self._fp.write(s.getvalue()) *************** *** 332,336 **** with a format string representing the part. """ ! def __init__(self, outfp, mangle_from_=1, maxheaderlen=78, fmt=None): """Like Generator.__init__() except that an additional optional argument is allowed. --- 295,299 ---- with a format string representing the part. """ ! def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None): """Like Generator.__init__() except that an additional optional argument is allowed. *************** *** 364,368 **** maintype = part.get_main_type('text') if maintype == 'text': ! print >> self, part.get_payload(decode=1) elif maintype == 'multipart': # Just skip this --- 327,331 ---- maintype = part.get_main_type('text') if maintype == 'text': ! print >> self, part.get_payload(decode=True) elif maintype == 'multipart': # Just skip this *************** *** 391,395 **** b = boundary counter = 0 ! while 1: cre = re.compile('^--' + re.escape(b) + '(--)?$', re.MULTILINE) if not cre.search(text): --- 354,358 ---- b = boundary counter = 0 ! while True: cre = re.compile('^--' + re.escape(b) + '(--)?$', re.MULTILINE) if not cre.search(text): Index: Iterators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Iterators.py,v retrieving revision 1.5 retrieving revision 1.5.10.1 diff -C2 -d -r1.5 -r1.5.10.1 *** Iterators.py 15 Oct 2001 04:38:22 -0000 1.5 --- Iterators.py 4 Oct 2002 17:24:24 -0000 1.5.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,33 **** """ ! from __future__ import generators ! from cStringIO import StringIO ! from types import StringType ! ! ! def body_line_iterator(msg): ! """Iterate over the parts, returning string payloads line-by-line.""" ! for subpart in msg.walk(): ! payload = subpart.get_payload() ! if type(payload) is StringType: ! for line in StringIO(payload): ! yield line ! def typed_subpart_iterator(msg, maintype='text', subtype=None): ! """Iterate over the subparts with a given MIME type. ! ! Use `maintype' as the main MIME type to match against; this defaults to ! "text". Optional `subtype' is the MIME subtype to match against; if ! omitted, only the main type is matched. ! """ ! for subpart in msg.walk(): ! if subpart.get_main_type('text') == maintype: ! if subtype is None or subpart.get_subtype('plain') == subtype: ! yield subpart --- 5,25 ---- """ ! import sys ! try: ! from email._compat22 import body_line_iterator, typed_subpart_iterator ! except SyntaxError: ! # Python 2.1 doesn't have generators ! from email._compat21 import body_line_iterator, typed_subpart_iterator ! def _structure(msg, fp=None, level=0): ! """A handy debugging aid""" ! if fp is None: ! fp = sys.stdout ! tab = ' ' * (level * 4) ! print >> fp, tab + msg.get_content_type() ! if msg.is_multipart(): ! for subpart in msg.get_payload(): ! _structure(subpart, fp, level+1) Index: MIMEAudio.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEAudio.py,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** MIMEAudio.py 24 Nov 2001 15:49:53 -0000 1.2 --- MIMEAudio.py 4 Oct 2002 17:24:24 -0000 1.2.6.1 *************** *** 7,13 **** from cStringIO import StringIO ! import MIMEBase ! import Errors ! import Encoders --- 7,13 ---- from cStringIO import StringIO ! from email import Errors ! from email import Encoders ! from email.MIMENonMultipart import MIMENonMultipart *************** *** 38,42 **** ! class MIMEAudio(MIMEBase.MIMEBase): """Class for generating audio/* MIME documents.""" --- 38,42 ---- ! class MIMEAudio(MIMENonMultipart): """Class for generating audio/* MIME documents.""" *************** *** 47,51 **** _audiodata is a string containing the raw audio data. If this data can be decoded by the standard Python `sndhdr' module, then the ! subtype will be automatically included in the Content-Type: header. Otherwise, you can specify the specific audio subtype via the _subtype parameter. If _subtype is not given, and no subtype can be --- 47,51 ---- _audiodata is a string containing the raw audio data. If this data can be decoded by the standard Python `sndhdr' module, then the ! subtype will be automatically included in the Content-Type header. Otherwise, you can specify the specific audio subtype via the _subtype parameter. If _subtype is not given, and no subtype can be *************** *** 56,64 **** Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any ! Content-Transfer-Encoding: or other headers to the message as necessary. The default encoding is Base64. Any additional keyword arguments are passed to the base class ! constructor, which turns them into parameters on the Content-Type: header. """ --- 56,64 ---- Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any ! Content-Transfer-Encoding or other headers to the message as necessary. The default encoding is Base64. Any additional keyword arguments are passed to the base class ! constructor, which turns them into parameters on the Content-Type header. """ *************** *** 67,71 **** if _subtype is None: raise TypeError, 'Could not find audio MIME subtype' ! MIMEBase.MIMEBase.__init__(self, 'audio', _subtype, **_params) self.set_payload(_audiodata) _encoder(self) --- 67,71 ---- if _subtype is None: raise TypeError, 'Could not find audio MIME subtype' ! MIMENonMultipart.__init__(self, 'audio', _subtype, **_params) self.set_payload(_audiodata) _encoder(self) Index: MIMEBase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEBase.py,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** MIMEBase.py 4 Oct 2001 17:05:11 -0000 1.4 --- MIMEBase.py 4 Oct 2002 17:24:24 -0000 1.4.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,9 **** """ ! import Message --- 5,9 ---- """ ! from email import Message Index: MIMEImage.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEImage.py,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** MIMEImage.py 4 Oct 2001 17:05:11 -0000 1.3 --- MIMEImage.py 4 Oct 2002 17:24:24 -0000 1.3.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 7,18 **** import imghdr ! # Intrapackage imports ! import MIMEBase ! import Errors ! import Encoders ! class MIMEImage(MIMEBase.MIMEBase): """Class for generating image/* type MIME documents.""" --- 7,17 ---- import imghdr ! from email import Errors ! from email import Encoders ! from email.MIMENonMultipart import MIMENonMultipart ! class MIMEImage(MIMENonMultipart): """Class for generating image/* type MIME documents.""" *************** *** 23,27 **** _imagedata is a string containing the raw image data. If this data can be decoded by the standard Python `imghdr' module, then the ! subtype will be automatically included in the Content-Type: header. Otherwise, you can specify the specific image subtype via the _subtype parameter. --- 22,26 ---- _imagedata is a string containing the raw image data. If this data can be decoded by the standard Python `imghdr' module, then the ! subtype will be automatically included in the Content-Type header. Otherwise, you can specify the specific image subtype via the _subtype parameter. *************** *** 31,39 **** Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any ! Content-Transfer-Encoding: or other headers to the message as necessary. The default encoding is Base64. Any additional keyword arguments are passed to the base class ! constructor, which turns them into parameters on the Content-Type: header. """ --- 30,38 ---- Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any ! Content-Transfer-Encoding or other headers to the message as necessary. The default encoding is Base64. Any additional keyword arguments are passed to the base class ! constructor, which turns them into parameters on the Content-Type header. """ *************** *** 42,46 **** if _subtype is None: raise TypeError, 'Could not guess image MIME subtype' ! MIMEBase.MIMEBase.__init__(self, 'image', _subtype, **_params) self.set_payload(_imagedata) _encoder(self) --- 41,45 ---- if _subtype is None: raise TypeError, 'Could not guess image MIME subtype' ! MIMENonMultipart.__init__(self, 'image', _subtype, **_params) self.set_payload(_imagedata) _encoder(self) Index: MIMEMessage.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEMessage.py,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** MIMEMessage.py 4 Oct 2001 17:05:11 -0000 1.3 --- MIMEMessage.py 4 Oct 2002 17:24:24 -0000 1.3.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,14 **** """ ! import Message ! import MIMEBase ! class MIMEMessage(MIMEBase.MIMEBase): """Class representing message/* MIME documents.""" --- 5,14 ---- """ ! from email import Message ! from email.MIMENonMultipart import MIMENonMultipart ! class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" *************** *** 23,28 **** the term "rfc822" is technically outdated by RFC 2822). """ ! MIMEBase.MIMEBase.__init__(self, 'message', _subtype) if not isinstance(_msg, Message.Message): raise TypeError, 'Argument is not an instance of Message' ! self.set_payload(_msg) --- 23,32 ---- the term "rfc822" is technically outdated by RFC 2822). """ ! MIMENonMultipart.__init__(self, 'message', _subtype) if not isinstance(_msg, Message.Message): raise TypeError, 'Argument is not an instance of Message' ! # It's convenient to use this base class method. We need to do it ! # this way or we'll get an exception ! Message.Message.attach(self, _msg) ! # And be sure our default type is set correctly ! self.set_default_type('message/rfc822') Index: MIMEText.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEText.py,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** MIMEText.py 4 Oct 2001 17:05:11 -0000 1.3 --- MIMEText.py 4 Oct 2002 17:24:24 -0000 1.3.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,18 **** """ ! import MIMEBase ! from Encoders import encode_7or8bit ! class MIMEText(MIMEBase.MIMEBase): """Class for generating text/* type MIME documents.""" def __init__(self, _text, _subtype='plain', _charset='us-ascii', ! _encoder=encode_7or8bit): """Create a text/* type MIME document. --- 5,19 ---- """ ! import warnings ! from email.MIMENonMultipart import MIMENonMultipart ! from email.Encoders import encode_7or8bit ! class MIMEText(MIMENonMultipart): """Class for generating text/* type MIME documents.""" def __init__(self, _text, _subtype='plain', _charset='us-ascii', ! _encoder=None): """Create a text/* type MIME document. *************** *** 22,41 **** _subtype is the MIME sub content type, defaulting to "plain". ! _charset is the character set parameter added to the Content-Type: ! header. This defaults to "us-ascii". ! _encoder is a function which will perform the actual encoding for ! transport of the text data. It takes one argument, which is this ! Text instance. It should use get_payload() and set_payload() to ! change the payload to the encoded form. It should also add any ! Content-Transfer-Encoding: or other headers to the message as ! necessary. The default encoding doesn't actually modify the payload, ! but it does set Content-Transfer-Encoding: to either `7bit' or `8bit' ! as appropriate. """ ! MIMEBase.MIMEBase.__init__(self, 'text', _subtype, ! **{'charset': _charset}) ! if _text and _text[-1] <> '\n': _text += '\n' ! self.set_payload(_text) ! _encoder(self) --- 23,48 ---- _subtype is the MIME sub content type, defaulting to "plain". ! _charset is the character set parameter added to the Content-Type ! header. This defaults to "us-ascii". Note that as a side-effect, the ! Content-Transfer-Encoding header will also be set. ! The use of the _encoder is deprecated. The encoding of the payload, ! and the setting of the character set parameter now happens implicitly ! based on the _charset argument. If _encoder is supplied, then a ! DeprecationWarning is used, and the _encoder functionality may ! override any header settings indicated by _charset. This is probably ! not what you want. """ ! MIMENonMultipart.__init__(self, 'text', _subtype, ! **{'charset': _charset}) ! if _text and not _text.endswith('\n'): _text += '\n' ! self.set_payload(_text, _charset) ! if _encoder is not None: ! warnings.warn('_encoder argument is obsolete.', ! DeprecationWarning, 2) ! # Because set_payload() with a _charset will set its own ! # Content-Transfer-Encoding header, we need to delete the ! # existing one or will end up with two of them. :( ! del self['content-transfer-encoding'] ! _encoder(self) Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** Message.py 24 Nov 2001 16:56:56 -0000 1.9 --- Message.py 4 Oct 2002 17:24:24 -0000 1.9.6.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,38 **** """ - from __future__ import generators - import re ! import base64 ! import quopri from cStringIO import StringIO ! from types import ListType # Intrapackage imports ! import Errors ! import Utils SEMISPACE = '; ' paramre = re.compile(r'\s*;\s*') class Message: ! """Basic message object for use inside the object tree. A message object is defined as something that has a bunch of RFC 2822 ! headers and a payload. If the body of the message is a multipart, then ! the payload is a list of Messages, otherwise it is a string. ! These objects implement part of the `mapping' interface, which assumes there is exactly one occurrance of the header per message. Some headers ! do in fact appear multiple times (e.g. Received:) and for those headers, you must use the explicit API to set or get all the headers. Not all of the mapping methods are implemented. - """ def __init__(self): --- 5,83 ---- """ import re ! import warnings from cStringIO import StringIO ! from types import ListType, TupleType, StringType # Intrapackage imports ! from email import Errors ! from email import Utils ! from email import Charset SEMISPACE = '; ' + + try: + True, False + except NameError: + True = 1 + False = 0 + + # Regular expression used to split header parameters. BAW: this may be too + # simple. It isn't strictly RFC 2045 (section 5.1) compliant, but it catches + # most headers found in the wild. We may eventually need a full fledged + # parser eventually. paramre = re.compile(r'\s*;\s*') + # Regular expression that matches `special' characters in parameters, the + # existance of which force quoting of the parameter value. + tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') + + + + # Helper functions + def _formatparam(param, value=None, quote=True): + """Convenience function to format and return a key=value pair. + + This will quote the value if needed or if quote is true. + """ + if value is not None and len(value) > 0: + # TupleType is used for RFC 2231 encoded parameter values where items + # are (charset, language, value). charset is a string, not a Charset + # instance. + if isinstance(value, TupleType): + # Encode as per RFC 2231 + param += '*' + value = Utils.encode_rfc2231(value[2], value[0], value[1]) + # BAW: Please check this. I think that if quote is set it should + # force quoting even if not necessary. + if quote or tspecials.search(value): + return '%s="%s"' % (param, Utils.quote(value)) + else: + return '%s=%s' % (param, value) + else: + return param + + + def _unquotevalue(value): + if isinstance(value, TupleType): + return value[0], value[1], Utils.unquote(value[2]) + else: + return Utils.unquote(value) class Message: ! """Basic message object. A message object is defined as something that has a bunch of RFC 2822 ! headers and a payload. It may optionally have an envelope header ! (a.k.a. Unix-From or From_ header). If the message is a container (i.e. a ! multipart or a message/rfc822), then the payload is a list of Message ! objects, otherwise it is a string. ! Message objects implement part of the `mapping' interface, which assumes there is exactly one occurrance of the header per message. Some headers ! do in fact appear multiple times (e.g. Received) and for those headers, you must use the explicit API to set or get all the headers. Not all of the mapping methods are implemented. """ def __init__(self): *************** *** 40,68 **** self._unixfrom = None self._payload = None # Defaults for multipart messages self.preamble = self.epilogue = None def __str__(self): """Return the entire formatted message as a string. ! This includes the headers, body, and `unixfrom' line. """ ! return self.as_string(unixfrom=1) ! def as_string(self, unixfrom=0): """Return the entire formatted message as a string. ! Optional `unixfrom' when true, means include the Unix From_ envelope header. """ ! from Generator import Generator fp = StringIO() g = Generator(fp) ! g(self, unixfrom=unixfrom) return fp.getvalue() def is_multipart(self): ! """Return true if the message consists of multiple parts.""" ! if type(self._payload) is ListType: ! return 1 ! return 0 # --- 85,116 ---- self._unixfrom = None self._payload = None + self._charset = None # Defaults for multipart messages self.preamble = self.epilogue = None + # Default content type + self._default_type = 'text/plain' def __str__(self): """Return the entire formatted message as a string. ! This includes the headers, body, and envelope header. """ ! return self.as_string(unixfrom=True) ! def as_string(self, unixfrom=False): """Return the entire formatted message as a string. ! Optional `unixfrom' when True, means include the Unix From_ envelope header. """ ! from email.Generator import Generator fp = StringIO() g = Generator(fp) ! g.flatten(self, unixfrom=unixfrom) return fp.getvalue() def is_multipart(self): ! """Return True if the message consists of multiple parts.""" ! if isinstance(self._payload, ListType): ! return True ! return False # *************** *** 83,116 **** If the current payload is empty, then the current payload will be made a scalar, set to the given value. """ if self._payload is None: self._payload = payload ! elif type(self._payload) is ListType: self._payload.append(payload) elif self.get_main_type() not in (None, 'multipart'): raise Errors.MultipartConversionError( ! 'Message main Content-Type: must be "multipart" or missing') else: self._payload = [self._payload, payload] ! # A useful synonym ! attach = add_payload ! def get_payload(self, i=None, decode=0): ! """Return the current payload exactly as is. ! Optional i returns that index into the payload. ! Optional decode is a flag indicating whether the payload should be ! decoded or not, according to the Content-Transfer-Encoding: header. ! When true and the message is not a multipart, the payload will be ! decoded if this header's value is `quoted-printable' or `base64'. If ! some other encoding is used, or the header is missing, the payload is ! returned as-is (undecoded). If the message is a multipart and the ! decode flag is true, then None is returned. """ if i is None: payload = self._payload ! elif type(self._payload) is not ListType: raise TypeError, i else: --- 131,180 ---- If the current payload is empty, then the current payload will be made a scalar, set to the given value. + + Note: This method is deprecated. Use .attach() instead. """ + warnings.warn('add_payload() is deprecated, use attach() instead.', + DeprecationWarning, 2) if self._payload is None: self._payload = payload ! elif isinstance(self._payload, ListType): self._payload.append(payload) elif self.get_main_type() not in (None, 'multipart'): raise Errors.MultipartConversionError( ! 'Message main content type must be "multipart" or missing') else: self._payload = [self._payload, payload] ! def attach(self, payload): ! """Add the given payload to the current payload. ! The current payload will always be a list of objects after this method ! is called. If you want to set the payload to a scalar object, use ! set_payload() instead. ! """ ! if self._payload is None: ! self._payload = [payload] ! else: ! self._payload.append(payload) ! def get_payload(self, i=None, decode=False): ! """Return a reference to the payload. ! The payload will either be a list object or a string. If you mutate ! the list object, you modify the message's payload in place. Optional ! i returns that index into the payload. ! ! Optional decode is a flag (defaulting to False) indicating whether the ! payload should be decoded or not, according to the ! Content-Transfer-Encoding header. When True and the message is not a ! multipart, the payload will be decoded if this header's value is ! `quoted-printable' or `base64'. If some other encoding is used, or ! the header is missing, the payload is returned as-is (undecoded). If ! the message is a multipart and the decode flag is True, then None is ! returned. """ if i is None: payload = self._payload ! elif not isinstance(self._payload, ListType): raise TypeError, i else: *************** *** 128,135 **** return payload ! def set_payload(self, payload): ! """Set the payload to the given value.""" self._payload = payload # --- 192,249 ---- return payload + def set_payload(self, payload, charset=None): + """Set the payload to the given value. ! Optional charset sets the message's default character set. See ! set_charset() for details. ! """ self._payload = payload + if charset is not None: + self.set_charset(charset) + + def set_charset(self, charset): + """Set the charset of the payload to a given character set. + + charset can be a Charset instance, a string naming a character set, or + None. If it is a string it will be converted to a Charset instance. + If charset is None, the charset parameter will be removed from the + Content-Type field. Anything else will generate a TypeError. + + The message will be assumed to be of type text/* encoded with + charset.input_charset. It will be converted to charset.output_charset + and encoded properly, if needed, when generating the plain text + representation of the message. MIME headers (MIME-Version, + Content-Type, Content-Transfer-Encoding) will be added as needed. + + """ + if charset is None: + self.del_param('charset') + self._charset = None + return + if isinstance(charset, StringType): + charset = Charset.Charset(charset) + if not isinstance(charset, Charset.Charset): + raise TypeError, charset + # BAW: should we accept strings that can serve as arguments to the + # Charset constructor? + self._charset = charset + if not self.has_key('MIME-Version'): + self.add_header('MIME-Version', '1.0') + if not self.has_key('Content-Type'): + self.add_header('Content-Type', 'text/plain', + charset=charset.get_output_charset()) + else: + self.set_param('charset', charset.get_output_charset()) + if not self.has_key('Content-Transfer-Encoding'): + cte = charset.get_body_encoding() + if callable(cte): + cte(self) + else: + self.add_header('Content-Transfer-Encoding', cte) + + def get_charset(self): + """Return the Charset instance associated with the message's payload. + """ + return self._charset # *************** *** 171,176 **** self._headers = newheaders ! def __contains__(self, key): ! return key.lower() in [k.lower() for k, v in self._headers] def has_key(self, name): --- 285,290 ---- self._headers = newheaders ! def __contains__(self, name): ! return name.lower() in [k.lower() for k, v in self._headers] def has_key(self, name): *************** *** 183,188 **** These will be sorted in the order they appeared in the original ! message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. """ return [k for k, v in self._headers] --- 297,303 ---- These will be sorted in the order they appeared in the original ! message, or were added to the message, and may contain duplicates. ! Any fields deleted and re-inserted are always appended to the header ! list. """ return [k for k, v in self._headers] *************** *** 192,197 **** These will be sorted in the order they appeared in the original ! message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. """ return [v for k, v in self._headers] --- 307,313 ---- These will be sorted in the order they appeared in the original ! message, or were added to the message, and may contain duplicates. ! Any fields deleted and re-inserted are always appended to the header ! list. """ return [v for k, v in self._headers] *************** *** 201,206 **** These will be sorted in the order they appeared in the original ! message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. """ return self._headers[:] --- 317,323 ---- These will be sorted in the order they appeared in the original ! message, or were added to the message, and may contain duplicates. ! Any fields deleted and re-inserted are always appended to the header ! list. """ return self._headers[:] *************** *** 251,255 **** msg.add_header('content-disposition', 'attachment', filename='bud.gif') - """ parts = [] --- 368,371 ---- *************** *** 258,271 **** parts.append(k.replace('_', '-')) else: ! parts.append('%s="%s"' % (k.replace('_', '-'), v)) if _value is not None: parts.insert(0, _value) self._headers.append((_name, SEMISPACE.join(parts))) def get_type(self, failobj=None): """Returns the message's content type. The returned string is coerced to lowercase and returned as a single ! string of the form `maintype/subtype'. If there was no Content-Type: header in the message, failobj is returned (defaults to None). """ --- 374,407 ---- parts.append(k.replace('_', '-')) else: ! parts.append(_formatparam(k.replace('_', '-'), v)) if _value is not None: parts.insert(0, _value) self._headers.append((_name, SEMISPACE.join(parts))) + def replace_header(self, _name, _value): + """Replace a header. + + Replace the first matching header found in the message, retaining + header order and case. If no matching header was found, a KeyError is + raised. + """ + _name = _name.lower() + for i, (k, v) in zip(range(len(self._headers)), self._headers): + if k.lower() == _name: + self._headers[i] = (k, _value) + break + else: + raise KeyError, _name + + # + # These methods are silently deprecated in favor of get_content_type() and + # friends (see below). They will be noisily deprecated in email 3.0. + # + def get_type(self, failobj=None): """Returns the message's content type. The returned string is coerced to lowercase and returned as a single ! string of the form `maintype/subtype'. If there was no Content-Type header in the message, failobj is returned (defaults to None). """ *************** *** 274,278 **** if value is missing: return failobj ! return paramre.split(value)[0].lower() def get_main_type(self, failobj=None): --- 410,414 ---- if value is missing: return failobj ! return paramre.split(value)[0].lower().strip() def get_main_type(self, failobj=None): *************** *** 282,289 **** if ctype is missing: return failobj ! parts = ctype.split('/') ! if len(parts) > 0: ! return ctype.split('/')[0] ! return failobj def get_subtype(self, failobj=None): --- 418,424 ---- if ctype is missing: return failobj ! if ctype.count('/') <> 1: ! return failobj ! return ctype.split('/')[0] def get_subtype(self, failobj=None): *************** *** 293,300 **** if ctype is missing: return failobj ! parts = ctype.split('/') ! if len(parts) > 1: ! return ctype.split('/')[1] ! return failobj def _get_params_preserve(self, failobj, header): --- 428,498 ---- if ctype is missing: return failobj ! if ctype.count('/') <> 1: ! return failobj ! return ctype.split('/')[1] ! ! # ! # Use these three methods instead of the three above. ! # ! ! def get_content_type(self): ! """Return the message's content type. ! ! The returned string is coerced to lower case of the form ! `maintype/subtype'. If there was no Content-Type header in the ! message, the default type as given by get_default_type() will be ! returned. Since according to RFC 2045, messages always have a default ! type this will always return a value. ! ! RFC 2045 defines a message's default type to be text/plain unless it ! appears inside a multipart/digest container, in which case it would be ! message/rfc822. ! """ ! missing = [] ! value = self.get('content-type', missing) ! if value is missing: ! # This should have no parameters ! return self.get_default_type() ! ctype = paramre.split(value)[0].lower().strip() ! # RFC 2045, section 5.2 says if its invalid, use text/plain ! if ctype.count('/') <> 1: ! return 'text/plain' ! return ctype ! ! def get_content_maintype(self): ! """Return the message's main content type. ! ! This is the `maintype' part of the string returned by ! get_content_type(). ! """ ! ctype = self.get_content_type() ! return ctype.split('/')[0] ! ! def get_content_subtype(self): ! """Returns the message's sub-content type. ! ! This is the `subtype' part of the string returned by ! get_content_type(). ! """ ! ctype = self.get_content_type() ! return ctype.split('/')[1] ! ! def get_default_type(self): ! """Return the `default' content type. ! ! Most messages have a default content type of text/plain, except for ! messages that are subparts of multipart/digest containers. Such ! subparts have a default content type of message/rfc822. ! """ ! return self._default_type ! ! def set_default_type(self, ctype): ! """Set the `default' content type. ! ! ctype should be either "text/plain" or "message/rfc822", although this ! is not enforced. The default content type is not stored in the ! Content-Type header. ! """ ! self._default_type = ctype def _get_params_preserve(self, failobj, header): *************** *** 309,331 **** try: name, val = p.split('=', 1) except ValueError: # Must have been a bare attribute ! name = p val = '' params.append((name, val)) return params ! def get_params(self, failobj=None, header='content-type'): ! """Return the message's Content-Type: parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as split on the `=' sign. The left hand side of the `=' is the key, while the right hand side is the value. If there is no `=' sign in ! the parameter the value is the empty string. The value is always ! unquoted. ! Optional failobj is the object to return if there is no Content-Type: header. Optional header is the header to search instead of ! Content-Type: """ missing = [] --- 507,532 ---- try: name, val = p.split('=', 1) + name = name.strip() + val = val.strip() except ValueError: # Must have been a bare attribute ! name = p.strip() val = '' params.append((name, val)) + params = Utils.decode_params(params) return params ! def get_params(self, failobj=None, header='content-type', unquote=True): ! """Return the message's Content-Type parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as split on the `=' sign. The left hand side of the `=' is the key, while the right hand side is the value. If there is no `=' sign in ! the parameter the value is the empty string. The value is as ! described in the get_param() method. ! Optional failobj is the object to return if there is no Content-Type header. Optional header is the header to search instead of ! Content-Type. If unquote is True, the value is unquoted. """ missing = [] *************** *** 333,347 **** if params is missing: return failobj ! return [(k, Utils.unquote(v)) for k, v in params] ! def get_param(self, param, failobj=None, header='content-type'): ! """Return the parameter value if found in the Content-Type: header. ! Optional failobj is the object to return if there is no Content-Type: ! header. Optional header is the header to search instead of ! Content-Type: ! Parameter keys are always compared case insensitively. Values are ! always unquoted. """ if not self.has_key(header): --- 534,564 ---- if params is missing: return failobj ! if unquote: ! return [(k, _unquotevalue(v)) for k, v in params] ! else: ! return params ! def get_param(self, param, failobj=None, header='content-type', ! unquote=True): ! """Return the parameter value if found in the Content-Type header. ! Optional failobj is the object to return if there is no Content-Type ! header, or the Content-Type header has no such parameter. Optional ! header is the header to search instead of Content-Type. ! Parameter keys are always compared case insensitively. The return ! value can either be a string, or a 3-tuple if the parameter was RFC ! 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty ! string. Your application should be prepared to deal with these, and ! can convert the parameter to a Unicode string like so: ! ! param = msg.get_param('foo') ! if isinstance(param, tuple): ! param = unicode(param[2], param[0]) ! ! In any case, the parameter value (either the returned string, or the ! VALUE item in the 3-tuple) is always unquoted, unless unquote is set ! to False. """ if not self.has_key(header): *************** *** 349,359 **** for k, v in self._get_params_preserve(failobj, header): if k.lower() == param.lower(): ! return Utils.unquote(v) return failobj def get_filename(self, failobj=None): """Return the filename associated with the payload if present. ! The filename is extracted from the Content-Disposition: header's `filename' parameter, and it is unquoted. """ --- 566,681 ---- for k, v in self._get_params_preserve(failobj, header): if k.lower() == param.lower(): ! if unquote: ! return _unquotevalue(v) ! else: ! return v return failobj + def set_param(self, param, value, header='Content-Type', requote=True, + charset=None, language=''): + """Set a parameter in the Content-Type header. + + If the parameter already exists in the header, its value will be + replaced with the new value. + + If header is Content-Type and has not yet been defined for this + message, it will be set to "text/plain" and the new parameter and + value will be appended as per RFC 2045. + + An alternate header can specified in the header argument, and all + parameters will be quoted as necessary unless requote is False. + + If charset is specified, the parameter will be encoded according to RFC + 2231. Optional language specifies the RFC 2231 language, defaulting + to the empty string. Both charset and language should be strings. + """ + if not isinstance(value, TupleType) and charset: + value = (charset, language, value) + + if not self.has_key(header) and header.lower() == 'content-type': + ctype = 'text/plain' + else: + ctype = self.get(header) + if not self.get_param(param, header=header): + if not ctype: + ctype = _formatparam(param, value, requote) + else: + ctype = SEMISPACE.join( + [ctype, _formatparam(param, value, requote)]) + else: + ctype = '' + for old_param, old_value in self.get_params(header=header, + unquote=requote): + append_param = '' + if old_param.lower() == param.lower(): + append_param = _formatparam(param, value, requote) + else: + append_param = _formatparam(old_param, old_value, requote) + if not ctype: + ctype = append_param + else: + ctype = SEMISPACE.join([ctype, append_param]) + if ctype <> self.get(header): + del self[header] + self[header] = ctype + + def del_param(self, param, header='content-type', requote=True): + """Remove the given parameter completely from the Content-Type header. + + The header will be re-written in place without the parameter or its + value. All values will be quoted as necessary unless requote is + False. Optional header specifies an alternative to the Content-Type + header. + """ + if not self.has_key(header): + return + new_ctype = '' + for p, v in self.get_params(header, unquote=requote): + if p.lower() <> param.lower(): + if not new_ctype: + new_ctype = _formatparam(p, v, requote) + else: + new_ctype = SEMISPACE.join([new_ctype, + _formatparam(p, v, requote)]) + if new_ctype <> self.get(header): + del self[header] + self[header] = new_ctype + + def set_type(self, type, header='Content-Type', requote=True): + """Set the main type and subtype for the Content-Type header. + + type must be a string in the form "maintype/subtype", otherwise a + ValueError is raised. + + This method replaces the Content-Type header, keeping all the + parameters in place. If requote is False, this leaves the existing + header's quoting as is. Otherwise, the parameters will be quoted (the + default). + + An alternative header can be specified in the header argument. When + the Content-Type header is set, we'll always also add a MIME-Version + header. + """ + # BAW: should we be strict? + if not type.count('/') == 1: + raise ValueError + # Set the Content-Type, you get a MIME-Version + if header.lower() == 'content-type': + del self['mime-version'] + self['MIME-Version'] = '1.0' + if not self.has_key(header): + self[header] = type + return + params = self.get_params(header, unquote=requote) + del self[header] + self[header] = type + # Skip the first param; it's the old type. + for p, v in params[1:]: + self.set_param(p, v, header, requote) + def get_filename(self, failobj=None): """Return the filename associated with the payload if present. ! The filename is extracted from the Content-Disposition header's `filename' parameter, and it is unquoted. """ *************** *** 362,371 **** if filename is missing: return failobj ! return Utils.unquote(filename.strip()) def get_boundary(self, failobj=None): """Return the boundary associated with the payload if present. ! The boundary is extracted from the Content-Type: header's `boundary' parameter, and it is unquoted. """ --- 684,699 ---- if filename is missing: return failobj ! if isinstance(filename, TupleType): ! # It's an RFC 2231 encoded parameter ! newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0]) ! else: ! newvalue = _unquotevalue(filename.strip()) ! return newvalue def get_boundary(self, failobj=None): """Return the boundary associated with the payload if present. ! The boundary is extracted from the Content-Type header's `boundary' parameter, and it is unquoted. """ *************** *** 374,409 **** if boundary is missing: return failobj ! return Utils.unquote(boundary.strip()) def set_boundary(self, boundary): ! """Set the boundary parameter in Content-Type: to 'boundary'. ! This is subtly different than deleting the Content-Type: header and adding a new one with a new boundary parameter via add_header(). The main difference is that using the set_boundary() method preserves the ! order of the Content-Type: header in the original message. ! HeaderParseError is raised if the message has no Content-Type: header. """ missing = [] params = self._get_params_preserve(missing, 'content-type') if params is missing: ! # There was no Content-Type: header, and we don't know what type # to set it to, so raise an exception. ! raise Errors.HeaderParseError, 'No Content-Type: header found' newparams = [] ! foundp = 0 for pk, pv in params: if pk.lower() == 'boundary': newparams.append(('boundary', '"%s"' % boundary)) ! foundp = 1 else: newparams.append((pk, pv)) if not foundp: ! # The original Content-Type: header had no boundary attribute. # Tack one one the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) ! # Replace the existing Content-Type: header with the new value newheaders = [] for h, v in self._headers: --- 702,740 ---- if boundary is missing: return failobj ! if isinstance(boundary, TupleType): ! # RFC 2231 encoded, so decode. It better end up as ascii ! return unicode(boundary[2], boundary[0]).encode('us-ascii') ! return _unquotevalue(boundary.strip()) def set_boundary(self, boundary): ! """Set the boundary parameter in Content-Type to 'boundary'. ! This is subtly different than deleting the Content-Type header and adding a new one with a new boundary parameter via add_header(). The main difference is that using the set_boundary() method preserves the ! order of the Content-Type header in the original message. ! HeaderParseError is raised if the message has no Content-Type header. """ missing = [] params = self._get_params_preserve(missing, 'content-type') if params is missing: ! # There was no Content-Type header, and we don't know what type # to set it to, so raise an exception. ! raise Errors.HeaderParseError, 'No Content-Type header found' newparams = [] ! foundp = False for pk, pv in params: if pk.lower() == 'boundary': newparams.append(('boundary', '"%s"' % boundary)) ! foundp = True else: newparams.append((pk, pv)) if not foundp: ! # The original Content-Type header had no boundary attribute. # Tack one one the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) ! # Replace the existing Content-Type header with the new value newheaders = [] for h, v in self._headers: *************** *** 421,445 **** self._headers = newheaders ! def walk(self): ! """Walk over the message tree, yielding each subpart. ! The walk is performed in depth-first order. This method is a ! generator. """ ! yield self ! if self.is_multipart(): ! for subpart in self.get_payload(): ! for subsubpart in subpart.walk(): ! yield subsubpart def get_charsets(self, failobj=None): """Return a list containing the charset(s) used in this message. ! The returned list of items describes the Content-Type: headers' charset parameter for this message and all the subparts in its payload. Each item will either be a string (the value of the charset parameter ! in the Content-Type: header of that part) or the value of the 'failobj' parameter (defaults to None), if the part does not have a main MIME type of "text", or the charset is not defined. --- 752,785 ---- self._headers = newheaders ! try: ! from email._compat22 import walk ! except SyntaxError: ! # Must be using Python 2.1 ! from email._compat21 import walk ! def get_content_charset(self, failobj=None): ! """Return the charset parameter of the Content-Type header. ! ! If there is no Content-Type header, or if that header has no charset ! parameter, failobj is returned. """ ! missing = [] ! charset = self.get_param('charset', missing) ! if charset is missing: ! return failobj ! if isinstance(charset, TupleType): ! # RFC 2231 encoded, so decode it, and it better end up as ascii. ! return unicode(charset[2], charset[0]).encode('us-ascii') ! return charset def get_charsets(self, failobj=None): """Return a list containing the charset(s) used in this message. ! The returned list of items describes the Content-Type headers' charset parameter for this message and all the subparts in its payload. Each item will either be a string (the value of the charset parameter ! in the Content-Type header of that part) or the value of the 'failobj' parameter (defaults to None), if the part does not have a main MIME type of "text", or the charset is not defined. *************** *** 449,451 **** message will still return a list of length 1. """ ! return [part.get_param('charset', failobj) for part in self.walk()] --- 789,791 ---- message will still return a list of length 1. """ ! return [part.get_content_charset(failobj) for part in self.walk()] Index: Parser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Parser.py,v retrieving revision 1.5.10.1 retrieving revision 1.5.10.2 diff -C2 -d -r1.5.10.1 -r1.5.10.2 *** Parser.py 28 Jan 2002 15:27:20 -0000 1.5.10.1 --- Parser.py 4 Oct 2002 17:24:24 -0000 1.5.10.2 *************** *** 5,22 **** """ from cStringIO import StringIO from types import ListType ! # Intrapackage imports ! import Errors ! import Message EMPTYSTRING = '' NL = '\n' class Parser: ! def __init__(self, _class=Message.Message): """Parser of RFC 2822 and MIME email messages. --- 5,28 ---- """ + import re from cStringIO import StringIO from types import ListType ! from email import Errors ! from email import Message EMPTYSTRING = '' NL = '\n' + try: + True, False + except NameError: + True = 1 + False = 0 + class Parser: ! def __init__(self, _class=Message.Message, strict=False): """Parser of RFC 2822 and MIME email messages. *************** *** 33,47 **** must be created. This class must have a constructor that can take zero arguments. Default is Message.Message. """ self._class = _class ! def parse(self, fp): root = self._class() self._parseheaders(root, fp) ! self._parsebody(root, fp) return root ! def parsestr(self, text): ! return self.parse(StringIO(text)) def _parseheaders(self, container, fp): --- 39,75 ---- must be created. This class must have a constructor that can take zero arguments. Default is Message.Message. + + Optional strict tells the parser to be strictly RFC compliant or to be + more forgiving in parsing of ill-formatted MIME documents. When + non-strict mode is used, the parser will try to make up for missing or + erroneous boundaries and other peculiarities seen in the wild. + Default is non-strict parsing. """ self._class = _class + self._strict = strict ! def parse(self, fp, headersonly=False): ! """Create a message structure from the data in a file. ! ! Reads all the data from the file and returns the root of the message ! structure. Optional headersonly is a flag specifying whether to stop ! parsing after reading the headers or not. The default is False, ! meaning it parses the entire contents of the file. ! """ root = self._class() self._parseheaders(root, fp) ! if not headersonly: ! self._parsebody(root, fp) return root ! def parsestr(self, text, headersonly=False): ! """Create a message structure from a string. ! ! Returns the root of the message structure. Optional headersonly is a ! flag specifying whether to stop parsing after reading the headers or ! not. The default is False, meaning it parses the entire contents of ! the file. ! """ ! return self.parse(StringIO(text), headersonly=headersonly) def _parseheaders(self, container, fp): *************** *** 51,58 **** lastvalue = [] lineno = 0 ! while 1: ! line = fp.readline()[:-1] ! if not line or not line.strip(): break lineno += 1 # Check for initial Unix From_ line --- 79,93 ---- lastvalue = [] lineno = 0 ! while True: ! # Don't strip the line before we test for the end condition, ! # because whitespace-only header lines are RFC compliant ! # continuation lines. ! line = fp.readline() ! if not line: break + line = line.splitlines()[0] + if not line: + break + # Ignore the trailing newline lineno += 1 # Check for initial Unix From_ line *************** *** 61,68 **** container.set_unixfrom(line) continue ! else: raise Errors.HeaderParseError( 'Unix-from in headers after first rfc822 header') ! # # Header continuation line if line[0] in ' \t': --- 96,106 ---- container.set_unixfrom(line) continue ! elif self._strict: raise Errors.HeaderParseError( 'Unix-from in headers after first rfc822 header') ! else: ! # ignore the wierdly placed From_ line ! # XXX: maybe set unixfrom anyway? or only if not already? ! continue # Header continuation line if line[0] in ' \t': *************** *** 79,84 **** i = line.find(':') if i < 0: ! raise Errors.HeaderParseError( ! 'Not a header, not a continuation') if lastheader: container[lastheader] = NL.join(lastvalue) --- 117,129 ---- i = line.find(':') if i < 0: ! if self._strict: ! raise Errors.HeaderParseError( ! "Not a header, not a continuation: ``%s''"%line) ! elif lineno == 1 and line.startswith('--'): ! # allow through duplicate boundary tags. ! continue ! else: ! raise Errors.HeaderParseError( ! "Not a header, not a continuation: ``%s''"%line) if lastheader: container[lastheader] = NL.join(lastvalue) *************** *** 101,143 **** preamble = epilogue = None # Split into subparts. The first boundary we're looking for won't ! # have the leading newline since we're at the start of the body ! # text. separator = '--' + boundary payload = fp.read() ! start = payload.find(separator) ! if start < 0: ! raise Errors.BoundaryError( ! "Couldn't find starting boundary: %s" % boundary) if start > 0: # there's some pre-MIME boundary preamble preamble = payload[0:start] ! start += len(separator) + 1 + isdigest ! terminator = payload.find('\n' + separator + '--', start) ! if terminator < 0: raise Errors.BoundaryError( ! "Couldn't find terminating boundary: %s" % boundary) ! if terminator+len(separator)+3 < len(payload): ! # there's some post-MIME boundary epilogue ! epilogue = payload[terminator+len(separator)+3:] # We split the textual payload on the boundary separator, which ! # includes the trailing newline. If the container is a # multipart/digest then the subparts are by default message/rfc822 ! # instead of text/plain. In that case, they'll have an extra ! # newline before the headers to distinguish the message's headers ! # from the subpart headers. ! if isdigest: ! separator += '\n\n' ! else: ! separator += '\n' ! parts = payload[start:terminator].split('\n' + separator) for part in parts: ! msgobj = self.parsestr(part) container.preamble = preamble container.epilogue = epilogue ! # Ensure that the container's payload is a list ! if not isinstance(container.get_payload(), ListType): ! container.set_payload([msgobj]) ! else: ! container.add_payload(msgobj) elif container.get_type() == 'message/delivery-status': # This special kind of type contains blocks of headers separated --- 146,236 ---- preamble = epilogue = None # Split into subparts. The first boundary we're looking for won't ! # always have a leading newline since we're at the start of the ! # body text, and there's not always a preamble before the first ! # boundary. separator = '--' + boundary payload = fp.read() ! # We use an RE here because boundaries can have trailing ! # whitespace. ! mo = re.search( ! r'(?P' + re.escape(separator) + r')(?P[ \t]*)', ! payload) ! if not mo: ! if self._strict: ! raise Errors.BoundaryError( ! "Couldn't find starting boundary: %s" % boundary) ! container.set_payload(payload) ! return ! start = mo.start() if start > 0: # there's some pre-MIME boundary preamble preamble = payload[0:start] ! # Find out what kind of line endings we're using ! start += len(mo.group('sep')) + len(mo.group('ws')) ! cre = re.compile('\r\n|\r|\n') ! mo = cre.search(payload, start) ! if mo: ! start += len(mo.group(0)) ! # We create a compiled regexp first because we need to be able to ! # specify the start position, and the module function doesn't ! # support this signature. :( ! cre = re.compile('(?P\r\n|\r|\n)' + ! re.escape(separator) + '--') ! mo = cre.search(payload, start) ! if mo: ! terminator = mo.start() ! linesep = mo.group('sep') ! if mo.end() < len(payload): ! # There's some post-MIME boundary epilogue ! epilogue = payload[mo.end():] ! elif self._strict: raise Errors.BoundaryError( ! "Couldn't find terminating boundary: %s" % boundary) ! else: ! # Handle the case of no trailing boundary. Check that it ends ! # in a blank line. Some cases (spamspamspam) don't even have ! # that! ! mo = re.search('(?P\r\n|\r|\n){2}$', payload) ! if not mo: ! mo = re.search('(?P\r\n|\r|\n)$', payload) ! if not mo: ! raise Errors.BoundaryError( ! 'No terminating boundary and no trailing empty line') ! linesep = mo.group('sep') ! terminator = len(payload) # We split the textual payload on the boundary separator, which ! # includes the trailing newline. If the container is a # multipart/digest then the subparts are by default message/rfc822 ! # instead of text/plain. In that case, they'll have a optional ! # block of MIME headers, then an empty line followed by the ! # message headers. ! parts = re.split( ! linesep + re.escape(separator) + r'[ \t]*' + linesep, ! payload[start:terminator]) for part in parts: ! if isdigest: ! if part[0] == linesep: ! # There's no header block so create an empty message ! # object as the container, and lop off the newline so ! # we can parse the sub-subobject ! msgobj = self._class() ! part = part[1:] ! else: ! parthdrs, part = part.split(linesep+linesep, 1) ! # msgobj in this case is the "message/rfc822" container ! msgobj = self.parsestr(parthdrs, headersonly=1) ! # while submsgobj is the message itself ! submsgobj = self.parsestr(part) ! msgobj.attach(submsgobj) ! msgobj.set_default_type('message/rfc822') ! else: ! msgobj = self.parsestr(part) container.preamble = preamble container.epilogue = epilogue ! container.attach(msgobj) ! elif container.get_main_type() == 'multipart': ! # Very bad. A message is a multipart with no boundary! ! raise Errors.BoundaryError( ! 'multipart message with no defined boundary') elif container.get_type() == 'message/delivery-status': # This special kind of type contains blocks of headers separated *************** *** 145,149 **** # separate Message object blocks = [] ! while 1: blockmsg = self._class() self._parseheaders(blockmsg, fp) --- 238,242 ---- # separate Message object blocks = [] ! while True: blockmsg = self._class() self._parseheaders(blockmsg, fp) *************** *** 161,167 **** msg = self._class() self._parsebody(msg, fp) ! container.add_payload(msg) else: ! container.add_payload(fp.read()) --- 254,260 ---- msg = self._class() self._parsebody(msg, fp) ! container.attach(msg) else: ! container.set_payload(fp.read()) Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** Utils.py 3 Dec 2001 19:26:40 -0000 1.9 --- Utils.py 4 Oct 2002 17:24:24 -0000 1.9.6.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 6,24 **** import time import re ! from rfc822 import unquote, quote, parseaddr ! from rfc822 import dump_address_pair ! from rfc822 import AddrlistClass as _AddrlistClass ! from rfc822 import parsedate_tz, parsedate, mktime_tz - from quopri import decodestring as _qdecode import base64 # Intrapackage imports ! from Encoders import _bencode, _qencode COMMASPACE = ', ' UEMPTYSTRING = u'' --- 6,60 ---- import time + import socket import re + import random + import os + import warnings + from cStringIO import StringIO + from types import ListType ! from rfc822 import quote ! from rfc822 import AddressList as _AddressList ! from rfc822 import mktime_tz ! ! # We need wormarounds for bugs in these methods in older Pythons (see below) ! from rfc822 import parsedate as _parsedate ! from rfc822 import parsedate_tz as _parsedate_tz ! ! try: ! True, False ! except NameError: ! True = 1 ! False = 0 ! ! try: ! from quopri import decodestring as _qdecode ! except ImportError: ! # Python 2.1 doesn't have quopri.decodestring() ! def _qdecode(s): ! import quopri as _quopri ! ! if not s: ! return s ! infp = StringIO(s) ! outfp = StringIO() ! _quopri.decode(infp, outfp) ! value = outfp.getvalue() ! if not s.endswith('\n') and value.endswith('\n'): ! return value[:-1] ! return value import base64 # Intrapackage imports ! from email.Encoders import _bencode, _qencode COMMASPACE = ', ' + EMPTYSTRING = '' UEMPTYSTRING = u'' + CRLF = '\r\n' + + specialsre = re.compile(r'[][\()<>@,:;".]') + escapesre = re.compile(r'[][\()"]') *************** *** 37,43 **** if not s: return s - hasnewline = (s[-1] == '\n') value = base64.decodestring(s) ! if not hasnewline and value[-1] == '\n': return value[:-1] return value --- 73,78 ---- if not s: return s value = base64.decodestring(s) ! if not s.endswith('\n') and value.endswith('\n'): return value[:-1] return value *************** *** 45,53 **** def getaddresses(fieldvalues): """Return a list of (REALNAME, EMAIL) for each fieldvalue.""" all = COMMASPACE.join(fieldvalues) ! a = _AddrlistClass(all) ! return a.getaddrlist() --- 80,123 ---- + def fix_eols(s): + """Replace all line-ending characters with \r\n.""" + # Fix newlines with no preceding carriage return + s = re.sub(r'(?', name) + return '%s%s%s <%s>' % (quotes, name, quotes, address) + return address + + # For backwards compatibility + def dump_address_pair(pair): + warnings.warn('Use email.Utils.formataddr() instead', + DeprecationWarning, 2) + return formataddr(pair) + + + def getaddresses(fieldvalues): """Return a list of (REALNAME, EMAIL) for each fieldvalue.""" all = COMMASPACE.join(fieldvalues) ! a = _AddressList(all) ! return a.addresslist *************** *** 65,92 **** def decode(s): ! """Return a decoded string according to RFC 2047, as a unicode string.""" rtn = [] ! parts = ecre.split(s, 1) ! while parts: ! # If there are less than 4 parts, it can't be encoded and we're done ! if len(parts) < 5: ! rtn.extend(parts) ! break ! # The first element is any non-encoded leading text ! rtn.append(parts[0]) ! charset = parts[1] ! encoding = parts[2].lower() ! atom = parts[3] ! # The next chunk to decode should be in parts[4] ! parts = ecre.split(parts[4]) ! # The encoding must be either `q' or `b', case-insensitive ! if encoding == 'q': ! func = _qdecode ! elif encoding == 'b': ! func = _bdecode else: ! func = _identity ! # Decode and get the unicode in the charset ! rtn.append(unicode(func(atom), charset)) # Now that we've decoded everything, we just need to join all the parts # together into the final string. --- 135,158 ---- def decode(s): ! """Return a decoded string according to RFC 2047, as a unicode string. ! ! NOTE: This function is deprecated. Use Header.decode_header() instead. ! """ ! warnings.warn('Use Header.decode_header() instead.', DeprecationWarning, 2) ! # Intra-package import here to avoid circular import problems. ! from email.Header import decode_header ! L = decode_header(s) ! if not isinstance(L, ListType): ! # s wasn't decoded ! return s ! rtn = [] ! for atom, charset in L: ! if charset is None: ! rtn.append(atom) else: ! # Convert the string to Unicode using the given encoding. Leave ! # Unicode conversion errors to strict. ! rtn.append(unicode(atom, charset)) # Now that we've decoded everything, we just need to join all the parts # together into the final string. *************** *** 97,100 **** --- 163,167 ---- def encode(s, charset='iso-8859-1', encoding='q'): """Encode a string according to RFC 2047.""" + warnings.warn('Use Header.Header.encode() instead.', DeprecationWarning, 2) encoding = encoding.lower() if encoding == 'q': *************** *** 108,112 **** ! def formatdate(timeval=None, localtime=0): """Returns a date string as specified by RFC 2822, e.g.: --- 175,179 ---- ! def formatdate(timeval=None, localtime=False): """Returns a date string as specified by RFC 2822, e.g.: *************** *** 116,120 **** gmtime() and localtime(), otherwise the current time is used. ! Optional localtime is a flag that when true, interprets timeval, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. --- 183,187 ---- gmtime() and localtime(), otherwise the current time is used. ! Optional localtime is a flag that when True, interprets timeval, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. *************** *** 151,152 **** --- 218,340 ---- now[0], now[3], now[4], now[5], zone) + + + + def make_msgid(idstring=None): + """Returns a string suitable for RFC 2822 compliant Message-ID, e.g: + + <20020201195627.33539.96671@nightshade.la.mastaler.com> + + Optional idstring if given is a string used to strengthen the + uniqueness of the message id. + """ + timeval = time.time() + utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval)) + pid = os.getpid() + randint = random.randrange(100000) + if idstring is None: + idstring = '' + else: + idstring = '.' + idstring + idhost = socket.getfqdn() + msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost) + return msgid + + + + # These functions are in the standalone mimelib version only because they've + # subsequently been fixed in the latest Python versions. We use this to worm + # around broken older Pythons. + def parsedate(data): + if not data: + return None + return _parsedate(data) + + + def parsedate_tz(data): + if not data: + return None + return _parsedate_tz(data) + + + def parseaddr(addr): + addrs = _AddressList(addr).addresslist + if not addrs: + return '', '' + return addrs[0] + + + # rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3. + def unquote(str): + """Remove quotes from a string.""" + if len(str) > 1: + if str.startswith('"') and str.endswith('"'): + return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') + if str.startswith('<') and str.endswith('>'): + return str[1:-1] + return str + + + + # RFC2231-related functions - parameter encoding and decoding + def decode_rfc2231(s): + """Decode string according to RFC 2231""" + import urllib + charset, language, s = s.split("'", 2) + s = urllib.unquote(s) + return charset, language, s + + + def encode_rfc2231(s, charset=None, language=None): + """Encode string according to RFC 2231. + + If neither charset nor language is given, then s is returned as-is. If + charset is given but not language, the string is encoded using the empty + string for language. + """ + import urllib + s = urllib.quote(s, safe='') + if charset is None and language is None: + return s + if language is None: + language = '' + return "%s'%s'%s" % (charset, language, s) + + + rfc2231_continuation = re.compile(r'^(?P\w+)\*((?P[0-9]+)\*?)?$') + + def decode_params(params): + """Decode parameters list according to RFC 2231. + + params is a sequence of 2-tuples containing (content type, string value). + """ + new_params = [] + # maps parameter's name to a list of continuations + rfc2231_params = {} + # params is a sequence of 2-tuples containing (content_type, string value) + name, value = params[0] + new_params.append((name, value)) + # Cycle through each of the rest of the parameters. + for name, value in params[1:]: + value = unquote(value) + mo = rfc2231_continuation.match(name) + if mo: + name, num = mo.group('name', 'num') + if num is not None: + num = int(num) + rfc2231_param1 = rfc2231_params.setdefault(name, []) + rfc2231_param1.append((num, value)) + else: + new_params.append((name, '"%s"' % quote(value))) + if rfc2231_params: + for name, continuations in rfc2231_params.items(): + value = [] + # Sort by number + continuations.sort() + # And now append all values in num order + for num, continuation in continuations: + value.append(continuation) + charset, language, value = decode_rfc2231(EMPTYSTRING.join(value)) + new_params.append((name, + (charset, language, '"%s"' % quote(value)))) + return new_params Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** __init__.py 9 Oct 2001 19:14:59 -0000 1.4 --- __init__.py 4 Oct 2002 17:24:24 -0000 1.4.10.1 *************** *** 1,3 **** ! # Copyright (C) 2001 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- 1,3 ---- ! # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) *************** *** 5,35 **** """ ! __version__ = '1.0' ! __all__ = ['Encoders', ! 'Errors', ! 'Generator', ! 'Iterators', ! 'MIMEAudio', ! 'MIMEBase', ! 'MIMEImage', ! 'MIMEMessage', ! 'MIMEText', ! 'Message', ! 'Parser', ! 'Utils', ! 'message_from_string', ! 'message_from_file', ! ] ! # Some convenience routines ! from Parser import Parser as _Parser ! from Message import Message as _Message ! def message_from_string(s, _class=_Message): ! return _Parser(_class).parsestr(s) ! def message_from_file(fp, _class=_Message): ! return _Parser(_class).parse(fp) --- 5,72 ---- """ ! __version__ = '2.4' ! __all__ = [ ! 'base64MIME', ! 'Charset', ! 'Encoders', ! 'Errors', ! 'Generator', ! 'Header', ! 'Iterators', ! 'Message', ! 'MIMEAudio', ! 'MIMEBase', ! 'MIMEImage', ! 'MIMEMessage', ! 'MIMEMultipart', ! 'MIMENonMultipart', ! 'MIMEText', ! 'Parser', ! 'quopriMIME', ! 'Utils', ! 'message_from_string', ! 'message_from_file', ! ] ! ! try: ! True, False ! except NameError: ! True = 1 ! False = 0 ! # Some convenience routines. Don't import Parser and Message as side-effects ! # of importing email since those cascadingly import most of the rest of the ! # email package. ! def message_from_string(s, _class=None, strict=False): ! """Parse a string into a Message object model. ! Optional _class and strict are passed to the Parser constructor. ! """ ! from email.Parser import Parser ! if _class is None: ! from email.Message import Message ! _class = Message ! return Parser(_class, strict=strict).parsestr(s) ! def message_from_file(fp, _class=None, strict=False): ! """Read a file and parse its contents into a Message object model. ! ! Optional _class and strict are passed to the Parser constructor. ! """ ! from email.Parser import Parser ! if _class is None: ! from email.Message import Message ! _class = Message ! return Parser(_class, strict=strict).parse(fp) ! ! ! ! # Patch encodings.aliases to recognize 'ansi_x3.4_1968' which isn't a standard ! # alias in Python 2.1.3, but is used by the email package test suite. ! from encodings.aliases import aliases # The aliases dictionary ! if not aliases.has_key('ansi_x3.4_1968'): ! aliases['ansi_x3.4_1968'] = 'ascii' ! del aliases # Not needed any more From barry@users.sourceforge.net Fri Oct 4 18:40:59 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:40:59 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test __init__.py,NONE,1.1.2.1 test_email.py,NONE,1.17.2.1 test_email_codecs.py,NONE,1.3.2.1 test_email_torture.py,NONE,1.4.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv19257/Lib/email/test Added Files: Tag: release22-maint __init__.py test_email.py test_email_codecs.py test_email_torture.py Log Message: Backporting of email 2.4 from Python 2.3. These are the backported tests and supporting files. --- NEW FILE: __init__.py --- # Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) --- NEW FILE: test_email.py --- # Copyright (C) 2001,2002 Python Software Foundation # email package unit tests import sys import os import time import unittest import base64 import difflib from cStringIO import StringIO from types import StringType, ListType import warnings import email from email.Charset import Charset from email.Header import Header, decode_header, make_header from email.Parser import Parser, HeaderParser from email.Generator import Generator, DecodedGenerator [...2241 lines suppressed...] def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] def suite(): suite = unittest.TestSuite() for testclass in _testclasses(): suite.addTest(unittest.makeSuite(testclass)) return suite def test_main(): for testclass in _testclasses(): run_unittest(testclass) if __name__ == '__main__': unittest.main(defaultTest='suite') --- NEW FILE: test_email_codecs.py --- # Copyright (C) 2002 Python Software Foundation # email package unit tests for (optional) Asian codecs import unittest from test.test_support import TestSkipped, run_unittest from email.test.test_email import TestEmailBase from email.Charset import Charset from email.Header import Header, decode_header # See if we have the Japanese codecs package installed try: unicode('foo', 'japanese.iso-2022-jp') except LookupError: raise TestSkipped, 'Optional Japanese codecs not installed' class TestEmailAsianCodecs(TestEmailBase): def test_japanese_codecs(self): eq = self.ndiffAssertEqual j = Charset("euc-jp") g = Charset("iso-8859-1") h = Header("Hello World!") jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' ghello = 'Gr\xfc\xdf Gott!' h.append(jhello, j) h.append(ghello, g) eq(h.encode(), 'Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=\n =?iso-8859-1?q?Gr=FC=DF_Gott!?=') eq(decode_header(h.encode()), [('Hello World!', None), ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), ('Gr\xfc\xdf Gott!', 'iso-8859-1')]) long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' h = Header(long, j, header_name="Subject") # test a very long header enc = h.encode() # BAW: The following used to pass. Sadly, the test afterwards is what # happens now. I've no idea which is right. Please, any Japanese and # RFC 2047 experts, please verify! ## eq(enc, '''\ ##=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYRsoQg==?= ## =?iso-2022-jp?b?GyRCITwlayRPO0oycTxUJE4+NRsoQg==?= ## =?iso-2022-jp?b?GyRCRyckckJUJEMkRiQkJF4kORsoQg==?=''') eq(enc, """\ =?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYRsoQg==?= =?iso-2022-jp?b?GyRCITwlayRPO0oycTxUJE4+NUcnJHJCVCRDJEYkJCReJDkbKEI=?=""") # BAW: same deal here. :( ## self.assertEqual( ## decode_header(enc), ## [("test-ja \x1b$B$XEj9F$5$l$?%a\x1b(B\x1b$B!<%k$O;J2q5\x1b(B\x1b$BG'$rBT$C$F$$$^$9\x1b(B", 'iso-2022-jp')]) self.assertEqual( decode_header(enc), [("test-ja \x1b$B$XEj9F$5$l$?%a\x1b(B\x1b$B!<%k$O;J2q5G'$rBT$C$F$$$^$9\x1b(B", 'iso-2022-jp')]) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestEmailAsianCodecs)) return suite def test_main(): run_unittest(TestEmailAsianCodecs) if __name__ == '__main__': unittest.main(defaultTest='suite') --- NEW FILE: test_email_torture.py --- # Copyright (C) 2002 Python Software Foundation # # A torture test of the email package. This should not be run as part of the # standard Python test suite since it requires several meg of email messages # collected in the wild. These source messages are not checked into the # Python distro, but are available as part of the standalone email package at # http://sf.net/projects/mimelib import sys import os import unittest from cStringIO import StringIO from types import ListType from email.test.test_email import TestEmailBase from test.test_support import TestSkipped import email from email import __file__ as testfile from email.Iterators import _structure def openfile(filename): from os.path import join, dirname, abspath path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) return open(path, 'rb') # Prevent this test from running in the Python distro try: openfile('crispin-torture.txt') except IOError: raise TestSkipped class TortureBase(TestEmailBase): def _msgobj(self, filename): fp = openfile(filename) try: msg = email.message_from_file(fp) finally: fp.close() return msg class TestCrispinTorture(TortureBase): # Mark Crispin's torture test from the SquirrelMail project def test_mondo_message(self): eq = self.assertEqual neq = self.ndiffAssertEqual msg = self._msgobj('crispin-torture.txt') payload = msg.get_payload() eq(type(payload), ListType) eq(len(payload), 12) eq(msg.preamble, None) eq(msg.epilogue, '\n\n') # Probably the best way to verify the message is parsed correctly is to # dump its structure and compare it against the known structure. fp = StringIO() _structure(msg, fp=fp) neq(fp.getvalue(), """\ multipart/mixed text/plain message/rfc822 multipart/alternative text/plain multipart/mixed text/richtext application/andrew-inset message/rfc822 audio/basic audio/basic image/pbm message/rfc822 multipart/mixed multipart/mixed text/plain audio/x-sun multipart/mixed image/gif image/gif application/x-be2 application/atomicmail audio/x-sun message/rfc822 multipart/mixed text/plain image/pgm text/plain message/rfc822 multipart/mixed text/plain image/pbm message/rfc822 application/postscript image/gif message/rfc822 multipart/mixed audio/basic audio/basic message/rfc822 multipart/mixed application/postscript text/plain message/rfc822 multipart/mixed text/plain multipart/parallel image/gif audio/basic application/atomicmail message/rfc822 audio/x-sun """) def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] def suite(): suite = unittest.TestSuite() for testclass in _testclasses(): suite.addTest(unittest.makeSuite(testclass)) return suite def test_main(): for testclass in _testclasses(): test_support.run_unittest(testclass) if __name__ == '__main__': unittest.main(defaultTest='suite') From barry@users.sourceforge.net Fri Oct 4 18:40:59 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:40:59 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test/data PyBanner048.gif,NONE,1.1.2.1 msg_01.txt,NONE,1.1.2.1 msg_02.txt,NONE,1.1.2.1 msg_03.txt,NONE,1.1.2.1 msg_04.txt,NONE,1.1.2.1 msg_05.txt,NONE,1.1.2.1 msg_06.txt,NONE,1.1.2.1 msg_07.txt,NONE,1.1.2.1 msg_08.txt,NONE,1.1.2.1 msg_09.txt,NONE,1.1.2.1 msg_10.txt,NONE,1.1.2.1 msg_11.txt,NONE,1.1.2.1 msg_12.txt,NONE,1.1.2.1 msg_13.txt,NONE,1.1.2.1 msg_14.txt,NONE,1.1.2.1 msg_15.txt,NONE,1.1.2.1 msg_16.txt,NONE,1.1.2.1 msg_17.txt,NONE,1.1.2.1 msg_18.txt,NONE,1.1.2.1 msg_19.txt,NONE,1.1.2.1 msg_20.txt,NONE,1.1.2.1 msg_21.txt,NONE,1.1.2.1 msg_22.txt,NONE,1.1.2.1 msg_23.txt,NONE,1.1.2.1 msg_24.txt,NONE,1.1.2.1 msg_25.txt,NONE,1.1.2.1 msg_26.txt,NONE,1.1.2.1 msg_27.txt,NONE,1.1.2.1 msg_28.txt,NONE,1.1.2.1 msg_29.txt,NONE,1.1.2.1 msg_30.txt,NONE,1.1.2.1 msg_31.txt,NONE,1.1.2.1 msg_32.txt,NONE,1.1.2.1 msg_33.txt,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test/data In directory usw-pr-cvs1:/tmp/cvs-serv19257/Lib/email/test/data Added Files: Tag: release22-maint PyBanner048.gif msg_01.txt msg_02.txt msg_03.txt msg_04.txt msg_05.txt msg_06.txt msg_07.txt msg_08.txt msg_09.txt msg_10.txt msg_11.txt msg_12.txt msg_13.txt msg_14.txt msg_15.txt msg_16.txt msg_17.txt msg_18.txt msg_19.txt msg_20.txt msg_21.txt msg_22.txt msg_23.txt msg_24.txt msg_25.txt msg_26.txt msg_27.txt msg_28.txt msg_29.txt msg_30.txt msg_31.txt msg_32.txt msg_33.txt Log Message: Backporting of email 2.4 from Python 2.3. These are the backported tests and supporting files. --- NEW FILE: PyBanner048.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: msg_01.txt --- Return-Path: Delivered-To: bbb@zzz.org Received: by mail.zzz.org (Postfix, from userid 889) id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15090.61304.110929.45684@aaa.zzz.org> From: bbb@ddd.com (John X. Doe) To: bbb@zzz.org Subject: This is a test message Date: Fri, 4 May 2001 14:05:44 -0400 Hi, Do you like this message? -Me --- NEW FILE: msg_02.txt --- MIME-version: 1.0 From: ppp-request@zzz.org Sender: ppp-admin@zzz.org To: ppp@zzz.org Subject: Ppp digest, Vol 1 #2 - 5 msgs Date: Fri, 20 Apr 2001 20:18:00 -0400 (EDT) X-Mailer: Mailman v2.0.4 X-Mailman-Version: 2.0.4 Content-Type: multipart/mixed; boundary="192.168.1.2.889.32614.987812255.500.21814" --192.168.1.2.889.32614.987812255.500.21814 Content-type: text/plain; charset=us-ascii Content-description: Masthead (Ppp digest, Vol 1 #2) Send Ppp mailing list submissions to ppp@zzz.org To subscribe or unsubscribe via the World Wide Web, visit http://www.zzz.org/mailman/listinfo/ppp or, via email, send a message with subject or body 'help' to ppp-request@zzz.org You can reach the person managing the list at ppp-admin@zzz.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Ppp digest..." --192.168.1.2.889.32614.987812255.500.21814 Content-type: text/plain; charset=us-ascii Content-description: Today's Topics (5 msgs) Today's Topics: 1. testing #1 (Barry A. Warsaw) 2. testing #2 (Barry A. Warsaw) 3. testing #3 (Barry A. Warsaw) 4. testing #4 (Barry A. Warsaw) 5. testing #5 (Barry A. Warsaw) --192.168.1.2.889.32614.987812255.500.21814 Content-Type: multipart/digest; boundary="__--__--" --__--__-- Message: 1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 20 Apr 2001 20:16:13 -0400 To: ppp@zzz.org From: barry@digicool.com (Barry A. Warsaw) Subject: [Ppp] testing #1 Precedence: bulk hello --__--__-- Message: 2 Date: Fri, 20 Apr 2001 20:16:21 -0400 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: ppp@zzz.org From: barry@digicool.com (Barry A. Warsaw) Precedence: bulk hello --__--__-- Message: 3 Date: Fri, 20 Apr 2001 20:16:25 -0400 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: ppp@zzz.org From: barry@digicool.com (Barry A. Warsaw) Subject: [Ppp] testing #3 Precedence: bulk hello --__--__-- Message: 4 Date: Fri, 20 Apr 2001 20:16:28 -0400 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: ppp@zzz.org From: barry@digicool.com (Barry A. Warsaw) Subject: [Ppp] testing #4 Precedence: bulk hello --__--__-- Message: 5 Date: Fri, 20 Apr 2001 20:16:32 -0400 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: ppp@zzz.org From: barry@digicool.com (Barry A. Warsaw) Subject: [Ppp] testing #5 Precedence: bulk hello --__--__---- --192.168.1.2.889.32614.987812255.500.21814 Content-type: text/plain; charset=us-ascii Content-description: Digest Footer _______________________________________________ Ppp mailing list Ppp@zzz.org http://www.zzz.org/mailman/listinfo/ppp --192.168.1.2.889.32614.987812255.500.21814-- End of Ppp Digest --- NEW FILE: msg_03.txt --- Return-Path: Delivered-To: bbb@zzz.org Received: by mail.zzz.org (Postfix, from userid 889) id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) Message-ID: <15090.61304.110929.45684@aaa.zzz.org> From: bbb@ddd.com (John X. Doe) To: bbb@zzz.org Subject: This is a test message Date: Fri, 4 May 2001 14:05:44 -0400 Hi, Do you like this message? -Me --- NEW FILE: msg_04.txt --- Return-Path: Delivered-To: barry@python.org Received: by mail.python.org (Postfix, from userid 889) id C2BF0D37C6; Tue, 11 Sep 2001 00:05:05 -0400 (EDT) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="h90VIIIKmx" Content-Transfer-Encoding: 7bit Message-ID: <15261.36209.358846.118674@anthem.python.org> From: barry@python.org (Barry A. Warsaw) To: barry@python.org Subject: a simple multipart Date: Tue, 11 Sep 2001 00:05:05 -0400 X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid X-Attribution: BAW X-Oblique-Strategy: Make a door into a window --h90VIIIKmx Content-Type: text/plain Content-Disposition: inline; filename="msg.txt" Content-Transfer-Encoding: 7bit a simple kind of mirror to reflect upon our own --h90VIIIKmx Content-Type: text/plain Content-Disposition: inline; filename="msg.txt" Content-Transfer-Encoding: 7bit a simple kind of mirror to reflect upon our own --h90VIIIKmx-- --- NEW FILE: msg_05.txt --- From: foo Subject: bar To: baz MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="D1690A7AC1.996856090/mail.example.com" Message-Id: <20010803162810.0CA8AA7ACC@mail.example.com> This is a MIME-encapsulated message. --D1690A7AC1.996856090/mail.example.com Content-Type: text/plain Yadda yadda yadda --D1690A7AC1.996856090/mail.example.com Yadda yadda yadda --D1690A7AC1.996856090/mail.example.com Content-Type: message/rfc822 From: nobody@python.org Yadda yadda yadda --D1690A7AC1.996856090/mail.example.com-- --- NEW FILE: msg_06.txt --- Return-Path: Delivered-To: barry@python.org MIME-Version: 1.0 Content-Type: message/rfc822 Content-Description: forwarded message Content-Transfer-Encoding: 7bit Message-ID: <15265.9482.641338.555352@python.org> From: barry@zope.com (Barry A. Warsaw) Sender: barry@python.org To: barry@python.org Subject: forwarded message from Barry A. Warsaw Date: Thu, 13 Sep 2001 17:28:42 -0400 X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid X-Attribution: BAW X-Oblique-Strategy: Be dirty X-Url: http://barry.wooz.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-Path: Delivered-To: barry@python.org Message-ID: <15265.9468.713530.98441@python.org> From: barry@zope.com (Barry A. Warsaw) Sender: barry@python.org To: barry@python.org Subject: testing Date: Thu, 13 Sep 2001 17:28:28 -0400 X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid X-Attribution: BAW X-Oblique-Strategy: Spectrum analysis X-Url: http://barry.wooz.org --- NEW FILE: msg_07.txt --- MIME-Version: 1.0 From: Barry To: Dingus Lovers Subject: Here is your dingus fish Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" Hi there, This is the dingus fish. --BOUNDARY Content-Type: image/gif; name="dingusfish.gif" Content-Transfer-Encoding: base64 content-disposition: attachment; filename="dingusfish.gif" R0lGODdhAAEAAfAAAP///wAAACwAAAAAAAEAAQAC/oSPqcvtD6OctNqLs968+w+G4kiW5omm6sq2 7gvH8kzX9o3n+s73/g8MCofEovGITGICTKbyCV0FDNOo9SqpQqpOrJfXzTQj2vD3TGtqL+NtGQ2f qTXmxzuOd7WXdcc9DyjU53ewFni4s0fGhdiYaEhGBelICTNoV1j5NUnFcrmUqemjNifJVWpaOqaI oFq3SspZsSraE7sHq3jr1MZqWvi662vxV4tD+pvKW6aLDOCLyur8PDwbanyDeq0N3DctbQYeLDvR RY6t95m6UB0d3mwIrV7e2VGNvjjffukeJp4w7F65KecGFsTHQGAygOrgrWs1jt28R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l1EqpfhJpVeKpVl6EgUAADs= --BOUNDARY-- --- NEW FILE: msg_08.txt --- MIME-Version: 1.0 From: Barry Warsaw To: Dingus Lovers Subject: Lyrics Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" --BOUNDARY Content-Type: text/html; charset="iso-8859-1" --BOUNDARY Content-Type: text/plain; charset="iso-8859-2" --BOUNDARY Content-Type: text/plain; charset="koi8-r" --BOUNDARY-- --- NEW FILE: msg_09.txt --- MIME-Version: 1.0 From: Barry Warsaw To: Dingus Lovers Subject: Lyrics Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" --BOUNDARY Content-Type: text/html; charset="iso-8859-1" --BOUNDARY Content-Type: text/plain --BOUNDARY Content-Type: text/plain; charset="koi8-r" --BOUNDARY-- --- NEW FILE: msg_10.txt --- MIME-Version: 1.0 From: Barry Warsaw To: Dingus Lovers Subject: Lyrics Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This is a 7bit encoded message. --BOUNDARY Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: Quoted-Printable =A1This is a Quoted Printable encoded message! --BOUNDARY Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: Base64 VGhpcyBpcyBhIEJhc2U2NCBlbmNvZGVkIG1lc3NhZ2Uu --BOUNDARY Content-Type: text/plain; charset="iso-8859-1" This has no Content-Transfer-Encoding: header. --BOUNDARY-- --- NEW FILE: msg_11.txt --- Content-Type: message/rfc822 MIME-Version: 1.0 Subject: The enclosing message Subject: An enclosed message Here is the body of the message. --- NEW FILE: msg_12.txt --- MIME-Version: 1.0 From: Barry Warsaw To: Dingus Lovers Subject: Lyrics Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain; charset="us-ascii" --BOUNDARY Content-Type: text/html; charset="iso-8859-1" --BOUNDARY Content-Type: multipart/mixed; boundary="ANOTHER" --ANOTHER Content-Type: text/plain; charset="iso-8859-2" --ANOTHER Content-Type: text/plain; charset="iso-8859-3" --ANOTHER-- --BOUNDARY Content-Type: text/plain; charset="us-ascii" --BOUNDARY Content-Type: text/plain; charset="koi8-r" --BOUNDARY-- --- NEW FILE: msg_13.txt --- MIME-Version: 1.0 From: Barry To: Dingus Lovers Subject: Here is your dingus fish Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="OUTER" --OUTER Content-Type: text/plain; charset="us-ascii" A text/plain part --OUTER Content-Type: multipart/mixed; boundary=BOUNDARY --BOUNDARY Content-Type: text/plain; charset="us-ascii" Hi there, This is the dingus fish. --BOUNDARY Content-Type: image/gif; name="dingusfish.gif" Content-Transfer-Encoding: base64 content-disposition: attachment; filename="dingusfish.gif" R0lGODdhAAEAAfAAAP///wAAACwAAAAAAAEAAQAC/oSPqcvtD6OctNqLs968+w+G4kiW5omm6sq2 7gvH8kzX9o3n+s73/g8MCofEovGITGICTKbyCV0FDNOo9SqpQqpOrJfXzTQj2vD3TGtqL+NtGQ2f qTXmxzuOd7WXdcc9DyjU53ewFni4s0fGhdiYaEhGBelICTNoV1j5NUnFcrmUqemjNifJVWpaOqaI oFq3SspZsSraE7sHq3jr1MZqWvi662vxV4tD+pvKW6aLDOCLyur8PDwbanyDeq0N3DctbQYeLDvR RY6t95m6UB0d3mwIrV7e2VGNvjjffukeJp4w7F65KecGFsTHQGAygOrgrWs1jt28Rc88KESYcGLA /obvTkH6p+CinWJiJmIMqXGQwH/y4qk0SYjgQTczT3ajKZGfuI0uJ4kkVI/DT5s3/ejkxI0aT4Y+ YTYgWbImUaXk9nlLmnSh1qJiJFl0OpUqRK4oOy7NyRQtHWofhoYVxkwWX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2VCfW2hJQrmMOuHW0W3dLQmCMO2ccdUd/xyfflH/olTiHZVdGwb8nIwRzSE J15jFlOJuBZBZ4CiyHyd2IFylFlB+HgHhYabhWOGwYO1ZH/Og1dtQlFMk352CGRSIFTapnWQEUtN l4zv8S0aaCFDyGCBqDUxZYpxGHX01y/JuH1xhn7TOCnNCI4eKDs5WGX4R425F4vF1o3BJ4vO0otq I3rimI7jJY1jISqnBxknCIvruF83mF5wN4X7qGLIhR8A2Vg0yFERSIXn9Vv3GHy3Vj/WIkKddlYi yIMv2I/VMjTLpW7pt05SWIZR0RPyxpB4SIUM9lBPGBl0GC7oSEEwRYLe4pJpZY2P0zbI1n+Oc44w qY3PUnmF0ixjVpDD/mJ9wpOBGTVgXlaCaZiPcIWK5NiKBIiPdGaQ0TWGvAiG7nMchdZb7Vgf8zNi MuMyzRdy/lePe9iC4TRx7WhhOQI/QiSVNAmAa2lT/piFbuh7ofJoYSZzrSZ1bvmWw3eN2nKUPVky uPN5/VRfohRd0VYZoqhKIlU6TXYhJxmPUIloAwc1bPmHEpaZYZORHNlXUJM07hATwHR8MJYqkwWR WaIezFhxSFlc8/Fq82hEnpeRozg3ULhhr9lAGtVEkCg5ZNRuuVleBPaZadhG0ZgkyPmDOTOKzViM YgOcpukKqQcbjAWS0IleQ2ROjdh6A+md1qWdBRSX7iSYgFRTtRmBpJioieXJiHfJiMGIR9fJOn8I MSfXYhspn4ooSa2mSAj4n+8Bmg03fBJZoPOJgsVZRxu1oOMRPXYYjdqjihFaEoZpXBREanuJoRI6 cibFinq4ngUKh/wQd/H5ofYCZ0HJXR62opZFaAT0iFIZo4DIiUojkjeqKiuoZirKo5Y1a7AWckGa BkuYoD5lpDK6eUs6CkDqpETwl1EqpfhJpVeKpVl6EgUAADs= --BOUNDARY-- --OUTER-- --- NEW FILE: msg_14.txt --- Return-Path: Delivered-To: bbb@zzz.org Received: by mail.zzz.org (Postfix, from userid 889) id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15090.61304.110929.45684@aaa.zzz.org> From: bbb@ddd.com (John X. Doe) To: bbb@zzz.org Subject: This is a test message Date: Fri, 4 May 2001 14:05:44 -0400 Hi, I'm sorry but I'm using a drainbread ISP, which although big and wealthy can't seem to generate standard compliant email. :( This message has a Content-Type: header with no subtype. I hope you can still read it. -Me --- NEW FILE: msg_15.txt --- Return-Path: Received: from fepD.post.tele.dk (195.41.46.149) by mail.groupcare.dk (LSMTP for Windows NT v1.1b) with SMTP id <0.0014F8A2@mail.groupcare.dk>; Mon, 30 Apr 2001 12:17:50 +0200 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2106 Subject: XX From: xx@xx.dk To: XX Message-ID: Mime-version: 1.0 Content-type: multipart/mixed; boundary="MS_Mac_OE_3071477847_720252_MIME_Part" > Denne meddelelse er i MIME-format. Da dit postl¾sningsprogram ikke forstŒr dette format, kan del af eller hele meddelelsen v¾re ul¾selig. --MS_Mac_OE_3071477847_720252_MIME_Part Content-type: multipart/alternative; boundary="MS_Mac_OE_3071477847_720252_MIME_Part" --MS_Mac_OE_3071477847_720252_MIME_Part Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Some removed test. --MS_Mac_OE_3071477847_720252_MIME_Part Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Some removed HTML Some removed text. --MS_Mac_OE_3071477847_720252_MIME_Part-- --MS_Mac_OE_3071477847_720252_MIME_Part Content-type: image/gif; name="xx.gif"; x-mac-creator="6F676C65"; x-mac-type="47494666" Content-disposition: attachment Content-transfer-encoding: base64 Some removed base64 encoded chars. --MS_Mac_OE_3071477847_720252_MIME_Part-- --- NEW FILE: msg_16.txt --- Return-Path: <> Delivered-To: scr-admin@socal-raves.org Received: from cougar.noc.ucla.edu (cougar.noc.ucla.edu [169.232.10.18]) by babylon.socal-raves.org (Postfix) with ESMTP id CCC2C51B84 for ; Sun, 23 Sep 2001 20:13:54 -0700 (PDT) Received: from sims-ms-daemon by cougar.noc.ucla.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) id <0GK500B01D0B8Y@cougar.noc.ucla.edu> for scr-admin@socal-raves.org; Sun, 23 Sep 2001 20:14:35 -0700 (PDT) Received: from cougar.noc.ucla.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) id <0GK500B01D0B8X@cougar.noc.ucla.edu>; Sun, 23 Sep 2001 20:14:35 -0700 (PDT) Date: Sun, 23 Sep 2001 20:14:35 -0700 (PDT) From: Internet Mail Delivery Subject: Delivery Notification: Delivery has failed To: scr-admin@socal-raves.org Message-id: <0GK500B04D0B8X@cougar.noc.ucla.edu> MIME-version: 1.0 Sender: scr-owner@socal-raves.org Errors-To: scr-owner@socal-raves.org X-BeenThere: scr@socal-raves.org X-Mailman-Version: 2.1a3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: SoCal-Raves List-Unsubscribe: , List-Archive: Content-Type: multipart/report; boundary="Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA)" --Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) Content-type: text/plain; charset=ISO-8859-1 This report relates to a message you sent with the following header fields: Message-id: <002001c144a6$8752e060$56104586@oxy.edu> Date: Sun, 23 Sep 2001 20:10:55 -0700 From: "Ian T. Henry" To: SoCal Raves Subject: [scr] yeah for Ians!! Your message cannot be delivered to the following recipients: Recipient address: jangel1@cougar.noc.ucla.edu Reason: recipient reached disk quota --Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) Content-type: message/DELIVERY-STATUS Original-envelope-id: 0GK500B4HD0888@cougar.noc.ucla.edu Reporting-MTA: dns; cougar.noc.ucla.edu Action: failed Status: 5.0.0 (recipient reached disk quota) Original-recipient: rfc822;jangel1@cougar.noc.ucla.edu Final-recipient: rfc822;jangel1@cougar.noc.ucla.edu --Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA) Content-type: MESSAGE/RFC822 Return-path: scr-admin@socal-raves.org Received: from sims-ms-daemon by cougar.noc.ucla.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) id <0GK500B01D0B8X@cougar.noc.ucla.edu>; Sun, 23 Sep 2001 20:14:35 -0700 (PDT) Received: from panther.noc.ucla.edu by cougar.noc.ucla.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0GK500B4GD0888@cougar.noc.ucla.edu> for jangel1@sims-ms-daemon; Sun, 23 Sep 2001 20:14:33 -0700 (PDT) Received: from babylon.socal-raves.org (ip-209-85-222-117.dreamhost.com [209.85.222.117]) by panther.noc.ucla.edu (8.9.1a/8.9.1) with ESMTP id UAA09793 for ; Sun, 23 Sep 2001 20:14:32 -0700 (PDT) Received: from babylon (localhost [127.0.0.1]) by babylon.socal-raves.org (Postfix) with ESMTP id D3B2951B70; Sun, 23 Sep 2001 20:13:47 -0700 (PDT) Received: by babylon.socal-raves.org (Postfix, from userid 60001) id A611F51B82; Sun, 23 Sep 2001 20:13:46 -0700 (PDT) Received: from tiger.cc.oxy.edu (tiger.cc.oxy.edu [134.69.3.112]) by babylon.socal-raves.org (Postfix) with ESMTP id ADA7351B70 for ; Sun, 23 Sep 2001 20:13:44 -0700 (PDT) Received: from ent (n16h86.dhcp.oxy.edu [134.69.16.86]) by tiger.cc.oxy.edu (8.8.8/8.8.8) with SMTP id UAA08100 for ; Sun, 23 Sep 2001 20:14:24 -0700 (PDT) Date: Sun, 23 Sep 2001 20:10:55 -0700 From: "Ian T. Henry" Subject: [scr] yeah for Ians!! Sender: scr-admin@socal-raves.org To: SoCal Raves Errors-to: scr-admin@socal-raves.org Message-id: <002001c144a6$8752e060$56104586@oxy.edu> MIME-version: 1.0 X-Mailer: Microsoft Outlook Express 5.50.4522.1200 Content-type: text/plain; charset=us-ascii Precedence: bulk Delivered-to: scr-post@babylon.socal-raves.org Delivered-to: scr@socal-raves.org X-Converted-To-Plain-Text: from multipart/alternative by demime 0.98e X-Converted-To-Plain-Text: Alternative section used was text/plain X-BeenThere: scr@socal-raves.org X-Mailman-Version: 2.1a3 List-Help: List-Post: List-Subscribe: , List-Id: SoCal-Raves List-Unsubscribe: , List-Archive: I always love to find more Ian's that are over 3 years old!! Ian _______________________________________________ For event info, list questions, or to unsubscribe, see http://www.socal-raves.org/ --Boundary_(ID_PGS2F2a+z+/jL7hupKgRhA)-- --- NEW FILE: msg_17.txt --- MIME-Version: 1.0 From: Barry To: Dingus Lovers Subject: Here is your dingus fish Date: Fri, 20 Apr 2001 19:35:02 -0400 Content-Type: multipart/mixed; boundary="BOUNDARY" Hi there, This is the dingus fish. [Non-text (image/gif) part of message omitted, filename dingusfish.gif] --- NEW FILE: msg_18.txt --- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" --- NEW FILE: msg_19.txt --- Send Ppp mailing list submissions to ppp@zzz.org To subscribe or unsubscribe via the World Wide Web, visit http://www.zzz.org/mailman/listinfo/ppp or, via email, send a message with subject or body 'help' to ppp-request@zzz.org You can reach the person managing the list at ppp-admin@zzz.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Ppp digest..." Today's Topics: 1. testing #1 (Barry A. Warsaw) 2. testing #2 (Barry A. Warsaw) 3. testing #3 (Barry A. Warsaw) 4. testing #4 (Barry A. Warsaw) 5. testing #5 (Barry A. Warsaw) hello hello hello hello hello _______________________________________________ Ppp mailing list Ppp@zzz.org http://www.zzz.org/mailman/listinfo/ppp --- NEW FILE: msg_20.txt --- Return-Path: Delivered-To: bbb@zzz.org Received: by mail.zzz.org (Postfix, from userid 889) id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15090.61304.110929.45684@aaa.zzz.org> From: bbb@ddd.com (John X. Doe) To: bbb@zzz.org Cc: ccc@zzz.org CC: ddd@zzz.org cc: eee@zzz.org Subject: This is a test message Date: Fri, 4 May 2001 14:05:44 -0400 Hi, Do you like this message? -Me --- NEW FILE: msg_21.txt --- From: aperson@dom.ain To: bperson@dom.ain Subject: Test Content-Type: multipart/mixed; boundary="BOUNDARY" MIME message --BOUNDARY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit One --BOUNDARY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Two --BOUNDARY-- End of MIME message --- NEW FILE: msg_22.txt --- Mime-Version: 1.0 Message-Id: Date: Tue, 16 Oct 2001 13:59:25 +0300 To: a@example.com From: b@example.com Content-Type: multipart/mixed; boundary="============_-1208892523==_============" --============_-1208892523==_============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Text text text. --============_-1208892523==_============ Content-Id: Content-Type: image/jpeg; name="wibble.JPG" ; x-mac-type="4A504547" ; x-mac-creator="474B4F4E" Content-Disposition: attachment; filename="wibble.JPG" Content-Transfer-Encoding: base64 /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAALCAXABIEBAREA g6bCjjw/pIZSjO6FWFpldjySOmCNrO7DBZibUXhTwtCixw+GtAijVdqxxaPp0aKvmGXa qrbBQvms0mAMeYS/3iTV1dG0hHaRNK01XblnWxtVdjkHLMIgTyqnk9VB7CrP2KzIINpa 4O7I+zxYO9WV8jZg71Zlb+8rMDkEirAVQFAUAKAFAAAUAYAUDgADgY6DjpRtXj5RxjHA 4wQRj0wQCMdCAewpaKKK/9k= --============_-1208892523==_============ Content-Id: Content-Type: image/jpeg; name="wibble2.JPG" ; x-mac-type="4A504547" ; x-mac-creator="474B4F4E" Content-Disposition: attachment; filename="wibble2.JPG" Content-Transfer-Encoding: base64 /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAALCAXABJ0BAREA /8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA W6NFJJBEkU10kKGTcWMDwxuU+0JHvk8qAtOpNwqSR0n8c3BlDyXHlqsUltHEiTvdXLxR 7vMiGDNJAJWkAMk8ZkCFp5G2oo5W++INrbQtNfTQxJAuXlupz9oS4d5Y1W+E2XlWZJJE Y7LWYQxTLE1zuMbfBPxw8X2fibVdIbSbI6nLZxX635t9TjtYreWR7WGKJTLJFFKSlozO 0ShxIXM43uC3/9k= --============_-1208892523==_============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Text text text. --============_-1208892523==_============-- --- NEW FILE: msg_23.txt --- From: aperson@dom.ain Content-Type: multipart/mixed; boundary="BOUNDARY" --BOUNDARY Content-Type: text/plain A message part --BOUNDARY-- --- NEW FILE: msg_24.txt --- Content-Type: multipart/mixed; boundary="BOUNDARY" MIME-Version: 1.0 Subject: A subject To: aperson@dom.ain From: bperson@dom.ain --BOUNDARY --BOUNDARY-- --- NEW FILE: msg_25.txt --- >From MAILER-DAEMON Fri Apr 06 16:46:09 2001 Received: from [204.245.199.98] (helo=zinfandel.lacita.com) by www.linux.org.uk with esmtp (Exim 3.13 #1) id 14lYR6-0008Iv-00 for linuxuser-admin@www.linux.org.uk; Fri, 06 Apr 2001 16:46:09 +0100 Received: from localhost (localhost) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with internal id JAB03225; Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) Date: Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) From: Mail Delivery Subsystem Subject: Returned mail: Too many hops 19 (17 max): from via [199.164.235.226], to Message-Id: <200104061723.JAB03225@zinfandel.lacita.com> To: To: postmaster@zinfandel.lacita.com MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; bo Auto-Submitted: auto-generated (failure) This is a MIME-encapsulated message --JAB03225.986577786/zinfandel.lacita.com The original message was received at Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) from [199.164.235.226] ----- The following addresses have delivery notifications ----- (unrecoverable error) ----- Transcript of session follows ----- 554 Too many hops 19 (17 max): from via [199.164.235.226], to --JAB03225.986577786/zinfandel.lacita.com Content-Type: message/delivery-status Reporting-MTA: dns; zinfandel.lacita.com Received-From-MTA: dns; [199.164.235.226] Arrival-Date: Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) Final-Recipient: rfc822; scoffman@wellpartner.com Action: failed Status: 5.4.6 Last-Attempt-Date: Fri, 6 Apr 2001 09:23:06 -0800 (GMT-0800) --JAB03225.986577786/zinfandel.lacita.com Content-Type: text/rfc822-headers Return-Path: linuxuser-admin@www.linux.org.uk Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03225 for ; Fri, 6 Apr 2001 09:23:03 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03221 for ; Fri, 6 Apr 2001 09:22:18 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03217 for ; Fri, 6 Apr 2001 09:21:37 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03213 for ; Fri, 6 Apr 2001 09:20:56 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03209 for ; Fri, 6 Apr 2001 09:20:15 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03205 for ; Fri, 6 Apr 2001 09:19:33 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03201 for ; Fri, 6 Apr 2001 09:18:52 -0800 (GMT-0800) Received: from zinfandel.lacita.com ([204.245.199.98]) by fo Received: from ns1.wellpartner.net ([199.164.235.226]) by zinfandel.lacita.com (8.7.3/8.6.10-MT4.00) with ESMTP id JAA03197 for ; Fri, 6 Apr 2001 09:17:54 -0800 (GMT-0800) Received: from www.linux.org.uk (parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by fo Received: from localhost.localdomain ([ by id Received: from [212.1.130.11] (helo=s1.uklinux.net ident=root) by id fo Received: from server (ppp-2-22.cvx4.telinco.net [212.1.149.22]) by fo From: Daniel James Organization: LinuxUser To: linuxuser@www.linux.org.uk X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; c MIME-Version: 1.0 Message-Id: <01040616033903.00962@server> Content-Transfer-Encoding: 8bit Subject: [LinuxUser] bulletin no. 45 Sender: linuxuser-admin@www.linux.org.uk Errors-To: linuxuser-admin@www.linux.org.uk X-BeenThere: linuxuser@www.linux.org.uk X-Mailman-Version: 2.0.3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , Date: Fri, 6 Apr 2001 16:03:39 +0100 --JAB03225.986577786/zinfandel.lacita.com-- --- NEW FILE: msg_26.txt --- Received: from xcar [192.168.0.2] by jeeves.wooster.local (SMTPD32-7.07 EVAL) id AFF92F0214; Sun, 12 May 2002 08:55:37 +0100 Date: Sun, 12 May 2002 08:56:15 +0100 From: Father Time To: timbo@jeeves.wooster.local Subject: IMAP file test Message-ID: <6df65d354b.father.time@rpc.wooster.local> X-Organization: Home User-Agent: Messenger-Pro/2.50a (MsgServe/1.50) (RISC-OS/4.02) POPstar/2.03 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1618492860--2051301190--113853680" Status: R X-UIDL: 319998302 This message is in MIME format which your mailer apparently does not support. You either require a newer version of your software which supports MIME, or a separate MIME decoding utility. Alternatively, ask the sender of this message to resend it in a different format. --1618492860--2051301190--113853680 Content-Type: text/plain; charset=us-ascii Simple email with attachment. --1618492860--2051301190--113853680 Content-Type: application/riscos; name="clock.bmp,69c"; type=BMP; load=&fff69c4b; exec=&355dd4d1; access=&03 Content-Disposition: attachment; filename="clock.bmp" Content-Transfer-Encoding: base64 Qk12AgAAAAAAAHYAAAAoAAAAIAAAACAAAAABAAQAAAAAAAAAAADXDQAA1w0AAAAAAAAA AAAAAAAAAAAAiAAAiAAAAIiIAIgAAACIAIgAiIgAALu7uwCIiIgAERHdACLuIgAz//8A zAAAAN0R3QDu7iIA////AAAAAAAAAAAAAAAAAAAAAAAAAAi3AAAAAAAAADeAAAAAAAAA C3ADMzMzMANwAAAAAAAAAAAHMAAAAANwAAAAAAAAAACAMAd3zPfwAwgAAAAAAAAIAwd/ f8x/f3AwgAAAAAAAgDB0x/f3//zPAwgAAAAAAAcHfM9////8z/AwAAAAAAiwd/f3//// ////A4AAAAAAcEx/f///////zAMAAAAAiwfM9////3///8zwOAAAAAcHf3////B///// 8DAAAAALB/f3///wd3d3//AwAAAABwTPf//wCQAAD/zAMAAAAAsEx/f///B////8wDAA AAAHB39////wf/////AwAAAACwf39///8H/////wMAAAAIcHfM9///B////M8DgAAAAA sHTH///wf///xAMAAAAACHB3f3//8H////cDgAAAAAALB3zH//D//M9wMAAAAAAAgLB0 z39///xHAwgAAAAAAAgLB3d3RHd3cDCAAAAAAAAAgLAHd0R3cAMIAAAAAAAAgAgLcAAA AAMwgAgAAAAACDAAAAu7t7cwAAgDgAAAAABzcIAAAAAAAAgDMwAAAAAAN7uwgAAAAAgH MzMAAAAACH97tzAAAAALu3c3gAAAAAAL+7tzDABAu7f7cAAAAAAACA+3MA7EQAv/sIAA AAAAAAAIAAAAAAAAAIAAAAAA --1618492860--2051301190--113853680-- --- NEW FILE: msg_27.txt --- Return-Path: Received: by mail.dom.ain (Postfix, from userid 889) id B9D0AD35DB; Tue, 4 Jun 2002 21:46:59 -0400 (EDT) Message-ID: <15613.28051.707126.569693@dom.ain> Date: Tue, 4 Jun 2002 21:46:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: bug demonstration 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 more text From: aperson@dom.ain (Anne P. Erson) To: bperson@dom.ain (Barney P. Erson) test --- NEW FILE: msg_28.txt --- From: aperson@dom.ain MIME-Version: 1.0 Content-Type: multipart/digest; boundary=BOUNDARY --BOUNDARY Content-Type: message/rfc822 Content-Type: text/plain; charset=us-ascii To: aa@bb.org From: cc@dd.org Subject: ee message 1 --BOUNDARY Content-Type: message/rfc822 Content-Type: text/plain; charset=us-ascii To: aa@bb.org From: cc@dd.org Subject: ee message 2 --BOUNDARY-- --- NEW FILE: msg_29.txt --- Return-Path: Delivered-To: bbb@zzz.org Received: by mail.zzz.org (Postfix, from userid 889) id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; title*0*="us-ascii'en'This%20is%20even%20more%20"; title*1*="%2A%2A%2Afun%2A%2A%2A%20"; title*2="isn't it!" Content-Transfer-Encoding: 7bit Message-ID: <15090.61304.110929.45684@aaa.zzz.org> From: bbb@ddd.com (John X. Doe) To: bbb@zzz.org Subject: This is a test message Date: Fri, 4 May 2001 14:05:44 -0400 Hi, Do you like this message? -Me --- NEW FILE: msg_30.txt --- From: aperson@dom.ain MIME-Version: 1.0 Content-Type: multipart/digest; boundary=BOUNDARY --BOUNDARY Content-Type: text/plain; charset=us-ascii To: aa@bb.org From: cc@dd.org Subject: ee message 1 --BOUNDARY Content-Type: text/plain; charset=us-ascii To: aa@bb.org From: cc@dd.org Subject: ee message 2 --BOUNDARY-- --- NEW FILE: msg_31.txt --- From: aperson@dom.ain MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=BOUNDARY_ --BOUNDARY Content-Type: text/plain message 1 --BOUNDARY Content-Type: text/plain message 2 --BOUNDARY-- --- NEW FILE: msg_32.txt --- Delivered-To: freebsd-isp@freebsd.org Date: Tue, 26 Sep 2000 12:23:03 -0500 From: Anne Person To: Barney Dude Subject: Re: Limiting Perl CPU Utilization... Mime-Version: 1.0 Content-Type: text/plain; charset*=ansi-x3.4-1968''us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.8i Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Some message. --- NEW FILE: msg_33.txt --- Delivered-To: freebsd-isp@freebsd.org Date: Wed, 27 Sep 2000 11:11:09 -0500 From: Anne Person To: Barney Dude Subject: Re: Limiting Perl CPU Utilization... Mime-Version: 1.0 Content-Type: multipart/signed; micalg*=ansi-x3.4-1968''pgp-md5; protocol*=ansi-x3.4-1968''application%2Fpgp-signature; boundary*="ansi-x3.4-1968''EeQfGwPcQSOJBaQU" Content-Disposition: inline Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset*=ansi-x3.4-1968''us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable part 1 --EeQfGwPcQSOJBaQU Content-Type: text/plain Content-Disposition: inline part 2 --EeQfGwPcQSOJBaQU-- From barry@users.sourceforge.net Fri Oct 4 18:57:29 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 10:57:29 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.36,1.337.2.4.2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv26720 Modified Files: Tag: release22-maint NEWS Log Message: Add a note about the backport of email 2.4 Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.36 retrieving revision 1.337.2.4.2.37 diff -C2 -d -r1.337.2.4.2.36 -r1.337.2.4.2.37 *** NEWS 25 Sep 2002 15:03:10 -0000 1.337.2.4.2.36 --- NEWS 4 Oct 2002 17:57:27 -0000 1.337.2.4.2.37 *************** *** 53,56 **** --- 53,63 ---- Library + - The email package from the Python 2.3 development tree has been + backported, including updated documentation. This version + corresponds to email 2.4 and should be nearly completely backward + compatible. However there have been lots of improvements in the + API, so you should read the section in the library manual about the + changes since email v1. + - random.gauss() uses a piece of hidden state used by nothing else, and the .seed() and .whseed() methods failed to reset it. In other From barry@users.sourceforge.net Fri Oct 4 19:00:17 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Fri, 04 Oct 2002 11:00:17 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py,1.3.2.1,1.3.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv28381 Modified Files: Tag: release22-maint test_email_codecs.py Log Message: regrtest expects TestSkipped to come from test_support not test.test_support Index: test_email_codecs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email_codecs.py,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** test_email_codecs.py 4 Oct 2002 17:40:57 -0000 1.3.2.1 --- test_email_codecs.py 4 Oct 2002 18:00:13 -0000 1.3.2.2 *************** *** 3,7 **** import unittest ! from test.test_support import TestSkipped, run_unittest from email.test.test_email import TestEmailBase --- 3,7 ---- import unittest ! from test.test_support import run_unittest from email.test.test_email import TestEmailBase *************** *** 13,16 **** --- 13,18 ---- unicode('foo', 'japanese.iso-2022-jp') except LookupError: + # Different in Python 2.3 + from test_support import TestSkipped raise TestSkipped, 'Optional Japanese codecs not installed' From fdrake@users.sourceforge.net Fri Oct 4 19:59:00 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 11:59:00 -0700 Subject: [Python-checkins] python/dist/src/Doc/api refcounts.dat,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv17773 Modified Files: refcounts.dat Log Message: Added refcount information for PyObject_GetIter(). Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** refcounts.dat 2 Jul 2002 16:16:18 -0000 1.43 --- refcounts.dat 4 Oct 2002 18:58:58 -0000 1.44 *************** *** 812,815 **** --- 812,818 ---- PyObject_GetItem:PyObject*:key:0: + PyObject_GetIter:PyObject*::+1: + PyObject_GetIter:PyObject*:o:0: + PyObject_HasAttr:int::: PyObject_HasAttr:PyObject*:o:0: From fdrake@users.sourceforge.net Fri Oct 4 19:59:39 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 11:59:39 -0700 Subject: [Python-checkins] python/dist/src/Doc/api refcounts.dat,1.38.6.3,1.38.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv18049 Modified Files: Tag: release22-maint refcounts.dat Log Message: Added refcount information for PyObject_GetIter(). Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.38.6.3 retrieving revision 1.38.6.4 diff -C2 -d -r1.38.6.3 -r1.38.6.4 *** refcounts.dat 20 Jun 2002 22:09:12 -0000 1.38.6.3 --- refcounts.dat 4 Oct 2002 18:59:36 -0000 1.38.6.4 *************** *** 805,808 **** --- 805,811 ---- PyObject_GetItem:PyObject*:key:0: + PyObject_GetIter:PyObject*::+1: + PyObject_GetIter:PyObject*:o:0: + PyObject_HasAttr:int::: PyObject_HasAttr:PyObject*:o:0: From fdrake@users.sourceforge.net Fri Oct 4 20:23:08 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 12:23:08 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.246,1.247 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv26228 Modified Files: Makefile Log Message: Remove some unnecessary dependencies (minor). Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** Makefile 1 Oct 2002 15:20:18 -0000 1.246 --- Makefile 4 Oct 2002 19:23:06 -0000 1.247 *************** *** 194,199 **** cd paper-$(PAPER) && $(MKPDF) api.tex ! paper-$(PAPER)/api.tex: api/api.tex $(ANNOAPI) ! $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/api.tex paper-$(PAPER)/abstract.tex: api/abstract.tex $(ANNOAPI) --- 194,199 ---- cd paper-$(PAPER) && $(MKPDF) api.tex ! paper-$(PAPER)/api.tex: api/api.tex ! cp api/api.tex $@ paper-$(PAPER)/abstract.tex: api/abstract.tex $(ANNOAPI) *************** *** 209,214 **** $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/init.tex ! paper-$(PAPER)/intro.tex: api/intro.tex $(ANNOAPI) ! $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/intro.tex paper-$(PAPER)/memory.tex: api/memory.tex $(ANNOAPI) --- 209,214 ---- $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/init.tex ! paper-$(PAPER)/intro.tex: api/intro.tex ! cp api/intro.tex $@ paper-$(PAPER)/memory.tex: api/memory.tex $(ANNOAPI) From fdrake@users.sourceforge.net Fri Oct 4 20:22:39 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 12:22:39 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.235.2.1.2.10,1.235.2.1.2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv26064 Modified Files: Tag: release22-maint Makefile Log Message: Remove some unnecessary dependencies (minor). Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.235.2.1.2.10 retrieving revision 1.235.2.1.2.11 diff -C2 -d -r1.235.2.1.2.10 -r1.235.2.1.2.11 *** Makefile 23 May 2002 19:42:11 -0000 1.235.2.1.2.10 --- Makefile 4 Oct 2002 19:22:37 -0000 1.235.2.1.2.11 *************** *** 191,196 **** cd paper-$(PAPER) && $(MKPDF) api.tex ! paper-$(PAPER)/api.tex: api/api.tex $(ANNOAPI) ! $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/api.tex paper-$(PAPER)/abstract.tex: api/abstract.tex $(ANNOAPI) --- 191,196 ---- cd paper-$(PAPER) && $(MKPDF) api.tex ! paper-$(PAPER)/api.tex: api/api.tex ! cp api/api.tex $@ paper-$(PAPER)/abstract.tex: api/abstract.tex $(ANNOAPI) *************** *** 206,211 **** $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/init.tex ! paper-$(PAPER)/intro.tex: api/intro.tex $(ANNOAPI) ! $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/intro.tex paper-$(PAPER)/memory.tex: api/memory.tex $(ANNOAPI) --- 206,211 ---- $(PYTHON) $(TOOLSDIR)/anno-api.py -o $@ api/init.tex ! paper-$(PAPER)/intro.tex: api/intro.tex ! cp api/intro.tex $@ paper-$(PAPER)/memory.tex: api/memory.tex $(ANNOAPI) From rhettinger@users.sourceforge.net Fri Oct 4 21:01:50 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 13:01:50 -0700 Subject: [Python-checkins] python/dist/src/Lib sets.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7956 Modified Files: sets.py Log Message: .iterkeys() is not needed. Index: sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** sets.py 29 Aug 2002 15:13:50 -0000 1.30 --- sets.py 4 Oct 2002 20:01:48 -0000 1.31 *************** *** 178,182 **** else: little, big = other, self ! common = filter(big._data.has_key, little._data.iterkeys()) return self.__class__(common) --- 178,182 ---- else: little, big = other, self ! common = filter(big._data.has_key, little._data) return self.__class__(common) From fdrake@users.sourceforge.net Fri Oct 4 21:40:47 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 13:40:47 -0700 Subject: [Python-checkins] python/dist/src/Doc/texinputs boilerplate.tex,1.70.2.1.2.6,1.70.2.1.2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv22397/texinputs Modified Files: Tag: release22-maint boilerplate.tex Log Message: Version number updates for Python 2.2.2. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.70.2.1.2.6 retrieving revision 1.70.2.1.2.7 diff -C2 -d -r1.70.2.1.2.6 -r1.70.2.1.2.7 *** boilerplate.tex 2 May 2002 04:50:47 -0000 1.70.2.1.2.6 --- boilerplate.tex 4 Oct 2002 20:40:45 -0000 1.70.2.1.2.7 *************** *** 7,11 **** \date{\today} % XXX update before release! ! \release{2.2.1} % software release, not documentation ! \setreleaseinfo{+} % empty for final release \setshortversion{2.2} % major.minor only for software --- 7,11 ---- \date{\today} % XXX update before release! ! \release{2.2.2} % software release, not documentation ! \setreleaseinfo{b1} % empty for final release \setshortversion{2.2} % major.minor only for software From fdrake@users.sourceforge.net Fri Oct 4 21:40:47 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 04 Oct 2002 13:40:47 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.235.2.1.2.11,1.235.2.1.2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv22397 Modified Files: Tag: release22-maint Makefile Log Message: Version number updates for Python 2.2.2. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.235.2.1.2.11 retrieving revision 1.235.2.1.2.12 diff -C2 -d -r1.235.2.1.2.11 -r1.235.2.1.2.12 *** Makefile 4 Oct 2002 19:22:37 -0000 1.235.2.1.2.11 --- Makefile 4 Oct 2002 20:40:44 -0000 1.235.2.1.2.12 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.1+ PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2 PYTHON= python From gvanrossum@users.sourceforge.net Fri Oct 4 21:49:07 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 04 Oct 2002 13:49:07 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings __init__.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv24937 Modified Files: __init__.py Log Message: When looking for an alias, first look for the normalized name (which still may contain dots), then if that doesn't exist look for the name with dots replaced by underscores. This is a little more forgiving. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/__init__.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** __init__.py 4 Oct 2002 11:45:38 -0000 1.12 --- __init__.py 4 Oct 2002 20:49:05 -0000 1.13 *************** *** 70,74 **** except ImportError: import aliases ! modname = aliases.aliases.get(modname, modname) try: mod = __import__(modname, globals(), locals(), _import_tail) --- 70,76 ---- except ImportError: import aliases ! modname = (aliases.aliases.get(modname) or ! aliases.aliases.get(modname.replace('.', '_')) or ! modname) try: mod = __import__(modname, globals(), locals(), _import_tail) From akuchling@users.sourceforge.net Fri Oct 4 23:34:14 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri, 04 Oct 2002 15:34:14 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv28240 Modified Files: whatsnew23.tex Log Message: Add a section to be written; remove reference to deleted code Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** whatsnew23.tex 14 Sep 2002 02:03:25 -0000 1.52 --- whatsnew23.tex 4 Oct 2002 22:34:11 -0000 1.53 *************** *** 314,317 **** --- 314,323 ---- %====================================================================== + \section{PEP 277: XXX} + + XXX write this section + + + %====================================================================== \section{PEP 278: Universal Newline Support} *************** *** 847,859 **** Modifying \file{sample.h} would then cause the module to be recompiled. (Contributed by Jeremy Hylton.) - - \item Two new binary packagers were added to the Distutils. - \code{bdist_pkgtool} builds \file{.pkg} files to use with Solaris - \program{pkgtool}, and \code{bdist_sdux} builds \program{swinstall} - packages for use on HP-UX. - An abstract binary packager class, - \module{distutils.command.bdist_packager}, was added; this may make it - easier to write binary packaging commands. (Contributed by Mark - Alexander.) \item The \module{getopt} module gained a new function, --- 853,856 ---- From tim_one@users.sourceforge.net Sat Oct 5 02:47:36 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 04 Oct 2002 18:47:36 -0700 Subject: [Python-checkins] python/dist/src/Python pythonrun.c,2.166,2.167 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11587/python/Python Modified Files: pythonrun.c Log Message: s/_alloca/alloca/g; Windows doesn't need the former, at least not unless __STDC__ is defined (or something like that ...). Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.166 retrieving revision 2.167 diff -C2 -d -r2.166 -r2.167 *** pythonrun.c 15 Aug 2002 01:20:16 -0000 2.166 --- pythonrun.c 5 Oct 2002 01:47:34 -0000 2.167 *************** *** 1451,1457 **** { __try { ! /* _alloca throws a stack overflow exception if there's not enough space left on the stack */ ! _alloca(PYOS_STACK_MARGIN * sizeof(void*)); return 0; } __except (EXCEPTION_EXECUTE_HANDLER) { --- 1451,1457 ---- { __try { ! /* alloca throws a stack overflow exception if there's not enough space left on the stack */ ! alloca(PYOS_STACK_MARGIN * sizeof(void*)); return 0; } __except (EXCEPTION_EXECUTE_HANDLER) { From tim_one@users.sourceforge.net Sat Oct 5 02:47:36 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 04 Oct 2002 18:47:36 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.262,2.263 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11587/python/Modules Modified Files: posixmodule.c Log Message: s/_alloca/alloca/g; Windows doesn't need the former, at least not unless __STDC__ is defined (or something like that ...). Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.262 retrieving revision 2.263 diff -C2 -d -r2.262 -r2.263 *** posixmodule.c 3 Oct 2002 07:24:48 -0000 2.262 --- posixmodule.c 5 Oct 2002 01:47:34 -0000 2.263 *************** *** 3607,3611 **** char *comshell; ! s1 = (char *)_alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) return x; --- 3607,3611 ---- char *comshell; ! s1 = (char *)alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) return x; *************** *** 3623,3627 **** /* NT/2000 and not using command.com. */ x = i + strlen(s3) + strlen(cmdstring) + 1; ! s2 = (char *)_alloca(x); ZeroMemory(s2, x); PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring); --- 3623,3627 ---- /* NT/2000 and not using command.com. */ x = i + strlen(s3) + strlen(cmdstring) + 1; ! s2 = (char *)alloca(x); ZeroMemory(s2, x); PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring); *************** *** 3676,3680 **** strlen(szConsoleSpawn) + 1; ! s2 = (char *)_alloca(x); ZeroMemory(s2, x); /* To maintain correct argument passing semantics, --- 3676,3680 ---- strlen(szConsoleSpawn) + 1; ! s2 = (char *)alloca(x); ZeroMemory(s2, x); /* To maintain correct argument passing semantics, From rhettinger@users.sourceforge.net Sat Oct 5 04:58:18 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 20:58:18 -0700 Subject: [Python-checkins] python/dist/src/Tools/idle EditorWindow.py,1.38.18.3,1.38.18.4 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv17647 Modified Files: Tag: release22-maint EditorWindow.py Log Message: Backport 1.43: Extended IDLE's open module menu item to handle hierarchical module names. Closes SF patch 600152. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/EditorWindow.py,v retrieving revision 1.38.18.3 retrieving revision 1.38.18.4 diff -C2 -d -r1.38.18.3 -r1.38.18.4 *** EditorWindow.py 23 Sep 2002 14:17:15 -0000 1.38.18.3 --- EditorWindow.py 5 Oct 2002 03:58:16 -0000 1.38.18.4 *************** *** 82,85 **** --- 82,99 ---- """ % idlever.IDLE_VERSION + def _find_module(fullname, path=None): + """Version of imp.find_module() that handles hierarchical module names""" + + file = None + for tgt in fullname.split('.'): + if file is not None: + file.close() # close intermediate files + (file, filename, descr) = imp.find_module(tgt, path) + if descr[2] == imp.PY_SOURCE: + break # find but not load the source file + module = imp.load_module(tgt, file, filename, descr) + path = module.__path__ + return file, filename, descr + class EditorWindow: *************** *** 341,348 **** if not name: return - # XXX Ought to support package syntax # XXX Ought to insert current file's directory in front of path try: ! (f, file, (suffix, mode, type)) = imp.find_module(name) except (NameError, ImportError), msg: tkMessageBox.showerror("Import error", str(msg), parent=self.text) --- 355,361 ---- if not name: return # XXX Ought to insert current file's directory in front of path try: ! (f, file, (suffix, mode, type)) = _find_module(name) except (NameError, ImportError), msg: tkMessageBox.showerror("Import error", str(msg), parent=self.text) From rhettinger@users.sourceforge.net Sat Oct 5 06:04:10 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 22:04:10 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.10,1.156.4.1.2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv6364 Modified Files: Tag: release22-maint tut.tex Log Message: Backport 1.161: Message for NameError has changed. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.156.4.1.2.10 retrieving revision 1.156.4.1.2.11 diff -C2 -d -r1.156.4.1.2.10 -r1.156.4.1.2.11 *** tut.tex 6 Sep 2002 18:09:22 -0000 1.156.4.1.2.10 --- tut.tex 5 Oct 2002 05:04:07 -0000 1.156.4.1.2.11 *************** *** 3080,3084 **** Traceback (most recent call last): File "", line 1, in ? ! NameError: spam >>> '2' + 2 Traceback (most recent call last): --- 3080,3084 ---- Traceback (most recent call last): File "", line 1, in ? ! NameError: name 'spam' is not defined >>> '2' + 2 Traceback (most recent call last): From rhettinger@users.sourceforge.net Sat Oct 5 06:14:21 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 22:14:21 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.11,1.156.4.1.2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv9662 Modified Files: Tag: release22-maint tut.tex Log Message: Backport 1.160 on looping idioms. Excludes enumerate(), a Py2.3 feature. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.156.4.1.2.11 retrieving revision 1.156.4.1.2.12 diff -C2 -d -r1.156.4.1.2.11 -r1.156.4.1.2.12 *** tut.tex 5 Oct 2002 05:04:07 -0000 1.156.4.1.2.11 --- tut.tex 5 Oct 2002 05:14:19 -0000 1.156.4.1.2.12 *************** *** 2047,2050 **** --- 2047,2079 ---- + \section{Looping Techniques \label{loopidioms}} + + When looping through dictionaries, the key and corresponding value can + be retrieved at the same time using the \method{items()} method. + + \begin{verbatim} + >>> knights = {'gallahad': 'the pure', 'robin': 'the brave'} + >>> for k, v in knights.items(): + ... print k, v + ... + gallahad the pure + robin the brave + \end{verbatim} + + To loop over two or more sequences at the same time, the entries + can be paired with the \function{zip()} function. + + \begin{verbatim} + >>> questions = ['name', 'quest', 'favorite color'] + >>> answers = ['lancelot', 'the holy grail', 'blue'] + >>> for q, a in zip(questions, answers): + ... print 'What is your %s? It is %s.' % (q, a) + ... + What is your name? It is lancelot. + What is your quest? It is the holy grail. + What is your favorite color? It is blue. + \end{verbatim} + + \section{More on Conditions \label{conditions}} From rhettinger@users.sourceforge.net Sat Oct 5 07:12:12 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 23:12:12 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref6.tex,1.47.4.2,1.47.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv30079 Modified Files: Tag: release22-maint ref6.tex Log Message: Backport 1.54 1.53 1.52 1.51 1.50 and 1.49: Try to improve the explanation of the "raise" statement and how its arguments are interpreted. This closes SF bug #532467. Fix Typo. Reword explanation of global statement since an undeclared global is a free variable and is subject to those rules. Note the sole case in which the ban on "from ... import *" within a function is enforced. Remove the following restriction: Names bound by import statements may not occur in global statements in the same scope. Why not? Note that it is illegal to delete a cell variable. Note that deleteing an unbound local will raise a NameError. Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.47.4.2 retrieving revision 1.47.4.3 diff -C2 -d -r1.47.4.2 -r1.47.4.3 *** ref6.tex 25 Jun 2002 13:39:49 -0000 1.47.4.2 --- ref6.tex 5 Oct 2002 06:12:08 -0000 1.47.4.3 *************** *** 353,362 **** to right. ! Deletion of a name removes the binding of that name (which must exist) from the local or global namespace, depending on whether the name ! occurs in a \keyword{global} statement in the same code block. \stindex{global} \indexii{unbinding}{name} Deletion of attribute references, subscriptions and slicings is passed to the primary object involved; deletion of a slicing --- 353,366 ---- to right. ! Deletion of a name removes the binding of that name from the local or global namespace, depending on whether the name ! occurs in a \keyword{global} statement in the same code block. If the ! name is unbound, a \exception{NameError} exception will be raised. \stindex{global} \indexii{unbinding}{name} + It is illegal to delete a name from the local namespace if it occurs + as a free variable\indexii{free}{variable} in a nested block. + Deletion of attribute references, subscriptions and slicings is passed to the primary object involved; deletion of a slicing *************** *** 518,552 **** If no expressions are present, \keyword{raise} re-raises the last ! expression that was raised in the current scope. ! ! Otherwise, \keyword{raise} evaluates its first expression, which must yield ! a string, class, or instance object. If there is a second expression, ! this is evaluated, else \code{None} is substituted. If the first ! expression is a class object, then the second expression may be an ! instance of that class or one of its derivatives, and then that ! instance is raised. If the second expression is not such an instance, ! the given class is instantiated. The argument list for the ! instantiation is determined as follows: if the second expression is a ! tuple, it is used as the argument list; if it is \code{None}, the ! argument list is empty; otherwise, the argument list consists of a ! single argument which is the second expression. If the first ! expression is an instance object, the second expression must be ! \code{None}. \index{exception} \indexii{raising}{exception} ! If the first object is a string, it then raises the exception ! identified by the first object, with the second one (or \code{None}) ! as its parameter. If the first object is a class or instance, ! it raises the exception identified by the class of the instance ! determined in the previous step, with the instance as ! its parameter. - If a third object is present, and it is not \code{None}, it should be - a traceback object (see section~\ref{traceback}), and it is - substituted instead of the current location as the place where the - exception occurred. This is useful to re-raise an exception - transparently in an except clause. - \obindex{traceback} --- 522,563 ---- If no expressions are present, \keyword{raise} re-raises the last ! expression that was active in the current scope. If no exception has ! been active in the current scope, an exception is raised that ! indicates indicates that this is the error. \index{exception} \indexii{raising}{exception} ! Otherwise, \keyword{raise} evaluates the expressions to get three ! objects, using \code{None} as the value of omitted expressions. The ! first two objects are used to determine the \emph{type} and ! \emph{value} of the exception. ! ! If the first object is an instance, the type of the exception is the ! class of the instance, the instance itself if the value, and the ! second object must be \code{None}. ! ! If the first object is a class, it becomes the type of the exception. ! The second object is used to determine the exception value: If it is ! an instance of the class, the instance becomes the exception value. ! If the second object is a tuple, it is used as the argument list for ! the class constructor; if it is \code{None}, an empty argument list is ! used, and any other object is treated as a single argument to the ! constructor. The instance so created by calling the constructor is ! used as the exception value. ! ! If the first object is a string, the string object is the exception ! type, and the second object becomes the exception value. ! ! If a third object is present and not \code{None}, it must be a ! traceback\obindex{traceback} object (see section~\ref{traceback}), and ! it is substituted instead of the current location as the place where ! the exception occurred. If the third object is present and not a ! traceback object or \code{None}, a \exception{TypeError} exception is ! raised. The three-expression form of \keyword{raise} is useful to ! re-raise an exception transparently in an except clause, but ! \keyword{raise} with no expressions should be preferred if the ! exception to be re-raised was the most recently active exception in ! the current scope. *************** *** 691,699 **** (\character{_}). ! Names bound by \keyword{import} statements may not occur in ! \keyword{global} statements in the same scope. ! \stindex{global} - The \keyword{from} form with \samp{*} may only occur in a module scope. \kwindex{from} \stindex{from} --- 702,710 ---- (\character{_}). ! The \keyword{from} form with \samp{*} may only occur in a module ! scope. If the wild card form of import --- \samp{import *} --- is ! used in a function and the function contains or is a nested block with ! free variables, the compiler will raise a \exception{SyntaxError}. \kwindex{from} \stindex{from} *************** *** 730,736 **** The \keyword{global} statement is a declaration which holds for the entire current code block. It means that the listed identifiers are to be ! interpreted as globals. While \emph{using} global names is automatic ! if they are not defined in the local scope, \emph{assigning} to global ! names would be impossible without \keyword{global}. \indexiii{global}{name}{binding} --- 741,747 ---- The \keyword{global} statement is a declaration which holds for the entire current code block. It means that the listed identifiers are to be ! interpreted as globals. It would be impossible to assign to a global ! variable without \keyword{global}, although free variables may refer ! to globals without being declared global. \indexiii{global}{name}{binding} From rhettinger@users.sourceforge.net Sat Oct 5 07:40:51 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 23:40:51 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex,1.82.4.5,1.82.4.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv9204 Modified Files: Tag: release22-maint ref3.tex Log Message: Backport 1.94: Clarified that the footnote applies to versions 1.5 and after instead of just version 1.5. Closes SF bug 577793. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.82.4.5 retrieving revision 1.82.4.6 diff -C2 -d -r1.82.4.5 -r1.82.4.6 *** ref3.tex 24 Sep 2002 21:01:07 -0000 1.82.4.5 --- ref3.tex 5 Oct 2002 06:40:49 -0000 1.82.4.6 *************** *** 960,967 **** globals referenced by the \method{__del__()} method may already have been deleted. For this reason, \method{__del__()} methods should do the ! absolute minimum needed to maintain external invariants. Python 1.5 ! guarantees that globals whose name begins with a single underscore are ! deleted from their module before other globals are deleted; if no ! other references to such globals exist, this may help in assuring that imported modules are still available at the time when the \method{__del__()} method is called. --- 960,967 ---- globals referenced by the \method{__del__()} method may already have been deleted. For this reason, \method{__del__()} methods should do the ! absolute minimum needed to maintain external invariants. Starting with ! version 1.5, Python guarantees that globals whose name begins with a single ! underscore are deleted from their module before other globals are deleted; ! if no other references to such globals exist, this may help in assuring that imported modules are still available at the time when the \method{__del__()} method is called. From rhettinger@users.sourceforge.net Sat Oct 5 07:51:36 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 04 Oct 2002 23:51:36 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.53.4.6,1.53.4.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv11196 Modified Files: Tag: release22-maint ref5.tex Log Message: Backport 1.61 (note, the actual deprecation is not backported since it could affect existing code; instead, the documentation of the deprecation is being backported to provide maximum advance notice): Patch 543387. Document deprecation of complex %, //,and divmod(). Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.53.4.6 retrieving revision 1.53.4.7 diff -C2 -d -r1.53.4.6 -r1.53.4.7 *** ref5.tex 25 Jun 2002 04:00:24 -0000 1.53.4.6 --- ref5.tex 5 Oct 2002 06:51:34 -0000 1.53.4.7 *************** *** 706,710 **** modulo are also connected with the built-in function \function{divmod()}: \code{divmod(x, y) == (x/y, x\%y)}. These identities don't hold for ! floating point and complex numbers; there similar identities hold approximately where \code{x/y} is replaced by \code{floor(x/y)}) or \code{floor(x/y) - 1} (for floats),\footnote{ --- 706,710 ---- modulo are also connected with the built-in function \function{divmod()}: \code{divmod(x, y) == (x/y, x\%y)}. These identities don't hold for ! floating point numbers; there similar identities hold approximately where \code{x/y} is replaced by \code{floor(x/y)}) or \code{floor(x/y) - 1} (for floats),\footnote{ *************** *** 714,719 **** the latter result, in order to preserve that \code{divmod(x,y)[0] * y + x \%{} y} be very close to \code{x}. ! } or \code{floor((x/y).real)} (for ! complex). The \code{+} (addition) operator yields the sum of its arguments. --- 714,724 ---- the latter result, in order to preserve that \code{divmod(x,y)[0] * y + x \%{} y} be very close to \code{x}. ! }. ! ! Complex floor division operator, modulo operator, and ! \function{divmod()}. ! ! \deprecated{2.3}{Instead convert to float using \function{abs()} ! if appropriate.} The \code{+} (addition) operator yields the sum of its arguments. From loewis@users.sourceforge.net Sat Oct 5 10:46:50 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 05 Oct 2002 02:46:50 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.492,1.493 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv19723/Misc Modified Files: NEWS Log Message: Document patch #594001. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.492 retrieving revision 1.493 diff -C2 -d -r1.492 -r1.493 *** NEWS 4 Oct 2002 11:55:21 -0000 1.492 --- NEWS 5 Oct 2002 09:46:48 -0000 1.493 *************** *** 67,70 **** --- 67,72 ---- ----------------- + - Unicode file name processing for Windows (PEP 277) is implemented. + - Codec error handling callbacks (PEP 293) are implemented. Error handling in unicode.encode or str.decode can now be customized. From loewis@users.sourceforge.net Sat Oct 5 10:46:50 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 05 Oct 2002 02:46:50 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.96,1.97 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19723/Doc/lib Modified Files: libos.tex Log Message: Document patch #594001. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** libos.tex 9 Sep 2002 16:17:45 -0000 1.96 --- libos.tex 5 Oct 2002 09:46:48 -0000 1.97 *************** *** 636,639 **** --- 636,645 ---- \end{funcdesc} + \begin{funcdesc}{getcwdu}{} + Return a Unicode object representing the current working directory. + Availability: \UNIX, Windows. + \versionadded{2.3} + \end{funcdesc} + \begin{funcdesc}{chroot}{path} Change the root directory of the current process to \var{path}. *************** *** 671,674 **** --- 677,683 ---- directory. Availability: Macintosh, \UNIX, Windows. + + \versionadded[On Windows NT/2k/XP, if \var{path} is a Unicode object, + the result will be a list of Unicode objects.]{2.3} \end{funcdesc} From rhettinger@users.sourceforge.net Sat Oct 5 15:42:54 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 07:42:54 -0700 Subject: [Python-checkins] python/dist/src/Lib random.py,1.26.6.6,1.26.6.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17518 Modified Files: Tag: release22-maint random.py Log Message: Backport 1.33 (omitting the deprecation warning but keeping the deprecation comment): Deprecated Random.cunifvariate clearing bug 506647. Also, added docstrings. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.26.6.6 retrieving revision 1.26.6.7 diff -C2 -d -r1.26.6.6 -r1.26.6.7 *** random.py 23 Sep 2002 14:52:40 -0000 1.26.6.6 --- random.py 5 Oct 2002 14:42:52 -0000 1.26.6.7 *************** *** 108,111 **** --- 108,124 ---- class Random: + """Random number generator base class used by bound module functions. + + Used to instantiate instances of Random to get generators that don't + share state. Especially useful for multi-threaded programs, creating + a different instance of Random for each thread, and using the jumpahead() + method to ensure that the generated sequences seen by each thread don't + overlap. + + Class Random can also be subclassed if you want to use a different basic + generator of your own devising: in that case, override the following + methods: random(), seed(), getstate(), setstate() and jumpahead(). + + """ VERSION = 1 # used by getstate/setstate *************** *** 372,375 **** --- 385,393 ---- def normalvariate(self, mu, sigma): + """Normal distribution. + + mu is the mean, and sigma is the standard deviation. + + """ # mu = mean, sigma = standard deviation *************** *** 392,395 **** --- 410,420 ---- def lognormvariate(self, mu, sigma): + """Log normal distribution. + + If you take the natural logarithm of this distribution, you'll get a + normal distribution with mean mu and standard deviation sigma. + mu can have any value, and sigma must be greater than zero. + + """ return _exp(self.normalvariate(mu, sigma)) *************** *** 397,400 **** --- 422,436 ---- def cunifvariate(self, mean, arc): + """Circular uniform distribution. + + mean is the mean angle, and arc is the range of the distribution, + centered around the mean angle. Both values must be expressed in + radians. Returned values range between mean - arc/2 and + mean + arc/2 and are normalized to between 0 and pi. + + Deprecated in version 2.3. Use: + (mean + arc * (Random.random() - 0.5)) % Math.pi + + """ # mean: mean angle (in radians between 0 and pi) # arc: range of distribution (in radians between 0 and pi) *************** *** 405,408 **** --- 441,451 ---- def expovariate(self, lambd): + """Exponential distribution. + + lambd is 1.0 divided by the desired mean. (The parameter would be + called "lambda", but that is a reserved word in Python.) Returned + values range from 0 to positive infinity. + + """ # lambd: rate lambd = 1/mean # ('lambda' is a Python reserved word) *************** *** 417,420 **** --- 460,471 ---- def vonmisesvariate(self, mu, kappa): + """Circular data distribution. + + mu is the mean angle, expressed in radians between 0 and 2*pi, and + kappa is the concentration parameter, which must be greater than or + equal to zero. If kappa is equal to zero, this distribution reduces + to a uniform random angle over the range 0 to 2*pi. + + """ # mu: mean angle (in radians between 0 and 2*pi) # kappa: concentration parameter kappa (>= 0) *************** *** 459,462 **** --- 510,518 ---- def gammavariate(self, alpha, beta): + """Gamma distribution. Not the gamma function! + + Conditions on the parameters are alpha > 0 and beta > 0. + + """ # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2 *************** *** 538,541 **** --- 594,605 ---- def gauss(self, mu, sigma): + """Gaussian distribution. + + mu is the mean, and sigma is the standard deviation. This is + slightly faster than the normalvariate() function. + + Not thread-safe without a lock around calls. + + """ # When x and y are two variables from [0, 1), uniformly *************** *** 583,586 **** --- 647,657 ---- def betavariate(self, alpha, beta): + """Beta distribution. + + Conditions on the parameters are alpha > -1 and beta} > -1. + Returned values range between 0 and 1. + + """ + # This version due to Janne Sinkkonen, and matches all the std # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution"). *************** *** 594,597 **** --- 665,669 ---- def paretovariate(self, alpha): + """Pareto distribution. alpha is the shape parameter.""" # Jain, pg. 495 *************** *** 602,605 **** --- 674,682 ---- def weibullvariate(self, alpha, beta): + """Weibull distribution. + + alpha is the scale parameter and beta is the shape parameter. + + """ # Jain, pg. 499; bug fix courtesy Bill Arms From rhettinger@users.sourceforge.net Sat Oct 5 16:00:12 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:00:12 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib librandom.tex,1.25.18.3,1.25.18.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26146 Modified Files: Tag: release22-maint librandom.tex Log Message: Backport 1.30 and 1.29: Markup adjustments; fix the names of modules referenced in an expression. Deprecated Random.cunifvariate clearing bug 506647. Index: librandom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librandom.tex,v retrieving revision 1.25.18.3 retrieving revision 1.25.18.4 diff -C2 -d -r1.25.18.3 -r1.25.18.4 *** librandom.tex 13 May 2002 23:47:02 -0000 1.25.18.3 --- librandom.tex 5 Oct 2002 15:00:09 -0000 1.25.18.4 *************** *** 207,211 **** between 0 and \emph{pi}. Returned values range between \code{\var{mean} - \var{arc}/2} and \code{\var{mean} + ! \var{arc}/2}. \end{funcdesc} --- 207,214 ---- between 0 and \emph{pi}. Returned values range between \code{\var{mean} - \var{arc}/2} and \code{\var{mean} + ! \var{arc}/2} and are normalized to between 0 and \emph{pi}. ! ! \deprecated{2.3}{Instead, use \code{(\var{mean} + \var{arc} * ! (random.random() - 0.5)) \% math.pi}.} \end{funcdesc} From rhettinger@users.sourceforge.net Sat Oct 5 16:14:35 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:14:35 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib librotor.tex,1.18,1.18.22.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv638 Modified Files: Tag: release22-maint librotor.tex Log Message: Backport 1.19: Document that the key should not contain null bytes. Index: librotor.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librotor.tex,v retrieving revision 1.18 retrieving revision 1.18.22.1 diff -C2 -d -r1.18 -r1.18.22.1 *** librotor.tex 24 Jan 2001 17:19:07 -0000 1.18 --- librotor.tex 5 Oct 2002 15:14:33 -0000 1.18.22.1 *************** *** 30,34 **** \begin{funcdesc}{newrotor}{key\optional{, numrotors}} Return a rotor object. \var{key} is a string containing the encryption key ! for the object; it can contain arbitrary binary data. The key will be used to randomly generate the rotor permutations and their initial positions. \var{numrotors} is the number of rotor permutations in the returned object; --- 30,35 ---- \begin{funcdesc}{newrotor}{key\optional{, numrotors}} Return a rotor object. \var{key} is a string containing the encryption key ! for the object; it can contain arbitrary binary data but not null bytes. ! The key will be used to randomly generate the rotor permutations and their initial positions. \var{numrotors} is the number of rotor permutations in the returned object; *************** *** 39,43 **** \begin{methoddesc}[rotor]{setkey}{key} ! Sets the rotor's key to \var{key}. \end{methoddesc} --- 40,44 ---- \begin{methoddesc}[rotor]{setkey}{key} ! Sets the rotor's key to \var{key}. The key should not contain null bytes. \end{methoddesc} From rhettinger@users.sourceforge.net Sat Oct 5 16:25:35 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:25:35 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex,1.73.6.9,1.73.6.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5277 Modified Files: Tag: release22-maint libre.tex Log Message: Backport 1.88 and 1.87: Update docs to reflect that \b considers underscore to be part of a word. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.73.6.9 retrieving revision 1.73.6.10 diff -C2 -d -r1.73.6.9 -r1.73.6.10 *** libre.tex 20 Aug 2002 13:58:12 -0000 1.73.6.9 --- libre.tex 5 Oct 2002 15:25:33 -0000 1.73.6.10 *************** *** 332,342 **** \item[\code{\e b}] Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of ! alphanumeric characters, so the end of a word is indicated by ! whitespace or a non-alphanumeric character. Inside a character range, ! \regexp{\e b} represents the backspace character, for compatibility with ! Python's string literals. ! \item[\code{\e B}] Matches the empty string, but only when it is ! \emph{not} at the beginning or end of a word. \item[\code{\e d}]Matches any decimal digit; this is --- 332,346 ---- \item[\code{\e b}] Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of ! alphanumeric or underscore characters, so the end of a word is indicated by ! whitespace or a non-alphanumeric, non-underscore character. Note that ! {}\code{\e b} is defined as the boundary between \code{\e w} and \code{\e ! W}, so the precise set of characters deemed to be alphanumeric depends on the ! values of the \code{UNICODE} and \code{LOCALE} flags. Inside a character ! range, \regexp{\e b} represents the backspace character, for compatibility ! with Python's string literals. ! \item[\code{\e B}] Matches the empty string, but only when it is \emph{not} ! at the beginning or end of a word. This is just the opposite of {}\code{\e ! b}, so is also subject to the settings of \code{LOCALE} and \code{UNICODE}. \item[\code{\e d}]Matches any decimal digit; this is From rhettinger@users.sourceforge.net Sat Oct 5 16:38:19 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:38:19 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex,1.80.6.12,1.80.6.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11024 Modified Files: Tag: release22-maint libstdtypes.tex Log Message: Backport 1.100: Discussion of Stop Iteration in the Iterator Protocol. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.80.6.12 retrieving revision 1.80.6.13 diff -C2 -d -r1.80.6.12 -r1.80.6.13 *** libstdtypes.tex 19 Aug 2002 22:01:19 -0000 1.80.6.12 --- libstdtypes.tex 5 Oct 2002 15:38:16 -0000 1.80.6.13 *************** *** 368,371 **** --- 368,378 ---- implementation of the iterator protocol. + The intention of the protocol is that once an iterator's + \method{next()} method raises \exception{StopIteration}, it will + continue to do so on subsequent calls. Implementations that + do not obey this property are deemed broken. (This constraint + was added in Python 2.3; in Python 2.2, various iterators are + broken according to this rule.) + \subsection{Sequence Types \label{typesseq}} From rhettinger@users.sourceforge.net Sat Oct 5 16:41:58 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:41:58 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex,1.80.6.13,1.80.6.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv13793 Modified Files: Tag: release22-maint libstdtypes.tex Log Message: Backport 1.94: Patch 543387. Document deprecation of complex %, //,and divmod(). Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.80.6.13 retrieving revision 1.80.6.14 diff -C2 -d -r1.80.6.13 -r1.80.6.14 *** libstdtypes.tex 5 Oct 2002 15:38:16 -0000 1.80.6.13 --- libstdtypes.tex 5 Oct 2002 15:41:56 -0000 1.80.6.14 *************** *** 218,223 **** \bifuncindex{complex} ! All numeric types support the following operations, sorted by ! ascending priority (operations in the same box have the same priority; all numeric operations have a higher priority than comparison operations): --- 218,223 ---- \bifuncindex{complex} ! All numeric types (except complex) support the following operations, ! sorted by ascending priority (operations in the same box have the same priority; all numeric operations have a higher priority than comparison operations): *************** *** 229,233 **** \lineiii{\var{x} * \var{y}}{product of \var{x} and \var{y}}{} \lineiii{\var{x} / \var{y}}{quotient of \var{x} and \var{y}}{(1)} ! \lineiii{\var{x} \%{} \var{y}}{remainder of \code{\var{x} / \var{y}}}{} \hline \lineiii{-\var{x}}{\var{x} negated}{} --- 229,233 ---- \lineiii{\var{x} * \var{y}}{product of \var{x} and \var{y}}{} \lineiii{\var{x} / \var{y}}{quotient of \var{x} and \var{y}}{(1)} ! \lineiii{\var{x} \%{} \var{y}}{remainder of \code{\var{x} / \var{y}}}{(4)} \hline \lineiii{-\var{x}}{\var{x} negated}{} *************** *** 240,244 **** \lineiii{complex(\var{re},\var{im})}{a complex number with real part \var{re}, imaginary part \var{im}. \var{im} defaults to zero.}{} \lineiii{\var{c}.conjugate()}{conjugate of the complex number \var{c}}{} ! \lineiii{divmod(\var{x}, \var{y})}{the pair \code{(\var{x} / \var{y}, \var{x} \%{} \var{y})}}{(3)} \lineiii{pow(\var{x}, \var{y})}{\var{x} to the power \var{y}}{} \lineiii{\var{x} ** \var{y}}{\var{x} to the power \var{y}}{} --- 240,244 ---- \lineiii{complex(\var{re},\var{im})}{a complex number with real part \var{re}, imaginary part \var{im}. \var{im} defaults to zero.}{} \lineiii{\var{c}.conjugate()}{conjugate of the complex number \var{c}}{} ! \lineiii{divmod(\var{x}, \var{y})}{the pair \code{(\var{x} / \var{y}, \var{x} \%{} \var{y})}}{(3)(4)} \lineiii{pow(\var{x}, \var{y})}{\var{x} to the power \var{y}}{} \lineiii{\var{x} ** \var{y}}{\var{x} to the power \var{y}}{} *************** *** 272,275 **** --- 272,281 ---- See section \ref{built-in-funcs}, ``Built-in Functions,'' for a full description. + + \item[(4)] + Complex floor division operator, modulo operator, and \function{divmod()}. + + \deprecated{2.3}{Instead convert to float using \function{abs()} + if appropriate.} \end{description} From rhettinger@users.sourceforge.net Sat Oct 5 16:50:43 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:50:43 -0700 Subject: [Python-checkins] python/dist/src/Doc/ext building.tex,1.1.2.2,1.1.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv18169 Modified Files: Tag: release22-maint building.tex Log Message: Typo Index: building.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/building.tex,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** building.tex 16 May 2002 13:47:31 -0000 1.1.2.2 --- building.tex 5 Oct 2002 15:50:41 -0000 1.1.2.3 *************** *** 9,13 **** mechanism (known as related to Makefile.pre.in, and Setup files) is no longer supported. Building custom interpreters was rarely used, and ! extensions modules can be built using distutils. Building an extension module using distutils requires that distutils --- 9,13 ---- mechanism (known as related to Makefile.pre.in, and Setup files) is no longer supported. Building custom interpreters was rarely used, and ! extension modules can be built using distutils. Building an extension module using distutils requires that distutils From rhettinger@users.sourceforge.net Sat Oct 5 16:52:40 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 08:52:40 -0700 Subject: [Python-checkins] python/dist/src/Doc/ext windows.tex,1.3.6.2,1.3.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv19130 Modified Files: Tag: release22-maint windows.tex Log Message: Typo Index: windows.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/windows.tex,v retrieving revision 1.3.6.2 retrieving revision 1.3.6.3 diff -C2 -d -r1.3.6.2 -r1.3.6.3 *** windows.tex 19 Apr 2002 04:06:06 -0000 1.3.6.2 --- windows.tex 5 Oct 2002 15:52:38 -0000 1.3.6.3 *************** *** 111,115 **** \item ! \strong{Cretating your own project}\\ Choose a name and create a directory for it. Copy your C sources into it. Note that the module source file name does not --- 111,115 ---- \item ! \strong{Creating your own project}\\ Choose a name and create a directory for it. Copy your C sources into it. Note that the module source file name does not From rhettinger@users.sourceforge.net Sat Oct 5 17:55:13 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 09:55:13 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref4.tex,1.28.18.2,1.28.18.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv11498 Modified Files: Tag: release22-maint ref4.tex Log Message: Backported Jeremy's documentation of nested scopes, execution frames and such. Index: ref4.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref4.tex,v retrieving revision 1.28.18.2 retrieving revision 1.28.18.3 diff -C2 -d -r1.28.18.2 -r1.28.18.3 *** ref4.tex 28 Aug 2002 02:10:04 -0000 1.28.18.2 --- ref4.tex 5 Oct 2002 16:55:11 -0000 1.28.18.3 *************** *** 3,165 **** ! \section{Code blocks, execution frames, and namespaces \label{execframes}} ! \index{code block} \index{namespace} ! \indexii{execution}{frame} ! A \dfn{code block}\indexii{code}{block} is a piece ! of Python program text that can be executed as a unit, such as a ! module, a class definition or a function body. Some code blocks (like ! modules) are normally executed only once, others (like function ! bodies) may be executed many times. Code blocks may textually contain ! other code blocks. Code blocks may invoke other code blocks (that may ! or may not be textually contained in them) as part of their execution, ! e.g., by invoking (calling) a function. ! The following are code blocks: A module is a code block. A function ! body is a code block. A class definition is a code block. Each ! command typed interactively is a separate code block; a script file (a ! file given as standard input to the interpreter or specified on the ! interpreter command line the first argument) is a code block; a script ! command (a command specified on the interpreter command line with the ! `\strong{-c}' option) is a code block. The file read by the built-in ! function \function{execfile()} is a code block. The string argument ! passed to the built-in function \function{eval()} and to the ! \keyword{exec} statement is a code block. And finally, the expression ! read and evaluated by the built-in function \function{input()} is a ! code block. ! A code block is executed in an execution frame. An \dfn{execution ! frame}\indexii{execution}{frame} contains some administrative ! information (used for debugging), determines where and how execution ! continues after the code block's execution has completed, and (perhaps ! most importantly) defines two namespaces, the local and the global ! namespace, that affect execution of the code block. ! A \dfn{namespace}\index{namespace} is a mapping from names ! (identifiers) to objects. A particular namespace may be referenced by ! more than one execution frame, and from other places as well. Adding ! a name to a namespace is called \dfn{binding}\indexii{binding}{name} a ! name (to an object); changing the mapping of a name is called ! \dfn{rebinding}\indexii{rebinding}{name}; removing a name is ! \dfn{unbinding}\indexii{unbinding}{name}. Namespaces are functionally ! equivalent to dictionaries (and often implemented as dictionaries). ! The \dfn{local namespace}\indexii{local}{namespace} of an execution ! frame determines the default place where names are defined and ! searched. The ! \dfn{global namespace}\indexii{global}{namespace} determines the place ! where names listed in \keyword{global}\stindex{global} statements are ! defined and searched, and where names that are not bound anywhere in ! the current code block are searched. ! Whether a name is local or global in a code block is determined by ! static inspection of the source text for the code block: in the ! absence of \keyword{global} statements, a name that is bound anywhere ! in the code block is local in the entire code block; all other names ! are considered global. The \keyword{global} statement forces global ! interpretation of selected names throughout the code block. The ! following constructs bind names: formal parameters to functions, \keyword{import} statements, class and function definitions (these bind the class or function name in the defining block), and targets that are identifiers if occurring in an assignment, \keyword{for} loop header, or in the second position of an \keyword{except} clause ! header. Local names are searched only on the local namespace; global ! names are searched only in the global and built-in ! namespace.\footnote{ ! If the code block contains \keyword{exec} statements or the ! construct ``\samp{from \ldots import *}'', the semantics of local ! names change: local name lookup first searches the local namespace, ! then the global namespace and the built-in namespace.} A target occurring in a \keyword{del} statement is also considered bound ! for this purpose (though the actual semantics are to ``unbind'' the ! name). ! When a global name is not found in the global namespace, it is ! searched in the built-in namespace (which is actually the global ! namespace of the module ! \module{__builtin__}\refbimodindex{__builtin__}). The built-in ! namespace associated with the execution of a code block is actually ! found by looking up the name \code{__builtins__} in its global ! namespace; this should be a dictionary or a module (in the latter case ! its dictionary is used). Normally, the \code{__builtins__} namespace ! is the dictionary of the built-in module \module{__builtin__} (note: ! no `s'); if it isn't, restricted ! execution\indexii{restricted}{execution} mode is in effect. When a ! name is not found at all, a ! \exception{NameError}\withsubitem{(built-in ! exception)}{\ttindex{NameError}} exception is raised. ! \stindex{from} ! \stindex{exec} ! \stindex{global} ! The following table lists the meaning of the local and global ! namespace for various types of code blocks. The namespace for a ! particular module is automatically created when the module is first ! imported (i.e., when it is loaded). Note that in almost all cases, ! the global namespace is the namespace of the containing module --- ! scopes in Python do not nest! ! \begin{tableiv}{l|l|l|l}{textrm} ! {Code block type}{Global namespace}{Local namespace}{Notes} ! \lineiv{Module} ! {n.s. for this module} ! {same as global}{} ! \lineiv{Script (file or command)} ! {n.s. for \module{__main__}\refbimodindex{__main__}} ! {same as global}{(1)} ! \lineiv{Interactive command} ! {n.s. for \module{__main__}\refbimodindex{__main__}} ! {same as global}{} ! \lineiv{Class definition} ! {global n.s. of containing block} ! {new n.s.}{} ! \lineiv{Function body} ! {global n.s. of containing block} ! {new n.s.}{(2)} ! \lineiv{String passed to \keyword{exec} statement} ! {global n.s. of containing block} ! {local n.s. of containing block}{(2), (3)} ! \lineiv{String passed to \function{eval()}} ! {global n.s. of caller} ! {local n.s. of caller}{(2), (3)} ! \lineiv{File read by \function{execfile()}} ! {global n.s. of caller} ! {local n.s. of caller}{(2), (3)} ! \lineiv{Expression read by \function{input()}} ! {global n.s. of caller} ! {local n.s. of caller}{} ! \end{tableiv} ! Notes: ! \begin{description} ! \item[n.s.] means \emph{namespace} ! \item[(1)] The main module for a script is always called ! \module{__main__}; ``the filename don't enter into it.'' ! \item[(2)] The global and local namespace for these can be ! overridden with optional extra arguments. ! \item[(3)] The \keyword{exec} statement and the \function{eval()} and ! \function{execfile()} functions have optional arguments to override ! the global and local namespace. If only one namespace is specified, ! it is used for both. ! \end{description} ! The built-in functions \function{globals()} and \function{locals()} returns a ! dictionary representing the current global and local namespace, ! respectively. The effect of modifications to this dictionary on the ! namespace are undefined.\footnote{ ! The current implementations return the dictionary actually used to ! implement the namespace, \emph{except} for functions, where the ! optimizer may cause the local namespace to be implemented ! differently, and \function{locals()} returns a read-only ! dictionary.} \section{Exceptions \label{exceptions}} --- 3,152 ---- ! \section{Naming and binding \label{naming}} ! \indexii{code}{block} \index{namespace} ! \index{scope} ! \dfn{Names}\index{name} refer to objects. Names are introduced by ! name binding operations. Each occurrence of a name in the program ! text refers to the \dfn{binding}\indexii{binding}{name} of that name ! established in the innermost function block containing the use. ! A \dfn{block}\index{block} is a piece of Python program text that is ! executed as a unit. The following are blocks: a module, a function ! body, and a class definition. Each command typed interactively is a ! block. A script file (a file given as standard input to the ! interpreter or specified on the interpreter command line the first ! argument) is a code block. A script command (a command specified on ! the interpreter command line with the `\strong{-c}' option) is a code ! block. The file read by the built-in function \function{execfile()} ! is a code block. The string argument passed to the built-in function ! \function{eval()} and to the \keyword{exec} statement is a code block. ! The expression read and evaluated by the built-in function ! \function{input()} is a code block. ! A code block is executed in an \dfn{execution ! frame}\indexii{execution}{frame}. A frame contains some ! administrative information (used for debugging) and determines where ! and how execution continues after the code block's execution has ! completed. ! A \dfn{scope}\index{scope} defines the visibility of a name within a ! block. If a local variable is defined in a block, its scope includes ! that block. If the definition occurs in a function block, the scope ! extends to any blocks contained within the defining one, unless a ! contained block introduces a different binding for the name. The ! scope of names defined in a class block is limited to the class block; ! it does not extend to the code blocks of methods. ! When a name is used in a code block, it is resolved using the nearest ! enclosing scope. The set of all such scopes visible to a code block ! is called the block's \dfn{environment}\index{environment}. ! If a name is bound in a block, it is a local variable of that block. ! If a name is bound at the module level, it is a global variable. (The ! variables of the module code block are local and global.) If a ! variable is used in a code block but not defined there, it is a ! \dfn{free variable}\indexii{free}{variable}. ! ! When a name is not found at all, a ! \exception{NameError}\withsubitem{(built-in ! exception)}{\ttindex{NameError}} exception is raised. If the name ! refers to a local variable that has not been bound, a ! \exception{UnboundLocalError}\ttindex{UnboundLocalError} exception is ! raised. \exception{UnboundLocalError} is a subclass of ! \exception{NameError}. ! ! The following constructs bind names: formal parameters to functions, \keyword{import} statements, class and function definitions (these bind the class or function name in the defining block), and targets that are identifiers if occurring in an assignment, \keyword{for} loop header, or in the second position of an \keyword{except} clause ! header. The \keyword{import} statement of the form ``\samp{from ! \ldots import *}''\stindex{from} binds all names defined in the ! imported module, except those beginning with an underscore. This form ! may only be used at the module level. A target occurring in a \keyword{del} statement is also considered bound ! for this purpose (though the actual semantics are to unbind the ! name). It is illegal to unbind a name that is referenced by an ! enclosing scope; the compiler will report a \exception{SyntaxError}. ! Each assignment or import statement occurs within a block defined by a ! class or function definition or at the module level (the top-level ! code block). ! If a name binding operation occurs anywhere within a code block, all ! uses of the name within the block are treated as references to the ! current block. This can lead to errors when a name is used within a ! block before it is bound. ! The previous rule is a subtle. Python lacks declarations and allows ! name binding operations to occur anywhere within a code block. The ! local variables of a code block can be determined by scanning the ! entire text of the block for name binding operations. ! If the global statement occurs within a block, all uses of the name ! specified in the statement refer to the binding of that name in the ! top-level namespace. Names are resolved in the top-level namespace by ! searching the global namespace, i.e. the namespace of the module ! containing the code block, and the builtin namespace, the namespace of ! the module \module{__builtin__}. The global namespace is searched ! first. If the name is not found there, the builtin namespace is ! searched. The global statement must precede all uses of the name. ! The built-in namespace associated with the execution of a code block ! is actually found by looking up the name \code{__builtins__} in its ! global namespace; this should be a dictionary or a module (in the ! latter case the module's dictionary is used). Normally, the ! \code{__builtins__} namespace is the dictionary of the built-in module ! \module{__builtin__} (note: no `s'). If it isn't, restricted ! execution\indexii{restricted}{execution} mode is in effect. ! The namespace for a module is automatically created the first time a ! module is imported. The main module for a script is always called ! \module{__main__}\refbimodindex{__main__}. ! The global statement has the same scope as a name binding operation ! in the same block. If the nearest enclosing scope for a free variable ! contains a global statement, the free variable is treated as a global. ! A class definition is an executable statement that may use and define ! names. These references follow the normal rules for name resolution. ! The namespace of the class definition becomes the attribute dictionary ! of the class. Names defined at the class scope are not visible in ! methods. ! \subsection{Interaction with dynamic features \label{dynamic-features}} ! There are several cases where Python statements are illegal when ! used in conjunction with nested scopes that contain free ! variables. ! If a variable is referenced in an enclosing scope, it is illegal ! to delete the name. An error will be reported at compile time. + If the wild card form of import --- \samp{import *} --- is used in a + function and the function contains or is a nested block with free + variables, the compiler will raise a SyntaxError. + + If \keyword{exec} is used in a function and the function contains or + is a nested block with free variables, the compiler will raise a + \exception{SyntaxError} unless the exec explicitly specifies the local + namespace for the \keyword{exec}. (In other words, \samp{exec obj} + would be illegal, but \samp{exec obj in ns} would be legal.) + + The \function{eval()}, \function{execfile()}, and \function{input()} + functions and the \keyword{exec} statement do not have access to the + full environment for resolving names. Names may be resolved in the + local and global namespaces of the caller. Free variables are not + resolved in the nearest enclosing namespace, but in the global + namespace.\footnote{This limitation occurs because the code that is + executed by these operations is not available at the time the + module is compiled.} + The \keyword{exec} statement and the \function{eval()} and + \function{execfile()} functions have optional arguments to override + the global and local namespace. If only one namespace is specified, + it is used for both. \section{Exceptions \label{exceptions}} *************** *** 206,214 **** When an exception is raised, an object (maybe \code{None}) is passed ! as the exception's ``parameter'' or ``value''; this object does not ! affect the selection of an exception handler, but is passed to the ! selected exception handler as additional information. For class ! exceptions, this object must be an instance of the exception class ! being raised. \begin{notice}[warning] --- 193,200 ---- When an exception is raised, an object (maybe \code{None}) is passed ! as the exception's \emph{value}; this object does not affect the ! selection of an exception handler, but is passed to the selected ! exception handler as additional information. For class exceptions, ! this object must be an instance of the exception class being raised. \begin{notice}[warning] From tim_one@users.sourceforge.net Sat Oct 5 18:54:59 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 10:54:59 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_pep277.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27605/python/Lib/test Modified Files: test_pep277.py Log Message: This test fails on Win98, which is fine, but when it failed it left a junk directory behind that caused 4 other tests to fail later. Now it cleans up after itself, and the 4 bogus later failures don't happen. Index: test_pep277.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep277.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_pep277.py 3 Oct 2002 23:14:10 -0000 1.1 --- test_pep277.py 5 Oct 2002 17:54:56 -0000 1.2 *************** *** 7,11 **** from nt import _getfullpathname except ImportError: ! raise TestSkipped, "test works only on NT" filenames = [ --- 7,11 ---- from nt import _getfullpathname except ImportError: ! raise TestSkipped, "test works only on NT+" filenames = [ *************** *** 21,27 **** ] class UnicodeFileTests(unittest.TestCase): def setUp(self): - self.files = [os.path.join(TESTFN, f) for f in filenames] try: os.mkdir(TESTFN) --- 21,37 ---- ] + # Destroy directory dirname and all files under it, to one level. + def deltree(dirname): + # Don't hide legitimate errors: if one of these suckers exists, it's + # an error if we can't remove it. + if os.path.exists(dirname): + for fname in os.listdir(dirname): + os.unlink(os.path.join(dirname, fname)) + os.rmdir(dirname) + class UnicodeFileTests(unittest.TestCase): + files = [os.path.join(TESTFN, f) for f in filenames] + def setUp(self): try: os.mkdir(TESTFN) *************** *** 35,41 **** def tearDown(self): ! for name in self.files: ! os.unlink(name) ! os.rmdir(TESTFN) def _apply_failure(self, fn, filename, expected_exception, --- 45,49 ---- def tearDown(self): ! deltree(TESTFN) def _apply_failure(self, fn, filename, expected_exception, *************** *** 101,105 **** suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UnicodeFileTests)) ! run_suite(suite) if __name__ == "__main__": --- 109,116 ---- suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UnicodeFileTests)) ! try: ! run_suite(suite) ! finally: ! deltree(TESTFN) if __name__ == "__main__": From rhettinger@users.sourceforge.net Sat Oct 5 21:43:47 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 13:43:47 -0700 Subject: [Python-checkins] python/dist/src/Objects complexobject.c,2.53.4.5,2.53.4.6 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14781 Modified Files: Tag: release22-maint complexobject.c Log Message: Backport 2.63 and 2.60: Call me anal, but there was a particular phrase that was speading to comments everywhere that bugged me: /* Foo is inlined */ instead of /* Inline Foo */. Somehow the "is inlined" phrase always confused me for half a second (thinking, "No it isn't" until I added the missing "here"). The new phrase is hopefully unambiguous. Close SF bug 563740. complex() now finds __complex__() in new style classes. Made conversion failure error messages consistent between types. Added related unittests. Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.53.4.5 retrieving revision 2.53.4.6 diff -C2 -d -r2.53.4.5 -r2.53.4.6 *** complexobject.c 18 Apr 2002 05:39:54 -0000 2.53.4.5 --- complexobject.c 5 Oct 2002 20:43:43 -0000 2.53.4.6 *************** *** 200,204 **** register PyComplexObject *op; ! /* PyObject_New is inlined */ op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); if (op == NULL) --- 200,204 ---- register PyComplexObject *op; ! /* Inline PyObject_New */ op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); if (op == NULL) *************** *** 812,819 **** complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { ! PyObject *r, *i, *tmp; PyNumberMethods *nbr, *nbi = NULL; Py_complex cr, ci; int own_r = 0; static char *kwlist[] = {"real", "imag", 0}; --- 812,820 ---- complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { ! PyObject *r, *i, *tmp, *f; PyNumberMethods *nbr, *nbi = NULL; Py_complex cr, ci; int own_r = 0; + static PyObject *complexstr; static char *kwlist[] = {"real", "imag", 0}; *************** *** 838,841 **** --- 839,862 ---- } + /* XXX Hack to support classes with __complex__ method */ + if (complexstr == NULL) { + complexstr = PyString_InternFromString("__complex__"); + if (complexstr == NULL) + return NULL; + } + f = PyObject_GetAttr(r, complexstr); + if (f == NULL) + PyErr_Clear(); + else { + PyObject *args = Py_BuildValue("()"); + if (args == NULL) + return NULL; + r = PyEval_CallObject(f, args); + Py_DECREF(args); + Py_DECREF(f); + if (r == NULL) + return NULL; + own_r = 1; + } nbr = r->ob_type->tp_as_number; if (i != NULL) *************** *** 844,873 **** ((i != NULL) && (nbi == NULL || nbi->nb_float == NULL))) { PyErr_SetString(PyExc_TypeError, ! "complex() arg can't be converted to complex"); return NULL; - } - /* XXX Hack to support classes with __complex__ method */ - if (PyInstance_Check(r)) { - static PyObject *complexstr; - PyObject *f; - if (complexstr == NULL) { - complexstr = PyString_InternFromString("__complex__"); - if (complexstr == NULL) - return NULL; - } - f = PyObject_GetAttr(r, complexstr); - if (f == NULL) - PyErr_Clear(); - else { - PyObject *args = Py_BuildValue("()"); - if (args == NULL) - return NULL; - r = PyEval_CallObject(f, args); - Py_DECREF(args); - Py_DECREF(f); - if (r == NULL) - return NULL; - own_r = 1; - } } if (PyComplex_Check(r)) { --- 865,870 ---- ((i != NULL) && (nbi == NULL || nbi->nb_float == NULL))) { PyErr_SetString(PyExc_TypeError, ! "complex() argument must be a string or a number"); return NULL; } if (PyComplex_Check(r)) { From rhettinger@users.sourceforge.net Sat Oct 5 22:14:14 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 14:14:14 -0700 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.93.6.7,2.93.6.8 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv24475 Modified Files: Tag: release22-maint abstract.c Log Message: Backport 2.103: Made conversion failure error messages consistent between types. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.93.6.7 retrieving revision 2.93.6.8 diff -C2 -d -r2.93.6.7 -r2.93.6.8 *** abstract.c 24 Sep 2002 11:11:12 -0000 2.93.6.7 --- abstract.c 5 Oct 2002 21:14:12 -0000 2.93.6.8 *************** *** 904,908 **** return int_from_string((char*)buffer, buffer_len); ! return type_error("object can't be converted to int"); } --- 904,908 ---- return int_from_string((char*)buffer, buffer_len); ! return type_error("int() argument must be a string or a number"); } *************** *** 961,965 **** return long_from_string(buffer, buffer_len); ! return type_error("object can't be converted to long"); } --- 961,965 ---- return long_from_string(buffer, buffer_len); ! return type_error("long() argument must be a string or a number"); } From rhettinger@users.sourceforge.net Sun Oct 6 03:16:54 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:16:54 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.100.4.11,1.100.4.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv32720 Modified Files: Tag: release22-maint libfuncs.tex Log Message: Backport 1.108 documenting Py2.3's impending deprecation of divmod() for complex numbers. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.100.4.11 retrieving revision 1.100.4.12 diff -C2 -d -r1.100.4.11 -r1.100.4.12 *** libfuncs.tex 24 Sep 2002 21:01:06 -0000 1.100.4.11 --- libfuncs.tex 6 Oct 2002 02:16:52 -0000 1.100.4.12 *************** *** 252,255 **** --- 252,258 ---- \code{\var{a} \%{} \var{b}} is non-zero it has the same sign as \var{b}, and \code{0 <= abs(\var{a} \%{} \var{b}) < abs(\var{b})}. + + \versionchanged[Using \function{divmod()} with complex numbers is + deprecated]{2.3} \end{funcdesc} From rhettinger@users.sourceforge.net Sun Oct 6 03:24:02 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:24:02 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libpickle.tex,1.33,1.33.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv2478 Modified Files: Tag: release22-maint libpickle.tex Log Message: Backport 1.36 documenting Py2.3's impending deprecation of the non-tuple form. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.33 retrieving revision 1.33.6.1 diff -C2 -d -r1.33 -r1.33.6.1 *** libpickle.tex 26 Nov 2001 21:30:36 -0000 1.33 --- libpickle.tex 6 Oct 2002 02:24:00 -0000 1.33.6.1 *************** *** 439,442 **** --- 439,443 ---- \item A tuple of arguments for the callable object, or \code{None}. + \deprecated{2.3}{Use the tuple of arguments instead} \item Optionally, the object's state, which will be passed to *************** *** 451,458 **** Upon unpickling, the callable will be called (provided that it meets the above criteria), passing in the tuple of arguments; it should ! return the unpickled object. If the second item was \code{None}, then ! instead of calling the callable directly, its \method{__basicnew__()} ! method is called without arguments. It should also return the ! unpickled object. An alternative to implementing a \method{__reduce__()} method on the --- 452,462 ---- Upon unpickling, the callable will be called (provided that it meets the above criteria), passing in the tuple of arguments; it should ! return the unpickled object. ! ! If the second item was \code{None}, then instead of calling the ! callable directly, its \method{__basicnew__()} method is called ! without arguments. It should also return the unpickled object. ! ! \deprecated{2.3}{Use the tuple of arguments instead} An alternative to implementing a \method{__reduce__()} method on the From rhettinger@users.sourceforge.net Sun Oct 6 03:29:05 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:29:05 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libxreadlines.tex,1.2.22.1,1.2.22.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv4163 Modified Files: Tag: release22-maint libxreadlines.tex Log Message: Backport 1.4 documenting the impending deprecation of xreadlines. Index: libxreadlines.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxreadlines.tex,v retrieving revision 1.2.22.1 retrieving revision 1.2.22.2 diff -C2 -d -r1.2.22.1 -r1.2.22.2 *** libxreadlines.tex 6 May 2002 16:03:00 -0000 1.2.22.1 --- libxreadlines.tex 6 Oct 2002 02:29:03 -0000 1.2.22.2 *************** *** 7,10 **** --- 7,11 ---- \versionadded{2.1} + \deprecated{2.3}{Use \code{for line in file} instead.} This module defines a new object type which can efficiently iterate From rhettinger@users.sourceforge.net Sun Oct 6 03:32:37 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:32:37 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libmimetools.tex,1.20.16.1,1.20.16.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5313 Modified Files: Tag: release22-maint libmimetools.tex Log Message: Backport 1.23 documenting impending deprecation in favor to the email package. Index: libmimetools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetools.tex,v retrieving revision 1.20.16.1 retrieving revision 1.20.16.2 diff -C2 -d -r1.20.16.1 -r1.20.16.2 *** libmimetools.tex 6 Aug 2002 21:22:59 -0000 1.20.16.1 --- libmimetools.tex 6 Oct 2002 02:32:34 -0000 1.20.16.2 *************** *** 5,8 **** --- 5,12 ---- \modulesynopsis{Tools for parsing MIME-style message bodies.} + \deprecated{2.3}{The \refmodule{email} package should be used in + preference to the \module{mimetools} module. This + module is present only to maintain backward + compatibility.} This module defines a subclass of the From rhettinger@users.sourceforge.net Sun Oct 6 03:34:17 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:34:17 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libmimewriter.tex,1.2,1.2.26.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6040 Modified Files: Tag: release22-maint libmimewriter.tex Log Message: Backport 1.3 documenting impending deprecation in favor of the email module. Index: libmimewriter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimewriter.tex,v retrieving revision 1.2 retrieving revision 1.2.26.1 diff -C2 -d -r1.2 -r1.2.26.1 *** libmimewriter.tex 3 Apr 2000 20:13:53 -0000 1.2 --- libmimewriter.tex 6 Oct 2002 02:34:15 -0000 1.2.26.1 *************** *** 7,10 **** --- 7,15 ---- \sectionauthor{Christopher G. Petrilli}{petrilli@amber.org} + \deprecated{2.3}{The \refmodule{email} package should be used in + preference to the \module{MimeWriter} module. This + module is present only to maintain backward + compatibility.} + This module defines the class \class{MimeWriter}. The \class{MimeWriter} class implements a basic formatter for creating From rhettinger@users.sourceforge.net Sun Oct 6 03:36:38 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:36:38 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libmimify.tex,1.11.18.1,1.11.18.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6819 Modified Files: Tag: release22-maint libmimify.tex Log Message: Backport 1.13 documenting impending deprecation in favor of the email module. Index: libmimify.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimify.tex,v retrieving revision 1.11.18.1 retrieving revision 1.11.18.2 diff -C2 -d -r1.11.18.1 -r1.11.18.2 *** libmimify.tex 18 Jun 2002 18:51:49 -0000 1.11.18.1 --- libmimify.tex 6 Oct 2002 02:36:36 -0000 1.11.18.2 *************** *** 5,10 **** \modulesynopsis{Mimification and unmimification of mail messages.} ! The mimify module defines two functions to convert mail messages to and from MIME format. The mail message can be either a simple message or a so-called multipart message. Each part is treated separately. --- 5,14 ---- \modulesynopsis{Mimification and unmimification of mail messages.} + \deprecated{2.3}{The \refmodule{email} package should be used in + preference to the \module{mimify} module. This + module is present only to maintain backward + compatibility.} ! The \module{mimify} module defines two functions to convert mail messages to and from MIME format. The mail message can be either a simple message or a so-called multipart message. Each part is treated separately. From rhettinger@users.sourceforge.net Sun Oct 6 03:38:48 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 19:38:48 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib librfc822.tex,1.38.14.2,1.38.14.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv7786 Modified Files: Tag: release22-maint librfc822.tex Log Message: Backport 1.42 documenting impending deprecation in favor of the email module. Index: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.38.14.2 retrieving revision 1.38.14.3 diff -C2 -d -r1.38.14.2 -r1.38.14.3 *** librfc822.tex 6 Aug 2002 21:22:59 -0000 1.38.14.2 --- librfc822.tex 6 Oct 2002 02:38:46 -0000 1.38.14.3 *************** *** 5,8 **** --- 5,13 ---- \modulesynopsis{Parse \rfc{2822} style mail messages.} + \deprecated{2.3}{The \refmodule{email} package should be used in + preference to the \module{rfc822} module. This + module is present only to maintain backward + compatibility.} + This module defines a class, \class{Message}, which represents an ``email message'' as defined by the Internet standard From rhettinger@users.sourceforge.net Sun Oct 6 04:10:28 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:10:28 -0700 Subject: [Python-checkins] python/dist/src/Lib webbrowser.py,1.26.6.1,1.26.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18606 Modified Files: Tag: release22-maint webbrowser.py Log Message: Backport 1.28 and 1.29: SF #515026, delete global variable that was apparently used only in a for loop. Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.26.6.1 retrieving revision 1.26.6.2 diff -C2 -d -r1.26.6.1 -r1.26.6.2 *** webbrowser.py 7 Jan 2002 15:29:33 -0000 1.26.6.1 --- webbrowser.py 6 Oct 2002 03:10:26 -0000 1.26.6.2 *************** *** 323,326 **** --- 323,328 ---- register(cmd.lower(), None, GenericBrowser( "%s '%%s'" % cmd.lower())) + cmd = None # to make del work if _tryorder was empty + del cmd _tryorder = filter(lambda x: _browsers.has_key(x.lower()) From rhettinger@users.sourceforge.net Sun Oct 6 04:13:32 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:13:32 -0700 Subject: [Python-checkins] python/dist/src/Lib user.py,1.5,1.5.28.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19830 Modified Files: Tag: release22-maint user.py Log Message: Backport 1.7: SF # 555779, import user doesn't work with CGIs Index: user.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/user.py,v retrieving revision 1.5 retrieving revision 1.5.28.1 diff -C2 -d -r1.5 -r1.5.28.1 *** user.py 30 Mar 2000 15:00:33 -0000 1.5 --- user.py 6 Oct 2002 03:13:29 -0000 1.5.28.1 *************** *** 27,30 **** --- 27,32 ---- if os.environ.has_key('HOME'): home = os.environ['HOME'] + elif os.name == 'posix': + home = os.path.expanduser("~/") elif os.name == 'nt': # Contributed by Jeff Bauer if os.environ.has_key('HOMEPATH'): From rhettinger@users.sourceforge.net Sun Oct 6 04:18:36 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:18:36 -0700 Subject: [Python-checkins] python/dist/src/Lib warnings.py,1.9.14.1,1.9.14.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20810 Modified Files: Tag: release22-maint warnings.py Log Message: Backport 1.17: Ignore IOError exceptions when writing the message. Index: warnings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/warnings.py,v retrieving revision 1.9.14.1 retrieving revision 1.9.14.2 diff -C2 -d -r1.9.14.1 -r1.9.14.2 *** warnings.py 18 Apr 2002 04:52:10 -0000 1.9.14.1 --- warnings.py 6 Oct 2002 03:18:34 -0000 1.9.14.2 *************** *** 99,103 **** if file is None: file = sys.stderr ! file.write(formatwarning(message, category, filename, lineno)) def formatwarning(message, category, filename, lineno): --- 99,106 ---- if file is None: file = sys.stderr ! try: ! file.write(formatwarning(message, category, filename, lineno)) ! except IOError: ! pass # the file (probably stderr) is invalid - this warning gets lost. def formatwarning(message, category, filename, lineno): From rhettinger@users.sourceforge.net Sun Oct 6 04:24:31 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:24:31 -0700 Subject: [Python-checkins] python/dist/src/Lib urllib.py,1.135.6.4,1.135.6.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21959 Modified Files: Tag: release22-maint urllib.py Log Message: Backport 1.151 and 1.152: Treat file://localhost/ as local too (same as file:/ and file:///). Fixes #607789, bugfix candidate. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.135.6.4 retrieving revision 1.135.6.5 diff -C2 -d -r1.135.6.4 -r1.135.6.5 *** urllib.py 18 Aug 2002 20:10:08 -0000 1.135.6.4 --- urllib.py 6 Oct 2002 03:24:29 -0000 1.135.6.5 *************** *** 400,404 **** def open_file(self, url): """Use local file or FTP depending on form of URL.""" ! if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: --- 400,404 ---- def open_file(self, url): """Use local file or FTP depending on form of URL.""" ! if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/': return self.open_ftp(url) else: From rhettinger@users.sourceforge.net Sun Oct 6 04:37:02 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:37:02 -0700 Subject: [Python-checkins] python/dist/src/Lib smtplib.py,1.46.4.3,1.46.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24395 Modified Files: Tag: release22-maint smtplib.py Log Message: Backport 1.60 and 1.62: Patch #586999: Fix multiline string in sendmail example. smptlib did not handle empty addresses. The problem was that it expected rfc822.parseaddr() to return None upon a parse failure. The actual, documented return value for a parse failure is (None, None). Closes SF bug 602029. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.46.4.3 retrieving revision 1.46.4.4 diff -C2 -d -r1.46.4.3 -r1.46.4.4 *** smtplib.py 2 Jun 2002 12:32:04 -0000 1.46.4.3 --- smtplib.py 6 Oct 2002 03:37:00 -0000 1.46.4.4 *************** *** 167,178 **** Should be able to handle anything rfc822.parseaddr can handle. """ ! m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass ! if not m: #something weird here.. punt -ddm ! return addr else: return "<%s>" % m --- 167,178 ---- Should be able to handle anything rfc822.parseaddr can handle. """ ! m = (None, None) try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass ! if m == (None, None): # Indicates parse failure or AttributeError #something weird here.. punt -ddm ! return "<%s>" % addr else: return "<%s>" % m *************** *** 605,609 **** >>> s=smtplib.SMTP("localhost") >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"] ! >>> msg = ''' ... From: Me@my.org ... Subject: testin'... --- 605,609 ---- >>> s=smtplib.SMTP("localhost") >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"] ! >>> msg = '''\\ ... From: Me@my.org ... Subject: testin'... From rhettinger@users.sourceforge.net Sun Oct 6 04:45:42 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:45:42 -0700 Subject: [Python-checkins] python/dist/src/Lib smtpd.py,1.11,1.11.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26305 Modified Files: Tag: release22-maint smtpd.py Log Message: Backport 1.12 and 1.13 and normalize whitespace (remove formfeeds): SF #515021, print the refused list to the DEBUGSTREAM, so the parameter is used Note: There is a TBD (aka FIXME) for how best to handle the refused addresses. smtp_RCPT(): Removed a somewhat embarrassing debugging line, found by Scot Stevenson. Could be a bug fix candidate, but probably doesn't matter much unless a certain blue-nosed cat suddenly becomes corporeal and starts emailing some stmp.py (sic) fronted mailer. Index: smtpd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtpd.py,v retrieving revision 1.11 retrieving revision 1.11.8.1 diff -C2 -d -r1.11 -r1.11.8.1 *** smtpd.py 4 Nov 2001 03:04:25 -0000 1.11 --- smtpd.py 6 Oct 2002 03:45:40 -0000 1.11.8.1 *************** *** 36,40 **** """ ! # Overview: # --- 36,40 ---- """ ! # Overview: # *************** *** 97,101 **** ! def usage(code, msg=''): print >> sys.stderr, __doc__ % globals() --- 97,101 ---- ! def usage(code, msg=''): print >> sys.stderr, __doc__ % globals() *************** *** 105,109 **** ! class SMTPChannel(asynchat.async_chat): COMMAND = 0 --- 105,109 ---- ! class SMTPChannel(asynchat.async_chat): COMMAND = 0 *************** *** 242,248 **** self.push('501 Syntax: RCPT TO:
') return - if address.lower().startswith('stimpy'): - self.push('503 You suck %s' % address) - return self.__rcpttos.append(address) print >> DEBUGSTREAM, 'recips:', self.__rcpttos --- 242,245 ---- *************** *** 272,276 **** ! class SMTPServer(asyncore.dispatcher): def __init__(self, localaddr, remoteaddr): --- 269,273 ---- ! class SMTPServer(asyncore.dispatcher): def __init__(self, localaddr, remoteaddr): *************** *** 319,323 **** ! class DebuggingServer(SMTPServer): # Do something with the gathered message --- 316,320 ---- ! class DebuggingServer(SMTPServer): # Do something with the gathered message *************** *** 335,339 **** ! class PureProxy(SMTPServer): def process_message(self, peer, mailfrom, rcpttos, data): --- 332,336 ---- ! class PureProxy(SMTPServer): def process_message(self, peer, mailfrom, rcpttos, data): *************** *** 349,353 **** refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got some refusals' def _deliver(self, mailfrom, rcpttos, data): --- 346,350 ---- refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got some refusals:', refused def _deliver(self, mailfrom, rcpttos, data): *************** *** 376,380 **** ! class MailmanProxy(PureProxy): def process_message(self, peer, mailfrom, rcpttos, data): --- 373,377 ---- ! class MailmanProxy(PureProxy): def process_message(self, peer, mailfrom, rcpttos, data): *************** *** 418,422 **** refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got refusals' # Now deliver directly to the list commands mlists = {} --- 415,419 ---- refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got refusals:', refused # Now deliver directly to the list commands mlists = {} *************** *** 455,459 **** ! class Options: setuid = 1 --- 452,456 ---- ! class Options: setuid = 1 *************** *** 461,465 **** ! def parseargs(): global DEBUGSTREAM --- 458,462 ---- ! def parseargs(): global DEBUGSTREAM *************** *** 518,522 **** ! if __name__ == '__main__': options = parseargs() --- 515,519 ---- ! if __name__ == '__main__': options = parseargs() From rhettinger@users.sourceforge.net Sun Oct 6 04:52:46 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 20:52:46 -0700 Subject: [Python-checkins] python/dist/src/Lib site.py,1.39,1.39.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28071 Modified Files: Tag: release22-maint site.py Log Message: Backport 1.45: Fix a problem in site.py which triggers in case sys.path is empty. Bugfix candidate for 2.2.2. Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.39 retrieving revision 1.39.4.1 diff -C2 -d -r1.39 -r1.39.4.1 *** site.py 17 Dec 2001 16:07:06 -0000 1.39 --- site.py 6 Oct 2002 03:52:44 -0000 1.39.4.1 *************** *** 93,97 **** # Append ./build/lib. in case we're running in the build dir # (especially for Guido :-) ! if os.name == "posix" and os.path.basename(sys.path[-1]) == "Modules": from distutils.util import get_platform s = "build/lib.%s-%.3s" % (get_platform(), sys.version) --- 93,98 ---- # Append ./build/lib. in case we're running in the build dir # (especially for Guido :-) ! if (os.name == "posix" and sys.path and ! os.path.basename(sys.path[-1]) == "Modules"): from distutils.util import get_platform s = "build/lib.%s-%.3s" % (get_platform(), sys.version) From tim_one@users.sourceforge.net Sun Oct 6 05:04:48 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:04:48 -0700 Subject: [Python-checkins] python/dist/src LICENSE,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv30935/python Modified Files: LICENSE Log Message: Update info for impending 2.2.2. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** LICENSE 11 Apr 2002 20:54:35 -0000 1.22 --- LICENSE 6 Oct 2002 04:04:45 -0000 1.23 *************** *** 41,44 **** --- 41,45 ---- 2.1.3 2.1.2 2002 PSF yes 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes Footnotes: From tim_one@users.sourceforge.net Sun Oct 6 05:04:48 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:04:48 -0700 Subject: [Python-checkins] python/dist/src/PCbuild BUILDno.txt,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv30935/python/PCbuild Modified Files: BUILDno.txt Log Message: Update info for impending 2.2.2. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** BUILDno.txt 9 Apr 2002 21:18:37 -0000 1.38 --- BUILDno.txt 6 Oct 2002 04:04:46 -0000 1.39 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 36 2.2.2b1 + 7-Oct-2002 35 2.1.3 (final) 8-Apr-2002 From tim_one@users.sourceforge.net Sun Oct 6 05:14:19 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:14:19 -0700 Subject: [Python-checkins] python/dist/src LICENSE,1.18.16.5,1.18.16.6 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv32616/22 Modified Files: Tag: release22-maint LICENSE Log Message: Assorted changes needed to release 2.2.2b1. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.18.16.5 retrieving revision 1.18.16.6 diff -C2 -d -r1.18.16.5 -r1.18.16.6 *** LICENSE 26 Jul 2002 15:41:59 -0000 1.18.16.5 --- LICENSE 6 Oct 2002 04:14:17 -0000 1.18.16.6 *************** *** 41,44 **** --- 41,45 ---- 2.1.3 2.1.2 2002 PSF yes 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes Footnotes: *************** *** 57,66 **** =============================================================== ! PSF LICENSE AGREEMENT FOR PYTHON 2.2.1 -------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and ! otherwise using Python 2.2.1 software in source or binary form and its associated documentation. --- 58,67 ---- =============================================================== ! PSF LICENSE AGREEMENT FOR PYTHON 2.2.2 -------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and ! otherwise using Python 2.2.2 software in source or binary form and its associated documentation. *************** *** 68,94 **** hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, ! prepare derivative works, distribute, and otherwise use Python 2.2.1 alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002 Python Software Foundation; All Rights Reserved" are ! retained in Python 2.2.1 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on ! or incorporates Python 2.2.1 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of ! the changes made to Python 2.2.1. ! 4. PSF is making Python 2.2.1 available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS ! FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.2.1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON ! 2.2.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS ! A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.2.1, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. --- 69,95 ---- hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, ! prepare derivative works, distribute, and otherwise use Python 2.2.2 alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002 Python Software Foundation; All Rights Reserved" are ! retained in Python 2.2.2 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on ! or incorporates Python 2.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of ! the changes made to Python 2.2.2. ! 4. PSF is making Python 2.2.2 available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS ! FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON ! 2.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS ! A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. *************** *** 102,106 **** products or services of Licensee, or any third party. ! 8. By copying, installing or otherwise using Python 2.2.1, Licensee agrees to be bound by the terms and conditions of this License Agreement. --- 103,107 ---- products or services of Licensee, or any third party. ! 8. By copying, installing or otherwise using Python 2.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. From tim_one@users.sourceforge.net Sun Oct 6 05:14:20 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:14:20 -0700 Subject: [Python-checkins] python/dist/src/Include patchlevel.h,2.60.2.1.2.6,2.60.2.1.2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv32616/22/Include Modified Files: Tag: release22-maint patchlevel.h Log Message: Assorted changes needed to release 2.2.2b1. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.60.2.1.2.6 retrieving revision 2.60.2.1.2.7 diff -C2 -d -r2.60.2.1.2.6 -r2.60.2.1.2.7 *** patchlevel.h 24 Sep 2002 17:14:19 -0000 2.60.2.1.2.6 --- patchlevel.h 6 Oct 2002 04:14:17 -0000 2.60.2.1.2.7 *************** *** 23,31 **** #define PY_MINOR_VERSION 2 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 0 /* Version as a string */ ! #define PY_VERSION "2.2.2a0" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 23,31 ---- #define PY_MINOR_VERSION 2 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2.2b1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From tim_one@users.sourceforge.net Sun Oct 6 05:14:20 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:14:20 -0700 Subject: [Python-checkins] python/dist/src/PCbuild BUILDno.txt,1.26.4.7,1.26.4.8 python20.wse,1.98.4.7,1.98.4.8 pythoncore.dsp,1.30.4.3,1.30.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv32616/22/PCbuild Modified Files: Tag: release22-maint BUILDno.txt python20.wse pythoncore.dsp Log Message: Assorted changes needed to release 2.2.2b1. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.26.4.7 retrieving revision 1.26.4.8 diff -C2 -d -r1.26.4.7 -r1.26.4.8 *** BUILDno.txt 9 Apr 2002 21:19:53 -0000 1.26.4.7 --- BUILDno.txt 6 Oct 2002 04:14:18 -0000 1.26.4.8 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 36 2.2.2b1 + 7-Oct-2002 34 2.2.1 (final) 10-Apr-2002 Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.98.4.7 retrieving revision 1.98.4.8 diff -C2 -d -r1.98.4.7 -r1.98.4.8 *** python20.wse 24 Sep 2002 17:17:38 -0000 1.98.4.7 --- python20.wse 6 Oct 2002 04:14:18 -0000 1.98.4.8 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2.2a0 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=8.14 ! Title=Python 2.2.2b1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 19,25 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2.2a0.exe Dialogs Version=8 ! Version File=2.2.2a0 Version Description=Python Programming Language Version Copyright=©2002 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2.2b1.exe Dialogs Version=8 ! Version File=2.2.2b1 Version Description=Python Programming Language Version Copyright=©2002 Python Software Foundation *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2.2a0 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2.2b1 end item: Remark Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.30.4.3 retrieving revision 1.30.4.4 diff -C2 -d -r1.30.4.3 -r1.30.4.4 *** pythoncore.dsp 4 Apr 2002 21:49:28 -0000 1.30.4.3 --- pythoncore.dsp 6 Oct 2002 04:14:18 -0000 1.30.4.4 *************** *** 740,748 **** !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=34 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=34 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" --- 740,748 ---- !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=36 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=36 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" From rhettinger@users.sourceforge.net Sun Oct 6 05:34:46 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 21:34:46 -0700 Subject: [Python-checkins] python/dist/src/Lib ntpath.py,1.44,1.44.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4840 Modified Files: Tag: release22-maint ntpath.py Log Message: Backport 1.45: Allow abspath to still do something sensisble if the nt module can not be imported. Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.44 retrieving revision 1.44.8.1 diff -C2 -d -r1.44 -r1.44.8.1 *** ntpath.py 5 Nov 2001 21:25:02 -0000 1.44 --- ntpath.py 6 Oct 2002 04:34:44 -0000 1.44.8.1 *************** *** 458,463 **** def abspath(path): """Return the absolute version of a path""" ! if path: # Empty path must return current working directory. from nt import _getfullpathname try: path = _getfullpathname(path) --- 458,473 ---- def abspath(path): """Return the absolute version of a path""" ! try: from nt import _getfullpathname + except ImportError: # Not running on Windows - mock up something sensible. + global abspath + def _abspath(path): + if not isabs(path): + path = join(os.getcwd(), path) + return normpath(path) + abspath = _abspath + return _abspath(path) + + if path: # Empty path must return current working directory. try: path = _getfullpathname(path) From rhettinger@users.sourceforge.net Sun Oct 6 06:43:49 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 05 Oct 2002 22:43:49 -0700 Subject: [Python-checkins] python/dist/src/Modules readline.c,2.41.6.2,2.41.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17507 Modified Files: Tag: release22-maint readline.c Log Message: Backport 2.49: SF #558432: Prevent Annoying ' ' from readline (Holker Krekel). readline in all python versions is configured to append a 'space' character for a successful completion. But for almost all python expressions 'space' is not wanted (see coding conventions PEP 8). For example if you have a function 'longfunction' and you type 'longf' you get 'longfunction ' as a completion. note the unwanted space at the end. The patch fixes this behaviour by setting readline's append_character to '\0' which means don't append anything. This doesn't work with readline < 2.1 (AFAIK nowadays readline2.2 is in good use). An alternative approach would be to make the append_character accessable from python so that modules like the rlcompleter.py can set it to '\0'. [Ed.: I think expecting readline >= 2.2 is fine. If a completer wants another character they can append that to the keyword in the list.] Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.41.6.2 retrieving revision 2.41.6.3 diff -C2 -d -r2.41.6.2 -r2.41.6.3 *** readline.c 24 Sep 2002 01:17:41 -0000 2.41.6.2 --- readline.c 6 Oct 2002 05:43:47 -0000 2.41.6.3 *************** *** 521,524 **** --- 521,525 ---- strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"); /* All nonalphanums except '.' */ + rl_completion_append_character ='\0'; begidx = PyInt_FromLong(0L); From loewis@users.sourceforge.net Sun Oct 6 12:48:12 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 04:48:12 -0700 Subject: [Python-checkins] python/dist/src configure,1.340,1.341 configure.in,1.351,1.352 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25615 Modified Files: configure configure.in Log Message: Also look in -lposix4 for sem_init. Fixes #618615. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.340 retrieving revision 1.341 diff -C2 -d -r1.340 -r1.341 *** configure 4 Oct 2002 10:21:59 -0000 1.340 --- configure 6 Oct 2002 11:48:08 -0000 1.341 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.350 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.351 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 9220,9231 **** fi # Dynamic linking for HP-UX ! ! echo "$as_me:$LINENO: checking for sem_init in -lrt" >&5 ! echo $ECHO_N "checking for sem_init in -lrt... $ECHO_C" >&6 ! if test "${ac_cv_lib_rt_sem_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ! ac_check_lib_save_LIBS=$LIBS ! LIBS="-lrt $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" --- 9220,9230 ---- fi # Dynamic linking for HP-UX ! echo "$as_me:$LINENO: checking for library containing sem_init" >&5 ! echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6 ! if test "${ac_cv_search_sem_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ! ac_func_search_save_LIBS=$LIBS ! ac_cv_search_sem_init=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" *************** *** 9265,9288 **** echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_rt_sem_init=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - ac_cv_lib_rt_sem_init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ! LIBS=$ac_check_lib_save_LIBS ! fi ! echo "$as_me:$LINENO: result: $ac_cv_lib_rt_sem_init" >&5 ! echo "${ECHO_T}$ac_cv_lib_rt_sem_init" >&6 ! if test $ac_cv_lib_rt_sem_init = yes; then ! cat >>confdefs.h <<_ACEOF ! #define HAVE_LIBRT 1 ! _ACEOF ! LIBS="-lrt $LIBS" fi ! # 'Real Time' functions on Solaris # checks for system dependent C++ extensions support --- 9264,9332 ---- echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_search_sem_init="none required" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ! if test "$ac_cv_search_sem_init" = no; then ! for ac_lib in rt posix4; do ! LIBS="-l$ac_lib $ac_func_search_save_LIBS" ! cat >conftest.$ac_ext <<_ACEOF ! #line $LINENO "configure" ! #include "confdefs.h" ! /* Override any gcc2 internal prototype to avoid an error. */ ! #ifdef __cplusplus ! extern "C" ! #endif ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char sem_init (); ! #ifdef F77_DUMMY_MAIN ! # ifdef __cplusplus ! extern "C" ! # endif ! int F77_DUMMY_MAIN() { return 1; } ! #endif ! int ! main () ! { ! sem_init (); ! ; ! return 0; ! } ! _ACEOF ! rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ! (eval $ac_link) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); } && ! { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; }; then ! ac_cv_search_sem_init="-l$ac_lib" ! break ! else ! echo "$as_me: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! fi ! rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ! done ! fi ! LIBS=$ac_func_search_save_LIBS ! fi ! echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 ! echo "${ECHO_T}$ac_cv_search_sem_init" >&6 ! if test "$ac_cv_search_sem_init" != no; then ! test "$ac_cv_search_sem_init" = "none required" || LIBS="$ac_cv_search_sem_init $LIBS" fi ! # 'Real Time' functions on Solaris, ! # posix4 on Solaris 2.6 # checks for system dependent C++ extensions support Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.351 retrieving revision 1.352 diff -C2 -d -r1.351 -r1.352 *** configure.in 4 Oct 2002 10:22:02 -0000 1.351 --- configure.in 6 Oct 2002 11:48:09 -0000 1.352 *************** *** 1094,1098 **** AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX ! AC_CHECK_LIB(rt, sem_init) # 'Real Time' functions on Solaris # checks for system dependent C++ extensions support --- 1094,1099 ---- AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX ! AC_SEARCH_LIBS(sem_init, rt posix4) # 'Real Time' functions on Solaris, ! # posix4 on Solaris 2.6 # checks for system dependent C++ extensions support From gvanrossum@users.sourceforge.net Sun Oct 6 15:37:13 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 06 Oct 2002 07:37:13 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_email.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3232 Modified Files: test_email.py Log Message: Make sure the email test suite can be run both stand-alone and under supervision of regrtest.py. Will backport to 2.2.2. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** test_email.py 19 Jul 2002 22:44:12 -0000 1.42 --- test_email.py 6 Oct 2002 14:37:11 -0000 1.43 *************** *** 5,11 **** # The specific tests now live in Lib/email/test from email.test.test_email import suite - if __name__ == '__main__': ! unittest.main(defaultTest='suite') --- 5,13 ---- # The specific tests now live in Lib/email/test from email.test.test_email import suite + from test.test_support import run_suite + def test_main(): + run_suite(suite()) if __name__ == '__main__': ! test_main() From gvanrossum@users.sourceforge.net Sun Oct 6 15:38:02 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 06 Oct 2002 07:38:02 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_email.py,1.24.4.3,1.24.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3453 Modified Files: Tag: release22-maint test_email.py Log Message: Backport: Make sure the email test suite can be run both stand-alone and under supervision of regrtest.py. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.24.4.3 retrieving revision 1.24.4.4 diff -C2 -d -r1.24.4.3 -r1.24.4.4 *** test_email.py 4 Oct 2002 17:24:24 -0000 1.24.4.3 --- test_email.py 6 Oct 2002 14:38:00 -0000 1.24.4.4 *************** *** 5,11 **** # The specific tests now live in Lib/email/test from email.test.test_email import suite - if __name__ == '__main__': ! unittest.main(defaultTest='suite') --- 5,13 ---- # The specific tests now live in Lib/email/test from email.test.test_email import suite + from test.test_support import run_suite + def test_main(): + run_suite(suite()) if __name__ == '__main__': ! test_main() From loewis@users.sourceforge.net Sun Oct 6 18:51:13 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 10:51:13 -0700 Subject: [Python-checkins] python/dist/src/Lib smtplib.py,1.46.4.4,1.46.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv507 Modified Files: Tag: release22-maint smtplib.py Log Message: Patch #572031: AUTH method LOGIN for smtplib. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.46.4.4 retrieving revision 1.46.4.5 diff -C2 -d -r1.46.4.4 -r1.46.4.5 *** smtplib.py 6 Oct 2002 03:37:00 -0000 1.46.4.4 --- smtplib.py 6 Oct 2002 17:51:10 -0000 1.46.4.5 *************** *** 57,60 **** --- 57,65 ---- CRLF="\r\n" + OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) + + def encode_base64(s, eol=None): + return "".join(base64.encodestring(s).split("\n")) + # Exception classes used by this module. class SMTPException(Exception): *************** *** 392,400 **** del resp[0] for each in resp: m=re.match(r'(?P[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=m.group("feature").lower() params=m.string[m.end("feature"):].strip() ! self.esmtp_features[feature]=params return (code,msg) --- 397,426 ---- del resp[0] for each in resp: + # To be able to communicate with as many SMTP servers as possible, + # we have to take the old-style auth advertisement into account, + # because: + # 1) Else our SMTP feature parser gets confused. + # 2) There are some servers that only advertise the auth methods we + # support using the old style. + auth_match = OLDSTYLE_AUTH.match(each) + if auth_match: + # This doesn't remove duplicates, but that's no problem + self.esmtp_features["auth"] = self.esmtp_features.get("auth", "") \ + + " " + auth_match.groups(0)[0] + continue + + # RFC 1869 requires a space between ehlo keyword and parameters. + # It's actually stricter, in that only spaces are allowed between + # parameters, but were not going to check for that here. Note + # that the space isn't present if there are no parameters. m=re.match(r'(?P[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=m.group("feature").lower() params=m.string[m.end("feature"):].strip() ! if feature == "auth": ! self.esmtp_features[feature] = self.esmtp_features.get(feature, "") \ ! + " " + params ! else: ! self.esmtp_features[feature]=params return (code,msg) *************** *** 495,506 **** challenge = base64.decodestring(challenge) response = user + " " + hmac.HMAC(password, challenge).hexdigest() ! return base64.encodestring(response)[:-1] def encode_plain(user, password): ! return base64.encodestring("%s\0%s\0%s" % ! (user, user, password))[:-1] AUTH_PLAIN = "PLAIN" AUTH_CRAM_MD5 = "CRAM-MD5" if self.helo_resp is None and self.ehlo_resp is None: --- 521,533 ---- challenge = base64.decodestring(challenge) response = user + " " + hmac.HMAC(password, challenge).hexdigest() ! return encode_base64(response, eol="") def encode_plain(user, password): ! return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") ! AUTH_PLAIN = "PLAIN" AUTH_CRAM_MD5 = "CRAM-MD5" + AUTH_LOGIN = "LOGIN" if self.helo_resp is None and self.ehlo_resp is None: *************** *** 519,524 **** # less preferred methods. Except for the purpose of testing the weaker # ones, we prefer stronger methods like CRAM-MD5: ! preferred_auths = [AUTH_CRAM_MD5, AUTH_PLAIN] ! #preferred_auths = [AUTH_PLAIN, AUTH_CRAM_MD5] # Determine the authentication method we'll use --- 546,550 ---- # less preferred methods. Except for the purpose of testing the weaker # ones, we prefer stronger methods like CRAM-MD5: ! preferred_auths = [AUTH_CRAM_MD5, AUTH_PLAIN, AUTH_LOGIN] # Determine the authentication method we'll use *************** *** 528,532 **** authmethod = method break - if self.debuglevel > 0: print "AuthMethod:", authmethod if authmethod == AUTH_CRAM_MD5: --- 554,557 ---- *************** *** 539,542 **** --- 564,573 ---- (code, resp) = self.docmd("AUTH", AUTH_PLAIN + " " + encode_plain(user, password)) + elif authmethod == AUTH_LOGIN: + (code, resp) = self.docmd("AUTH", + "%s %s" % (AUTH_LOGIN, encode_base64(user, eol=""))) + if code != 334: + raise SMTPAuthenticationError(code, resp) + (code, resp) = self.docmd(encode_base64(password, eol="")) elif authmethod == None: raise SMTPException("No suitable authentication method found.") From loewis@users.sourceforge.net Sun Oct 6 18:55:11 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 10:55:11 -0700 Subject: [Python-checkins] python/dist/src/Lib smtplib.py,1.62,1.63 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1851 Modified Files: smtplib.py Log Message: Patch #572031: AUTH method LOGIN for smtplib (most of the patch hides in rev. 1.59). Backported to 2.2. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** smtplib.py 5 Sep 2002 01:14:07 -0000 1.62 --- smtplib.py 6 Oct 2002 17:55:08 -0000 1.63 *************** *** 575,579 **** if code != 334: raise SMTPAuthenticationError(code, resp) ! (code, resp) = self.docmd(encode_base64(user, eol="")) elif authmethod is None: raise SMTPException("No suitable authentication method found.") --- 575,579 ---- if code != 334: raise SMTPAuthenticationError(code, resp) ! (code, resp) = self.docmd(encode_base64(password, eol="")) elif authmethod is None: raise SMTPException("No suitable authentication method found.") From gvanrossum@users.sourceforge.net Sun Oct 6 21:15:00 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 06 Oct 2002 13:15:00 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_email.py,1.24.4.4,1.24.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1079 Modified Files: Tag: release22-maint test_email.py Log Message: Aargh! The 2.3 version of this file requires "from test.test_support import run_suite", but the 2.2.2 version requires "from test_support import run_suite" ... :-( Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.24.4.4 retrieving revision 1.24.4.5 diff -C2 -d -r1.24.4.4 -r1.24.4.5 *** test_email.py 6 Oct 2002 14:38:00 -0000 1.24.4.4 --- test_email.py 6 Oct 2002 20:14:58 -0000 1.24.4.5 *************** *** 5,9 **** # The specific tests now live in Lib/email/test from email.test.test_email import suite ! from test.test_support import run_suite def test_main(): --- 5,9 ---- # The specific tests now live in Lib/email/test from email.test.test_email import suite ! from test_support import run_suite def test_main(): From gvanrossum@users.sourceforge.net Sun Oct 6 21:36:33 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 06 Oct 2002 13:36:33 -0700 Subject: [Python-checkins] python/dist/src/Lib/test regrtest.py,1.98,1.99 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv7538 Modified Files: regrtest.py Log Message: Add test_pep277 to the expected skips on Linux. (This test seems to be skipped everywhere except on Windows NT and descendants, but I'm only going to add it to the skip list for the platform I can test.) Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** regrtest.py 30 Sep 2002 16:19:48 -0000 1.98 --- regrtest.py 6 Oct 2002 20:36:31 -0000 1.99 *************** *** 544,547 **** --- 544,548 ---- test_nis test_ntpath + test_pep277 test_socket_ssl test_socketserver From rhettinger@users.sourceforge.net Sun Oct 6 23:11:15 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 06 Oct 2002 15:11:15 -0700 Subject: [Python-checkins] python/dist/src/Lib posixpath.py,1.46,1.46.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11198 Modified Files: Tag: release22-maint posixpath.py Log Message: Backport 1.52: SF # 555779, import user doesn't work with CGIs Index: posixpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/posixpath.py,v retrieving revision 1.46 retrieving revision 1.46.10.1 diff -C2 -d -r1.46 -r1.46.10.1 *** posixpath.py 10 Oct 2001 04:16:20 -0000 1.46 --- posixpath.py 6 Oct 2002 22:11:13 -0000 1.46.10.1 *************** *** 307,312 **** if i == 1: if not os.environ.has_key('HOME'): ! return path ! userhome = os.environ['HOME'] else: import pwd --- 307,314 ---- if i == 1: if not os.environ.has_key('HOME'): ! import pwd ! userhome = pwd.getpwuid(os.getuid())[5] ! else: ! userhome = os.environ['HOME'] else: import pwd From rhettinger@users.sourceforge.net Sun Oct 6 23:37:43 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 06 Oct 2002 15:37:43 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.29.8.3,1.29.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv22393 Modified Files: Tag: release22-maint ref7.tex Log Message: Backport 1.33: Update programmer's note on nested functions. Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.29.8.3 retrieving revision 1.29.8.4 diff -C2 -d -r1.29.8.3 -r1.29.8.4 *** ref7.tex 15 Mar 2002 23:18:05 -0000 1.29.8.3 --- ref7.tex 6 Oct 2002 22:37:40 -0000 1.29.8.4 *************** *** 390,398 **** \indexii{lambda}{form} ! \strong{Programmer's note:} a ``\code{def}'' form executed inside a ! function definition defines a local function that can be returned or ! passed around. The semantics of name resolution in the nested ! function will change in Python 2.2. See the appendix for a ! description of the new semantics. --- 390,398 ---- \indexii{lambda}{form} ! \strong{Programmer's note:} Functions are first-class objects. A ! ``\code{def}'' form executed inside a function definition defines a ! local function that can be returned or passed around. Free variables ! used in the nested function can access the local variables of the ! function containing the def. See section \ref{naming} for details. From rhettinger@users.sourceforge.net Sun Oct 6 23:47:14 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 06 Oct 2002 15:47:14 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.29.8.4,1.29.8.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv26637 Modified Files: Tag: release22-maint ref7.tex Log Message: Backport 1.34: Changing section reference. Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.29.8.4 retrieving revision 1.29.8.5 diff -C2 -d -r1.29.8.4 -r1.29.8.5 *** ref7.tex 6 Oct 2002 22:37:40 -0000 1.29.8.4 --- ref7.tex 6 Oct 2002 22:47:12 -0000 1.29.8.5 *************** *** 417,421 **** inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section \ref{execframes}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the --- 417,421 ---- inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section \ref{naming}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the From tim_one@users.sourceforge.net Mon Oct 7 01:59:04 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun, 06 Oct 2002 17:59:04 -0700 Subject: [Python-checkins] python/dist/src/PCbuild python20.wse,1.98.4.8,1.98.4.9 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv17639/22/PCbuild Modified Files: Tag: release22-maint python20.wse Log Message: They don't work yet, but the installer at least needs to install the email pkg's distinct test suite. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.98.4.8 retrieving revision 1.98.4.9 diff -C2 -d -r1.98.4.8 -r1.98.4.9 *** python20.wse 6 Oct 2002 04:14:18 -0000 1.98.4.8 --- python20.wse 7 Oct 2002 00:59:01 -0000 1.98.4.9 *************** *** 1912,1915 **** --- 1912,1933 ---- Flags=0000000000000010 end + item: Install File + Source=..\lib\email\test\*.py + Destination=%MAINDIR%\Lib\email\test + Description=email tests + Flags=0000000000000010 + end + item: Install File + Source=..\lib\email\test\data\*.txt + Destination=%MAINDIR%\Lib\email\test\data + Description=email test data + Flags=0000000000000010 + end + item: Install File + Source=..\lib\email\test\data\*.gif + Destination=%MAINDIR%\Lib\email\test\data + Description=email test data + Flags=0000000000000010 + end item: Remark end From tim_one@users.sourceforge.net Mon Oct 7 02:18:19 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun, 06 Oct 2002 18:18:19 -0700 Subject: [Python-checkins] python/dist/src/Lib/test pickletester.py,1.12.4.2,1.12.4.3 test_StringIO.py,1.10.6.2,1.10.6.3 test_cfgparser.py,1.9.10.3,1.9.10.4 test_generators.py,1.30.6.1,1.30.6.2 test_httplib.py,1.2.12.2,1.2.12.3 test_multifile.py,1.1.2.1,1.1.2.2 test_netrc.py,1.1.2.1,1.1.2.2 test_string.py,1.15.6.1,1.15.6.2 test_trace.py,1.4.2.1,1.4.2.2 test_urlparse.py,1.2.24.2,1.2.24.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv25501/Lib/test Modified Files: Tag: release22-maint pickletester.py test_StringIO.py test_cfgparser.py test_generators.py test_httplib.py test_multifile.py test_netrc.py test_string.py test_trace.py test_urlparse.py Log Message: Whitespace normalization. Index: pickletester.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v retrieving revision 1.12.4.2 retrieving revision 1.12.4.3 diff -C2 -d -r1.12.4.2 -r1.12.4.3 *** pickletester.py 7 Mar 2002 10:12:38 -0000 1.12.4.2 --- pickletester.py 7 Oct 2002 01:18:17 -0000 1.12.4.3 *************** *** 254,258 **** s = self.dumps(t) u = self.loads(s) ! self.assertEqual(t, u) import os if hasattr(os, "stat"): --- 254,258 ---- s = self.dumps(t) u = self.loads(s) ! self.assertEqual(t, u) import os if hasattr(os, "stat"): Index: test_StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v retrieving revision 1.10.6.2 retrieving revision 1.10.6.3 diff -C2 -d -r1.10.6.2 -r1.10.6.3 *** test_StringIO.py 18 Mar 2002 13:31:31 -0000 1.10.6.2 --- test_StringIO.py 7 Oct 2002 01:18:17 -0000 1.10.6.3 *************** *** 78,82 **** # snippets to larger Unicode strings. This is tested by this # method. Note that cStringIO does not support this extension. ! f = self.MODULE.StringIO() f.write(self._line[:6]) --- 78,82 ---- # snippets to larger Unicode strings. This is tested by this # method. Note that cStringIO does not support this extension. ! f = self.MODULE.StringIO() f.write(self._line[:6]) Index: test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.9.10.3 retrieving revision 1.9.10.4 diff -C2 -d -r1.9.10.3 -r1.9.10.4 *** test_cfgparser.py 27 Sep 2002 16:34:30 -0000 1.9.10.3 --- test_cfgparser.py 7 Oct 2002 01:18:17 -0000 1.9.10.4 *************** *** 71,75 **** likes it. """) ! def case_sensitivity(): print "Testing case sensitivity..." --- 71,75 ---- likes it. """) ! def case_sensitivity(): print "Testing case sensitivity..." Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.30.6.1 retrieving revision 1.30.6.2 diff -C2 -d -r1.30.6.1 -r1.30.6.2 *** test_generators.py 12 Jun 2002 03:48:46 -0000 1.30.6.1 --- test_generators.py 7 Oct 2002 01:18:17 -0000 1.30.6.2 *************** *** 817,821 **** ... finally: ... yield i ! ... >>> g = f() >>> print g.next() --- 817,821 ---- ... finally: ... yield i ! ... >>> g = f() >>> print g.next() Index: test_httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_httplib.py,v retrieving revision 1.2.12.2 retrieving revision 1.2.12.3 diff -C2 -d -r1.2.12.2 -r1.2.12.3 *** test_httplib.py 12 Jul 2002 14:23:43 -0000 1.2.12.2 --- test_httplib.py 7 Oct 2002 01:18:17 -0000 1.2.12.3 *************** *** 57,59 **** if cookies != hdr: raise AssertionError, "multiple headers not combined properly" - --- 57,58 ---- Index: test_multifile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_multifile.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_multifile.py 22 Sep 2002 09:03:03 -0000 1.1.2.1 --- test_multifile.py 7 Oct 2002 01:18:17 -0000 1.1.2.2 *************** *** 5,14 **** msg = """Mime-Version: 1.0 Content-Type: multipart/mixed; ! boundary="=====================_590453667==_" X-OriginalArrivalTime: 05 Feb 2002 03:43:23.0310 (UTC) FILETIME=[42D88CE0:01C1ADF7] --=====================_590453667==_ Content-Type: multipart/alternative; ! boundary="=====================_590453677==_.ALT" --=====================_590453677==_.ALT --- 5,14 ---- msg = """Mime-Version: 1.0 Content-Type: multipart/mixed; ! boundary="=====================_590453667==_" X-OriginalArrivalTime: 05 Feb 2002 03:43:23.0310 (UTC) FILETIME=[42D88CE0:01C1ADF7] --=====================_590453667==_ Content-Type: multipart/alternative; ! boundary="=====================_590453677==_.ALT" --=====================_590453677==_.ALT *************** *** 50,55 **** mf.push(boundary) ! while mf.next(): ! getMIMEMsg(mf) mf.pop() else: --- 50,55 ---- mf.push(boundary) ! while mf.next(): ! getMIMEMsg(mf) mf.pop() else: Index: test_netrc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_netrc.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_netrc.py 25 Mar 2002 13:23:53 -0000 1.1.2.1 --- test_netrc.py 7 Oct 2002 01:18:17 -0000 1.1.2.2 *************** *** 13,17 **** line4 ! default login log2 password pass2 """ --- 13,17 ---- line4 ! default login log2 password pass2 """ *************** *** 26,30 **** fp.close() self.netrc = netrc.netrc(temp_filename) ! def tearDown (self): del self.netrc --- 26,30 ---- fp.close() self.netrc = netrc.netrc(temp_filename) ! def tearDown (self): del self.netrc *************** *** 37,43 **** self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1')) self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2')) ! ! if __name__ == "__main__": test_support.run_unittest(NetrcTestCase) - --- 37,42 ---- self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1')) self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2')) ! ! if __name__ == "__main__": test_support.run_unittest(NetrcTestCase) Index: test_string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_string.py,v retrieving revision 1.15.6.1 retrieving revision 1.15.6.2 diff -C2 -d -r1.15.6.1 -r1.15.6.2 *** test_string.py 22 Apr 2002 11:57:05 -0000 1.15.6.1 --- test_string.py 7 Oct 2002 01:18:17 -0000 1.15.6.2 *************** *** 39,43 **** if value is input: if verbose: ! print 'no' print '*',f, `input`, `output`, `value` return --- 39,43 ---- if value is input: if verbose: ! print 'no' print '*',f, `input`, `output`, `value` return Index: test_trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** test_trace.py 2 Oct 2002 13:13:46 -0000 1.4.2.1 --- test_trace.py 7 Oct 2002 01:18:17 -0000 1.4.2.2 *************** *** 120,124 **** def settrace_and_return(tracefunc): _settrace_and_return(tracefunc) ! settrace_and_return.events = [(1, 'return')] --- 120,124 ---- def settrace_and_return(tracefunc): _settrace_and_return(tracefunc) ! settrace_and_return.events = [(1, 'return')] *************** *** 132,136 **** except RuntimeError, exc: pass ! settrace_and_raise.events = [(2, 'exception'), (3, 'line'), --- 132,136 ---- except RuntimeError, exc: pass ! settrace_and_raise.events = [(2, 'exception'), (3, 'line'), *************** *** 147,151 **** class TraceTestCase(unittest.TestCase): def compare_events(self, line_offset, events, expected_events): ! events = [(l - line_offset, e) for (l, e) in events] if events != expected_events: self.fail( --- 147,151 ---- class TraceTestCase(unittest.TestCase): def compare_events(self, line_offset, events, expected_events): ! events = [(l - line_offset, e) for (l, e) in events] if events != expected_events: self.fail( *************** *** 153,158 **** "\n".join(difflib.ndiff(map(str, expected_events), map(str, events)))) ! ! def run_test(self, func): tracer = Tracer() --- 153,158 ---- "\n".join(difflib.ndiff(map(str, expected_events), map(str, events)))) ! ! def run_test(self, func): tracer = Tracer() *************** *** 169,173 **** self.compare_events(func.func_code.co_firstlineno, tracer.events, func.events) ! def test_1_basic(self): self.run_test(basic) --- 169,173 ---- self.compare_events(func.func_code.co_firstlineno, tracer.events, func.events) ! def test_1_basic(self): self.run_test(basic) *************** *** 207,211 **** except RuntimeError: self.fail("recursion counter not reset") ! def test_main(): --- 207,211 ---- except RuntimeError: self.fail("recursion counter not reset") ! def test_main(): Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.2.24.2 retrieving revision 1.2.24.3 diff -C2 -d -r1.2.24.2 -r1.2.24.3 *** test_urlparse.py 25 Sep 2002 19:22:10 -0000 1.2.24.2 --- test_urlparse.py 7 Oct 2002 01:18:17 -0000 1.2.24.3 *************** *** 13,18 **** (RFC1808_BASE, ('http', 'a', '/b/c/d', 'p', 'q', 'f')), ! ('file:///tmp/junk.txt', ! ('file', '', '/tmp/junk.txt', '', '', '')), ]: result = urlparse.urlparse(url) --- 13,18 ---- (RFC1808_BASE, ('http', 'a', '/b/c/d', 'p', 'q', 'f')), ! ('file:///tmp/junk.txt', ! ('file', '', '/tmp/junk.txt', '', '', '')), ]: result = urlparse.urlparse(url) From tim_one@users.sourceforge.net Mon Oct 7 02:18:19 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun, 06 Oct 2002 18:18:19 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.38.10.6,1.38.10.7 StringIO.py,1.19.12.3,1.19.12.4 fileinput.py,1.8.8.1,1.8.8.2 httplib.py,1.42.10.8,1.42.10.9 smtplib.py,1.46.4.5,1.46.4.6 tabnanny.py,1.16.16.1,1.16.16.2 tokenize.py,1.28.14.1,1.28.14.2 urllib2.py,1.24.8.2,1.24.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25501/Lib Modified Files: Tag: release22-maint ConfigParser.py StringIO.py fileinput.py httplib.py smtplib.py tabnanny.py tokenize.py urllib2.py Log Message: Whitespace normalization. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.38.10.6 retrieving revision 1.38.10.7 diff -C2 -d -r1.38.10.6 -r1.38.10.7 *** ConfigParser.py 3 Oct 2002 15:27:47 -0000 1.38.10.6 --- ConfigParser.py 7 Oct 2002 01:18:17 -0000 1.38.10.7 *************** *** 283,287 **** # do the string interpolation value = rawval ! depth = MAX_INTERPOLATION_DEPTH while depth: # Loop through this until it's done depth -= 1 --- 283,287 ---- # do the string interpolation value = rawval ! depth = MAX_INTERPOLATION_DEPTH while depth: # Loop through this until it's done depth -= 1 Index: StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v retrieving revision 1.19.12.3 retrieving revision 1.19.12.4 diff -C2 -d -r1.19.12.3 -r1.19.12.4 *** StringIO.py 15 May 2002 03:50:31 -0000 1.19.12.3 --- StringIO.py 7 Oct 2002 01:18:17 -0000 1.19.12.4 *************** *** 38,51 **** class StringIO: ! """class StringIO([buffer]) ! When a StringIO object is created, it can be initialized to an existing string by passing the string to the constructor. If no string is given, ! the StringIO will start empty. The StringIO object can accept either Unicode or 8-bit strings, but mixing the two may take some care. If both are used, 8-bit strings that cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause ! a UnicodeError to be raised when getvalue() is called. """ def __init__(self, buf = ''): --- 38,51 ---- class StringIO: ! """class StringIO([buffer]) ! When a StringIO object is created, it can be initialized to an existing string by passing the string to the constructor. If no string is given, ! the StringIO will start empty. The StringIO object can accept either Unicode or 8-bit strings, but mixing the two may take some care. If both are used, 8-bit strings that cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause ! a UnicodeError to be raised when getvalue() is called. """ def __init__(self, buf = ''): *************** *** 186,190 **** strings that cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause a UnicodeError to be raised when getvalue() ! is called. """ if self.buflist: --- 186,190 ---- strings that cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause a UnicodeError to be raised when getvalue() ! is called. """ if self.buflist: Index: fileinput.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/fileinput.py,v retrieving revision 1.8.8.1 retrieving revision 1.8.8.2 diff -C2 -d -r1.8.8.1 -r1.8.8.2 *** fileinput.py 15 May 2002 03:50:31 -0000 1.8.8.1 --- fileinput.py 7 Oct 2002 01:18:17 -0000 1.8.8.2 *************** *** 95,99 **** as global state for the functions of this module, and is also returned to use during iteration. The parameters to this function will be passed ! along to the constructor of the FileInput class. """ global _state --- 95,99 ---- as global state for the functions of this module, and is also returned to use during iteration. The parameters to this function will be passed ! along to the constructor of the FileInput class. """ global _state *************** *** 119,123 **** Before the first line has been read, this function has no effect; it cannot be used to skip the first file. After the last line of the ! last file has been read, this function has no effect. """ if not _state: --- 119,123 ---- Before the first line has been read, this function has no effect; it cannot be used to skip the first file. After the last line of the ! last file has been read, this function has no effect. """ if not _state: *************** *** 128,132 **** """ Return the name of the file currently being read. ! Before the first line has been read, returns None. """ if not _state: --- 128,132 ---- """ Return the name of the file currently being read. ! Before the first line has been read, returns None. """ if not _state: *************** *** 138,142 **** Return the cumulative line number of the line that has just been read. Before the first line has been read, returns 0. After the last line ! of the last file has been read, returns the line number of that line. """ if not _state: --- 138,142 ---- Return the cumulative line number of the line that has just been read. Before the first line has been read, returns 0. After the last line ! of the last file has been read, returns the line number of that line. """ if not _state: *************** *** 148,152 **** Return the line number in the current file. Before the first line has been read, returns 0. After the last line of the last file has ! been read, returns the line number of that line within the file. """ if not _state: --- 148,152 ---- Return the line number in the current file. Before the first line has been read, returns 0. After the last line of the last file has ! been read, returns the line number of that line within the file. """ if not _state: *************** *** 157,161 **** """ Returns true the line just read is the first line of its file, ! otherwise returns false. """ if not _state: --- 157,161 ---- """ Returns true the line just read is the first line of its file, ! otherwise returns false. """ if not _state: *************** *** 166,170 **** """ Returns true if the last line was read from sys.stdin, ! otherwise returns false. """ if not _state: --- 166,170 ---- """ Returns true if the last line was read from sys.stdin, ! otherwise returns false. """ if not _state: *************** *** 174,178 **** class FileInput: """class FileInput([files[, inplace[, backup]]]) ! Class FileInput is the implementation of the module; its methods filename(), lineno(), fileline(), isfirstline(), isstdin(), nextfile() --- 174,178 ---- class FileInput: """class FileInput([files[, inplace[, backup]]]) ! Class FileInput is the implementation of the module; its methods filename(), lineno(), fileline(), isfirstline(), isstdin(), nextfile() *************** *** 181,185 **** input line, and a __getitem__() method which implements the sequence behavior. The sequence must be accessed in strictly ! sequential order; random access and readline() cannot be mixed. """ --- 181,185 ---- input line, and a __getitem__() method which implements the sequence behavior. The sequence must be accessed in strictly ! sequential order; random access and readline() cannot be mixed. """ Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.42.10.8 retrieving revision 1.42.10.9 diff -C2 -d -r1.42.10.8 -r1.42.10.9 *** httplib.py 25 Sep 2002 16:53:17 -0000 1.42.10.8 --- httplib.py 7 Oct 2002 01:18:17 -0000 1.42.10.9 *************** *** 372,376 **** if self.chunked: return self._read_chunked(amt) ! if amt is None: # unbounded read --- 372,376 ---- if self.chunked: return self._read_chunked(amt) ! if amt is None: # unbounded read *************** *** 442,446 **** return value ! def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads. --- 442,446 ---- return value ! def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.46.4.5 retrieving revision 1.46.4.6 diff -C2 -d -r1.46.4.5 -r1.46.4.6 *** smtplib.py 6 Oct 2002 17:51:10 -0000 1.46.4.5 --- smtplib.py 7 Oct 2002 01:18:17 -0000 1.46.4.6 *************** *** 409,413 **** + " " + auth_match.groups(0)[0] continue ! # RFC 1869 requires a space between ehlo keyword and parameters. # It's actually stricter, in that only spaces are allowed between --- 409,413 ---- + " " + auth_match.groups(0)[0] continue ! # RFC 1869 requires a space between ehlo keyword and parameters. # It's actually stricter, in that only spaces are allowed between *************** *** 525,529 **** def encode_plain(user, password): return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") ! AUTH_PLAIN = "PLAIN" --- 525,529 ---- def encode_plain(user, password): return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") ! AUTH_PLAIN = "PLAIN" Index: tabnanny.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tabnanny.py,v retrieving revision 1.16.16.1 retrieving revision 1.16.16.2 diff -C2 -d -r1.16.16.1 -r1.16.16.2 *** tabnanny.py 15 May 2002 03:50:31 -0000 1.16.16.1 --- tabnanny.py 7 Oct 2002 01:18:17 -0000 1.16.16.2 *************** *** 3,14 **** """The Tab Nanny despises ambiguous indentation. She knows no mercy. ! tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function ! check() described below. Warning: The API provided by this module is likely to change in future ! releases; such changes may not be backward compatible. """ --- 3,14 ---- """The Tab Nanny despises ambiguous indentation. She knows no mercy. ! tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function ! check() described below. Warning: The API provided by this module is likely to change in future ! releases; such changes may not be backward compatible. """ *************** *** 74,85 **** def check(file): """check(file_or_dir) ! If file_or_dir is a directory and not a symbolic link, then recursively descend the directory tree named by file_or_dir, checking all .py files along the way. If file_or_dir is an ordinary Python source file, it is checked for whitespace related problems. The diagnostic messages are ! written to standard output using the print statement. """ ! if os.path.isdir(file) and not os.path.islink(file): if verbose: --- 74,85 ---- def check(file): """check(file_or_dir) ! If file_or_dir is a directory and not a symbolic link, then recursively descend the directory tree named by file_or_dir, checking all .py files along the way. If file_or_dir is an ordinary Python source file, it is checked for whitespace related problems. The diagnostic messages are ! written to standard output using the print statement. """ ! if os.path.isdir(file) and not os.path.islink(file): if verbose: Index: tokenize.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tokenize.py,v retrieving revision 1.28.14.1 retrieving revision 1.28.14.2 diff -C2 -d -r1.28.14.1 -r1.28.14.2 *** tokenize.py 15 May 2002 03:50:31 -0000 1.28.14.1 --- tokenize.py 7 Oct 2002 01:18:17 -0000 1.28.14.2 *************** *** 126,137 **** The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize(). ! The first parameter, readline, must be a callable object which provides the same interface as the readline() method of built-in file objects. ! Each call to the function should return one line of input as a string. The second parameter, tokeneater, must also be a callable object. It is called once for each token, with five arguments, corresponding to the ! tuples generated by generate_tokens(). """ try: --- 126,137 ---- The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize(). ! The first parameter, readline, must be a callable object which provides the same interface as the readline() method of built-in file objects. ! Each call to the function should return one line of input as a string. The second parameter, tokeneater, must also be a callable object. It is called once for each token, with five arguments, corresponding to the ! tuples generated by generate_tokens(). """ try: *************** *** 151,155 **** readline() method of built-in file objects. Each call to the function should return one line of input as a string. ! The generator produces 5-tuples with these members: the token type; the token string; a 2-tuple (srow, scol) of ints specifying the row and --- 151,155 ---- readline() method of built-in file objects. Each call to the function should return one line of input as a string. ! The generator produces 5-tuples with these members: the token type; the token string; a 2-tuple (srow, scol) of ints specifying the row and *************** *** 157,161 **** ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed is the ! logical line; continuation lines are included. """ lnum = parenlev = continued = 0 --- 157,161 ---- ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed is the ! logical line; continuation lines are included. """ lnum = parenlev = continued = 0 Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.24.8.2 retrieving revision 1.24.8.3 diff -C2 -d -r1.24.8.2 -r1.24.8.3 *** urllib2.py 25 Sep 2002 10:32:49 -0000 1.24.8.2 --- urllib2.py 7 Oct 2002 01:18:17 -0000 1.24.8.3 *************** *** 459,463 **** if ':' in user_pass: user, password = user_pass.split(':', 1) ! user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))) req.add_header('Proxy-Authorization', 'Basic ' + user_pass) --- 459,463 ---- if ':' in user_pass: user, password = user_pass.split(':', 1) ! user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))) req.add_header('Proxy-Authorization', 'Basic ' + user_pass) From tim_one@users.sourceforge.net Mon Oct 7 02:20:54 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun, 06 Oct 2002 18:20:54 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_trace.py,1.4.2.2,1.4.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26753/Lib/test Modified Files: Tag: release22-maint test_trace.py Log Message: This has no hope of working under -O. Skip it then instead of failing. Index: test_trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -C2 -d -r1.4.2.2 -r1.4.2.3 *** test_trace.py 7 Oct 2002 01:18:17 -0000 1.4.2.2 --- test_trace.py 7 Oct 2002 01:20:52 -0000 1.4.2.3 *************** *** 6,9 **** --- 6,12 ---- import difflib + if not __debug__: + raise test_support.TestSkipped, "tracing not supported under -O" + # A very basic example. If this fails, we're in deep trouble. def basic(): From rhettinger@users.sourceforge.net Mon Oct 7 03:33:58 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 06 Oct 2002 19:33:58 -0700 Subject: [Python-checkins] python/dist/src/Parser myreadline.c,2.26,2.26.24.1 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv24304 Modified Files: Tag: release22-maint myreadline.c Log Message: Backport 2.27: Fix bug 439992 - [win32] KeyboardInterrupt Not Caught. This gets us closer to consistent Ctrl+C behaviour on NT and Win9x. NT now reliably generates KeyboardInterrupt exceptions for NT when a file IO operation was aborted. Bugfix candidate Index: myreadline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/myreadline.c,v retrieving revision 2.26 retrieving revision 2.26.24.1 diff -C2 -d -r2.26 -r2.26.24.1 *** myreadline.c 2 Mar 2001 06:29:51 -0000 2.26 --- myreadline.c 7 Oct 2002 02:33:56 -0000 2.26.24.1 *************** *** 11,14 **** --- 11,18 ---- #include "Python.h" + #ifdef MS_WINDOWS + #define WIN32_LEAN_AND_MEAN + #include "windows.h" + #endif /* MS_WINDOWS */ int (*PyOS_InputHook)(void) = NULL; *************** *** 32,35 **** --- 36,68 ---- if (p != NULL) return 0; /* No error */ + #ifdef MS_WINDOWS + /* In the case of a Ctrl+C or some other external event + interrupting the operation: + Win2k/NT: ERROR_OPERATION_ABORTED is the most recent Win32 + error code (and feof() returns TRUE). + Win9x: Ctrl+C seems to have no effect on fgets() returning + early - the signal handler is called, but the fgets() + only returns "normally" (ie, when Enter hit or feof()) + */ + if (GetLastError()==ERROR_OPERATION_ABORTED) { + /* Signals come asynchronously, so we sleep a brief + moment before checking if the handler has been + triggered (we cant just return 1 before the + signal handler has been called, as the later + signal may be treated as a separate interrupt). + */ + Sleep(1); + if (PyOS_InterruptOccurred()) { + return 1; /* Interrupt */ + } + /* Either the sleep wasn't long enough (need a + short loop retrying?) or not interrupted at all + (in which case we should revisit the whole thing!) + Logging some warning would be nice. assert is not + viable as under the debugger, the various dialogs + mean the condition is not true. + */ + } + #endif /* MS_WINDOWS */ if (feof(fp)) { return -1; /* EOF */ From loewis@users.sourceforge.net Mon Oct 7 06:53:32 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 22:53:32 -0700 Subject: [Python-checkins] python/dist/src/Misc/RPM python-2.2.spec,1.1.2.2,1.1.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Misc/RPM In directory usw-pr-cvs1:/tmp/cvs-serv11355 Modified Files: Tag: release22-maint python-2.2.spec Log Message: Patch #619352: Update for 2.2.2b1. Install python2 and python2.2. Add Makefile.pre.in to -devel. Index: python-2.2.spec =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/RPM/python-2.2.spec,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** python-2.2.spec 9 Apr 2002 09:29:28 -0000 1.1.2.2 --- python-2.2.spec 7 Oct 2002 05:53:29 -0000 1.1.2.3 *************** *** 5,28 **** # Is the resulting package and the installed binary named "python" or # "python2"? ! #WARNING: Commenting out doesn't work. Last line is what's used. ! %define config_binsuffix none ! %define config_binsuffix 2 # Build tkinter? "auto" enables it if /usr/bin/wish exists. ! #WARNING: Commenting out doesn't work. Last line is what's used. ! %define config_tkinter no ! %define config_tkinter yes %define config_tkinter auto # Use pymalloc? The last line (commented or not) determines wether # pymalloc is used. ! #WARNING: Commenting out doesn't work. Last line is what's used. ! %define config_pymalloc yes %define config_pymalloc no # Enable IPV6? ! #WARNING: Commenting out doesn't work. Last line is what's used. ! %define config_ipv6 yes ! %define config_ipv6 no ################################# --- 5,23 ---- # Is the resulting package and the installed binary named "python" or # "python2"? ! # Valid values: [none/2/2.2] ! %define config_binsuffix 2.2.2b1 # Build tkinter? "auto" enables it if /usr/bin/wish exists. ! # Valid values: [no/yes/auto] %define config_tkinter auto # Use pymalloc? The last line (commented or not) determines wether # pymalloc is used. ! # Valid values: [no/yes] %define config_pymalloc no # Enable IPV6? ! # Valid values: [no/yes/auto] ! %define config_ipv6 auto ################################# *************** *** 31,35 **** %define name python ! %define version 2.2.1 %define release 1 %define __prefix /usr --- 26,30 ---- %define name python ! %define version 2.2.2b1 %define release 1 %define __prefix /usr *************** *** 37,41 **** # kludge to get around rpm define weirdness ! %define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi) %define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi) %define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) --- 32,36 ---- # kludge to get around rpm define weirdness ! %define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else if [ "%{config_ipv6}" == auto ]; then echo; else echo --disable-ipv6; fi; fi) %define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi) %define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) *************** *** 128,132 **** %changelog ! * Tue Mar 26 2002 Sean Reifschneider [Release 2.2.1c2-1] - Updated to 2.2.1c2. --- 123,139 ---- %changelog ! * Sun Oct 06 2002 Sean Reifschneider ! [Release 2.2.2b1-1] ! - Updated for the 2.2.2b1 release. ! - Changing ipv6 settings to include "auto" which will let configure ! figure it out. (suggested by Martin v. Loewis) ! - Changing the settable flags at the top of this file. ! (suggested by Martin v. Loewis) ! ! [Release 2.2.1-2] ! - Enabled IPV6 by default. (Suggested by Pekka Pessi) ! - Set up to install python2 and python2.2 when using the suffix. ! - Added Makefile.pre.in to -devel. ! [Release 2.2.1c2-1] - Updated to 2.2.1c2. *************** *** 219,222 **** --- 226,232 ---- make prefix=$RPM_BUILD_ROOT%{__prefix} install + # copy over Makefile.pre.in + cp Makefile.pre.in Makefile.pre $RPM_BUILD_ROOT%{__prefix}/lib/python%{libvers}/config/ + # REPLACE PATH IN PYDOC if [ ! -z "%{binsuffix}" ] *************** *** 235,239 **** if [ ! -z "%{binsuffix}" ] then ! ( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*; mv -f python python"%{binsuffix}" ) ( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 ) --- 245,250 ---- if [ ! -z "%{binsuffix}" ] then ! ( cd $RPM_BUILD_ROOT%{__prefix}/bin; ! rm -f python"%{binsuffix}"; mv -f python python"%{binsuffix}" ) ( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 ) From loewis@users.sourceforge.net Mon Oct 7 06:56:44 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 22:56:44 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command bdist_rpm.py,1.27.6.1,1.27.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv13168 Modified Files: Tag: release22-maint bdist_rpm.py Log Message: Patch #619493: Prefer rpmbuild over rpm if available. Index: bdist_rpm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_rpm.py,v retrieving revision 1.27.6.1 retrieving revision 1.27.6.2 diff -C2 -d -r1.27.6.1 -r1.27.6.2 *** bdist_rpm.py 25 Mar 2002 13:13:45 -0000 1.27.6.1 --- bdist_rpm.py 7 Oct 2002 05:56:42 -0000 1.27.6.2 *************** *** 281,284 **** --- 281,287 ---- self.announce('building RPMs') rpm_cmd = ['rpm'] + if os.path.exists('/usr/bin/rpmbuild') or \ + os.path.exists('/bin/rpmbuild'): + rpm_cmd = ['rpmbuild'] if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') From loewis@users.sourceforge.net Mon Oct 7 06:57:23 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 22:57:23 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command bdist_rpm.py,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv13493 Modified Files: bdist_rpm.py Log Message: Patch #619493: Prefer rpmbuild over rpm if available. Backported to 2.2. Index: bdist_rpm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_rpm.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** bdist_rpm.py 11 Sep 2002 16:31:52 -0000 1.31 --- bdist_rpm.py 7 Oct 2002 05:57:21 -0000 1.32 *************** *** 283,286 **** --- 283,289 ---- log.info("building RPMs") rpm_cmd = ['rpm'] + if os.path.exists('/usr/bin/rpmbuild') or \ + os.path.exists('/bin/rpmbuild'): + rpm_cmd = ['rpmbuild'] if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') From loewis@users.sourceforge.net Mon Oct 7 07:21:09 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 23:21:09 -0700 Subject: [Python-checkins] python/dist/src configure.in,1.352,1.353 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv24905 Modified Files: configure.in Log Message: Fix quoting for Solaris LDSHARED. Will backport to 2.2. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.352 retrieving revision 1.353 diff -C2 -d -r1.352 -r1.353 *** configure.in 6 Oct 2002 11:48:09 -0000 1.352 --- configure.in 7 Oct 2002 06:21:05 -0000 1.353 *************** *** 929,933 **** if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED="$(CC) -G"; fi ;; hp*|HP*) LDSHARED="ld -b";; --- 929,933 ---- if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED='$(CC) -G'; fi ;; hp*|HP*) LDSHARED="ld -b";; From loewis@users.sourceforge.net Mon Oct 7 07:21:46 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 23:21:46 -0700 Subject: [Python-checkins] python/dist/src configure,1.341,1.342 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25139 Modified Files: configure Log Message: Fix quoting for Solaris LDSHARED. Will backport to 2.2. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.341 retrieving revision 1.342 diff -C2 -d -r1.341 -r1.342 *** configure 6 Oct 2002 11:48:08 -0000 1.341 --- configure 7 Oct 2002 06:21:41 -0000 1.342 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.351 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.352 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 8918,8922 **** if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED="$(CC) -G"; fi ;; hp*|HP*) LDSHARED="ld -b";; --- 8918,8922 ---- if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED='$(CC) -G'; fi ;; hp*|HP*) LDSHARED="ld -b";; From loewis@users.sourceforge.net Mon Oct 7 07:22:24 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 23:22:24 -0700 Subject: [Python-checkins] python/dist/src configure,1.279.6.13,1.279.6.14 configure.in,1.288.6.13,1.288.6.14 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25339 Modified Files: Tag: release22-maint configure configure.in Log Message: Fix quoting for Solaris LDSHARED. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.279.6.13 retrieving revision 1.279.6.14 diff -C2 -d -r1.279.6.13 -r1.279.6.14 *** configure 4 Oct 2002 10:16:24 -0000 1.279.6.13 --- configure 7 Oct 2002 06:22:19 -0000 1.279.6.14 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.288.6.12 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.288.6.13 # Guess values for system-dependent variables and create Makefiles. *************** *** 3187,3191 **** if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED="$(CC) -G"; fi ;; hp*|HP*) LDSHARED="ld -b";; --- 3187,3191 ---- if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED='$(CC) -G'; fi ;; hp*|HP*) LDSHARED="ld -b";; Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.288.6.13 retrieving revision 1.288.6.14 diff -C2 -d -r1.288.6.13 -r1.288.6.14 *** configure.in 4 Oct 2002 10:16:27 -0000 1.288.6.13 --- configure.in 7 Oct 2002 06:22:21 -0000 1.288.6.14 *************** *** 801,805 **** if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED="$(CC) -G"; fi ;; hp*|HP*) LDSHARED="ld -b";; --- 801,805 ---- if test "$GCC" = "yes" then LDSHARED='$(CC) -shared' ! else LDSHARED='$(CC) -G'; fi ;; hp*|HP*) LDSHARED="ld -b";; From loewis@users.sourceforge.net Mon Oct 7 07:44:24 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun, 06 Oct 2002 23:44:24 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.263,2.264 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1042 Modified Files: posixmodule.c Log Message: Apply file system default encoding to exec and spawn path and arguments. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.263 retrieving revision 2.264 diff -C2 -d -r2.263 -r2.264 *** posixmodule.c 5 Oct 2002 01:47:34 -0000 2.263 --- posixmodule.c 7 Oct 2002 06:44:21 -0000 2.264 *************** *** 1853,1856 **** --- 1853,1867 ---- } + #if defined(HAVE_EXECV) || defined(HAVE_SPAWNV) + static void + free_string_array(char **array, int count) + { + int i; + for (i = 0; i < count; i++) + PyMem_Free(array[i]); + PyMem_DEL(array); + } + #endif + #ifdef HAVE_EXECV *************** *** 1874,1878 **** argv is a list or tuple of strings. */ ! if (!PyArg_ParseTuple(args, "sO:execv", &path, &argv)) return NULL; if (PyList_Check(argv)) { --- 1885,1891 ---- argv is a list or tuple of strings. */ ! if (!PyArg_ParseTuple(args, "etO:execv", ! Py_FileSystemDefaultEncoding, ! &path, &argv)) return NULL; if (PyList_Check(argv)) { *************** *** 1886,1889 **** --- 1899,1903 ---- else { PyErr_SetString(PyExc_TypeError, "execv() arg 2 must be a tuple or list"); + PyMem_Free(path); return NULL; } *************** *** 1891,1905 **** if (argc == 0) { PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty"); return NULL; } argvlist = PyMem_NEW(char *, argc+1); ! if (argvlist == NULL) return NULL; for (i = 0; i < argc; i++) { ! if (!PyArg_Parse((*getitem)(argv, i), "s", &argvlist[i])) { ! PyMem_DEL(argvlist); PyErr_SetString(PyExc_TypeError, "execv() arg 2 must contain only strings"); return NULL; --- 1905,1925 ---- if (argc == 0) { PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty"); + PyMem_Free(path); return NULL; } argvlist = PyMem_NEW(char *, argc+1); ! if (argvlist == NULL) { ! PyMem_Free(path); return NULL; + } for (i = 0; i < argc; i++) { ! if (!PyArg_Parse((*getitem)(argv, i), "et", ! Py_FileSystemDefaultEncoding, ! &argvlist[i])) { ! free_string_array(argvlist, i); PyErr_SetString(PyExc_TypeError, "execv() arg 2 must contain only strings"); + PyMem_Free(path); return NULL; *************** *** 1916,1920 **** /* If we get here it's definitely an error */ ! PyMem_DEL(argvlist); return posix_error(); } --- 1936,1941 ---- /* If we get here it's definitely an error */ ! free_string_array(argvlist, argc); ! PyMem_Free(path); return posix_error(); } *************** *** 1939,1942 **** --- 1960,1964 ---- int i, pos, argc, envc; PyObject *(*getitem)(PyObject *, int); + int lastarg = 0; /* execve has three arguments: (path, argv, env), where *************** *** 1944,1948 **** like posix.environ. */ ! if (!PyArg_ParseTuple(args, "sOO:execve", &path, &argv, &env)) return NULL; if (PyList_Check(argv)) { --- 1966,1972 ---- like posix.environ. */ ! if (!PyArg_ParseTuple(args, "etOO:execve", ! Py_FileSystemDefaultEncoding, ! &path, &argv, &env)) return NULL; if (PyList_Check(argv)) { *************** *** 1956,1964 **** else { PyErr_SetString(PyExc_TypeError, "execve() arg 2 must be a tuple or list"); ! return NULL; } if (!PyMapping_Check(env)) { PyErr_SetString(PyExc_TypeError, "execve() arg 3 must be a mapping object"); ! return NULL; } --- 1980,1988 ---- else { PyErr_SetString(PyExc_TypeError, "execve() arg 2 must be a tuple or list"); ! goto fail_0; } if (!PyMapping_Check(env)) { PyErr_SetString(PyExc_TypeError, "execve() arg 3 must be a mapping object"); ! goto fail_0; } *************** *** 1966,1970 **** PyErr_SetString(PyExc_ValueError, "execve() arg 2 must not be empty"); ! return NULL; } --- 1990,1994 ---- PyErr_SetString(PyExc_ValueError, "execve() arg 2 must not be empty"); ! goto fail_0; } *************** *** 1972,1985 **** if (argvlist == NULL) { PyErr_NoMemory(); ! return NULL; } for (i = 0; i < argc; i++) { if (!PyArg_Parse((*getitem)(argv, i), ! "s;execve() arg 2 must contain only strings", &argvlist[i])) { goto fail_1; } } argvlist[argc] = NULL; --- 1996,2011 ---- if (argvlist == NULL) { PyErr_NoMemory(); ! goto fail_0; } for (i = 0; i < argc; i++) { if (!PyArg_Parse((*getitem)(argv, i), ! "et;execve() arg 2 must contain only strings", &argvlist[i])) { + lastarg = i; goto fail_1; } } + lastarg = argc; argvlist[argc] = NULL; *************** *** 2045,2051 **** PyMem_DEL(envlist); fail_1: ! PyMem_DEL(argvlist); Py_XDECREF(vals); Py_XDECREF(keys); return NULL; } --- 2071,2079 ---- PyMem_DEL(envlist); fail_1: ! free_string_array(argvlist,lastarg); Py_XDECREF(vals); Py_XDECREF(keys); + fail_0: + PyMem_Free(path); return NULL; } *************** *** 2075,2079 **** argv is a list or tuple of strings. */ ! if (!PyArg_ParseTuple(args, "isO:spawnv", &mode, &path, &argv)) return NULL; if (PyList_Check(argv)) { --- 2103,2109 ---- argv is a list or tuple of strings. */ ! if (!PyArg_ParseTuple(args, "ietO:spawnv", &mode, ! Py_FileSystemDefaultEncoding, ! &path, &argv)) return NULL; if (PyList_Check(argv)) { *************** *** 2087,2101 **** else { PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must be a tuple or list"); return NULL; } argvlist = PyMem_NEW(char *, argc+1); ! if (argvlist == NULL) return NULL; for (i = 0; i < argc; i++) { ! if (!PyArg_Parse((*getitem)(argv, i), "s", &argvlist[i])) { ! PyMem_DEL(argvlist); PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must contain only strings"); return NULL; } --- 2117,2137 ---- else { PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must be a tuple or list"); + PyMem_Free(path); return NULL; } argvlist = PyMem_NEW(char *, argc+1); ! if (argvlist == NULL) { ! PyMem_Free(path); return NULL; + } for (i = 0; i < argc; i++) { ! if (!PyArg_Parse((*getitem)(argv, i), "et", ! Py_FileSystemDefaultEncoding, ! &argvlist[i])) { ! free_string_array(argvlist, i); PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must contain only strings"); + PyMem_Free(path); return NULL; } *************** *** 2116,2120 **** #endif ! PyMem_DEL(argvlist); if (spawnval == -1) --- 2152,2157 ---- #endif ! free_string_array(argvlist, argc); ! PyMem_Free(path); if (spawnval == -1) *************** *** 2149,2152 **** --- 2186,2190 ---- Py_intptr_t spawnval; PyObject *(*getitem)(PyObject *, int); + int lastarg = 0; /* spawnve has four arguments: (mode, path, argv, env), where *************** *** 2154,2158 **** like posix.environ. */ ! if (!PyArg_ParseTuple(args, "isOO:spawnve", &mode, &path, &argv, &env)) return NULL; if (PyList_Check(argv)) { --- 2192,2198 ---- like posix.environ. */ ! if (!PyArg_ParseTuple(args, "ietOO:spawnve", &mode, ! Py_FileSystemDefaultEncoding, ! &path, &argv, &env)) return NULL; if (PyList_Check(argv)) { *************** *** 2166,2174 **** else { PyErr_SetString(PyExc_TypeError, "spawnve() arg 2 must be a tuple or list"); ! return NULL; } if (!PyMapping_Check(env)) { PyErr_SetString(PyExc_TypeError, "spawnve() arg 3 must be a mapping object"); ! return NULL; } --- 2206,2214 ---- else { PyErr_SetString(PyExc_TypeError, "spawnve() arg 2 must be a tuple or list"); ! goto fail_0; } if (!PyMapping_Check(env)) { PyErr_SetString(PyExc_TypeError, "spawnve() arg 3 must be a mapping object"); ! goto fail_0; } *************** *** 2176,2189 **** if (argvlist == NULL) { PyErr_NoMemory(); ! return NULL; } for (i = 0; i < argc; i++) { if (!PyArg_Parse((*getitem)(argv, i), ! "s;spawnve() arg 2 must contain only strings", &argvlist[i])) { goto fail_1; } } argvlist[argc] = NULL; --- 2216,2232 ---- if (argvlist == NULL) { PyErr_NoMemory(); ! goto fail_0; } for (i = 0; i < argc; i++) { if (!PyArg_Parse((*getitem)(argv, i), ! "et;spawnve() arg 2 must contain only strings", ! Py_FileSystemDefaultEncoding, &argvlist[i])) { + lastarg = i; goto fail_1; } } + lastarg = argc; argvlist[argc] = NULL; *************** *** 2252,2258 **** PyMem_DEL(envlist); fail_1: ! PyMem_DEL(argvlist); Py_XDECREF(vals); Py_XDECREF(keys); return res; } --- 2295,2303 ---- PyMem_DEL(envlist); fail_1: ! free_string_array(argvlist, lastarg); Py_XDECREF(vals); Py_XDECREF(keys); + fail_0: + PyMem_Free(path); return res; } From mwh@users.sourceforge.net Mon Oct 7 10:37:29 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:37:29 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.301.4.5,2.301.4.6 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv10762 Modified Files: Tag: release22-maint ceval.c Log Message: This is Armin Rigo's patch: [ 617312 ] debugger-controlled jumps (Psyco #3) Forward port candidate, I guess. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.301.4.5 retrieving revision 2.301.4.6 diff -C2 -d -r2.301.4.5 -r2.301.4.6 *** ceval.c 2 Oct 2002 13:13:47 -0000 2.301.4.5 --- ceval.c 7 Oct 2002 09:37:26 -0000 2.301.4.6 *************** *** 586,597 **** tstate->frame = f; - co = f->f_code; - fastlocals = f->f_localsplus; - freevars = f->f_localsplus + f->f_nlocals; - _PyCode_GETCODEPTR(co, &first_instr); - next_instr = first_instr + f->f_lasti; - stack_pointer = f->f_stacktop; - assert(stack_pointer != NULL); - f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ if (tstate->use_tracing) { --- 586,589 ---- *************** *** 632,635 **** --- 624,636 ---- } + co = f->f_code; + fastlocals = f->f_localsplus; + freevars = f->f_localsplus + f->f_nlocals; + _PyCode_GETCODEPTR(co, &first_instr); + next_instr = first_instr + f->f_lasti; + stack_pointer = f->f_stacktop; + assert(stack_pointer != NULL); + f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ + #ifdef LLTRACE lltrace = PyDict_GetItemString(f->f_globals,"__lltrace__") != NULL; *************** *** 1973,1976 **** --- 1974,1978 ---- /* Trace each line of code reached */ f->f_lasti = INSTR_OFFSET(); + f->f_stacktop = stack_pointer; /* Inline call_trace() for performance: */ tstate->tracing++; *************** *** 1981,1984 **** --- 1983,1991 ---- || tstate->c_profilefunc); tstate->tracing--; + /* Reload possibly changed frame fields */ + JUMPTO(f->f_lasti); + stack_pointer = f->f_stacktop; + assert(stack_pointer != NULL); + f->f_stacktop = NULL; break; From mwh@users.sourceforge.net Mon Oct 7 10:40:22 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:40:22 -0700 Subject: [Python-checkins] python/dist/src/Include pystate.h,2.18,2.18.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv11757/Include Modified Files: Tag: release22-maint pystate.h Log Message: This is Armin Rigo's patch: [ 617311 ] Tiny profiling info (Psyco #2) Forward port candidate. Index: pystate.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v retrieving revision 2.18 retrieving revision 2.18.16.1 diff -C2 -d -r2.18 -r2.18.16.1 *** pystate.h 19 Jul 2001 12:19:11 -0000 2.18 --- pystate.h 7 Oct 2002 09:40:20 -0000 2.18.16.1 *************** *** 70,73 **** --- 70,75 ---- PyObject *dict; + int tick_counter; + /* XXX signal handlers should also be here */ From mwh@users.sourceforge.net Mon Oct 7 10:40:22 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:40:22 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.301.4.6,2.301.4.7 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11757/Python Modified Files: Tag: release22-maint ceval.c Log Message: This is Armin Rigo's patch: [ 617311 ] Tiny profiling info (Psyco #2) Forward port candidate. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.301.4.6 retrieving revision 2.301.4.7 diff -C2 -d -r2.301.4.6 -r2.301.4.7 *** ceval.c 7 Oct 2002 09:37:26 -0000 2.301.4.6 --- ceval.c 7 Oct 2002 09:40:20 -0000 2.301.4.7 *************** *** 658,661 **** --- 658,662 ---- if (things_to_do || --tstate->ticker < 0) { tstate->ticker = tstate->interp->checkinterval; + tstate->tick_counter++; if (things_to_do) { if (Py_MakePendingCalls() < 0) { From mwh@users.sourceforge.net Mon Oct 7 10:47:23 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:47:23 -0700 Subject: [Python-checkins] python/dist/src/Include pystate.h,2.18.16.1,2.18.16.2 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv14160/Include Modified Files: Tag: release22-maint pystate.h Log Message: This is Armin Rigo's patch: [ 617309 ] getframe hook (Psyco #1) Forward port candidate. Index: pystate.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v retrieving revision 2.18.16.1 retrieving revision 2.18.16.2 diff -C2 -d -r2.18.16.1 -r2.18.16.2 *** pystate.h 7 Oct 2002 09:40:20 -0000 2.18.16.1 --- pystate.h 7 Oct 2002 09:47:20 -0000 2.18.16.2 *************** *** 110,113 **** --- 110,116 ---- DL_IMPORT(PyThreadState *) PyThreadState_Next(PyThreadState *); + /* hook for PyEval_GetFrame(), requested for Psyco */ + extern DL_IMPORT(unaryfunc) _PyThreadState_GetFrame; + #ifdef __cplusplus } From mwh@users.sourceforge.net Mon Oct 7 10:47:23 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:47:23 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.301.4.7,2.301.4.8 pystate.c,2.20,2.20.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv14160/Python Modified Files: Tag: release22-maint ceval.c pystate.c Log Message: This is Armin Rigo's patch: [ 617309 ] getframe hook (Psyco #1) Forward port candidate. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.301.4.7 retrieving revision 2.301.4.8 diff -C2 -d -r2.301.4.7 -r2.301.4.8 *** ceval.c 7 Oct 2002 09:40:20 -0000 2.301.4.7 --- ceval.c 7 Oct 2002 09:47:20 -0000 2.301.4.8 *************** *** 2950,2957 **** PyEval_GetBuiltins(void) { ! PyThreadState *tstate = PyThreadState_Get(); ! PyFrameObject *current_frame = tstate->frame; if (current_frame == NULL) ! return tstate->interp->builtins; else return current_frame->f_builtins; --- 2950,2956 ---- PyEval_GetBuiltins(void) { ! PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame(); if (current_frame == NULL) ! return PyThreadState_Get()->interp->builtins; else return current_frame->f_builtins; *************** *** 2961,2965 **** PyEval_GetLocals(void) { ! PyFrameObject *current_frame = PyThreadState_Get()->frame; if (current_frame == NULL) return NULL; --- 2960,2964 ---- PyEval_GetLocals(void) { ! PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame(); if (current_frame == NULL) return NULL; *************** *** 2971,2975 **** PyEval_GetGlobals(void) { ! PyFrameObject *current_frame = PyThreadState_Get()->frame; if (current_frame == NULL) return NULL; --- 2970,2974 ---- PyEval_GetGlobals(void) { ! PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame(); if (current_frame == NULL) return NULL; *************** *** 2981,2986 **** PyEval_GetFrame(void) { ! PyFrameObject *current_frame = PyThreadState_Get()->frame; ! return (PyObject *)current_frame; } --- 2980,2985 ---- PyEval_GetFrame(void) { ! PyThreadState *tstate = PyThreadState_Get(); ! return _PyThreadState_GetFrame((PyObject *)tstate); } *************** *** 2988,2992 **** PyEval_GetRestricted(void) { ! PyFrameObject *current_frame = PyThreadState_Get()->frame; return current_frame == NULL ? 0 : current_frame->f_restricted; } --- 2987,2991 ---- PyEval_GetRestricted(void) { ! PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame(); return current_frame == NULL ? 0 : current_frame->f_restricted; } *************** *** 2995,2999 **** PyEval_MergeCompilerFlags(PyCompilerFlags *cf) { ! PyFrameObject *current_frame = PyThreadState_Get()->frame; int result = 0; --- 2994,2998 ---- PyEval_MergeCompilerFlags(PyCompilerFlags *cf) { ! PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame(); int result = 0; Index: pystate.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v retrieving revision 2.20 retrieving revision 2.20.16.1 diff -C2 -d -r2.20 -r2.20.16.1 *** pystate.c 19 Jul 2001 12:19:27 -0000 2.20 --- pystate.c 7 Oct 2002 09:47:21 -0000 2.20.16.1 *************** *** 36,39 **** --- 36,40 ---- PyThreadState *_PyThreadState_Current = NULL; + unaryfunc _PyThreadState_GetFrame = NULL; *************** *** 115,122 **** --- 116,132 ---- + /* Default implementation for _PyThreadState_GetFrame */ + static struct _frame * + threadstate_getframe(PyThreadState *self) + { + return self->frame; + } + PyThreadState * PyThreadState_New(PyInterpreterState *interp) { PyThreadState *tstate = PyMem_NEW(PyThreadState, 1); + if (_PyThreadState_GetFrame == NULL) + _PyThreadState_GetFrame = (unaryfunc)threadstate_getframe; if (tstate != NULL) { From mwh@users.sourceforge.net Mon Oct 7 10:47:23 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 02:47:23 -0700 Subject: [Python-checkins] python/dist/src/Modules pyexpat.c,2.57.6.3,2.57.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14160/Modules Modified Files: Tag: release22-maint pyexpat.c Log Message: This is Armin Rigo's patch: [ 617309 ] getframe hook (Psyco #1) Forward port candidate. Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.57.6.3 retrieving revision 2.57.6.4 diff -C2 -d -r2.57.6.3 -r2.57.6.4 *** pyexpat.c 25 Sep 2002 22:31:35 -0000 2.57.6.3 --- pyexpat.c 7 Oct 2002 09:47:20 -0000 2.57.6.4 *************** *** 393,397 **** tstate, /*back*/ c, /*code*/ ! tstate->frame->f_globals, /*globals*/ NULL /*locals*/ ); --- 393,397 ---- tstate, /*back*/ c, /*code*/ ! PyEval_GetGlobals(), /*globals*/ NULL /*locals*/ ); From mwh@users.sourceforge.net Mon Oct 7 11:38:35 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 03:38:35 -0700 Subject: [Python-checkins] python/dist/src setup.py,1.73.4.9,1.73.4.10 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv2787 Modified Files: Tag: release22-maint setup.py Log Message: Backport fdrake's revision 1.88 of setup.py revision 1.46 of Lib/distutils/sysconfig.py When using a Python that has not been installed to build 3rd-party modules, distutils does not understand that the build version of the source tree is needed. This patch fixes distutils.sysconfig to understand that the running Python is part of the build tree and needs to use the appropriate "shape" of the tree. This does not assume anything about the current directory, so can be used to build 3rd-party modules using Python's build tree as well. This is useful since it allows us to use a non-installed debug-mode Python with 3rd-party modules for testing. It as the side-effect that set_python_build() is no longer needed (the hack which was added to allow distutils to be used to build the "standard" extension modules). This closes SF patch #547734. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.73.4.9 retrieving revision 1.73.4.10 diff -C2 -d -r1.73.4.9 -r1.73.4.10 *** setup.py 30 Sep 2002 14:42:29 -0000 1.73.4.9 --- setup.py 7 Oct 2002 10:38:33 -0000 1.73.4.10 *************** *** 790,793 **** # --install-platlib if __name__ == '__main__': - sysconfig.set_python_build() main() --- 790,792 ---- From mwh@users.sourceforge.net Mon Oct 7 11:38:35 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 03:38:35 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils sysconfig.py,1.44,1.44.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv2787/Lib/distutils Modified Files: Tag: release22-maint sysconfig.py Log Message: Backport fdrake's revision 1.88 of setup.py revision 1.46 of Lib/distutils/sysconfig.py When using a Python that has not been installed to build 3rd-party modules, distutils does not understand that the build version of the source tree is needed. This patch fixes distutils.sysconfig to understand that the running Python is part of the build tree and needs to use the appropriate "shape" of the tree. This does not assume anything about the current directory, so can be used to build 3rd-party modules using Python's build tree as well. This is useful since it allows us to use a non-installed debug-mode Python with 3rd-party modules for testing. It as the side-effect that set_python_build() is no longer needed (the hack which was added to allow distutils to be used to build the "standard" extension modules). This closes SF patch #547734. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.44 retrieving revision 1.44.6.1 diff -C2 -d -r1.44 -r1.44.6.1 *** sysconfig.py 6 Dec 2001 20:51:35 -0000 1.44 --- sysconfig.py 7 Oct 2002 10:38:33 -0000 1.44.6.1 *************** *** 24,40 **** EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ! # Boolean; if it's true, we're still building Python, so ! # we use different (hard-wired) directories. ! ! python_build = 0 ! ! def set_python_build(): ! """Set the python_build flag to true. ! This means that we're building Python itself. Only called from ! the setup.py script shipped with Python. ! """ ! global python_build python_build = 1 --- 24,41 ---- EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ! # python_build: (Boolean) if true, we're either building Python or ! # building an extension with an un-installed Python, so we use ! # different (hard-wired) directories. ! argv0_path = os.path.dirname(os.path.abspath(sys.executable)) ! landmark = os.path.join(argv0_path, "Modules", "Setup") ! if not os.path.isfile(landmark): ! python_build = 0 ! elif os.path.isfile(os.path.join(argv0_path, "Lib", "os.py")): python_build = 1 + else: + python_build = os.path.isfile(os.path.join(os.path.dirname(argv0_path), + "Lib", "os.py")) + del argv0_path, landmark *************** *** 54,58 **** if os.name == "posix": if python_build: ! return "Include/" return os.path.join(prefix, "include", "python" + sys.version[:3]) elif os.name == "nt": --- 55,66 ---- if os.name == "posix": if python_build: ! base = os.path.dirname(os.path.abspath(sys.executable)) ! if plat_specific: ! inc_dir = base ! else: ! inc_dir = os.path.join(base, "Include") ! if not os.path.exists(inc_dir): ! inc_dir = os.path.join(os.path.dirname(base), "Include") ! return inc_dir return os.path.join(prefix, "include", "python" + sys.version[:3]) elif os.name == "nt": *************** *** 155,159 **** """Return full pathname of installed Makefile from the Python build.""" if python_build: ! return './Makefile' lib_dir = get_python_lib(plat_specific=1, standard_lib=1) return os.path.join(lib_dir, "config", "Makefile") --- 163,167 ---- """Return full pathname of installed Makefile from the Python build.""" if python_build: ! return os.path.join(os.path.dirname(sys.executable), "Makefile") lib_dir = get_python_lib(plat_specific=1, standard_lib=1) return os.path.join(lib_dir, "config", "Makefile") From mwh@users.sourceforge.net Mon Oct 7 12:30:09 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 04:30:09 -0700 Subject: [Python-checkins] python/dist/src/Python compile.c,2.234.4.4,2.234.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv29524 Modified Files: Tag: release22-maint compile.c Log Message: Backport my checkin of revision 2.264 of Python/compile.c: Clamp code objects' tp_compare result to [-1, 1]. Bugfix candidate. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.234.4.4 retrieving revision 2.234.4.5 diff -C2 -d -r2.234.4.4 -r2.234.4.5 *** compile.c 11 Aug 2002 15:40:35 -0000 2.234.4.4 --- compile.c 7 Oct 2002 11:30:07 -0000 2.234.4.5 *************** *** 134,142 **** if (cmp) return cmp; cmp = co->co_argcount - cp->co_argcount; ! if (cmp) return cmp; cmp = co->co_nlocals - cp->co_nlocals; ! if (cmp) return cmp; cmp = co->co_flags - cp->co_flags; ! if (cmp) return cmp; cmp = PyObject_Compare(co->co_code, cp->co_code); if (cmp) return cmp; --- 134,142 ---- if (cmp) return cmp; cmp = co->co_argcount - cp->co_argcount; ! if (cmp) return (cmp<0)?-1:1; cmp = co->co_nlocals - cp->co_nlocals; ! if (cmp) return (cmp<0)?-1:1; cmp = co->co_flags - cp->co_flags; ! if (cmp) return (cmp<0)?-1:1; cmp = PyObject_Compare(co->co_code, cp->co_code); if (cmp) return cmp; From loewis@users.sourceforge.net Mon Oct 7 12:57:08 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 04:57:08 -0700 Subject: [Python-checkins] python/dist/src configure,1.279.6.14,1.279.6.15 configure.in,1.288.6.14,1.288.6.15 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv11763 Modified Files: Tag: release22-maint configure configure.in Log Message: Patch #609700: always build with same $(CC) on Linux. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.279.6.14 retrieving revision 1.279.6.15 diff -C2 -d -r1.279.6.14 -r1.279.6.15 *** configure 7 Oct 2002 06:22:19 -0000 1.279.6.14 --- configure 7 Oct 2002 11:57:02 -0000 1.279.6.15 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.288.6.13 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.288.6.14 # Guess values for system-dependent variables and create Makefiles. *************** *** 3211,3215 **** LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/$(PYTHON)' fi ;; ! Linux*) LDSHARED="gcc -shared";; dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; --- 3211,3215 ---- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/$(PYTHON)' fi ;; ! Linux*) LDSHARED='$(CC) -shared';; dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.288.6.14 retrieving revision 1.288.6.15 diff -C2 -d -r1.288.6.14 -r1.288.6.15 *** configure.in 7 Oct 2002 06:22:21 -0000 1.288.6.14 --- configure.in 7 Oct 2002 11:57:04 -0000 1.288.6.15 *************** *** 825,829 **** LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/$(PYTHON)' fi ;; ! Linux*) LDSHARED="gcc -shared";; dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; --- 825,829 ---- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/$(PYTHON)' fi ;; ! Linux*) LDSHARED='$(CC) -shared';; dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; From mwh@users.sourceforge.net Mon Oct 7 13:21:11 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 05:21:11 -0700 Subject: [Python-checkins] python/dist/src/Lib/compiler pycodegen.py,1.58.4.2,1.58.4.2.2.1 symbols.py,1.10.8.1,1.10.8.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory usw-pr-cvs1:/tmp/cvs-serv24937 Modified Files: Tag: release22-maint pycodegen.py symbols.py Log Message: A couple of fixes for the compiler package: * always write the mtime to a .pyc in little endian format * ensure class's docstrings get attached to the class, not the enclosing scope! Rather more fixes are needed for the trunk; these will be done in due course. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.58.4.2 retrieving revision 1.58.4.2.2.1 diff -C2 -d -r1.58.4.2 -r1.58.4.2.2.1 *** pycodegen.py 21 Dec 2001 16:11:33 -0000 1.58.4.2 --- pycodegen.py 7 Oct 2002 12:21:09 -0000 1.58.4.2.2.1 *************** *** 137,141 **** # same effect is to call marshal and then skip the code. mtime = os.stat(self.filename)[stat.ST_MTIME] ! mtime = struct.pack('i', mtime) return self.MAGIC + mtime --- 137,141 ---- # same effect is to call marshal and then skip the code. mtime = os.stat(self.filename)[stat.ST_MTIME] ! mtime = struct.pack(' Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv32278/Misc Modified Files: Tag: release22-maint NEWS Log Message: Backport: 2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262 2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162 2002/08/11 12:23:03 lemburg Misc/NEWS 1.461 2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65 2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39 Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level. u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.37 retrieving revision 1.337.2.4.2.38 diff -C2 -d -r1.337.2.4.2.37 -r1.337.2.4.2.38 *** NEWS 4 Oct 2002 17:57:27 -0000 1.337.2.4.2.37 --- NEWS 7 Oct 2002 12:32:55 -0000 1.337.2.4.2.38 *************** *** 5,8 **** --- 5,11 ---- Core and builtins + - u'%c' will now raise a ValueError in case the argument is an + integer outside the valid range of Unicode code point ordinals. + - When x is an object whose class implements __mul__ and __rmul__, 1.0*x would correctly invoke __rmul__, but 1*x would erroneously *************** *** 87,90 **** --- 90,96 ---- C API + + - New C API PyUnicode_FromOrdinal() which exposes unichr() at C + level. Windows From mwh@users.sourceforge.net Mon Oct 7 13:32:58 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 05:32:58 -0700 Subject: [Python-checkins] python/dist/src/Include unicodeobject.h,2.36.10.1,2.36.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv32278/Include Modified Files: Tag: release22-maint unicodeobject.h Log Message: Backport: 2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262 2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162 2002/08/11 12:23:03 lemburg Misc/NEWS 1.461 2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65 2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39 Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level. u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581. Index: unicodeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v retrieving revision 2.36.10.1 retrieving revision 2.36.10.2 diff -C2 -d -r2.36.10.1 -r2.36.10.2 *** unicodeobject.h 22 Apr 2002 18:42:44 -0000 2.36.10.1 --- unicodeobject.h 7 Oct 2002 12:32:56 -0000 2.36.10.2 *************** *** 518,521 **** --- 518,533 ---- #endif + /* --- Unicode ordinals --------------------------------------------------- */ + + /* Create a Unicode Object from the given Unicode code point ordinal. + + The ordinal must be in range(0x10000) on narrow Python builds + (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is + raised in case it is not. + + */ + + extern DL_IMPORT(PyObject*) PyUnicode_FromOrdinal(int ordinal); + /* === Builtin Codecs ===================================================== From mwh@users.sourceforge.net Mon Oct 7 13:32:58 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 05:32:58 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py,1.47.6.6,1.47.6.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv32278/Lib/test Modified Files: Tag: release22-maint test_unicode.py Log Message: Backport: 2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262 2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162 2002/08/11 12:23:03 lemburg Misc/NEWS 1.461 2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65 2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39 Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level. u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.47.6.6 retrieving revision 1.47.6.7 diff -C2 -d -r1.47.6.6 -r1.47.6.7 *** test_unicode.py 24 Sep 2002 14:06:55 -0000 1.47.6.6 --- test_unicode.py 7 Oct 2002 12:32:56 -0000 1.47.6.7 *************** *** 443,446 **** --- 443,454 ---- verify(value == u'abc, def') + for ordinal in (-100, 0x200000): + try: + u"%c" % ordinal + except ValueError: + pass + else: + print '*** formatting u"%%c" %% %i should give a ValueError' % ordinal + # formatting jobs delegated from the string implementation: verify('...%(foo)s...' % {'foo':u"abc"} == u'...abc...') *************** *** 737,740 **** --- 745,756 ---- except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) + + # UTF-8 must be roundtrip safe for all UCS-2 code points + # This excludes surrogates: in the full range, there would be + # a surrogate pair (\udbff\udc00), which gets converted back + # to a non-BMP character (\U0010fc00) + u = u''.join(map(unichr, range(0,0xd800)+range(0xe000,0x10000))) + for encoding in ('utf-8',): + verify(unicode(u.encode(encoding),encoding) == u) print 'done.' From mwh@users.sourceforge.net Mon Oct 7 13:32:59 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 05:32:59 -0700 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c,2.124.6.15,2.124.6.16 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv32278/Objects Modified Files: Tag: release22-maint unicodeobject.c Log Message: Backport: 2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262 2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162 2002/08/11 12:23:03 lemburg Misc/NEWS 1.461 2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65 2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39 Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level. u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.124.6.15 retrieving revision 2.124.6.16 diff -C2 -d -r2.124.6.15 -r2.124.6.16 *** unicodeobject.c 24 Sep 2002 15:22:30 -0000 2.124.6.15 --- unicodeobject.c 7 Oct 2002 12:32:56 -0000 2.124.6.16 *************** *** 391,394 **** --- 391,433 ---- #endif + PyObject *PyUnicode_FromOrdinal(int ordinal) + { + Py_UNICODE s[2]; + + #ifdef Py_UNICODE_WIDE + if (ordinal < 0 || ordinal > 0x10ffff) { + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x110000) " + "(wide Python build)"); + return NULL; + } + #else + if (ordinal < 0 || ordinal > 0xffff) { + PyErr_SetString(PyExc_ValueError, + "unichr() arg not in range(0x10000) " + "(narrow Python build)"); + return NULL; + } + #endif + + if (ordinal <= 0xffff) { + /* UCS-2 character */ + s[0] = (Py_UNICODE) ordinal; + return PyUnicode_FromUnicode(s, 1); + } + else { + #ifndef Py_UNICODE_WIDE + /* UCS-4 character. store as two surrogate characters */ + ordinal -= 0x10000L; + s[0] = 0xD800 + (Py_UNICODE) (ordinal >> 10); + s[1] = 0xDC00 + (Py_UNICODE) (ordinal & 0x03FF); + return PyUnicode_FromUnicode(s, 2); + #else + s[0] = (Py_UNICODE)ordinal; + return PyUnicode_FromUnicode(s, 1); + #endif + } + } + PyObject *PyUnicode_FromObject(register PyObject *obj) { *************** *** 5323,5327 **** if (x == -1 && PyErr_Occurred()) goto onError; ! buf[0] = (char) x; } buf[1] = '\0'; --- 5362,5381 ---- if (x == -1 && PyErr_Occurred()) goto onError; ! #ifdef Py_UNICODE_WIDE ! if (x < 0 || x > 0x10ffff) { ! PyErr_SetString(PyExc_ValueError, ! "%c arg not in range(0x110000) " ! "(wide Python build)"); ! return -1; ! } ! #else ! if (x < 0 || x > 0xffff) { ! PyErr_SetString(PyExc_ValueError, ! "%c arg not in range(0x10000) " ! "(narrow Python build)"); ! return -1; ! } ! #endif ! buf[0] = (Py_UNICODE) x; } buf[1] = '\0'; From mwh@users.sourceforge.net Mon Oct 7 13:32:59 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon, 07 Oct 2002 05:32:59 -0700 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.246.4.5,2.246.4.6 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv32278/Python Modified Files: Tag: release22-maint bltinmodule.c Log Message: Backport: 2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262 2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162 2002/08/11 12:23:03 lemburg Misc/NEWS 1.461 2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65 2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39 Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level. u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.246.4.5 retrieving revision 2.246.4.6 diff -C2 -d -r2.246.4.5 -r2.246.4.6 *** bltinmodule.c 24 Sep 2002 11:23:05 -0000 2.246.4.5 --- bltinmodule.c 7 Oct 2002 12:32:57 -0000 2.246.4.6 *************** *** 302,343 **** { long x; - Py_UNICODE s[2]; if (!PyArg_ParseTuple(args, "l:unichr", &x)) return NULL; ! #ifdef Py_UNICODE_WIDE ! if (x < 0 || x > 0x10ffff) { ! PyErr_SetString(PyExc_ValueError, ! "unichr() arg not in range(0x110000) " ! "(wide Python build)"); ! return NULL; ! } ! #else ! if (x < 0 || x > 0xffff) { ! PyErr_SetString(PyExc_ValueError, ! "unichr() arg not in range(0x10000) " ! "(narrow Python build)"); ! return NULL; ! } ! #endif ! ! if (x <= 0xffff) { ! /* UCS-2 character */ ! s[0] = (Py_UNICODE) x; ! return PyUnicode_FromUnicode(s, 1); ! } ! else { ! #ifndef Py_UNICODE_WIDE ! /* UCS-4 character. store as two surrogate characters */ ! x -= 0x10000L; ! s[0] = 0xD800 + (Py_UNICODE) (x >> 10); ! s[1] = 0xDC00 + (Py_UNICODE) (x & 0x03FF); ! return PyUnicode_FromUnicode(s, 2); ! #else ! s[0] = (Py_UNICODE)x; ! return PyUnicode_FromUnicode(s, 1); ! #endif ! } } --- 302,310 ---- { long x; if (!PyArg_ParseTuple(args, "l:unichr", &x)) return NULL; ! return PyUnicode_FromOrdinal(x); } From gvanrossum@users.sourceforge.net Mon Oct 7 14:09:27 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:09:27 -0700 Subject: [Python-checkins] python/dist/src/Lib pickle.py,1.56.4.2,1.56.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13142 Modified Files: Tag: release22-maint pickle.py Log Message: Backport 1.70 and 1.71 (which really go together): 1.70: whichmodule() should skip dummy package entries in sys.modules. This fixes the charming, but unhelpful error message for >>> pickle.dumps(type.__new__) Can't pickle : it's not the same object as datetime.math.__new__ 1.71: Fiddle comments and variable names in whichmodule(). Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.56.4.2 retrieving revision 1.56.4.3 diff -C2 -d -r1.56.4.2 -r1.56.4.3 *** pickle.py 16 Jul 2002 20:02:14 -0000 1.56.4.2 --- pickle.py 7 Oct 2002 13:09:25 -0000 1.56.4.3 *************** *** 553,578 **** ! classmap = {} ! # This is no longer used to find classes, but still for functions ! def whichmodule(cls, clsname): ! """Figure out the module in which a class occurs. Search sys.modules for the module. Cache in classmap. Return a module name. ! If the class cannot be found, return __main__. """ ! if classmap.has_key(cls): ! return classmap[cls] for name, module in sys.modules.items(): if name != '__main__' and \ ! hasattr(module, clsname) and \ ! getattr(module, clsname) is cls: break else: name = '__main__' ! classmap[cls] = name return name --- 553,579 ---- ! classmap = {} # called classmap for backwards compatibility ! def whichmodule(func, funcname): ! """Figure out the module in which a function occurs. Search sys.modules for the module. Cache in classmap. Return a module name. ! If the function cannot be found, return __main__. """ ! if classmap.has_key(classmap): ! return classmap[func] for name, module in sys.modules.items(): + if module is None: + continue # skip dummy package entries if name != '__main__' and \ ! hasattr(module, funcname) and \ ! getattr(module, funcname) is func: break else: name = '__main__' ! classmap[func] = name return name From gvanrossum@users.sourceforge.net Mon Oct 7 14:18:26 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:18:26 -0700 Subject: [Python-checkins] python/dist/src/Lib pickle.py,1.56.4.3,1.56.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19355 Modified Files: Tag: release22-maint pickle.py Log Message: Darn. Fix stupid typo in whichmodule() backport. Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.56.4.3 retrieving revision 1.56.4.4 diff -C2 -d -r1.56.4.3 -r1.56.4.4 *** pickle.py 7 Oct 2002 13:09:25 -0000 1.56.4.3 --- pickle.py 7 Oct 2002 13:18:23 -0000 1.56.4.4 *************** *** 563,567 **** If the function cannot be found, return __main__. """ ! if classmap.has_key(classmap): return classmap[func] --- 563,567 ---- If the function cannot be found, return __main__. """ ! if classmap.has_key(func): return classmap[func] From loewis@users.sourceforge.net Mon Oct 7 14:23:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:23:26 -0700 Subject: [Python-checkins] python/dist/src/Lib shutil.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21395/Lib Modified Files: shutil.py Log Message: Patch #448038: Add move(). Report errors from copytree as in shutil.Error. Index: shutil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/shutil.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** shutil.py 8 Sep 2002 20:43:59 -0000 1.23 --- shutil.py 7 Oct 2002 13:23:24 -0000 1.24 *************** *** 8,14 **** import sys import stat __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", ! "copytree","rmtree"] def copyfileobj(fsrc, fdst, length=16*1024): --- 8,18 ---- import sys import stat + import exceptions __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", ! "copytree","rmtree","Error"] ! ! class Error(exceptions.EnvironmentError): ! pass def copyfileobj(fsrc, fdst, length=16*1024): *************** *** 96,99 **** --- 100,104 ---- names = os.listdir(src) os.mkdir(dst) + errors = [] for name in names: srcname = os.path.join(src, name) *************** *** 109,113 **** # XXX What about devices, sockets etc.? except (IOError, os.error), why: ! print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why)) def rmtree(path, ignore_errors=0, onerror=None): --- 114,120 ---- # XXX What about devices, sockets etc.? except (IOError, os.error), why: ! errors.append((srcname, dstname, why)) ! if errors: ! raise Error, errors def rmtree(path, ignore_errors=0, onerror=None): *************** *** 142,143 **** --- 149,171 ---- cmdtuples.append((os.remove, real_f)) cmdtuples.append((os.rmdir, path)) + + + def move(src, dst): + """Recursively move a file or directory to another location. + + If the destination is on our current filesystem, then simply use + rename. Otherwise, copy src to the dst and then remove src. + A lot more could be done here... A look at a mv.c shows a lot of + the issues this implementation glosses over. + + """ + + try: + os.rename(src, dst) + except OSError: + if os.path.isdir(src): + copytree(src, dst, symlinks=1) + rmtree(src) + else: + copy2(src,dst) + os.unlink(src) From loewis@users.sourceforge.net Mon Oct 7 14:23:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:23:26 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.493,1.494 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv21395/Misc Modified Files: NEWS Log Message: Patch #448038: Add move(). Report errors from copytree as in shutil.Error. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.493 retrieving revision 1.494 diff -C2 -d -r1.493 -r1.494 *** NEWS 5 Oct 2002 09:46:48 -0000 1.493 --- NEWS 7 Oct 2002 13:23:24 -0000 1.494 *************** *** 343,346 **** --- 343,349 ---- ------- + - shutil.move was added. shutil.copytree now reports errors as an + exception at the end, instead of printing error messages. + - Encoding name normalization was generalized to not only replace hyphens with underscores, but also all other non-alphanumeric From loewis@users.sourceforge.net Mon Oct 7 14:23:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:23:26 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libshutil.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21395/Doc/lib Modified Files: libshutil.tex Log Message: Patch #448038: Add move(). Report errors from copytree as in shutil.Error. Index: libshutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libshutil.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libshutil.tex 30 Jun 2002 04:43:20 -0000 1.10 --- libshutil.tex 7 Oct 2002 13:23:24 -0000 1.11 *************** *** 94,97 **** --- 94,113 ---- \end{funcdesc} + \begin{funcdesc}{move}{src, dst} + Recursively move a file or directory to another location. + + If the destination is on our current filesystem, then simply use + rename. Otherwise, copy src to the dst and then remove src. + + \versionadded{2.3} + \end{funcdesc} + + \begin{excdesc}{Error} + This exception collects exceptions that raised during a mult-file + operation. For \function{copytree}, the exception argument is a + list of 3-tuples (\var{srcname}, \var{dstname}, \var{exception}). + + \versionadded{2.3} + \end{excdesc} \subsection{Example \label{shutil-example}} From gvanrossum@users.sourceforge.net Mon Oct 7 14:24:04 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:24:04 -0700 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.56.8.4,1.56.8.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21949 Modified Files: Tag: release22-maint pydoc.py Log Message: Backport 1.63: In both spilldata() functions, pretend that the docstring for non-callable objects is always None. This makes for less confusing output and fixes the problem reported in SF patch #550290. Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.56.8.4 retrieving revision 1.56.8.5 diff -C2 -d -r1.56.8.4 -r1.56.8.5 *** pydoc.py 26 Sep 2002 21:50:01 -0000 1.56.8.4 --- pydoc.py 7 Oct 2002 13:24:02 -0000 1.56.8.5 *************** *** 675,679 **** for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) ! doc = getattr(value, "__doc__", None) if doc is None: push('
%s
\n' % base) --- 675,682 ---- for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) ! if callable(value): ! doc = getattr(value, "__doc__", None) ! else: ! doc = None if doc is None: push('
%s
\n' % base) *************** *** 1067,1071 **** push(msg) for name, kind, homecls, value in ok: ! doc = getattr(value, "__doc__", None) push(self.docother(getattr(object, name), name, mod, 70, doc) + '\n') --- 1070,1077 ---- push(msg) for name, kind, homecls, value in ok: ! if callable(value): ! doc = getattr(value, "__doc__", None) ! else: ! doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + '\n') From gvanrossum@users.sourceforge.net Mon Oct 7 14:40:44 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:40:44 -0700 Subject: [Python-checkins] python/nondist/peps pep-0008.txt,1.16,1.17 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv28974 Modified Files: pep-0008.txt Log Message: Add ruling about source code encodings. Index: pep-0008.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pep-0008.txt 22 Jun 2002 02:14:49 -0000 1.16 --- pep-0008.txt 7 Oct 2002 13:40:41 -0000 1.17 *************** *** 125,128 **** --- 125,139 ---- pages of related sections of your file. + Encodings (PEP 263) + + Code in the core Python distribution should aways use the ASCII or + Latin-1 encoding (a.k.a. ISO-8859-1). Files using ASCII should + not have a coding cookie. Latin-1 should only be used when a + comment or docstring needs to mention an author name that requires + Latin-1; otherwise, using \x escapes is the preferred way to + include non-ASCII data in string literals. An exception is made + for those files that are part of the test suite for the code + implementing PEP 263. + Imports From loewis@users.sourceforge.net Mon Oct 7 14:55:53 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:55:53 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.189,2.190 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv1745/Objects Modified Files: stringobject.c Log Message: Patch #479898: Use multibyte C library for printing strings if available. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.189 retrieving revision 2.190 diff -C2 -d -r2.189 -r2.190 *** stringobject.c 12 Sep 2002 14:43:40 -0000 2.189 --- stringobject.c 7 Oct 2002 13:55:50 -0000 2.190 *************** *** 27,30 **** --- 27,43 ---- + #if defined(HAVE_MBTOWC) && defined(HAVE_WCHAR_H) + # define PRINT_MULTIBYTE_STRING + # include + # include + # if defined(HAVE_ISWPRINT) + # define _isprint iswprint + # else + # define _isprint isprint + # endif + #endif + + static const char *hexchars = "0123456789abcdef"; + /* For both PyString_FromString() and PyString_FromStringAndSize(), the *************** *** 750,755 **** --- 763,774 ---- string_print(PyStringObject *op, FILE *fp, int flags) { + #ifndef PRINT_MULTIBYTE_STRING int i; char c; + #else + char *scur, *send; + wchar_t c; + int cr; + #endif int quote; *************** *** 777,794 **** fputc(quote, fp); for (i = 0; i < op->ob_size; i++) { c = op->ob_sval[i]; if (c == quote || c == '\\') ! fprintf(fp, "\\%c", c); else if (c == '\t') ! fprintf(fp, "\\t"); else if (c == '\n') ! fprintf(fp, "\\n"); else if (c == '\r') ! fprintf(fp, "\\r"); ! else if (c < ' ' || c >= 0x7f) ! fprintf(fp, "\\x%02x", c & 0xff); ! else fputc(c, fp); } fputc(quote, fp); --- 796,829 ---- fputc(quote, fp); + #ifndef PRINT_MULTIBYTE_STRING for (i = 0; i < op->ob_size; i++) { c = op->ob_sval[i]; + #else + for (scur = op->ob_sval, send = op->ob_sval + op->ob_size; + scur < send; scur += cr) { + if ((cr = mbtowc(&c, scur, send - scur)) <= 0) + goto non_printable; + #endif if (c == quote || c == '\\') ! fputc('\\', fp), fputc(c, fp); else if (c == '\t') ! fputs("\\t", fp); else if (c == '\n') ! fputs("\\n", fp); else if (c == '\r') ! fputs("\\r", fp); ! #ifndef PRINT_MULTIBYTE_STRING ! else if (' ' <= c && c < 0x7f) fputc(c, fp); + else + fprintf(fp, "\\x%02x", c & 0xff); + #else + else if (_isprint(c)) + fwrite(scur, cr, 1, fp); + else { + non_printable: cr = 1; /* unit to move cursor */ + fprintf(fp, "\\x%02x", *scur & 0xff); + } + #endif } fputc(quote, fp); *************** *** 811,816 **** --- 846,857 ---- } else { + #ifndef PRINT_MULTIBYTE_STRING register int i; register char c; + #else + register char *scur, *send; + wchar_t c; + int cr; + #endif register char *p; int quote; *************** *** 825,828 **** --- 866,870 ---- p = PyString_AS_STRING(v); *p++ = quote; + #ifndef PRINT_MULTIBYTE_STRING for (i = 0; i < op->ob_size; i++) { /* There's at least enough room for a hex escape *************** *** 830,833 **** --- 872,881 ---- assert(newsize - (p - PyString_AS_STRING(v)) >= 5); c = op->ob_sval[i]; + #else + for (scur = op->ob_sval, send = op->ob_sval + op->ob_size; + scur < send; scur += cr) { + if ((cr = mbtowc(&c, scur, send - scur)) <= 0) + goto non_printable; + #endif if (c == quote || c == '\\') *p++ = '\\', *p++ = c; *************** *** 838,850 **** else if (c == '\r') *p++ = '\\', *p++ = 'r'; ! else if (c < ' ' || c >= 0x7f) { ! /* For performance, we don't want to call ! PyOS_snprintf here (extra layers of ! function call). */ ! sprintf(p, "\\x%02x", c & 0xff); ! p += 4; ! } ! else *p++ = c; } assert(newsize - (p - PyString_AS_STRING(v)) >= 1); --- 886,903 ---- else if (c == '\r') *p++ = '\\', *p++ = 'r'; ! #ifndef PRINT_MULTIBYTE_STRING ! else if (' ' <= c && c < 0x7f) *p++ = c; + else { + #else + else if (_isprint(c)) + memcpy(p, scur, cr), p += cr; + else { + non_printable: cr = 1; c = *scur; + #endif + *p++ = '\\'; *p++ = 'x'; + *p++ = hexchars[(c >> 4) & 0x0f]; + *p++ = hexchars[c & 0x0f]; + } } assert(newsize - (p - PyString_AS_STRING(v)) >= 1); From loewis@users.sourceforge.net Mon Oct 7 14:55:54 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 06:55:54 -0700 Subject: [Python-checkins] python/dist/src configure,1.342,1.343 configure.in,1.353,1.354 pyconfig.h.in,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv1745 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #479898: Use multibyte C library for printing strings if available. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.342 retrieving revision 1.343 diff -C2 -d -r1.342 -r1.343 *** configure 7 Oct 2002 06:21:41 -0000 1.342 --- configure 7 Oct 2002 13:55:30 -0000 1.343 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.352 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.353 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 11661,11669 **** for ac_func in alarm chown chroot clock confstr ctermid ctermid_r execv \ fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton kill killpg lchown link lstat mkfifo mknod mktime \ ! mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ --- 11661,11671 ---- + + for ac_func in alarm chown chroot clock confstr ctermid ctermid_r execv \ fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton iswprint kill killpg lchown link lstat mbtowc mkfifo \ ! mknod mktime mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.353 retrieving revision 1.354 diff -C2 -d -r1.353 -r1.354 *** configure.in 7 Oct 2002 06:21:05 -0000 1.353 --- configure.in 7 Oct 2002 13:55:48 -0000 1.354 *************** *** 1680,1685 **** fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton kill killpg lchown link lstat mkfifo mknod mktime \ ! mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ --- 1680,1685 ---- fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton iswprint kill killpg lchown link lstat mbtowc mkfifo \ ! mknod mktime mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** pyconfig.h.in 4 Oct 2002 07:21:24 -0000 1.50 --- pyconfig.h.in 7 Oct 2002 13:55:49 -0000 1.51 *************** *** 197,200 **** --- 197,203 ---- #undef HAVE_INTTYPES_H + /* Define to 1 if you have the `iswprint' function. */ + #undef HAVE_ISWPRINT + /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL *************** *** 227,233 **** #undef HAVE_LIBINTL_H - /* Define to 1 if you have the `rt' library (-lrt). */ - #undef HAVE_LIBRT - /* Define to 1 if you have the header file. */ #undef HAVE_LIBUTIL_H --- 230,233 ---- *************** *** 250,253 **** --- 250,256 ---- /* Define this if you have the makedev macro. */ #undef HAVE_MAKEDEV + + /* Define to 1 if you have the `mbtowc' function. */ + #undef HAVE_MBTOWC /* Define to 1 if you have the `memmove' function. */ From fdrake@users.sourceforge.net Mon Oct 7 17:19:04 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 07 Oct 2002 09:19:04 -0700 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl,1.116.4.3,1.116.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv30711 Modified Files: Tag: release22-maint python.perl Log Message: Back-port part of 1.128 from the trunk: \productioncont: Replace leading spaces with   so that it's possible to control the indentation of continuation lines. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.116.4.3 retrieving revision 1.116.4.4 diff -C2 -d -r1.116.4.3 -r1.116.4.4 *** python.perl 3 Apr 2002 02:46:17 -0000 1.116.4.3 --- python.perl 7 Oct 2002 16:18:57 -0000 1.116.4.4 *************** *** 809,812 **** --- 809,813 ---- local($_) = @_; my $defn = next_argument(); + $defn =~ s/^( +)/' ' x length $1/e; return ("\n" . "  \n" From fdrake@users.sourceforge.net Mon Oct 7 17:26:33 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 07 Oct 2002 09:26:33 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.53.4.7,1.53.4.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv1987 Modified Files: Tag: release22-maint ref5.tex Log Message: Backport patches from trunk revisions 1.62, 1.63. Modified to be easier to read for both HTML and typeset renderings. Relies on ../perl/python.perl revision 1.116.4.4. Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.53.4.7 retrieving revision 1.53.4.8 diff -C2 -d -r1.53.4.7 -r1.53.4.8 *** ref5.tex 5 Oct 2002 06:51:34 -0000 1.53.4.7 --- ref5.tex 7 Oct 2002 16:26:28 -0000 1.53.4.8 *************** *** 439,446 **** {\token{primary} "(" [\token{argument_list} [","]] ")"} \production{argument_list} ! {\token{positional_arguments} ["," \token{keyword_arguments}} ! \productioncont{ ["," "*" \token{expression} ["," "**" \token{expression}]]]} ! \productioncont{| \token{keyword_arguments} ["," "*" \token{expression}} ! \productioncont{ ["," "**" \token{expression}]]} \productioncont{| "*" \token{expression} ["," "**" \token{expression}]} \productioncont{| "**" \token{expression}} --- 439,447 ---- {\token{primary} "(" [\token{argument_list} [","]] ")"} \production{argument_list} ! {\token{positional_arguments} ["," \token{keyword_arguments}]} ! \productioncont{ ["," "*" \token{expression}]} ! \productioncont{ ["," "**" \token{expression}]} ! \productioncont{| \token{keyword_arguments} ["," "*" \token{expression}]} ! \productioncont{ ["," "**" \token{expression}]} \productioncont{| "*" \token{expression} ["," "**" \token{expression}]} \productioncont{| "**" \token{expression}} From fdrake@users.sourceforge.net Mon Oct 7 17:28:41 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 07 Oct 2002 09:28:41 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv3033 Modified Files: ref5.tex Log Message: Modified presentation of the grammar for calls to be easier to read for both HTML and typeset renderings. Corresponds to revision 1.53.4.8 on the r22-maint branch. Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ref5.tex 25 Jun 2002 04:04:14 -0000 1.64 --- ref5.tex 7 Oct 2002 16:28:38 -0000 1.65 *************** *** 423,430 **** {\token{primary} "(" [\token{argument_list} [","]] ")"} \production{argument_list} ! {\token{positional_arguments} ["," \token{keyword_arguments}] ! ["," "*" \token{expression}] ["," "**" \token{expression}]} ! \productioncont{| \token{keyword_arguments} ["," "*" \token{expression}] ! ["," "**" \token{expression}]} \productioncont{| "*" \token{expression} ["," "**" \token{expression}]} \productioncont{| "**" \token{expression}} --- 423,431 ---- {\token{primary} "(" [\token{argument_list} [","]] ")"} \production{argument_list} ! {\token{positional_arguments} ["," \token{keyword_arguments}]} ! \productioncont{ ["," "*" \token{expression}]} ! \productioncont{ ["," "**" \token{expression}]} ! \productioncont{| \token{keyword_arguments} ["," "*" \token{expression}]} ! \productioncont{ ["," "**" \token{expression}]} \productioncont{| "*" \token{expression} ["," "**" \token{expression}]} \productioncont{| "**" \token{expression}} From barry@users.sourceforge.net Mon Oct 7 18:02:44 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:02:44 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Parser.py,1.5.10.2,1.5.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv17633/Lib/email Modified Files: Tag: release22-maint Parser.py Log Message: _parsebody(): Use get_content_type() instead of the deprecated get_type(). Also, one of the regular expressions is constant so might as well make it a module global. And, when splitting up digests, handle lineseps that are longer than 1 character in length (e.g. \r\n). Index: Parser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Parser.py,v retrieving revision 1.5.10.2 retrieving revision 1.5.10.3 diff -C2 -d -r1.5.10.2 -r1.5.10.3 *** Parser.py 4 Oct 2002 17:24:24 -0000 1.5.10.2 --- Parser.py 7 Oct 2002 17:02:40 -0000 1.5.10.3 *************** *** 21,24 **** --- 21,26 ---- False = 0 + nlcre = re.compile('\r\n|\r|\n') + *************** *** 138,142 **** # boundary if present. boundary = container.get_boundary() ! isdigest = (container.get_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of --- 140,144 ---- # boundary if present. boundary = container.get_boundary() ! isdigest = (container.get_content_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of *************** *** 168,173 **** # Find out what kind of line endings we're using start += len(mo.group('sep')) + len(mo.group('ws')) ! cre = re.compile('\r\n|\r|\n') ! mo = cre.search(payload, start) if mo: start += len(mo.group(0)) --- 170,174 ---- # Find out what kind of line endings we're using start += len(mo.group('sep')) + len(mo.group('ws')) ! mo = nlcre.search(payload, start) if mo: start += len(mo.group(0)) *************** *** 210,219 **** for part in parts: if isdigest: ! if part[0] == linesep: # There's no header block so create an empty message # object as the container, and lop off the newline so # we can parse the sub-subobject msgobj = self._class() ! part = part[1:] else: parthdrs, part = part.split(linesep+linesep, 1) --- 211,220 ---- for part in parts: if isdigest: ! if part.startswith(linesep): # There's no header block so create an empty message # object as the container, and lop off the newline so # we can parse the sub-subobject msgobj = self._class() ! part = part[len(linesep):] else: parthdrs, part = part.split(linesep+linesep, 1) From barry@users.sourceforge.net Mon Oct 7 18:05:30 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:05:30 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.17.2.1,1.17.2.2 test_email_torture.py,1.4.2.1,1.4.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv19003/Lib/email/test Modified Files: Tag: release22-maint test_email.py test_email_torture.py Log Message: openfile(): Go back to opening the files in text mode. This undoes the change in revision 1.11 (test_email.py) in response to SF bug #609988. We now think that was the wrong fix and that WinZip was the real culprit there. This and the Parser.py patch will be forward ported into Python 2.3 and email 2.5. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** test_email.py 4 Oct 2002 17:40:57 -0000 1.17.2.1 --- test_email.py 7 Oct 2002 17:05:28 -0000 1.17.2.2 *************** *** 47,51 **** def openfile(filename): path = os.path.join(os.path.dirname(landmark), 'data', filename) ! return open(path, 'rb') --- 47,51 ---- def openfile(filename): path = os.path.join(os.path.dirname(landmark), 'data', filename) ! return open(path, 'r') Index: test_email_torture.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email_torture.py,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** test_email_torture.py 4 Oct 2002 17:40:57 -0000 1.4.2.1 --- test_email_torture.py 7 Oct 2002 17:05:28 -0000 1.4.2.2 *************** *** 23,27 **** from os.path import join, dirname, abspath path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) ! return open(path, 'rb') # Prevent this test from running in the Python distro --- 23,27 ---- from os.path import join, dirname, abspath path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) ! return open(path, 'r') # Prevent this test from running in the Python distro From gvanrossum@users.sourceforge.net Mon Oct 7 18:09:28 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:09:28 -0700 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.56.8.5,1.56.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20557 Modified Files: Tag: release22-maint pydoc.py Log Message: Backport 1.68: Extend stripid() to handle strings ending in more than one '>'. Add resolve() to handle looking up objects and names (fix SF bug 586931). Add a nicer error message when given a filename that doesn't exist. Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.56.8.5 retrieving revision 1.56.8.6 diff -C2 -d -r1.56.8.5 -r1.56.8.6 *** pydoc.py 7 Oct 2002 13:24:02 -0000 1.56.8.5 --- pydoc.py 7 Oct 2002 17:09:25 -0000 1.56.8.6 *************** *** 107,113 **** """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. ! for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): ! return re.sub(pattern, '>', text) return text --- 107,113 ---- """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. ! for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']: if re.search(pattern, repr(Exception)): ! return re.sub(pattern, '\\1', text) return text *************** *** 1324,1366 **** html = HTMLDoc() ! def doc(thing, title='Python Library Documentation: %s', forceload=0): ! """Display text documentation, given an object or a path to an object.""" ! suffix, name = '', None ! if type(thing) is type(''): ! try: ! object = locate(thing, forceload) ! except ErrorDuringImport, value: ! print value ! return if not object: ! print 'no Python documentation found for %s' % repr(thing) ! return ! parts = split(thing, '.') ! if len(parts) > 1: suffix = ' in ' + join(parts[:-1], '.') ! name = parts[-1] ! thing = object ! desc = describe(thing) ! module = inspect.getmodule(thing) ! if not suffix and module and module is not thing: ! suffix = ' in module ' + module.__name__ ! pager(title % (desc + suffix) + '\n\n' + text.document(thing, name)) ! def writedoc(key, forceload=0): """Write HTML documentation to a file in the current directory.""" try: ! object = locate(key, forceload) ! except ErrorDuringImport, value: print value - else: - if object: - page = html.page(describe(object), - html.document(object, object.__name__)) - file = open(key + '.html', 'w') - file.write(page) - file.close() - print 'wrote', key + '.html' - else: - print 'no Python documentation found for %s' % repr(key) def writedocs(dir, pkgpath='', done=None): --- 1324,1362 ---- html = HTMLDoc() ! def resolve(thing, forceload=0): ! """Given an object or a path to an object, get the object and its name.""" ! if isinstance(thing, str): ! object = locate(thing, forceload) if not object: ! raise ImportError, 'no Python documentation found for %r' % thing ! return object, thing ! else: ! return thing, getattr(thing, '__name__', None) ! def doc(thing, title='Python Library Documentation: %s', forceload=0): ! """Display text documentation, given an object or a path to an object.""" ! try: ! object, name = resolve(thing, forceload) ! desc = describe(object) ! module = inspect.getmodule(object) ! if name and '.' in name: ! desc += ' in ' + name[:name.rfind('.')] ! elif module and module is not object: ! desc += ' in module ' + module.__name__ ! pager(title % desc + '\n\n' + text.document(object, name)) ! except (ImportError, ErrorDuringImport), value: ! print value ! def writedoc(thing, forceload=0): """Write HTML documentation to a file in the current directory.""" try: ! object, name = resolve(thing, forceload) ! page = html.page(describe(object), html.document(object, name)) ! file = open(name + '.html', 'w') ! file.write(page) ! file.close() ! print 'wrote', name + '.html' ! except (ImportError, ErrorDuringImport), value: print value def writedocs(dir, pkgpath='', done=None): *************** *** 2032,2036 **** def ispath(x): ! return type(x) is types.StringType and find(x, os.sep) >= 0 def cli(): --- 2028,2032 ---- def ispath(x): ! return isinstance(x, str) and find(x, os.sep) >= 0 def cli(): *************** *** 2072,2075 **** --- 2068,2074 ---- if not args: raise BadUsage for arg in args: + if ispath(arg) and not os.path.exists(arg): + print 'file %r does not exist' % arg + break try: if ispath(arg) and os.path.isfile(arg): From barry@users.sourceforge.net Mon Oct 7 18:18:54 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:18:54 -0700 Subject: [Python-checkins] python/dist/src/Lib/email __init__.py,1.4.10.1,1.4.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv25283 Modified Files: Tag: release22-maint __init__.py Log Message: Bump the version to 2.4.1 (not 2.5 as previously mentioned) to sync it with the standalone mimelib package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.4.10.1 retrieving revision 1.4.10.2 diff -C2 -d -r1.4.10.1 -r1.4.10.2 *** __init__.py 4 Oct 2002 17:24:24 -0000 1.4.10.1 --- __init__.py 7 Oct 2002 17:18:52 -0000 1.4.10.2 *************** *** 5,9 **** """ ! __version__ = '2.4' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.1' __all__ = [ From barry@users.sourceforge.net Mon Oct 7 18:19:44 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:19:44 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.38,1.337.2.4.2.39 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv25602 Modified Files: Tag: release22-maint NEWS Log Message: Update the email package version number. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.38 retrieving revision 1.337.2.4.2.39 diff -C2 -d -r1.337.2.4.2.38 -r1.337.2.4.2.39 *** NEWS 7 Oct 2002 12:32:55 -0000 1.337.2.4.2.38 --- NEWS 7 Oct 2002 17:19:41 -0000 1.337.2.4.2.39 *************** *** 58,62 **** - The email package from the Python 2.3 development tree has been backported, including updated documentation. This version ! corresponds to email 2.4 and should be nearly completely backward compatible. However there have been lots of improvements in the API, so you should read the section in the library manual about the --- 58,62 ---- - The email package from the Python 2.3 development tree has been backported, including updated documentation. This version ! corresponds to email 2.4.1 and should be nearly completely backward compatible. However there have been lots of improvements in the API, so you should read the section in the library manual about the From barry@users.sourceforge.net Mon Oct 7 18:20:28 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:20:28 -0700 Subject: [Python-checkins] python/dist/src/Lib/email __init__.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv25879 Modified Files: __init__.py Log Message: Bump the version to 2.4.1 (not 2.5 as previously mentioned) to sync it with the standalone mimelib package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** __init__.py 30 Sep 2002 20:41:33 -0000 1.17 --- __init__.py 7 Oct 2002 17:20:25 -0000 1.18 *************** *** 5,9 **** """ ! __version__ = '2.4' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.1' __all__ = [ From loewis@users.sourceforge.net Mon Oct 7 18:27:18 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:27:18 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_pep277.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28092 Modified Files: test_pep277.py Log Message: Use escaped Unicode literals, according to PEP 8. Index: test_pep277.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep277.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_pep277.py 5 Oct 2002 17:54:56 -0000 1.2 --- test_pep277.py 7 Oct 2002 17:27:15 -0000 1.3 *************** *** 1,3 **** - # -*- coding: utf-8 -*- # Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir --- 1,2 ---- *************** *** 10,22 **** filenames = [ ! "abc", ! unicode("ascii","utf-8"), ! unicode("Grüß-Gott","utf-8"), ! unicode("Γειά-σας","utf-8"), ! unicode("ЗдравÑтвуйте","utf-8"), ! unicode("ã«ã½ã‚“","utf-8"), ! unicode("השקצץס","utf-8"), ! unicode("曨曩曫","utf-8"), ! unicode("曨שんдΓß","utf-8"), ] --- 9,21 ---- filenames = [ ! 'abc', ! u'ascii', ! u'Gr\xfc\xdf-Gott', ! u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', ! u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', ! u'\u306b\u307d\u3093', ! u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', ! u'\u66e8\u66e9\u66eb', ! u'\u66e8\u05e9\u3093\u0434\u0393\xdf', ] *************** *** 93,98 **** def test_directory(self): ! dirname = unicode(os.path.join(TESTFN,"Grüß-曨曩曫"),"utf-8") ! filename = unicode("ß-曨曩曫","utf-8") oldwd = os.getcwd() os.mkdir(dirname) --- 92,97 ---- def test_directory(self): ! dirname = os.path.join(TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') ! filename = u'\xdf-\u66e8\u66e9\u66eb' oldwd = os.getcwd() os.mkdir(dirname) From barry@users.sourceforge.net Mon Oct 7 18:27:37 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:27:37 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Parser.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv28371/Lib/email Modified Files: Parser.py Log Message: _parsebody(): Use get_content_type() instead of the deprecated get_type(). Also, one of the regular expressions is constant so might as well make it a module global. And, when splitting up digests, handle lineseps that are longer than 1 character in length (e.g. \r\n). Index: Parser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Parser.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Parser.py 30 Sep 2002 20:07:22 -0000 1.16 --- Parser.py 7 Oct 2002 17:27:35 -0000 1.17 *************** *** 21,24 **** --- 21,26 ---- False = 0 + nlcre = re.compile('\r\n|\r|\n') + *************** *** 138,142 **** # boundary if present. boundary = container.get_boundary() ! isdigest = (container.get_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of --- 140,144 ---- # boundary if present. boundary = container.get_boundary() ! isdigest = (container.get_content_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of *************** *** 168,173 **** # Find out what kind of line endings we're using start += len(mo.group('sep')) + len(mo.group('ws')) ! cre = re.compile('\r\n|\r|\n') ! mo = cre.search(payload, start) if mo: start += len(mo.group(0)) --- 170,174 ---- # Find out what kind of line endings we're using start += len(mo.group('sep')) + len(mo.group('ws')) ! mo = nlcre.search(payload, start) if mo: start += len(mo.group(0)) *************** *** 210,219 **** for part in parts: if isdigest: ! if part[0] == linesep: # There's no header block so create an empty message # object as the container, and lop off the newline so # we can parse the sub-subobject msgobj = self._class() ! part = part[1:] else: parthdrs, part = part.split(linesep+linesep, 1) --- 211,220 ---- for part in parts: if isdigest: ! if part.startswith(linesep): # There's no header block so create an empty message # object as the container, and lop off the newline so # we can parse the sub-subobject msgobj = self._class() ! part = part[len(linesep):] else: parthdrs, part = part.split(linesep+linesep, 1) From barry@users.sourceforge.net Mon Oct 7 18:27:58 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:27:58 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.17,1.18 test_email_torture.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv28568/Lib/email/test Modified Files: test_email.py test_email_torture.py Log Message: openfile(): Go back to opening the files in text mode. This undoes the change in revision 1.11 (test_email.py) in response to SF bug #609988. We now think that was the wrong fix and that WinZip was the real culprit there. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_email.py 1 Oct 2002 17:57:06 -0000 1.17 --- test_email.py 7 Oct 2002 17:27:55 -0000 1.18 *************** *** 47,51 **** def openfile(filename): path = os.path.join(os.path.dirname(landmark), 'data', filename) ! return open(path, 'rb') --- 47,51 ---- def openfile(filename): path = os.path.join(os.path.dirname(landmark), 'data', filename) ! return open(path, 'r') Index: test_email_torture.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email_torture.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_email_torture.py 18 Sep 2002 22:17:57 -0000 1.4 --- test_email_torture.py 7 Oct 2002 17:27:55 -0000 1.5 *************** *** 23,27 **** from os.path import join, dirname, abspath path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) ! return open(path, 'rb') # Prevent this test from running in the Python distro --- 23,27 ---- from os.path import join, dirname, abspath path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename)) ! return open(path, 'r') # Prevent this test from running in the Python distro From loewis@users.sourceforge.net Mon Oct 7 18:45:58 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 10:45:58 -0700 Subject: [Python-checkins] python/dist/src configure,1.343,1.344 configure.in,1.354,1.355 pyconfig.h.in,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3800 Modified Files: configure configure.in pyconfig.h.in Log Message: Check for wctype.h. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.343 retrieving revision 1.344 diff -C2 -d -r1.343 -r1.344 *** configure 7 Oct 2002 13:55:30 -0000 1.343 --- configure 7 Oct 2002 17:45:53 -0000 1.344 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.353 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.354 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 902,906 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 902,906 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *************** *** 3891,3894 **** --- 3891,3895 ---- + for ac_header in dlfcn.h fcntl.h grp.h limits.h langinfo.h \ libintl.h locale.h ncurses.h poll.h pthread.h \ *************** *** 3896,3900 **** sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ sys/resource.h netpacket/packet.h do --- 3897,3901 ---- sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h wctype.h libutil.h \ sys/resource.h netpacket/packet.h do *************** *** 16842,16846 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 16843,16847 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -d -r1.354 -r1.355 *** configure.in 7 Oct 2002 13:55:48 -0000 1.354 --- configure.in 7 Oct 2002 17:45:55 -0000 1.355 *************** *** 619,623 **** sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT --- 619,623 ---- sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h wctype.h libutil.h \ sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** pyconfig.h.in 7 Oct 2002 13:55:49 -0000 1.51 --- pyconfig.h.in 7 Oct 2002 17:45:56 -0000 1.52 *************** *** 593,596 **** --- 593,599 ---- #undef HAVE_WCHAR_H + /* Define to 1 if you have the header file. */ + #undef HAVE_WCTYPE_H + /* Define to 1 if you have the `_getpty' function. */ #undef HAVE__GETPTY From gvanrossum@users.sourceforge.net Mon Oct 7 19:08:29 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:08:29 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.39,1.337.2.4.2.40 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv14033/Misc Modified Files: Tag: release22-maint NEWS Log Message: Backport, at the reqest of Kevin Jacobs: - Changed new-style class instantiation so that when C's __new__ method returns something that's not a C instance, its __init__ is not called. [SF bug #537450] XXX This is arguably a semantic change, but it's hard to imagine a reason for wanting to depend on the old behavior. If problems with this are reported within a week of the release of 2.2.2 beta 1, we may revert this change. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.39 retrieving revision 1.337.2.4.2.40 diff -C2 -d -r1.337.2.4.2.39 -r1.337.2.4.2.40 *** NEWS 7 Oct 2002 17:19:41 -0000 1.337.2.4.2.39 --- NEWS 7 Oct 2002 18:08:26 -0000 1.337.2.4.2.40 *************** *** 1,7 **** ! What's New in Python 2.2.2? ! Release date: dd-mmm-2002 ! =========================== Core and builtins - u'%c' will now raise a ValueError in case the argument is an --- 1,14 ---- ! What's New in Python 2.2.2b1? ! Release date: 7-Oct-2002 ! ============================= Core and builtins + + - Changed new-style class instantiation so that when C's __new__ + method returns something that's not a C instance, its __init__ is + not called. [SF bug #537450] (This is arguably a semantic change, + but it's hard to imagine a reason for wanting to depend on the old + behavior. If problems with this are reported within a week of the + release of 2.2.2 beta 1, we may revert this change.) - u'%c' will now raise a ValueError in case the argument is an From gvanrossum@users.sourceforge.net Mon Oct 7 19:08:29 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:08:29 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.23,2.126.4.24 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14033/Objects Modified Files: Tag: release22-maint typeobject.c Log Message: Backport, at the reqest of Kevin Jacobs: - Changed new-style class instantiation so that when C's __new__ method returns something that's not a C instance, its __init__ is not called. [SF bug #537450] XXX This is arguably a semantic change, but it's hard to imagine a reason for wanting to depend on the old behavior. If problems with this are reported within a week of the release of 2.2.2 beta 1, we may revert this change. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126.4.23 retrieving revision 2.126.4.24 diff -C2 -d -r2.126.4.23 -r2.126.4.24 *** typeobject.c 14 Aug 2002 17:36:26 -0000 2.126.4.23 --- typeobject.c 7 Oct 2002 18:08:27 -0000 2.126.4.24 *************** *** 190,193 **** --- 190,197 ---- (PyDict_Check(kwds) && PyDict_Size(kwds) == 0))) return obj; + /* If the returned object is not an instance of type, + it won't be initialized. */ + if (!PyType_IsSubtype(obj->ob_type, type)) + return obj; type = obj->ob_type; if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS) && From gvanrossum@users.sourceforge.net Mon Oct 7 19:08:28 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:08:28 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.24,1.113.4.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14033/Lib/test Modified Files: Tag: release22-maint test_descr.py Log Message: Backport, at the reqest of Kevin Jacobs: - Changed new-style class instantiation so that when C's __new__ method returns something that's not a C instance, its __init__ is not called. [SF bug #537450] XXX This is arguably a semantic change, but it's hard to imagine a reason for wanting to depend on the old behavior. If problems with this are reported within a week of the release of 2.2.2 beta 1, we may revert this change. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.113.4.24 retrieving revision 1.113.4.25 diff -C2 -d -r1.113.4.24 -r1.113.4.25 *** test_descr.py 1 Aug 2002 19:03:41 -0000 1.113.4.24 --- test_descr.py 7 Oct 2002 18:08:26 -0000 1.113.4.25 *************** *** 3018,3021 **** --- 3018,3042 ---- del C.__del__ + def funnynew(): + if verbose: print "Testing __new__ returning something unexpected..." + class C(object): + def __new__(cls, arg): + if isinstance(arg, str): return [1, 2, 3] + elif isinstance(arg, int): return object.__new__(D) + else: return object.__new__(cls) + class D(C): + def __init__(self, arg): + self.foo = arg + vereq(C("1"), [1, 2, 3]) + vereq(D("1"), [1, 2, 3]) + d = D(None) + veris(d.foo, None) + d = C(1) + vereq(isinstance(d, D), True) + vereq(d.foo, 1) + d = D(1) + vereq(isinstance(d, D), True) + vereq(d.foo, 1) + def test_main(): class_docstrings() *************** *** 3079,3082 **** --- 3100,3104 ---- copy_setstate() subtype_resurrection() + funnynew() if verbose: print "All OK" From gvanrossum@users.sourceforge.net Mon Oct 7 19:14:21 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:14:21 -0700 Subject: [Python-checkins] python/dist/src README,1.136.4.7,1.136.4.8 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv17833 Modified Files: Tag: release22-maint README Log Message: Update version to 2.2.2b1. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.136.4.7 retrieving revision 1.136.4.8 diff -C2 -d -r1.136.4.7 -r1.136.4.8 *** README 23 Sep 2002 14:02:44 -0000 1.136.4.7 --- README 7 Oct 2002 18:14:18 -0000 1.136.4.8 *************** *** 1,4 **** ! This is Python version 2.2.1 ! ============================ Copyright (c) 2001, 2002 Python Software Foundation. --- 1,4 ---- ! This is Python version 2.2.2b1 ! ============================== Copyright (c) 2001, 2002 Python Software Foundation. From loewis@users.sourceforge.net Mon Oct 7 19:26:19 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:26:19 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.190,2.191 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23766 Modified Files: stringobject.c Log Message: Include wctype.h. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.190 retrieving revision 2.191 diff -C2 -d -r2.190 -r2.191 *** stringobject.c 7 Oct 2002 13:55:50 -0000 2.190 --- stringobject.c 7 Oct 2002 18:26:16 -0000 2.191 *************** *** 27,34 **** ! #if defined(HAVE_MBTOWC) && defined(HAVE_WCHAR_H) # define PRINT_MULTIBYTE_STRING # include # include # if defined(HAVE_ISWPRINT) # define _isprint iswprint --- 27,35 ---- ! #if defined(HAVE_MBTOWC) && defined(HAVE_WCHAR_H) && defined(HAVE_WCTYPE_H) # define PRINT_MULTIBYTE_STRING # include # include + # include # if defined(HAVE_ISWPRINT) # define _isprint iswprint From loewis@users.sourceforge.net Mon Oct 7 19:34:36 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:34:36 -0700 Subject: [Python-checkins] python/nondist/peps pep-0277.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv27885 Modified Files: pep-0277.txt Log Message: The PEP is now implemented. Index: pep-0277.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0277.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0277.txt 12 Aug 2002 11:43:56 -0000 1.3 --- pep-0277.txt 7 Oct 2002 18:34:33 -0000 1.4 *************** *** 4,8 **** Last-Modified: $Date$ Author: neilh@scintilla.org (Neil Hodgson) ! Status: Draft Type: Standards Track Created: 11-Jan-2002 --- 4,8 ---- Last-Modified: $Date$ Author: neilh@scintilla.org (Neil Hodgson) ! Status: Final Type: Standards Track Created: 11-Jan-2002 From loewis@users.sourceforge.net Mon Oct 7 19:38:50 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:38:50 -0700 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.213,1.214 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv29968 Modified Files: pep-0000.txt Log Message: Update status for PEP 277. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.213 retrieving revision 1.214 diff -C2 -d -r1.213 -r1.214 *** pep-0000.txt 20 Sep 2002 14:10:49 -0000 1.213 --- pep-0000.txt 7 Oct 2002 18:38:47 -0000 1.214 *************** *** 88,92 **** S 275 Switching on Multiple Values Lemburg S 276 Simple Iterator for ints Althoff - S 277 Unicode file name support for Windows NT Hodgson S 278 Universal Newline Support Jansen S 280 Optimizing access to globals van Rossum --- 88,91 ---- *************** *** 137,140 **** --- 136,140 ---- SF 263 Defining Python Source Code Encodings Lemburg SF 264 Future statements in simulated shells Hudson + SF 277 Unicode file name support for Windows NT Hodgson SF 279 The enumerate() built-in function Hettinger SF 285 Adding a bool type van Rossum *************** *** 269,273 **** S 275 Switching on Multiple Values Lemburg S 276 Simple Iterator for ints Althoff ! S 277 Unicode file name support for Windows NT Hodgson S 278 Universal Newline Support Jansen SF 279 The enumerate() built-in function Hettinger --- 269,273 ---- S 275 Switching on Multiple Values Lemburg S 276 Simple Iterator for ints Althoff ! SF 277 Unicode file name support for Windows NT Hodgson S 278 Universal Newline Support Jansen SF 279 The enumerate() built-in function Hettinger From fdrake@users.sourceforge.net Mon Oct 7 19:47:51 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:47:51 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.235.2.1.2.12,1.235.2.1.2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv3056 Modified Files: Tag: release22-maint Makefile Log Message: Fix up the release number for the 2.2.2b1 documentation release. This is what was actually used. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.235.2.1.2.12 retrieving revision 1.235.2.1.2.13 diff -C2 -d -r1.235.2.1.2.12 -r1.235.2.1.2.13 *** Makefile 4 Oct 2002 20:40:44 -0000 1.235.2.1.2.12 --- Makefile 7 Oct 2002 18:47:48 -0000 1.235.2.1.2.13 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2b1 PYTHON= python From loewis@users.sourceforge.net Mon Oct 7 19:52:31 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 11:52:31 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv5453 Modified Files: whatsnew23.tex Log Message: Document PEP 277 changes. Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** whatsnew23.tex 4 Oct 2002 22:34:11 -0000 1.53 --- whatsnew23.tex 7 Oct 2002 18:52:29 -0000 1.54 *************** *** 307,312 **** \seepep{263}{Defining Python Source Code Encodings}{Written by ! Marc-Andr\'e Lemburg and Martin von L\"owis; implemented by Martin von ! L\"owis.} \end{seealso} --- 307,312 ---- \seepep{263}{Defining Python Source Code Encodings}{Written by ! Marc-Andr\'e Lemburg and Martin von L\"owis; implemented by SUZUKI ! Hisao and Martin von L\"owis.} \end{seealso} *************** *** 314,320 **** %====================================================================== ! \section{PEP 277: XXX} ! XXX write this section --- 314,346 ---- %====================================================================== ! \section{PEP 277: Unicode file name support for Windows NT} ! On Windows NT, 2000, and XP, the system stores file names as Unicode ! strings. Traditionally, Python has represented file names are byte ! strings, which is inadequate since it renders some file names ! inaccessible. ! ! Python allows now to use arbitrary Unicode strings (within limitations ! of the file system) for all functions that expect file names, in ! particular \function{open}. If a Unicode string is passed to ! \function{os.listdir}, Python returns now a list of Unicode strings. ! A new function \function{getcwdu} returns the current directory as a ! Unicode string. ! ! Byte strings continue to work as file names, the system will ! transparently convert them to Unicode using the \code{mbcs} encoding. ! ! Other systems allow Unicode strings as file names as well, but convert ! them to byte strings before passing them to the system, which may ! cause UnicodeErrors. Applications can test whether arbitrary Unicode ! strings are supported as file names with \code{os.path.unicode_file_names}. ! ! \begin{seealso} ! ! \seepep{277}{Unicode file name support for Windows NT}{Written by Neil ! Hodgson; implemented by Neil Hodgson, Martin von L\"owis, and Mark ! Hammond.} ! ! \end{seealso} From loewis@users.sourceforge.net Mon Oct 7 20:01:10 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 07 Oct 2002 12:01:10 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv10373 Modified Files: whatsnew23.tex Log Message: Document PEP 293. Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** whatsnew23.tex 7 Oct 2002 18:52:29 -0000 1.54 --- whatsnew23.tex 7 Oct 2002 19:01:07 -0000 1.55 *************** *** 493,497 **** \section{PEP 293: Codec Error Handling Callbacks} ! XXX write this section \begin{seealso} --- 493,517 ---- \section{PEP 293: Codec Error Handling Callbacks} ! When encoding a Unicode string into a byte string, unencodable ! characters may be encountered. So far, Python allowed to specify the ! error processing as either ``strict'' (raise \code{UnicodeError}, ! default), ``ignore'' (skip the character), or ``replace'' (with ! question mark). It may be desirable to specify an alternative ! processing of the error, e.g. by inserting an XML character reference ! or HTML entity reference into the converted string. ! ! Python now has a flexible framework to add additional processing ! strategies; new error handlers can be added with ! \function{codecs.register_error}. Codecs then can access the error ! handler with \code{codecs.lookup_error}. An equivalent C API has been ! added for codecs written in C. The error handler gets various state ! information, such as the string being converted, the position in the ! string where the error was detected, and the target encoding. It can ! then either raise an exception, or return a replacement string. ! ! Two additional error handlers have been implemented using this ! framework: ``backslashreplace'' using Python backslash quoting to ! represent the unencodable character, and ``xmlcharrefreplace'' emits ! XML character references. \begin{seealso} From gvanrossum@users.sourceforge.net Mon Oct 7 22:39:02 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 14:39:02 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.40,1.337.2.4.2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv16554 Modified Files: Tag: release22-maint NEWS Log Message: News for 2.2.2b1. I'm exhausted -- this was a multi-hour job of poring over the logs. Quite likely I've forgotten some things, introduced typos, and organized things less than ideally. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.40 retrieving revision 1.337.2.4.2.41 diff -C2 -d -r1.337.2.4.2.40 -r1.337.2.4.2.41 *** NEWS 7 Oct 2002 18:08:26 -0000 1.337.2.4.2.40 --- NEWS 7 Oct 2002 21:38:58 -0000 1.337.2.4.2.41 *************** *** 3,6 **** --- 3,17 ---- ============================= + Almost everything in this release is a pure bugfix and is backported + from a corresponding bugfix alrady applied to Python 2.3. While at + the time of writing, Python 2.3 is still in pre-alpha form, only + accessible via CVS, it receives continuous and extensive testing by + its developers. The list below is not a complete list of fixed bugs; + it only lists fixed bugs that someone might be interested in hearing + about. Documentation fixes are not listed. + + Tip: to quickly find SourceForge bug or patch NNNNNN, use an URL of + the form www.python.org/sf/NNNNNN. + Core and builtins *************** *** 12,18 **** --- 23,64 ---- release of 2.2.2 beta 1, we may revert this change.) + - Fix a core dump in type_new() when looking for the tp_init() slot. + This could call a garbage pointer when e.g. an ExtensionClass was + given. + + - A variety of very obscure end-case bugs in new-style classes were + fixed, some of which could be made to trigger core dumps with absurd + input. + - u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. + - Several small patches were applied that aren't bugfixes (and aren't + even backported from 2.3!) but make life easier for tools like Armin + Rigo's Psyco. [SF patches 617309, 617311, 617312] + + - Made conversion failure error message consistent between types. + + - The complex() built-in now finds __complex__() in new-style + classes. [SF bug 563740] + + - Fixed a problem in the UTF-8 decoder where a Unicode literal + containing a "lone surrogate" would cause a .pyc file to be written + that could not be read. [SF bug 610783] + + - Fixed a problem with code objects whose stacksize is >= 2**15. + These cannot be marshalled correctly. As a work-around, don't write + a .pyc file in this case. [SF bug 561858] + + - Fixed several bugs that could cause issubclass() and isinstance() to + leave an exception lingering behind while returning a non-error + value. + + - The Unicode replace() method would do the wrong thing for a unicode + subclass when there were zero string replacements. [SF bug 599128] + + - Fixed some endcase bugs in Unicode rfind()/rindex() and endswith(). + [SF bug 595350] + - When x is an object whose class implements __mul__ and __rmul__, 1.0*x would correctly invoke __rmul__, but 1*x would erroneously *************** *** 20,25 **** type. This has been fixed now. ! - If a dying instance of a new-style class got resurrected by its class's ! __del__ method, Python aborted with a fatal error. - Source that creates parse nodes with an extremely large number of --- 66,73 ---- type. This has been fixed now. ! - The __delete__ method wrapper wasn't supported. [SF patch 588728] ! ! - If a dying instance of a new-style class got resurrected by its ! class's __del__ method, Python aborted with a fatal error. - Source that creates parse nodes with an extremely large number of *************** *** 38,44 **** [SF bug 519621] - Repaired a slow memory leak possible only in programs creating a ! great many cyclic structures involving frames. Reported on ! SourceForge as bug 543148. - A method zfill() was added to str and unicode, that fills a numeric --- 86,96 ---- [SF bug 519621] + - Fixed an inefficiency in clearing the stack frame of new frame + objects. + - Repaired a slow memory leak possible only in programs creating a ! great many cyclic structures involving frames [SF bug 543148]. ! ! - Fixed an esoteric performance glitch in GC. [SF bug 574132] - A method zfill() was added to str and unicode, that fills a numeric *************** *** 50,63 **** deprecated now. ! - String methods lstrip(), rstrip() and strip() now take an optional ! argument that specifies the characters to strip. For example, ! "Foo!!!?!?!?".rstrip("?!") -> "Foo". In addition, "200L".strip("L") ! will return "200". This is useful for replacing code that assumed ! longs will always be printed with a trailing "L". Extension modules ! - If the size passed to mmap.mmap() is larger than the length of the ! file on non-Windows platforms, a ValueError is raised. [SF bug 585792] Library --- 102,137 ---- deprecated now. ! - String and Unicode methods lstrip(), rstrip() and strip() now take ! an optional argument that specifies the characters to strip. For ! example, "Foo!!!?!?!?".rstrip("?!") -> "Foo". In addition, ! "200L".strip("L") will return "200". This is useful for replacing ! code that assumed longs will always be printed with a trailing "L". ! ! - A change to how new-style classes deal with __doc__: you can now ! supply a __doc__ descriptor that returns something different for a ! class than for instances of that class. Extension modules ! - In readline.c: change completion to avoid appending a space ! character; this is usually more useful when editing Python code. ! ! - Fixed a crash in debug builds for marshal.dumps([128] * 1000). [SF ! bug 588452] ! ! - In cPickle.c: more robust test of whether global objects are ! accessible. Added recursion limit to pickling [SF bug 576084]. Try ! the persistent id code *before* calling save_global(). ! ! - In mmapmpdule.c: if the size passed to mmap() is larger than the ! length of the file on non-Windows platforms, a ValueError is ! raised. [SF bug 585792] ! ! - In socketmodule.c: improve robustness of IPv6 code. ! ! - In _hotshot.c: fix broken logic in the logreader object. ! ! - In zlibmodule.c: fix for crash on second flush() call. [SF bug ! 544995] Library *************** *** 70,90 **** changes since email v1. ! - random.gauss() uses a piece of hidden state used by nothing else, ! and the .seed() and .whseed() methods failed to reset it. In other ! words, setting the seed didn't completely determine the sequence of ! results produced by random.gauss(). It does now. Programs repeatedly ! mixing calls to a seed method with calls to gauss() may see different ! results now. ! - Some fixes in the copy module: when an object is copied through its ! __reduce__ method, there was no check for a __setstate__ method on ! the result [SF patch 565085]; deepcopy should treat instances of ! custom metaclasses the same way it treats instances of type 'type' ! [SF patch 560794]. Build - The fpectl module is not built by default; it's dangerous or useless ! except in the hands of experts. - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or --- 144,295 ---- changes since email v1. ! - In pydoc.py: Extend stripid() to handle strings ending in more than ! one '>'; add resolve() to handle looking up objects and names (fix ! SF bug 586931); add a nicer error message when given a filename that ! doesn't exist. Pretend that the docstring for non-callable objects ! is always None; this makes for less confusing output and fixes the ! problem reported in SF patch 550290. Change the way 'less' is ! invoked as a browser (on Unix) to make it more robust. ! - In pickle.py: Whichmodule() now skips dummy (None) package entries ! in sys.modules. Try the persistent id code *before* calling ! save_global(). ! ! - A variety of fixes were applied to the compiler package. ! ! - In distutils/: Fix distutils.sysconfig to understand that the ! running Python is part of the build tree and needs to use the ! appropriate "shape" of the tree [SF patch 547734]. Prefer rpmbuild ! over rpm if available [SF patch 619493]. util.convert_path() ! failed with empty pathname. [SF bug 574235] ! ! - In posixpath.py and user.py: fixed SF bug 555779, "import user ! doesn't work with CGIs." ! ! - In site.py: fixed a problem which triggered when sys.path was empty. ! ! - In smtpd.py: print the refused list to the DEBUGSTREAM [SF 515021]; ! removed an embarrassing debug line from smtp_RCPT(). ! ! - In smtplib.py: fix multiline string in sendmail example [SF patch ! 586999]; handle empty addresses [SF bug 602029]. ! ! - In urllib.py: treat file://localhost/ as local too (same as file:/ ! and file:///). [SF bug 607789] ! ! - In warnings.py: ignore IOError when writing the message. ! ! - In ConfigParser.py: allow internal whitespace in keys [SF bug ! 583248]; use option name transform consistently in has_option() [SF ! bug 561822]; misc other patches. ! ! - In sre_compile.py (the compile() function for the re module): ! Disable big charsets in UCS-4 builds. [SF bug 599377] ! ! - In pre.py (the deprecated, *old* implementation of the re module): ! fix broken sub() and subn(). [SF bug 570057] ! ! - In weakref.py: The WeakKeyDictionary constructor didn't work when a ! dict arg was given. [SF patch 564549] ! ! - In xml/: various fixes tracking PyXML. ! ! - In urllib2.py: fix proxy config with user+pass authentication. [SF ! patch 527518] ! ! - In pdb.py: Increase the maxstring value of _saferepr. Add exit as ! an alias for quit [SF bug 543674]. Fix crash on input line ! consisting of one or more spaces [SF bug 579701]. ! ! - In test/regrtest.py: added some sys.stdout.flush() calls. ! ! - In random.py: ! ! - Deprecate (in comment) cunifvariate(). [SF bug 506647] ! ! - Loosened the acceptable 'start' and 'stop' arguments to ! randrange() so that any Python (bounded) ints can be used. So, ! e.g., randrange(-sys.maxint-1, sys.maxint) no longer blows up. ! [SF bug 594996] ! ! - The gauss() method uses a piece of hidden state used by nothing ! else, and the .seed() and .whseed() methods failed to reset it. ! In other words, setting the seed didn't completely determine the ! sequence of results produced by random.gauss(). It does now. ! Programs repeatedly mixing calls to a seed method with calls to ! gauss() may see different results now. ! ! - The randint() method is rehabilitated (i.e. no longer deprecated). ! ! - In copy.py: when an object is copied through its __reduce__ method, ! there was no check for a __setstate__ method on the result [SF ! patch 565085]; deepcopy should treat instances of custom ! metaclasses the same way it treats instances of type 'type' [SF ! patch 560794]. ! ! - In turtle.py: update canvas before computing width; draw turtle when ! done drawing circle. [SF bug 612595] ! ! - In Tkinter.py: Canvas.select_item() now returns the selected item, ! if any. [SF patch 581396] ! ! - In multifile.py: *backed out* the change that stripped a trailing ! \r\n. This caused more problems than it fixed. [SF bug 514676] ! ! - In rexec.py: fixed several security problems. *This does not mean ! that rexec is now considered safe!* ! ! - In os.py: security fixes for _execvpe(). ! ! - In gzip.py: open files in binary mode. ! ! - In CGIHTTPServer.py: update os.environ regardless of hos it tries to ! handle calls (fork, popen*, etc.). Also fixed a flush() of a ! read-only file (can't do that on MacOS X). ! ! - In urllib.py: in splituser(), allow @ in the userinfo field. This ! is not allowed by RFC 2396; however, other tools support unescaped ! @'s so we should also. [SF patch 596581, bug 581529] ! ! - In base64.py: decodestring('') should return '' instead of raising ! an exception. [SF bug 595671] ! ! - atexit.py: keep working if sys.exitfunc is already set when this is ! first imported. ! ! - In copy.py: Make sure that *any* object whose id() is used as a memo ! key is kept alive in the memo. [SF bug 592567] ! ! - In httplib.py: fixed a variety of bugs. The httplib.py in Python ! 2.2.2 is identical to that in the CVS head (at the time of the ! release of 2.2.2). ! ! - In rfc822.py: change the default for Message.get() back to None. ! ! - In bdb.py: fix an old bug that made it impossible to continue after ! hitting a breakpoint while in the bottom frame. ! ! - In Queue.py: use try/finally to ensure that all locks are properly ! released. [SF bug 544473] ! ! - In SocketServer.py: the correct initialization of self.wfile is ! StringIO.StringIO(), not StringIO.StringIO(self.packet). [SF bug ! 543318] Build + - Various platform-specific problems were fixed, including most open + 64-bit platform specific issues. + + - Updated Misc/RPM for Python 2.2.2b1; added Makefile.pre.in to -devel. + - The fpectl module is not built by default; it's dangerous or useless ! except in the hands of experts. (At the same time, a fix for DEC ! Alpha under Linux was applied.) ! ! - Better check for C++ linkage. [SF bug 559429] ! ! - The errno module needs to be statically linked, since it is now ! needed during the extension building phase. - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or *************** *** 94,98 **** COUNT_ALLOCS is not enabled by default, in either release or debug builds, and that new-style classes are immortal only in COUNT_ALLOCS ! builds. SourceForge bug 578752. C API --- 299,306 ---- COUNT_ALLOCS is not enabled by default, in either release or debug builds, and that new-style classes are immortal only in COUNT_ALLOCS ! builds. [SF bug 578752] ! ! - In order to avoid problems with binutils 2.12 and later, test for ! --export-dynamic in its help output. C API *************** *** 103,106 **** --- 311,328 ---- Windows + - Improve handling of ^C on Windows. [SF bug 439992] + + - Provide a fallback version of ntpath.abspath() when the nt module + can't be imported. + + - Fixed asyncore on Windows to avoid calling select() with three empty + lists. Use time.sleep() instead, to match what happens on + Unix/Linux in that case. [SF item 611464] + + - Fixed selectmodule.c to call WSAGetLastError() to retrieve the error + number. + + - Fixed the test for mmap so that it passes on Windows too. + - SF bug 595919: popenN return only text mode pipes popen2() and popen3() created text-mode pipes even when binary mode *************** *** 110,113 **** --- 332,339 ---- of that has been fixed in the installer (disabled Wise's "delete in- use files" uninstall option). + + Other + + - Most changes to IDLE were backported, including some featurettes. From gvanrossum@users.sourceforge.net Tue Oct 8 02:04:36 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 07 Oct 2002 18:04:36 -0700 Subject: [Python-checkins] python/dist/src/Include patchlevel.h,2.60.2.1.2.7,2.60.2.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv15512 Modified Files: Tag: release22-maint patchlevel.h Log Message: Upgrade the version *string* by adding a '+'. This marks the first checkin since 2.2.2b1 was released. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.60.2.1.2.7 retrieving revision 2.60.2.1.2.8 diff -C2 -d -r2.60.2.1.2.7 -r2.60.2.1.2.8 *** patchlevel.h 6 Oct 2002 04:14:17 -0000 2.60.2.1.2.7 --- patchlevel.h 8 Oct 2002 01:04:34 -0000 2.60.2.1.2.8 *************** *** 27,31 **** /* Version as a string */ ! #define PY_VERSION "2.2.2b1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 27,31 ---- /* Version as a string */ ! #define PY_VERSION "2.2.2b1+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From mhammond@users.sourceforge.net Tue Oct 8 03:44:31 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:31 -0700 Subject: [Python-checkins] python/dist/src/Python sysmodule.c,2.110,2.111 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11411/Python Modified Files: sysmodule.c Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.110 retrieving revision 2.111 diff -C2 -d -r2.110 -r2.111 *** sysmodule.c 3 Sep 2002 20:10:45 -0000 2.110 --- sysmodule.c 8 Oct 2002 02:44:28 -0000 2.111 *************** *** 21,24 **** --- 21,29 ---- #include "osdefs.h" + #ifdef MS_WINDOWS + #define WIN32_LEAN_AND_MEAN + #include "windows.h" + #endif /* MS_WINDOWS */ + #ifdef MS_COREDLL extern void *PyWin_DLLhModule; *************** *** 405,408 **** --- 410,441 ---- ); + #ifdef MS_WINDOWS + PyDoc_STRVAR(getwindowsversion_doc, + "getwindowsversion()\n\ + \n\ + Return information about the running version of Windows.\n\ + The result is a tuple of (major, minor, build, platform, text)\n\ + All elements are numbers, except text which is a string.\n\ + Platform may be 0 for win32s, 1 for Windows 9x/ME, 2 for Windows NT/2000/XP\n\ + " + ); + + static PyObject * + sys_getwindowsversion(PyObject *self) + { + OSVERSIONINFO ver; + ver.dwOSVersionInfoSize = sizeof(ver); + if (!GetVersionEx(&ver)) + return PyErr_SetFromWindowsErr(0); + return Py_BuildValue("HHHHs", + ver.dwMajorVersion, + ver.dwMinorVersion, + ver.dwBuildNumber, + ver.dwPlatformId, + ver.szCSDVersion); + } + + #endif /* MS_WINDOWS */ + #ifdef HAVE_DLOPEN static PyObject * *************** *** 571,574 **** --- 604,611 ---- getrecursionlimit_doc}, {"_getframe", sys_getframe, METH_VARARGS, getframe_doc}, + #ifdef MS_WINDOWS + {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, + getwindowsversion_doc}, + #endif /* MS_WINDOWS */ #ifdef USE_MALLOPT {"mdebug", sys_mdebug, METH_VARARGS}, From mhammond@users.sourceforge.net Tue Oct 8 03:44:31 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:31 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libsys.tex,1.60,1.61 libposixpath.tex,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11411/Doc/lib Modified Files: libsys.tex libposixpath.tex Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: libsys.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsys.tex,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** libsys.tex 3 Sep 2002 13:25:17 -0000 1.60 --- libsys.tex 8 Oct 2002 02:44:29 -0000 1.61 *************** *** 217,220 **** --- 217,246 ---- \end{funcdesc} + \begin{funcdesc}{getwindowsversion}{} + Return a tuple containing five components, describing the Windows + version currently running. The elements are \var{major}, \var{minor}, + \var{build}, \var{platform}, and \var{text}. \var{text} contains + a string while all other values are integers. + + \var{platform} may be one of the following values: + \begin{list}{}{\leftmargin 0.7in \labelwidth 0.65in} + \item[0 (\constant{VER_PLATFORM_WIN32s})] + Win32s on Windows 3.1. + \item[1 (\constant{VER_PLATFORM_WIN32_WINDOWS})] + Windows 95/98/ME + \item[2 (\constant{VER_PLATFORM_WIN32_NT})] + Windows NT/2000/XP + \item[3 (\constant{VER_PLATFORM_WIN32_CE})] + Windows CE. + \end{list} + + This function wraps the Win32 \function{GetVersionEx()} function; + see the Microsoft Documentation for more information about these + fields. + + Availability: Windows. + \versionadded{2.3} + \end{funcdesc} + \begin{datadesc}{hexversion} The version number encoded as a single integer. This is guaranteed Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** libposixpath.tex 12 Sep 2002 18:01:26 -0000 1.28 --- libposixpath.tex 8 Oct 2002 02:44:29 -0000 1.29 *************** *** 220,223 **** --- 220,230 ---- assignment.) + \begin{datadesc}{supports_unicode_filenames} + True if arbitrary Unicode strings can be used as file names (within + limitations imposed by the file system), and if os.listdir returns + Unicode strings for a Unicode argument. + \versionadded{2.3} + \end{datadesc} + \begin{notice} Symbolic links to directories are not treated as subdirectories, and From mhammond@users.sourceforge.net Tue Oct 8 03:44:32 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:32 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_pep277.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11411/Lib/test Modified Files: test_pep277.py Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: test_pep277.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep277.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_pep277.py 7 Oct 2002 17:27:15 -0000 1.3 --- test_pep277.py 8 Oct 2002 02:44:30 -0000 1.4 *************** *** 3,9 **** import os, unittest from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite ! try: ! from nt import _getfullpathname ! except ImportError: raise TestSkipped, "test works only on NT+" --- 3,7 ---- import os, unittest from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite ! if not os.path.supports_unicode_filenames: raise TestSkipped, "test works only on NT+" *************** *** 25,29 **** # an error if we can't remove it. if os.path.exists(dirname): ! for fname in os.listdir(dirname): os.unlink(os.path.join(dirname, fname)) os.rmdir(dirname) --- 23,28 ---- # an error if we can't remove it. if os.path.exists(dirname): ! # must pass unicode to os.listdir() so we get back unicode results. ! for fname in os.listdir(unicode(dirname)): os.unlink(os.path.join(dirname, fname)) os.rmdir(dirname) *************** *** 100,104 **** f.write((filename + '\n').encode("utf-8")) f.close() ! print repr(_getfullpathname(filename)) os.remove(filename) os.chdir(oldwd) --- 99,103 ---- f.write((filename + '\n').encode("utf-8")) f.close() ! print repr(filename) os.remove(filename) os.chdir(oldwd) From mhammond@users.sourceforge.net Tue Oct 8 03:44:32 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:32 -0700 Subject: [Python-checkins] python/dist/src/Lib dospath.py,1.29,1.30 macpath.py,1.39,1.40 ntpath.py,1.49,1.50 os2emxpath.py,1.6,1.7 posixpath.py,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11411/Lib Modified Files: dospath.py macpath.py ntpath.py os2emxpath.py posixpath.py Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: dospath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dospath.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dospath.py 1 Jun 2002 19:51:15 -0000 1.29 --- dospath.py 8 Oct 2002 02:44:29 -0000 1.30 *************** *** 7,11 **** "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath"] def normcase(s): --- 7,12 ---- "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath", ! "supports_unicode_filenames"] def normcase(s): *************** *** 337,338 **** --- 338,340 ---- # realpath is a no-op on systems without islink support realpath = abspath + supports_unicode_filenames = False Index: macpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/macpath.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** macpath.py 1 Jun 2002 19:51:15 -0000 1.39 --- macpath.py 8 Oct 2002 02:44:30 -0000 1.40 *************** *** 7,11 **** "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile", ! "walk","expanduser","expandvars","normpath","abspath"] # Normalize the case of a pathname. Dummy in Posix, but .lower() here. --- 7,12 ---- "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile", ! "walk","expanduser","expandvars","normpath","abspath", ! "supports_unicode_filenames"] # Normalize the case of a pathname. Dummy in Posix, but .lower() here. *************** *** 249,250 **** --- 250,253 ---- path = macfs.ResolveAliasFile(path)[0].as_pathname() return path + + supports_unicode_filenames = False Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ntpath.py 1 Jun 2002 19:51:15 -0000 1.49 --- ntpath.py 8 Oct 2002 02:44:30 -0000 1.50 *************** *** 8,16 **** import os import stat __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath","splitunc"] # Normalize the case of a pathname and map slashes to backslashes. --- 8,18 ---- import os import stat + import sys __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath","splitunc", ! "supports_unicode_filenames"] # Normalize the case of a pathname and map slashes to backslashes. *************** *** 477,478 **** --- 479,482 ---- # realpath is a no-op on systems without islink support realpath = abspath + # Win9x family and earlier have no Unicode filename support. + supports_unicode_filenames = sys.getwindowsversion()[3] >= 2 Index: os2emxpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os2emxpath.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** os2emxpath.py 1 Jun 2002 19:51:15 -0000 1.6 --- os2emxpath.py 8 Oct 2002 02:44:30 -0000 1.7 *************** *** 12,16 **** "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath","splitunc"] # Normalize the case of a pathname and map slashes to backslashes. --- 12,17 ---- "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", ! "walk","expanduser","expandvars","normpath","abspath","splitunc", ! "supports_unicode_filenames"] # Normalize the case of a pathname and map slashes to backslashes. *************** *** 401,402 **** --- 402,405 ---- path = join(os.getcwd(), path) return normpath(path) + + supports_unicode_filenames = False Index: posixpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/posixpath.py,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** posixpath.py 5 Sep 2002 21:08:25 -0000 1.52 --- posixpath.py 8 Oct 2002 02:44:30 -0000 1.53 *************** *** 18,22 **** "getatime","islink","exists","isdir","isfile","ismount", "walk","expanduser","expandvars","normpath","abspath", ! "samefile","sameopenfile","samestat"] # Normalize the case of a pathname. Trivial in Posix, string.lower on Mac. --- 18,22 ---- "getatime","islink","exists","isdir","isfile","ismount", "walk","expanduser","expandvars","normpath","abspath", ! "samefile","sameopenfile","samestat","supports_unicode_filenames"] # Normalize the case of a pathname. Trivial in Posix, string.lower on Mac. *************** *** 410,411 **** --- 410,414 ---- return filename + + supports_unicode_filenames = False + From mhammond@users.sourceforge.net Tue Oct 8 03:44:33 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:33 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_pep277,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv11411/Lib/test/output Modified Files: test_pep277 Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: test_pep277 =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_pep277,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_pep277 3 Oct 2002 23:14:10 -0000 1.1 --- test_pep277 8 Oct 2002 02:44:30 -0000 1.2 *************** *** 1,4 **** test_pep277 ! u'F:\\src\\python-cvs\\Lib\\test\\@test\\Gr\xfc\xdf-\u66e8\u66e9\u66eb\\\xdf-\u66e8\u66e9\u66eb' ['???', '???', '??????', '????????????', '????G\xdf', 'Ge??-sa?', 'Gr\xfc\xdf-Gott', 'abc', 'ascii'] [u'Gr\xfc\xdf-Gott', u'abc', u'ascii', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb'] --- 1,4 ---- test_pep277 ! u'\xdf-\u66e8\u66e9\u66eb' ['???', '???', '??????', '????????????', '????G\xdf', 'Ge??-sa?', 'Gr\xfc\xdf-Gott', 'abc', 'ascii'] [u'Gr\xfc\xdf-Gott', u'abc', u'ascii', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb'] From mhammond@users.sourceforge.net Tue Oct 8 03:44:33 2002 From: mhammond@users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon, 07 Oct 2002 19:44:33 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.494,1.495 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv11411/Misc Modified Files: NEWS Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.494 retrieving revision 1.495 diff -C2 -d -r1.494 -r1.495 *** NEWS 7 Oct 2002 13:23:24 -0000 1.494 --- NEWS 8 Oct 2002 02:44:31 -0000 1.495 *************** *** 68,71 **** --- 68,73 ---- - Unicode file name processing for Windows (PEP 277) is implemented. + All platforms now have an os.path.supports_unicode_filenames attribute, + which is set to True on Windows NT/2000/XP, and False elsewhere. - Codec error handling callbacks (PEP 293) are implemented. *************** *** 193,196 **** --- 195,202 ---- reliably) are also interrupted (as generally happens on for Linux/Unix.) [SF bugs 231273, 439992 and 581232] + + - sys.getwindowsversion() has been added on Windows. This + returns a tuple with information about the version of Windows + currently running. - Slices and repetitions of buffer objects now consistently return From gvanrossum@users.sourceforge.net Tue Oct 8 15:49:41 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Tue, 08 Oct 2002 07:49:41 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.41,1.337.2.4.2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv16581 Modified Files: Tag: release22-maint NEWS Log Message: Fix typo. Prepare headers for 2.2.2 final release. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.41 retrieving revision 1.337.2.4.2.42 diff -C2 -d -r1.337.2.4.2.41 -r1.337.2.4.2.42 *** NEWS 7 Oct 2002 21:38:58 -0000 1.337.2.4.2.41 --- NEWS 8 Oct 2002 14:49:38 -0000 1.337.2.4.2.42 *************** *** 1,2 **** --- 1,6 ---- + What's New in Python 2.2.2 (final) ? + Release date: dd-Mmm-yyyy + ==================================== + What's New in Python 2.2.2b1? Release date: 7-Oct-2002 *************** *** 4,8 **** Almost everything in this release is a pure bugfix and is backported ! from a corresponding bugfix alrady applied to Python 2.3. While at the time of writing, Python 2.3 is still in pre-alpha form, only accessible via CVS, it receives continuous and extensive testing by --- 8,12 ---- Almost everything in this release is a pure bugfix and is backported ! from a corresponding bugfix already applied to Python 2.3. While at the time of writing, Python 2.3 is still in pre-alpha form, only accessible via CVS, it receives continuous and extensive testing by From gvanrossum@users.sourceforge.net Tue Oct 8 15:50:58 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Tue, 08 Oct 2002 07:50:58 -0700 Subject: [Python-checkins] python/dist/src/Python pystate.c,2.20.16.1,2.20.16.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv17188 Modified Files: Tag: release22-maint pystate.c Log Message: Initialize tick_counter to 0. Found by Neal Norwitz. Index: pystate.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v retrieving revision 2.20.16.1 retrieving revision 2.20.16.2 diff -C2 -d -r2.20.16.1 -r2.20.16.2 *** pystate.c 7 Oct 2002 09:47:21 -0000 2.20.16.1 --- pystate.c 8 Oct 2002 14:50:55 -0000 2.20.16.2 *************** *** 138,141 **** --- 138,142 ---- tstate->tracing = 0; tstate->use_tracing = 0; + tstate->tick_counter = 0; tstate->dict = NULL; From mwh@users.sourceforge.net Tue Oct 8 15:59:45 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Tue, 08 Oct 2002 07:59:45 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils sysconfig.py,1.44.6.1,1.44.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv20610/Lib/distutils Modified Files: Tag: release22-maint sysconfig.py Log Message: Put a do-nothing set_python_build() back. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.44.6.1 retrieving revision 1.44.6.2 diff -C2 -d -r1.44.6.1 -r1.44.6.2 *** sysconfig.py 7 Oct 2002 10:38:33 -0000 1.44.6.1 --- sysconfig.py 8 Oct 2002 14:59:43 -0000 1.44.6.2 *************** *** 39,42 **** --- 39,47 ---- del argv0_path, landmark + # set_python_build() was present in 2.2 and 2.2.1; it's not needed + # any more, but so 3rd party build scripts don't break, we leave + # a do-nothing version: + def set_python_build(): + pass def get_python_inc(plat_specific=0, prefix=None): From akuchling@users.sourceforge.net Tue Oct 8 18:00:44 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue, 08 Oct 2002 10:00:44 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.42,1.337.2.4.2.43 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv8790 Modified Files: Tag: release22-maint NEWS Log Message: Fix a few typos: an extra space; typo in filename; capitalization error in method name Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.42 retrieving revision 1.337.2.4.2.43 diff -C2 -d -r1.337.2.4.2.42 -r1.337.2.4.2.43 *** NEWS 8 Oct 2002 14:49:38 -0000 1.337.2.4.2.42 --- NEWS 8 Oct 2002 17:00:41 -0000 1.337.2.4.2.43 *************** *** 59,63 **** value. ! - The Unicode replace() method would do the wrong thing for a unicode subclass when there were zero string replacements. [SF bug 599128] --- 59,63 ---- value. ! - The Unicode replace() method would do the wrong thing for a unicode subclass when there were zero string replacements. [SF bug 599128] *************** *** 128,132 **** the persistent id code *before* calling save_global(). ! - In mmapmpdule.c: if the size passed to mmap() is larger than the length of the file on non-Windows platforms, a ValueError is raised. [SF bug 585792] --- 128,132 ---- the persistent id code *before* calling save_global(). ! - In mmapmodule.c: if the size passed to mmap() is larger than the length of the file on non-Windows platforms, a ValueError is raised. [SF bug 585792] *************** *** 156,160 **** invoked as a browser (on Unix) to make it more robust. ! - In pickle.py: Whichmodule() now skips dummy (None) package entries in sys.modules. Try the persistent id code *before* calling save_global(). --- 156,160 ---- invoked as a browser (on Unix) to make it more robust. ! - In pickle.py: whichmodule() now skips dummy (None) package entries in sys.modules. Try the persistent id code *before* calling save_global(). From fdrake@users.sourceforge.net Tue Oct 8 20:49:38 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 08 Oct 2002 12:49:38 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_sax,1.10,1.10.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv17520/Lib/test/output Modified Files: Tag: release22-maint test_sax Log Message: Fix some code that was added to the r22-maint branch to allow it to work with arbitrary versions of Expat. Not applicable to Python 2.3, which will incorporate an Expat that does not need this crutch. Index: test_sax =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_sax,v retrieving revision 1.10 retrieving revision 1.10.16.1 diff -C2 -d -r1.10 -r1.10.16.1 *** test_sax 7 Aug 2001 19:17:06 -0000 1.10 --- test_sax 8 Oct 2002 19:49:36 -0000 1.10.16.1 *************** *** 22,25 **** --- 22,28 ---- Passed test_expat_nsattrs_empty Passed test_expat_nsattrs_wattr + Passed test_expat_nsdecl_pair_diff + Passed test_expat_nsdecl_pair_same + Passed test_expat_nsdecl_single Passed test_filter_basic Passed test_make_parser *************** *** 37,39 **** Passed test_xmlgen_ns Passed test_xmlgen_pi ! 37 tests, 0 failures --- 40,42 ---- Passed test_xmlgen_ns Passed test_xmlgen_pi ! 40 tests, 0 failures From fdrake@users.sourceforge.net Tue Oct 8 20:49:38 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 08 Oct 2002 12:49:38 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_sax.py,1.19.8.1,1.19.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17520/Lib/test Modified Files: Tag: release22-maint test_sax.py Log Message: Fix some code that was added to the r22-maint branch to allow it to work with arbitrary versions of Expat. Not applicable to Python 2.3, which will incorporate an Expat that does not need this crutch. Index: test_sax.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sax.py,v retrieving revision 1.19.8.1 retrieving revision 1.19.8.2 diff -C2 -d -r1.19.8.1 -r1.19.8.2 *** test_sax.py 26 Sep 2002 15:24:41 -0000 1.19.8.1 --- test_sax.py 8 Oct 2002 19:49:35 -0000 1.19.8.2 *************** *** 349,352 **** --- 349,416 ---- attrs[(ns_uri, "attr")] == "val" + class ElemGatherer(ContentHandler): + def __init__(self): + self.events = [] + def startElementNS(self, pair, qname, attrs): + self.events.append(('start', pair, qname)) + def endElementNS(self, pair, qname): + self.events.append(('end', pair, qname)) + + def check_expat_nsdecl(text, expected): + parser = create_parser(1) + handler = ElemGatherer() + parser.setContentHandler(handler) + parser.feed(text) + parser.close() + if verbose and handler.events != expected: + from pprint import pprint + print "Expected:" + pprint(expected) + print "Received:" + pprint(handler.events) + return handler.events == expected + + def test_expat_nsdecl_single(): + return check_expat_nsdecl( + "", [ + ("start", ("http://xml.python.org/", "abc"), "abc"), + ("end", ("http://xml.python.org/", "abc"), "abc"), + ]) + + def test_expat_nsdecl_pair_same(): + # XXX This shows where xml.sax.expatreader can use the wrong + # prefix when more than one is in scope for a particular URI. + # We still want to exercise this code since previous versions got + # the namespace handling wrong in more severe ways (exceptions + # that should not have happened). + return check_expat_nsdecl( + "" + "" + "" + "", [ + ("start", ("http://xml.python.org/", "abc"), "foo:abc"), + ("start", ("http://xml.python.org/", "def"), "foo:def"), + ("end", ("http://xml.python.org/", "def"), "foo:def"), + ("start", ("http://xml.python.org/", "ghi"), "foo:ghi"), + ("end", ("http://xml.python.org/", "ghi"), "foo:ghi"), + ("end", ("http://xml.python.org/", "abc"), "foo:abc"), + ]) + + def test_expat_nsdecl_pair_diff(): + return check_expat_nsdecl( + "" + "" + "" + "", [ + ("start", ("http://xml.python.org/1", "abc"), "abc"), + ("start", ("http://xml.python.org/2", "def"), "foo:def"), + ("end", ("http://xml.python.org/2", "def"), "foo:def"), + ("start", ("http://xml.python.org/1", "ghi"), "ghi"), + ("end", ("http://xml.python.org/1", "ghi"), "ghi"), + ("end", ("http://xml.python.org/1", "abc"), "abc"), + ]) + # ===== InputSource support From fdrake@users.sourceforge.net Tue Oct 8 20:49:39 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 08 Oct 2002 12:49:39 -0700 Subject: [Python-checkins] python/dist/src/Lib/xml/sax expatreader.py,1.25.16.3,1.25.16.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv17520/Lib/xml/sax Modified Files: Tag: release22-maint expatreader.py Log Message: Fix some code that was added to the r22-maint branch to allow it to work with arbitrary versions of Expat. Not applicable to Python 2.3, which will incorporate an Expat that does not need this crutch. Index: expatreader.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/expatreader.py,v retrieving revision 1.25.16.3 retrieving revision 1.25.16.4 diff -C2 -d -r1.25.16.3 -r1.25.16.4 *** expatreader.py 26 Sep 2002 15:24:40 -0000 1.25.16.3 --- expatreader.py 8 Oct 2002 19:49:36 -0000 1.25.16.4 *************** *** 225,230 **** --- 225,236 ---- if len(pair) == 1: pair = (None, name) + qname = name else: pair = tuple(pair) + qname = pair[1] + if self._ns_stack: + prefix = self._ns_stack[-1][pair[0]][-1] + if prefix: + qname = "%s:%s" % (prefix, pair[1]) newattrs = {} *************** *** 234,248 **** if len(apair) == 1: apair = (None, aname) ! qname = aname else: apair = tuple(apair) # XXX need to guess the prefix prefix = self._ns_stack[-1][apair[0]][-1] ! qname = "%s:%s" % (prefix, apair[1]) newattrs[apair] = value ! qnames[apair] = qname ! self._cont_handler.startElementNS(pair, None, AttributesNSImpl(newattrs, qnames)) --- 240,254 ---- if len(apair) == 1: apair = (None, aname) ! aqname = aname else: apair = tuple(apair) # XXX need to guess the prefix prefix = self._ns_stack[-1][apair[0]][-1] ! aqname = "%s:%s" % (prefix, apair[1]) newattrs[apair] = value ! qnames[apair] = aqname ! self._cont_handler.startElementNS(pair, qname, AttributesNSImpl(newattrs, qnames)) *************** *** 251,258 **** if len(pair) == 1: pair = (None, name) else: pair = tuple(pair) ! self._cont_handler.endElementNS(pair, None) # this is not used (call directly to ContentHandler) --- 257,270 ---- if len(pair) == 1: pair = (None, name) + qname = name else: pair = tuple(pair) + qname = pair[1] + if self._ns_stack: + prefix = self._ns_stack[-1][pair[0]][-1] + if prefix: + qname = "%s:%s" % (prefix, pair[1]) ! self._cont_handler.endElementNS(pair, qname) # this is not used (call directly to ContentHandler) *************** *** 266,274 **** def start_namespace_decl(self, prefix, uri): if self._ns_stack: ! d = self._ns_stack.copy() if d.has_key(uri): L = d[uri][:] d[uri] = L L.append(prefix) else: d = {uri: [prefix]} --- 278,288 ---- def start_namespace_decl(self, prefix, uri): if self._ns_stack: ! d = self._ns_stack[-1].copy() if d.has_key(uri): L = d[uri][:] d[uri] = L L.append(prefix) + else: + d[uri] = [prefix] else: d = {uri: [prefix]} From tim_one@users.sourceforge.net Tue Oct 8 22:01:11 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Tue, 08 Oct 2002 14:01:11 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_b1.py,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15803/python/Lib/test Modified Files: test_b1.py Log Message: The list(xrange(sys.maxint / 4)) test. Changed 4 to 2. The belief is that this test intended to trigger a bit of code in listobject.c's NRESIZE macro that's looking for arithmetic overflow. As written, it doesn't achieve that, though, and leaves it up to the platform realloc() as to whether it wants to allocate 2 gigabytes. Some platforms say "sure!", although they don't appear to mean it, and disaster ensues. Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow test instead, leaving the platform realloc() out of it. I'll backport this to the 2.2 branch next. Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** test_b1.py 11 Sep 2002 18:32:30 -0000 1.54 --- test_b1.py 8 Oct 2002 21:01:07 -0000 1.55 *************** *** 550,554 **** # http://sources.redhat.com/ml/newlib/2002/msg00369.html ! list(xrange(sys.maxint / 4)) except MemoryError: pass --- 550,554 ---- # http://sources.redhat.com/ml/newlib/2002/msg00369.html ! list(xrange(sys.maxint // 2)) except MemoryError: pass From tim_one@users.sourceforge.net Tue Oct 8 22:03:29 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Tue, 08 Oct 2002 14:03:29 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_b1.py,1.42.4.4,1.42.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18070/22/Lib/test Modified Files: Tag: release22-maint test_b1.py Log Message: The list(xrange(sys.maxint / 4)) test. Changed 4 to 2. The belief is that this test intended to trigger a bit of code in listobject.c's NRESIZE macro that's looking for arithmetic overflow. As written, it doesn't achieve that, though, and leaves it up to the platform realloc() as to whether it wants to allocate 2 gigabytes. Some platforms say "sure!", although they don't appear to mean it, and disaster ensues. Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow test instead, leaving the platform realloc() out of it. Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.42.4.4 retrieving revision 1.42.4.5 diff -C2 -d -r1.42.4.4 -r1.42.4.5 *** test_b1.py 23 Sep 2002 20:59:28 -0000 1.42.4.4 --- test_b1.py 8 Oct 2002 21:03:26 -0000 1.42.4.5 *************** *** 516,520 **** # http://sources.redhat.com/ml/newlib/2002/msg00369.html ! list(xrange(sys.maxint / 4)) except MemoryError: pass --- 516,520 ---- # http://sources.redhat.com/ml/newlib/2002/msg00369.html ! list(xrange(sys.maxint // 2)) except MemoryError: pass From tim_one@users.sourceforge.net Wed Oct 9 02:07:13 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Tue, 08 Oct 2002 18:07:13 -0700 Subject: [Python-checkins] python/dist/src/Lib/test regrtest.py,1.99,1.100 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26707/python/Lib/test Modified Files: regrtest.py Log Message: Logic for determining whether skipping test_pep277 is expected: whether ths "should be" skipped depends on os.path.supports_unicode_filenames, not really on the platform. Fiddled the expected-skip constructor appropriately. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** regrtest.py 6 Oct 2002 20:36:31 -0000 1.99 --- regrtest.py 9 Oct 2002 01:07:11 -0000 1.100 *************** *** 496,499 **** --- 496,504 ---- # Map sys.platform to a string containing the basenames of tests # expected to be skipped on that platform. + # + # Special cases: + # test_pep277 + # The _ExpectedSkips constructor adds this to the set of expected + # skips if not os.path.supports_unicode_filenames. _expectations = { *************** *** 544,548 **** test_nis test_ntpath - test_pep277 test_socket_ssl test_socketserver --- 549,552 ---- *************** *** 820,827 **** --- 824,834 ---- class _ExpectedSkips: def __init__(self): + import os.path self.valid = False if sys.platform in _expectations: s = _expectations[sys.platform] self.expected = Set(s.split()) + if not os.path.supports_unicode_filenames: + self.expected.add('test_pep277') self.valid = True From rhettinger@users.sourceforge.net Wed Oct 9 04:53:13 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 08 Oct 2002 20:53:13 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.43,1.337.2.4.2.44 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv13290 Modified Files: Tag: release22-maint NEWS Log Message: List specific updates for IDLE. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.43 retrieving revision 1.337.2.4.2.44 diff -C2 -d -r1.337.2.4.2.43 -r1.337.2.4.2.44 *** NEWS 8 Oct 2002 17:00:41 -0000 1.337.2.4.2.43 --- NEWS 9 Oct 2002 03:53:10 -0000 1.337.2.4.2.44 *************** *** 340,343 **** --- 340,350 ---- - Most changes to IDLE were backported, including some featurettes. + Open module can now handle hierarchical names for packages (such + as xml.dom.minidom). On Windows, Edit SelectAll is now called + with Control-A rather than Alt-A. The Edit Menu only offers + module options (like import module, check module, or run script) + in a module window. Those options no longer appear in the shell + window where they did not have meaningful application and was + confusing new users. From tim_one@users.sourceforge.net Wed Oct 9 08:56:07 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Wed, 09 Oct 2002 00:56:07 -0700 Subject: [Python-checkins] python/dist/src/Lib ntpath.py,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28728/python/Lib Modified Files: ntpath.py Log Message: Don't try to access sys.getwindowsversion unless it exists (ntpath is imported on systems other than Windows, and in particular is imported by test___all__; the compile farm reported that all Linux tests failed due to this; isn't anyone in PythonDevLand running CVS on Linux?!). Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ntpath.py 8 Oct 2002 02:44:30 -0000 1.50 --- ntpath.py 9 Oct 2002 07:56:04 -0000 1.51 *************** *** 480,482 **** realpath = abspath # Win9x family and earlier have no Unicode filename support. ! supports_unicode_filenames = sys.getwindowsversion()[3] >= 2 --- 480,483 ---- realpath = abspath # Win9x family and earlier have no Unicode filename support. ! supports_unicode_filenames = (hasattr(sys, "getwindowsversion") and ! sys.getwindowsversion()[3] >= 2) From akuchling@users.sourceforge.net Wed Oct 9 13:11:13 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed, 09 Oct 2002 05:11:13 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv5278 Modified Files: whatsnew23.tex Log Message: Minor edits and markup fixes Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** whatsnew23.tex 7 Oct 2002 19:01:07 -0000 1.55 --- whatsnew23.tex 9 Oct 2002 12:11:10 -0000 1.56 *************** *** 317,338 **** On Windows NT, 2000, and XP, the system stores file names as Unicode ! strings. Traditionally, Python has represented file names are byte ! strings, which is inadequate since it renders some file names inaccessible. ! Python allows now to use arbitrary Unicode strings (within limitations ! of the file system) for all functions that expect file names, in ! particular \function{open}. If a Unicode string is passed to ! \function{os.listdir}, Python returns now a list of Unicode strings. ! A new function \function{getcwdu} returns the current directory as a ! Unicode string. ! Byte strings continue to work as file names, the system will ! transparently convert them to Unicode using the \code{mbcs} encoding. ! Other systems allow Unicode strings as file names as well, but convert ! them to byte strings before passing them to the system, which may ! cause UnicodeErrors. Applications can test whether arbitrary Unicode ! strings are supported as file names with \code{os.path.unicode_file_names}. \begin{seealso} --- 317,339 ---- On Windows NT, 2000, and XP, the system stores file names as Unicode ! strings. Traditionally, Python has represented file names as byte ! strings, which is inadequate because it renders some file names inaccessible. ! Python now allows using arbitrary Unicode strings (within the ! limitations of the file system) for all functions that expect file ! names, in particular the \function{open()} built-in. If a Unicode ! string is passed to \function{os.listdir}, Python now returns a list ! of Unicode strings. A new function, \function{os.getcwdu()}, returns ! the current directory as a Unicode string. ! Byte strings still work as file names, and Python will transparently ! convert them to Unicode using the \code{mbcs} encoding. ! Other systems also allow Unicode strings as file names, but convert ! them to byte strings before passing them to the system which may cause ! a \exception{UnicodeError} to be raised. Applications can test whether ! arbitrary Unicode strings are supported as file names by checking ! \member{os.path.unicode_file_names}, a Boolean value. \begin{seealso} *************** *** 494,515 **** When encoding a Unicode string into a byte string, unencodable ! characters may be encountered. So far, Python allowed to specify the ! error processing as either ``strict'' (raise \code{UnicodeError}, ! default), ``ignore'' (skip the character), or ``replace'' (with ! question mark). It may be desirable to specify an alternative ! processing of the error, e.g. by inserting an XML character reference ! or HTML entity reference into the converted string. Python now has a flexible framework to add additional processing ! strategies; new error handlers can be added with \function{codecs.register_error}. Codecs then can access the error ! handler with \code{codecs.lookup_error}. An equivalent C API has been ! added for codecs written in C. The error handler gets various state ! information, such as the string being converted, the position in the ! string where the error was detected, and the target encoding. It can ! then either raise an exception, or return a replacement string. Two additional error handlers have been implemented using this ! framework: ``backslashreplace'' using Python backslash quoting to represent the unencodable character, and ``xmlcharrefreplace'' emits XML character references. --- 495,518 ---- When encoding a Unicode string into a byte string, unencodable ! characters may be encountered. So far, Python has allowed specifying ! the error processing as either ``strict'' (raising ! \exception{UnicodeError}), ``ignore'' (skip the character), or ! ``replace'' (with question mark), defaulting to ``strict''. It may be ! desirable to specify an alternative processing of the error, e.g. by ! inserting an XML character reference or HTML entity reference into the ! converted string. Python now has a flexible framework to add additional processing ! strategies. New error handlers can be added with \function{codecs.register_error}. Codecs then can access the error ! handler with \function{codecs.lookup_error}. An equivalent C API has ! been added for codecs written in C. The error handler gets the ! necessary state information, such as the string being converted, the ! position in the string where the error was detected, and the target ! encoding. The handler can then either raise an exception, or return a ! replacement string. Two additional error handlers have been implemented using this ! framework: ``backslashreplace'' uses Python backslash quoting to represent the unencodable character, and ``xmlcharrefreplace'' emits XML character references. *************** *** 518,522 **** \seepep{293}{Codec Error Handling Callbacks}{Written and implemented by ! Walter Dörwald.} \end{seealso} --- 521,525 ---- \seepep{293}{Codec Error Handling Callbacks}{Written and implemented by ! Walter D\"orwald.} \end{seealso} From gvanrossum@users.sourceforge.net Wed Oct 9 17:37:06 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 09:37:06 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.206,1.207 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv29017 Modified Files: ACKS Log Message: Add a few people who were in the ACKS file in the 2.2.2 branch but not on the trunk. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** ACKS 30 Sep 2002 16:23:15 -0000 1.206 --- ACKS 9 Oct 2002 16:37:03 -0000 1.207 *************** *** 257,260 **** --- 257,261 ---- Bill Janssen Drew Jenkins + Flemming Kjær Jensen Jiba Orjan Johansen *************** *** 303,306 **** --- 304,308 ---- William Lewis Robert van Liere + Martin Ligr Christopher Lindblad Eric Lindvall *************** *** 389,392 **** --- 391,395 ---- Eduardo Pérez Fernando Pérez + Mark Perrego Tim Peters Chris Petrilli *************** *** 548,551 **** --- 551,555 ---- Frank Willison Greg V. Wilson + Jody Winston Dik Winter Blake Winton From gvanrossum@users.sourceforge.net Wed Oct 9 17:38:20 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 09:38:20 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.149.4.11,1.149.4.12 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv29674 Modified Files: Tag: release22-maint ACKS Log Message: Make this file identical to the version on the trunk. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.149.4.11 retrieving revision 1.149.4.12 diff -C2 -d -r1.149.4.11 -r1.149.4.12 *** ACKS 23 Sep 2002 21:04:09 -0000 1.149.4.11 --- ACKS 9 Oct 2002 16:38:18 -0000 1.149.4.12 *************** *** 22,30 **** --- 22,35 ---- Jason Asbahr David Ascher + Peter Åstrand + John Aycock Donovan Baarda + Attila Babo Alfonso Baciero Stig Bakken Greg Ball Luigi Ballabio + Michael J. Barber + Chris Barker Cesar Eduardo Barros Des Barry *************** *** 36,43 **** --- 41,50 ---- David Beazley Neal Becker + Bill Bedford Reimer Behrends Thomas Bellman Juan M. Bello Rivas Andy Bensky + Michel Van den Bergh Eric Beser Stephen Bevan *************** *** 45,49 **** --- 52,58 ---- Dominic Binks Roy Bixler + Martin Bless Pablo Bleyer + Erik van Blokland Finn Bock Paul Boddie *************** *** 56,60 **** --- 65,71 ---- Terrence Brannon Dave Brennan + Tom Bridgman Gary S. Brown + Daniel Brotsky Oleg Broytmann Dave Brueck *************** *** 71,78 **** --- 82,91 ---- Ralph Butler Daniel Calvelo + Brett Cannon Mike Carlton Luke Kenneth Casson Leighton Donn Cave Per Cederqvist + Octavian Cerna Jeffrey Chang Brad Chapman *************** *** 87,90 **** --- 100,104 ---- David Cinege Mike Clarkson + Brad Clements Steve Clift Josh Cogliati *************** *** 99,102 **** --- 113,118 ---- Steve Cousins Alex Coventry + Matthew Dixon Cowles + Christopher A. Craig Laura Creighton Drew Csillag *************** *** 106,109 **** --- 122,126 ---- Lars Damerow Eric Daniel + Ben Darnell Jonathan Dasteel John DeGood *************** *** 113,116 **** --- 130,135 ---- Walter Dörwald Jaromir Dolecek + Cesar Douady + Dean Draayer Fred L. Drake, Jr. John DuBois *************** *** 139,146 **** --- 158,169 ---- Martijn Faassen Andreas Faerber + Bill Fancher Mark Favas Niels Ferguson Sebastian Fernandez + Vincent Fiack + Russell Finn Nils Fischbeck + Hernán Martínez Foffani Doug Fort Robin Friedrich *************** *** 152,161 **** --- 175,188 ---- Lele Gaifax Raymund Galvin + Nitin Ganatra Fred Gansevles Lars Marius Garshol Harry Henry Gebel Thomas Gellekum + Christos Georgiou Ben Gertzfield + Dinu Gherman Jonathan Giddy + Michael Gilfix Chris Gonnerman David Goodger *************** *** 193,196 **** --- 220,224 ---- Bernhard Herzog Magnus L. Hetland + Raymond Hettinger Kevan Heydon Jason Hildebrand *************** *** 202,205 **** --- 230,234 ---- Chris Hoffman Albert Hofkamp + Jonathan Hogg Gerrit Holl Philip Homburg *************** *** 218,221 **** --- 247,251 ---- Greg Humphreys Jeremy Hylton + Tony Ingraldi John Interrante Ben Jackson *************** *** 223,240 **** --- 253,276 ---- David Jacobs Kevin Jacobs + Geert Jansen Jack Jansen Bill Janssen Drew Jenkins Flemming Kjær Jensen + Jiba Orjan Johansen Simon Johnston Richard Jones Lucas de Jonge + Jens B. Jorgensen John Jorgensen Andreas Jung + Tattoo Mabonzo K. Bob Kahn Tamito Kajiyama + Jacob Kaplan-Moss Lou Kates Randall Kern + Robert Kern Magnus Kessler Lawrence Kesteloot *************** *** 244,247 **** --- 280,284 ---- Ron Klatchko Bastian Kleineidam + Bob Kline Matthias Klose Kim Knapp *************** *** 251,254 **** --- 288,292 ---- Joseph Koshy Bob Kras + Holger Krekel Hannu Krosing Andrew Kuchling *************** *** 261,264 **** --- 299,303 ---- Christopher Lee Inyeol Lee + Luc Lefebvre Kip Lehman Marc-Andre Lemburg *************** *** 273,276 **** --- 312,316 ---- Martin von Löwis Anne Lord + Tom Loredo Jason Lowe Tony Lownds *************** *** 281,286 **** Jim Lynch Mikael Lyngvig ! Nick Maclaren Tim MacKenzie Steve Majewski Grzegorz Makarewicz --- 321,327 ---- Jim Lynch Mikael Lyngvig ! Andrew I MacIntyre Tim MacKenzie + Nick Maclaren Steve Majewski Grzegorz Makarewicz *************** *** 310,313 **** --- 351,355 ---- The Dragon De Monsyne Skip Montanaro + James A Morrison Sape Mullender Sjoerd Mullender *************** *** 324,344 **** Bill Noon Stefan Norberg Joe Norton Neal Norwitz Jeffrey Ollie Nigel O'Brian Tim O'Malley Denis S. Otkidach Piet van Oostrum Jason Orendorff Douglas Orr Todd R. Palmer Dan Parisien Harri Pasanen Randy Pausch ! Mark Perrego Marcel van der Peijl Samuele Pedroni Steven Pemberton Tim Peters Chris Petrilli --- 366,395 ---- Bill Noon Stefan Norberg + Tim Northover Joe Norton Neal Norwitz Jeffrey Ollie Nigel O'Brian + Kevin O'Connor Tim O'Malley + Pascal Oberndoerfer Denis S. Otkidach Piet van Oostrum Jason Orendorff Douglas Orr + Russel Owen Todd R. Palmer + Alexandre Parenteau Dan Parisien Harri Pasanen Randy Pausch ! Ondrej Palkovsky ! M. Papillon Marcel van der Peijl Samuele Pedroni Steven Pemberton + Eduardo Pérez + Fernando Pérez + Mark Perrego Tim Peters Chris Petrilli *************** *** 348,351 **** --- 399,403 ---- Neale Pickett Dan Pierson + Martijn Pieters François Pinard Michael Piotrowski *************** *** 354,357 **** --- 406,410 ---- Paul Prescod Donovan Preston + Steve Purcell Brian Quinlan Anders Qvist *************** *** 368,371 **** --- 421,425 ---- Steven Reiz Roeland Rengelink + Tim Rice Jan Pieter Riegel Armin Rigo *************** *** 415,422 **** --- 469,478 ---- Eric Siegerman Paul Sijben + Kirill Simonov Nathan Paul Simons Janne Sinkkonen George Sipe Kragen Sitaker + Christopher Smith Gregory P. Smith Rafal Smotrzyk *************** *** 426,433 **** --- 482,492 ---- Per Spilling Noah Spurrier + Oliver Steele Greg Stein + Chris Stern Dan Stromberg Nathan Sullivan Mark Summerfield + Hisao Suzuki Kalle Svensson Hajime Saitou *************** *** 448,453 **** --- 507,514 ---- Eric Tiedemann Tracy Tims + Oren Tirosh Jason Tishler Christian Tismer + Frank J. Tobin R Lindsay Todd Bennett Todd *************** *** 462,465 **** --- 523,527 ---- Jaap Vermeulen Al Vezza + Jacques A. Vidrine John Viega Kannan Vijayan *************** *** 476,479 **** --- 538,543 ---- Bob Watson Henrik Weber + Corran Webster + Zack Weinberg Edward Welbourne Rickard Westman *************** *** 481,484 **** --- 545,551 ---- Truida Wiedijk Gerry Wiener + Bryce "Zooko" Wilcox-O'Hearn + Gerald S. Williams + John Williams Sue Williams Frank Willison *************** *** 493,496 **** --- 560,564 ---- Dan Wolfe Richard Wolff + Gordon Worley Thomas Wouters Doug Wyatt *************** *** 499,502 **** --- 567,571 ---- Masazumi Yoshikawa Danny Yoo + Bernard Yue Moshe Zadka Milan Zamazal From loewis@users.sourceforge.net Wed Oct 9 18:23:32 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 09 Oct 2002 10:23:32 -0700 Subject: [Python-checkins] python/dist/src/Lib os.py,1.62,1.63 dospath.py,1.30,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24338 Modified Files: os.py Removed Files: dospath.py Log Message: Remove more DOS support. Index: os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** os.py 7 Sep 2002 04:48:03 -0000 1.62 --- os.py 9 Oct 2002 17:23:29 -0000 1.63 *************** *** 2,8 **** This exports: ! - all functions from posix, nt, dos, os2, mac, or ce, e.g. unlink, stat, etc. ! - os.path is one of the modules posixpath, ntpath, macpath, or dospath ! - os.name is 'posix', 'nt', 'dos', 'os2', 'mac', 'ce' or 'riscos' - os.curdir is a string representing the current directory ('.' or ':') - os.pardir is a string representing the parent directory ('..' or '::') --- 2,8 ---- This exports: ! - all functions from posix, nt, os2, mac, or ce, e.g. unlink, stat, etc. ! - os.path is one of the modules posixpath, ntpath, or macpath ! - os.name is 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos' - os.curdir is a string representing the current directory ('.' or ':') - os.pardir is a string representing the parent directory ('..' or '::') *************** *** 75,96 **** del nt - elif 'dos' in _names: - name = 'dos' - linesep = '\r\n' - curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';' - defpath = '.;C:\\bin' - from dos import * - try: - from dos import _exit - except ImportError: - pass - import dospath - path = dospath - del dospath - - import dos - __all__.extend(_get_exports_list(dos)) - del dos - elif 'os2' in _names: name = 'os2' --- 75,78 ---- *************** *** 366,373 **** # Fake unsetenv() for Windows ! # not sure about os2 and dos here but # I'm guessing they are the same. ! if name in ('os2', 'nt', 'dos'): def unsetenv(key): putenv(key, "") --- 348,355 ---- # Fake unsetenv() for Windows ! # not sure about os2 here but # I'm guessing they are the same. ! if name in ('os2', 'nt'): def unsetenv(key): putenv(key, "") *************** *** 376,380 **** # On RISC OS, all env access goes through getenv and putenv from riscosenviron import _Environ ! elif name in ('os2', 'nt', 'dos'): # Where Env Var Names Must Be UPPERCASE # But we store them as upper case class _Environ(UserDict.IterableUserDict): --- 358,362 ---- # On RISC OS, all env access goes through getenv and putenv from riscosenviron import _Environ ! elif name in ('os2', 'nt'): # Where Env Var Names Must Be UPPERCASE # But we store them as upper case class _Environ(UserDict.IterableUserDict): --- dospath.py DELETED --- From gvanrossum@users.sourceforge.net Wed Oct 9 19:17:08 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 11:17:08 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test___all__.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17662 Modified Files: test___all__.py Log Message: Add special consideration for rlcompleter. As a side effect of initializing GNU readline, setlocale(LC_CTYPE, "") is called, which changes the macros to use the "default" locale (which isn't the *initial* locale -- the initial locale is the "C" locale in which only ASCII characters are printable). When the default locale is e.g. Latin-1, the repr() of string objects can include 8-bit characters with the high bit set; I believe this is due to the recent PRINT_MULTIBYTE_STRING changes to stringobject.c. This in turn screws up test_pyexpat and test_rotor, which depend on the repr() of 8-bit strings with high bit characters. The solution (for now) is to force the LC_CTYPE locale to "C" after importing rlcompleter. This is the locale required by the test suite anyway. Index: test___all__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** test___all__.py 30 Jul 2002 23:26:00 -0000 1.27 --- test___all__.py 9 Oct 2002 18:17:06 -0000 1.28 *************** *** 133,137 **** check_all("rexec") check_all("rfc822") - check_all("rlcompleter") check_all("robotparser") check_all("sched") --- 133,136 ---- *************** *** 162,163 **** --- 161,174 ---- check_all("xdrlib") check_all("zipfile") + + # rlcompleter needs special consideration; it import readline which + # initializes GNU readline which calls setlocale(LC_CTYPE, "")... :-( + try: + check_all("rlcompleter") + finally: + try: + import locale + except ImportError: + pass + else: + locale.setlocale(locale.LC_CTYPE, 'C') From gvanrossum@users.sourceforge.net Wed Oct 9 20:07:56 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 12:07:56 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.191,2.192 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv9782 Modified Files: stringobject.c Log Message: The string formatting code has a test to switch to Unicode when %s sees a Unicode argument. Unfortunately this test was also executed for %r, because %s and %r share almost all of their code. This meant that, if u is a unicode object while repr(u) is an 8-bit string containing ASCII characters, '%r' % u is a *unicode* string containing only ASCII characters! Fixed by executing the test only for %s. Also fixed an error message -- %s argument has non-string str() doesn't make sense for %r, so the error message now differentiates between %s and %r. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.191 retrieving revision 2.192 diff -C2 -d -r2.191 -r2.192 *** stringobject.c 7 Oct 2002 18:26:16 -0000 2.191 --- stringobject.c 9 Oct 2002 19:07:53 -0000 2.192 *************** *** 3859,3863 **** break; case 's': - case 'r': #ifdef Py_USING_UNICODE if (PyUnicode_Check(v)) { --- 3859,3862 ---- *************** *** 3867,3870 **** --- 3866,3871 ---- } #endif + /* Fall through */ + case 'r': if (c == 's') temp = PyObject_Str(v); *************** *** 3875,3879 **** if (!PyString_Check(temp)) { PyErr_SetString(PyExc_TypeError, ! "%s argument has non-string str()"); Py_DECREF(temp); goto error; --- 3876,3882 ---- if (!PyString_Check(temp)) { PyErr_SetString(PyExc_TypeError, ! c == 's' ? ! "%s argument has non-string str()" : ! "%r argument has non-string repr()"); Py_DECREF(temp); goto error; From gvanrossum@users.sourceforge.net Wed Oct 9 20:14:33 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 12:14:33 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.192,2.193 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13463 Modified Files: stringobject.c Log Message: Undo this part of the previous checkin: Also fixed an error message -- %s argument has non-string str() doesn't make sense for %r, so the error message now differentiates between %s and %r. because PyObject_Repr() and PyObject_Str() ensure that this can never happen. Added a helpful comment instead. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.192 retrieving revision 2.193 diff -C2 -d -r2.192 -r2.193 *** stringobject.c 9 Oct 2002 19:07:53 -0000 2.192 --- stringobject.c 9 Oct 2002 19:14:30 -0000 2.193 *************** *** 3875,3882 **** goto error; if (!PyString_Check(temp)) { PyErr_SetString(PyExc_TypeError, ! c == 's' ? ! "%s argument has non-string str()" : ! "%r argument has non-string repr()"); Py_DECREF(temp); goto error; --- 3875,3883 ---- goto error; if (!PyString_Check(temp)) { + /* XXX Note: this should never happen, + since PyObject_Repr() and + PyObject_Str() assure this */ PyErr_SetString(PyExc_TypeError, ! "%s argument has non-string str()"); Py_DECREF(temp); goto error; From gvanrossum@users.sourceforge.net Wed Oct 9 22:27:35 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 14:27:35 -0700 Subject: [Python-checkins] python/dist/src/Modules readline.c,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11102 Modified Files: readline.c Log Message: GNU readline() mistakenly sets the LC_CTYPE locale. This is evil. Only the user or the app's main() should do this! We must save and restore the locale around the rl_initialize() call. Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** readline.c 2 Aug 2002 02:27:13 -0000 2.52 --- readline.c 9 Oct 2002 21:27:33 -0000 2.53 *************** *** 13,16 **** --- 13,25 ---- #include + #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) + /* GNU readline() mistakenly sets the LC_CTYPE locale. + * This is evil. Only the user or the app's main() should do this! + * We must save and restore the locale around the rl_initialize() call. + */ + #define SAVE_LOCALE + #include + #endif + /* GNU readline definitions */ #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ *************** *** 539,542 **** --- 548,555 ---- setup_readline(void) { + #ifdef SAVE_LOCALE + char *saved_locale = setlocale(LC_CTYPE, NULL); + #endif + using_history(); *************** *** 572,575 **** --- 585,592 ---- */ rl_initialize(); + + #ifdef SAVE_LOCALE + setlocale(LC_CTYPE, saved_locale); /* Restore locale */ + #endif } From montanaro@users.sourceforge.net Wed Oct 9 22:37:21 2002 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed, 09 Oct 2002 14:37:21 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils unixccompiler.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv14334 Modified Files: unixccompiler.py Log Message: MacOSX linker doesn't understand -R flag at all, no matter how you feed it the flag. Punt and return a -L flag instead (returning "" gums up the command to be forked). Index: unixccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** unixccompiler.py 9 Sep 2002 12:16:58 -0000 1.47 --- unixccompiler.py 9 Oct 2002 21:37:18 -0000 1.48 *************** *** 197,201 **** # we use this hack. compiler = os.path.basename(sysconfig.get_config_var("CC")) ! if compiler == "gcc" or compiler == "g++": return "-Wl,-R" + dir else: --- 197,204 ---- # we use this hack. compiler = os.path.basename(sysconfig.get_config_var("CC")) ! if sys.platform[:6] == "darwin": ! # MacOSX's linker doesn't understand the -R flag at all ! return "-L" + dir ! elif compiler == "gcc" or compiler == "g++": return "-Wl,-R" + dir else: From gvanrossum@users.sourceforge.net Wed Oct 9 22:40:50 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 09 Oct 2002 14:40:50 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.495,1.496 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv16944 Modified Files: NEWS Log Message: News about repr() and 8-bit characters, and setlocale() in the readline module. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.495 retrieving revision 1.496 diff -C2 -d -r1.495 -r1.496 *** NEWS 8 Oct 2002 02:44:31 -0000 1.495 --- NEWS 9 Oct 2002 21:40:48 -0000 1.496 *************** *** 67,70 **** --- 67,76 ---- ----------------- + - The repr() function for 8-bit strings now preserves all characters + that are considered printable in the current locale. (Previously, + all bytes that are not printable ASCII would be encoded in hex.) + This requires the user to set the current locale; in the initial "C" + locale the old behavior is maintained. [SF patch 479898] + - Unicode file name processing for Windows (PEP 277) is implemented. All platforms now have an os.path.supports_unicode_filenames attribute, *************** *** 348,351 **** --- 354,368 ---- Library ------- + + - Importing the readline module now no longer has the side effect of + calling setlocale(LC_CTYPE, ""). The initial "C" locale, or + whatever locale is explicitly set by the user, is preserved. If you + want repr() of 8-bit strings in your preferred encoding to preserve + all printable characters of that encoding, you have to add the + following code to your $PYTHONSTARTUP file or to your application's + main(): + + import locale + locale.setlocale(locale.LC_CTYPE, "") - shutil.move was added. shutil.copytree now reports errors as an From fdrake@users.sourceforge.net Wed Oct 9 23:33:26 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 09 Oct 2002 15:33:26 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib librfc822.tex,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv4374 Modified Files: librfc822.tex Log Message: Accept Armin's documentation patch for SF bug #558179. Adjusted some markup to make the descriptions more consistent. Index: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** librfc822.tex 25 Sep 2002 22:13:27 -0000 1.42 --- librfc822.tex 9 Oct 2002 22:33:23 -0000 1.43 *************** *** 256,265 **** \code{\var{m}.getheader(name)} but raises \exception{KeyError} if there is no matching header; and \code{len(\var{m})}, ! \code{\var{m}.get(name\optional{, deafult})}, ! \code{\var{m}.has_key(name)}, \code{\var{m}.keys()}, \code{\var{m}.values()} \code{\var{m}.items()}, and ! \code{\var{m}.setdefault(name\optional{, default})} act as expected, ! with the one difference that \method{get()} and \method{setdefault()} ! use an empty string as the default value. \class{Message} instances also support the mapping writable interface \code{\var{m}[name] = value} and \code{del \var{m}[name]}. \class{Message} objects do not --- 256,265 ---- \code{\var{m}.getheader(name)} but raises \exception{KeyError} if there is no matching header; and \code{len(\var{m})}, ! \code{\var{m}.get(\var{name}\optional{\var{, default}})}, ! \code{\var{m}.has_key(\var{name})}, \code{\var{m}.keys()}, \code{\var{m}.values()} \code{\var{m}.items()}, and ! \code{\var{m}.setdefault(\var{name}\optional{\var{, default}})} act as ! expected, with the one difference that \method{setdefault()} uses ! an empty string as the default value. \class{Message} instances also support the mapping writable interface \code{\var{m}[name] = value} and \code{del \var{m}[name]}. \class{Message} objects do not From fdrake@users.sourceforge.net Wed Oct 9 23:34:42 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 09 Oct 2002 15:34:42 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib librfc822.tex,1.38.14.3,1.38.14.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv4832 Modified Files: Tag: release22-maint librfc822.tex Log Message: Accept Armin's documentation patch for SF bug #558179. Adjusted some markup to make the descriptions more consistent. Index: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.38.14.3 retrieving revision 1.38.14.4 diff -C2 -d -r1.38.14.3 -r1.38.14.4 *** librfc822.tex 6 Oct 2002 02:38:46 -0000 1.38.14.3 --- librfc822.tex 9 Oct 2002 22:34:39 -0000 1.38.14.4 *************** *** 256,265 **** \code{\var{m}.getheader(name)} but raises \exception{KeyError} if there is no matching header; and \code{len(\var{m})}, ! \code{\var{m}.get(name\optional{, deafult})}, ! \code{\var{m}.has_key(name)}, \code{\var{m}.keys()}, \code{\var{m}.values()} \code{\var{m}.items()}, and ! \code{\var{m}.setdefault(name\optional{, default})} act as expected, ! with the one difference that \method{get()} and \method{setdefault()} ! use an empty string as the default value. \class{Message} instances also support the mapping writable interface \code{\var{m}[name] = value} and \code{del \var{m}[name]}. \class{Message} objects do not --- 256,265 ---- \code{\var{m}.getheader(name)} but raises \exception{KeyError} if there is no matching header; and \code{len(\var{m})}, ! \code{\var{m}.get(\var{name}\optional{\var{, default}})}, ! \code{\var{m}.has_key(\var{name})}, \code{\var{m}.keys()}, \code{\var{m}.values()} \code{\var{m}.items()}, and ! \code{\var{m}.setdefault(\var{name}\optional{\var{, default}})} act as ! expected, with the one difference that \method{setdefault()} uses ! an empty string as the default value. \class{Message} instances also support the mapping writable interface \code{\var{m}[name] = value} and \code{del \var{m}[name]}. \class{Message} objects do not From nnorwitz@users.sourceforge.net Thu Oct 10 00:17:07 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Wed, 09 Oct 2002 16:17:07 -0700 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20310/Lib Modified Files: urllib2.py Log Message: SF #614596, fix for urllib2.AbstractBasicAuthHandler, John Williams (johnw42) Make the regex case insensitive for some web sites which use Realm. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** urllib2.py 13 Aug 2002 13:59:55 -0000 1.34 --- urllib2.py 9 Oct 2002 23:17:04 -0000 1.35 *************** *** 573,577 **** class AbstractBasicAuthHandler: ! rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"') # XXX there can actually be multiple auth-schemes in a --- 573,577 ---- class AbstractBasicAuthHandler: ! rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I) # XXX there can actually be multiple auth-schemes in a From barry@users.sourceforge.net Thu Oct 10 01:59:19 2002 From: barry@users.sourceforge.net (barry@users.sourceforge.net) Date: Wed, 09 Oct 2002 17:59:19 -0700 Subject: [Python-checkins] python/dist/src setup.py,1.73.4.10,1.73.4.11 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv21122 Modified Files: Tag: release22-maint setup.py Log Message: detect_modules(): Be more conservative about adding runtime_library_dirs (i.e. -R flags) when building the _socket.so module. Whitelist only the platforms we know need the flags, which are only sunos (aka Solaris) platforms at the moment. Tested on RH7.3, OSX 10.2, and Solaris 8. Forward port candidate for Python 2.3. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.73.4.10 retrieving revision 1.73.4.11 diff -C2 -d -r1.73.4.10 -r1.73.4.11 *** setup.py 7 Oct 2002 10:38:33 -0000 1.73.4.10 --- setup.py 10 Oct 2002 00:59:16 -0000 1.73.4.11 *************** *** 362,369 **** if (ssl_incs is not None and ssl_libs is not None): exts.append( Extension('_socket', ['socketmodule.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, ! runtime_library_dirs = ssl_libs, libraries = ['ssl', 'crypto'], define_macros = [('USE_SSL',1)] ) ) --- 362,372 ---- if (ssl_incs is not None and ssl_libs is not None): + rtlibs = None + if platform.startswith('sunos'): + rtlibs = ssl_libs exts.append( Extension('_socket', ['socketmodule.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, ! runtime_library_dirs = rtlibs, libraries = ['ssl', 'crypto'], define_macros = [('USE_SSL',1)] ) ) From akuchling@users.sourceforge.net Thu Oct 10 12:31:50 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu, 10 Oct 2002 04:31:50 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv8430 Modified Files: whatsnew23.tex Log Message: [Bug #621038] Remove duplicated item Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** whatsnew23.tex 9 Oct 2002 12:11:10 -0000 1.56 --- whatsnew23.tex 10 Oct 2002 11:31:48 -0000 1.57 *************** *** 1223,1230 **** \code{PyObject_DelItem(\var{mapping}, PyString_New(\var{key})}. - \item The source code for the Expat XML parser is now included with - the Python source, so the \module{pyexpat} module is no longer - dependent on having a system library containing Expat. - \item File objects now manage their internal string buffer differently by increasing it exponentially when needed. --- 1223,1226 ---- *************** *** 1313,1317 **** article: Michael Chermside, Scott David Daniels, Fred~L. Drake, Jr., Michael Hudson, Detlef Lannert, Martin von L\"owis, Andrew MacIntyre, ! Gustavo Niemeyer, Neal Norwitz, Jason Tishler. \end{document} --- 1309,1313 ---- article: Michael Chermside, Scott David Daniels, Fred~L. Drake, Jr., Michael Hudson, Detlef Lannert, Martin von L\"owis, Andrew MacIntyre, ! Lalo Martins, Gustavo Niemeyer, Neal Norwitz, Jason Tishler. \end{document} From akuchling@users.sourceforge.net Thu Oct 10 12:32:32 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu, 10 Oct 2002 04:32:32 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.57,1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv8582 Modified Files: whatsnew23.tex Log Message: [Bug #621039] Fix broken link Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** whatsnew23.tex 10 Oct 2002 11:31:48 -0000 1.57 --- whatsnew23.tex 10 Oct 2002 11:32:30 -0000 1.58 *************** *** 1262,1266 **** Sean Reifschneider.) ! Python now supports AtheOS (\url{www.atheos.cx}) and GNU/Hurd. --- 1262,1266 ---- Sean Reifschneider.) ! Python now supports AtheOS (\url{http://www.atheos.cx}) and GNU/Hurd. From loewis@users.sourceforge.net Thu Oct 10 15:27:33 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 07:27:33 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.264,2.265 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3565/Modules Modified Files: posixmodule.c Log Message: Patch #569139: Implementation of major, minor and makedev. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.264 retrieving revision 2.265 diff -C2 -d -r2.264 -r2.265 *** posixmodule.c 7 Oct 2002 06:44:21 -0000 2.264 --- posixmodule.c 10 Oct 2002 14:27:30 -0000 2.265 *************** *** 278,284 **** --- 278,291 ---- #endif + #if defined(MAJOR_IN_MKDEV) + #include + #else + #if defined(MAJOR_IN_SYSMACROS) + #include + #endif #if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H) #include #endif + #endif /* Return a dictionary corresponding to the POSIX environment table */ *************** *** 5082,5092 **** #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) PyDoc_STRVAR(posix_mknod__doc__, ! "mknod(filename, [, mode=0600, major, minor])\n\n\ Create a filesystem node (file, device special file or named pipe)\n\ named filename. mode specifies both the permissions to use and the\n\ type of node to be created, being combined (bitwise OR) with one of\n\ S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO. For S_IFCHR and S_IFBLK,\n\ ! major and minor define the newly created device special file, otherwise\n\ ! they are ignored."); --- 5089,5099 ---- #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) PyDoc_STRVAR(posix_mknod__doc__, ! "mknod(filename, [, mode=0600, device])\n\n\ Create a filesystem node (file, device special file or named pipe)\n\ named filename. mode specifies both the permissions to use and the\n\ type of node to be created, being combined (bitwise OR) with one of\n\ S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO. For S_IFCHR and S_IFBLK,\n\ ! device defines the newly created device special file (probably using\n\ ! os.makedev()), otherwise it is ignored."); *************** *** 5096,5107 **** char *filename; int mode = 0600; ! int major = 0; ! int minor = 0; int res; ! if (!PyArg_ParseTuple(args, "s|iii:mknod", &filename, ! &mode, &major, &minor)) return NULL; Py_BEGIN_ALLOW_THREADS ! res = mknod(filename, mode, makedev(major, minor)); Py_END_ALLOW_THREADS if (res < 0) --- 5103,5112 ---- char *filename; int mode = 0600; ! int device = 0; int res; ! if (!PyArg_ParseTuple(args, "s|iii:mknod", &filename, &mode, &device)) return NULL; Py_BEGIN_ALLOW_THREADS ! res = mknod(filename, mode, device); Py_END_ALLOW_THREADS if (res < 0) *************** *** 5112,5115 **** --- 5117,5161 ---- #endif + #ifdef HAVE_DEVICE_MACROS + PyDoc_STRVAR(posix_major__doc__, + "major(device) -> major number\n\ + Extracts a device major number from a raw device number."); + + static PyObject * + posix_major(PyObject *self, PyObject *args) + { + int device; + if (!PyArg_ParseTuple(args, "i:major", &device)) + return NULL; + return PyInt_FromLong((long)major(device)); + } + + PyDoc_STRVAR(posix_minor__doc__, + "minor(device) -> minor number\n\ + Extracts a device minor number from a raw device number."); + + static PyObject * + posix_minor(PyObject *self, PyObject *args) + { + int device; + if (!PyArg_ParseTuple(args, "i:minor", &device)) + return NULL; + return PyInt_FromLong((long)minor(device)); + } + + PyDoc_STRVAR(posix_makedev__doc__, + "makedev(major, minor) -> device number\n\ + Composes a raw device number from the major and minor device numbers."); + + static PyObject * + posix_makedev(PyObject *self, PyObject *args) + { + int major, minor; + if (!PyArg_ParseTuple(args, "ii:makedev", &major, &minor)) + return NULL; + return PyInt_FromLong((long)makedev(major, minor)); + } + #endif /* device macros */ + #ifdef HAVE_FTRUNCATE *************** *** 6905,6908 **** --- 6951,6959 ---- #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) {"mknod", posix_mknod, METH_VARARGS, posix_mknod__doc__}, + #endif + #ifdef HAVE_DEVICE_MACROS + {"major", posix_major, METH_VARARGS, posix_major__doc__}, + {"minor", posix_minor, METH_VARARGS, posix_minor__doc__}, + {"makedev", posix_makedev, METH_VARARGS, posix_makedev__doc__}, #endif #ifdef HAVE_FTRUNCATE From loewis@users.sourceforge.net Thu Oct 10 15:27:32 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 07:27:32 -0700 Subject: [Python-checkins] python/dist/src configure,1.344,1.345 configure.in,1.355,1.356 pyconfig.h.in,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3565 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #569139: Implementation of major, minor and makedev. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.344 retrieving revision 1.345 diff -C2 -d -r1.344 -r1.345 *** configure 7 Oct 2002 17:45:53 -0000 1.344 --- configure 10 Oct 2002 14:27:27 -0000 1.345 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.354 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.355 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 902,906 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 902,906 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *************** *** 4297,4300 **** --- 4297,4573 ---- fi + echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 + echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6 + if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + return makedev(0, 0); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_sys_types_h_makedev=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_sys_types_h_makedev=no + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 + echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6 + + if test $ac_cv_header_sys_types_h_makedev = no; then + if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 + echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 + if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 + echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 + else + # Is the header compilable? + echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 + echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + #include + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_compiler=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 + echo "${ECHO_T}$ac_header_compiler" >&6 + + # Is the header present? + echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 + echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + ac_header_preproc=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no + fi + rm -f conftest.err conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 + echo "${ECHO_T}$ac_header_preproc" >&6 + + # So? What about this header? + case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 + echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 + echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 + echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;};; + esac + echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 + echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 + if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_cv_header_sys_mkdev_h=$ac_header_preproc + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 + echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 + + fi + if test $ac_cv_header_sys_mkdev_h = yes; then + + cat >>confdefs.h <<\_ACEOF + #define MAJOR_IN_MKDEV 1 + _ACEOF + + fi + + + + if test $ac_cv_header_sys_mkdev_h = no; then + if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 + echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 + if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 + echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 + else + # Is the header compilable? + echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 + echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + #include + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_compiler=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 + echo "${ECHO_T}$ac_header_compiler" >&6 + + # Is the header present? + echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 + echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + ac_header_preproc=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no + fi + rm -f conftest.err conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 + echo "${ECHO_T}$ac_header_preproc" >&6 + + # So? What about this header? + case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 + echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 + echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 + echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;};; + esac + echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 + echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 + if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_cv_header_sys_sysmacros_h=$ac_header_preproc + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 + echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 + + fi + if test $ac_cv_header_sys_sysmacros_h = yes; then + + cat >>confdefs.h <<\_ACEOF + #define MAJOR_IN_SYSMACROS 1 + _ACEOF + + fi + + + fi + fi + # checks for typedefs *************** *** 12499,12502 **** --- 12772,12835 ---- + echo "$as_me:$LINENO: checking for major" >&5 + echo $ECHO_N "checking for major... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #if defined(MAJOR_IN_MKDEV) + #include + #elif defined(MAJOR_IN_SYSMACROS) + #include + #else + #include + #endif + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + makedev(major(0),minor(0)); + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + + cat >>confdefs.h <<\_ACEOF + #define HAVE_DEVICE_MACROS 1 + _ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 + + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + + fi + rm -f conftest.$ac_objext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define *************** *** 16843,16847 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 17176,17180 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.355 retrieving revision 1.356 diff -C2 -d -r1.355 -r1.356 *** configure.in 7 Oct 2002 17:45:55 -0000 1.355 --- configure.in 10 Oct 2002 14:27:30 -0000 1.356 *************** *** 622,625 **** --- 622,626 ---- sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT + AC_HEADER_MAJOR # checks for typedefs *************** *** 1717,1720 **** --- 1718,1739 ---- ) + AC_MSG_CHECKING(for major, minor, and makedev) + AC_TRY_COMPILE([ + #if defined(MAJOR_IN_MKDEV) + #include + #elif defined(MAJOR_IN_SYSMACROS) + #include + #else + #include + #endif + ],[ + makedev(major(0),minor(0)); + ],[ + AC_DEFINE(HAVE_DEVICE_MACROS, 1, + [Define to 1 if you have the device macros.]) + AC_MSG_RESULT(yes) + ],[ + AC_MSG_RESULT(no) + ]) # On OSF/1 V5.1, getaddrinfo is available, but a define Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** pyconfig.h.in 7 Oct 2002 17:45:56 -0000 1.52 --- pyconfig.h.in 10 Oct 2002 14:27:30 -0000 1.53 *************** *** 58,61 **** --- 58,64 ---- #undef HAVE_CTERMID_R + /* Define to 1 if you have the device macros. */ + #undef HAVE_DEVICE_MACROS + /* Define to 1 if you have the header file, and it defines `DIR'. */ *************** *** 604,607 **** --- 607,618 ---- /* Define if you are using Mach cthreads under mach / */ #undef MACH_C_THREADS + + /* Define to 1 if `major', `minor', and `makedev' are declared in . + */ + #undef MAJOR_IN_MKDEV + + /* Define to 1 if `major', `minor', and `makedev' are declared in + . */ + #undef MAJOR_IN_SYSMACROS /* Define if malloc(0) returns a NULL pointer. */ From loewis@users.sourceforge.net Thu Oct 10 15:27:32 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 07:27:32 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.97,1.98 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv3565/Doc/lib Modified Files: libos.tex Log Message: Patch #569139: Implementation of major, minor and makedev. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** libos.tex 5 Oct 2002 09:46:48 -0000 1.97 --- libos.tex 10 Oct 2002 14:27:30 -0000 1.98 *************** *** 701,711 **** \end{funcdesc} ! \begin{funcdesc}{mknod}{path\optional{, mode=0600, major, minor}} Create a filesystem node (file, device special file or named pipe) ! named filename. mode specifies both the permissions to use and the ! type of node to be created, being combined (bitwise OR) with one of ! S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO (those constants are available ! in \module{stat}). For S_IFCHR and S_IFBLK, major and minor define the ! newly created device special file, otherwise they are ignored. \versionadded{2.3} --- 701,730 ---- \end{funcdesc} ! \begin{funcdesc}{mknod}{path\optional{, mode=0600, device}} Create a filesystem node (file, device special file or named pipe) ! named filename. \var{mode} specifies both the permissions to use and ! the type of node to be created, being combined (bitwise OR) with one ! of S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO (those constants are ! available in \module{stat}). For S_IFCHR and S_IFBLK, \var{device} ! defines the newly created device special file (probably using ! \function{os.makedev()}), otherwise it is ignored. ! ! \versionadded{2.3} ! \end{funcdesc} ! ! \begin{funcdesc}{major}{device} ! Extracts a device major number from a raw device number. ! ! \versionadded{2.3} ! \end{funcdesc} ! ! \begin{funcdesc}{minor}{device} ! Extracts a device minor number from a raw device number. ! ! \versionadded{2.3} ! \end{funcdesc} ! ! \begin{funcdesc}{makedev}{major, minor} ! Composes a raw device number from the major and minor device numbers. \versionadded{2.3} From loewis@users.sourceforge.net Thu Oct 10 15:36:15 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 07:36:15 -0700 Subject: [Python-checkins] python/dist/src/Lib/lib-tk Tkinter.py,1.163,1.164 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv7095/Lib/lib-tk Modified Files: Tkinter.py Log Message: Patch #612602: Streamline configure methods. Index: Tkinter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Tkinter.py 23 Jul 2002 02:52:58 -0000 1.163 --- Tkinter.py 10 Oct 2002 14:36:13 -0000 1.164 *************** *** 1068,1080 **** root = self._root() root.report_callback_exception(exc, val, tb) ! # These used to be defined in Widget: ! def configure(self, cnf=None, **kw): ! """Configure resources of a widget. ! ! The values for resources are specified as keyword ! arguments. To get an overview about ! the allowed keyword arguments call the method keys. ! """ ! # XXX ought to generalize this so tag_config etc. can use it if kw: cnf = _cnfmerge((cnf, kw)) --- 1068,1073 ---- root = self._root() root.report_callback_exception(exc, val, tb) ! def _configure(self, cmd, cnf, kw): ! """Internal function.""" if kw: cnf = _cnfmerge((cnf, kw)) *************** *** 1084,1096 **** cnf = {} for x in self.tk.split( ! self.tk.call(self._w, 'configure')): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) is StringType: ! x = self.tk.split(self.tk.call( ! self._w, 'configure', '-'+cnf)) return (x[0][1:],) + x[1:] ! self.tk.call((self._w, 'configure') ! + self._options(cnf)) config = configure def cget(self, key): --- 1077,1097 ---- cnf = {} for x in self.tk.split( ! self.tk.call(_flatten((self._w, cmd)))): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) is StringType: ! x = self.tk.split( ! self.tk.call(_flatten((self._w, cmd, '-'+cnf)))) return (x[0][1:],) + x[1:] ! self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) ! # These used to be defined in Widget: ! def configure(self, cnf=None, **kw): ! """Configure resources of a widget. ! ! The values for resources are specified as keyword ! arguments. To get an overview about ! the allowed keyword arguments call the method keys. ! """ ! return self._configure('configure', cnf, kw) config = configure def cget(self, key): *************** *** 2044,2060 **** the allowed keyword arguments call the method without arguments. """ ! if cnf is None and not kw: ! cnf = {} ! for x in self.tk.split( ! self.tk.call(self._w, ! 'itemconfigure', tagOrId)): ! cnf[x[0][1:]] = (x[0][1:],) + x[1:] ! return cnf ! if type(cnf) == StringType and not kw: ! x = self.tk.split(self.tk.call( ! self._w, 'itemconfigure', tagOrId, '-'+cnf)) ! return (x[0][1:],) + x[1:] ! self.tk.call((self._w, 'itemconfigure', tagOrId) + ! self._options(cnf, kw)) itemconfig = itemconfigure # lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift, --- 2045,2049 ---- the allowed keyword arguments call the method without arguments. """ ! return self._configure(('itemconfigure', tagOrId), cnf, kw) itemconfig = itemconfigure # lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift, *************** *** 2384,2399 **** Valid resource names: background, bg, foreground, fg, selectbackground, selectforeground.""" ! if cnf is None and not kw: ! cnf = {} ! for x in self.tk.split( ! self.tk.call(self._w, 'itemconfigure', index)): ! cnf[x[0][1:]] = (x[0][1:],) + x[1:] ! return cnf ! if type(cnf) == StringType and not kw: ! x = self.tk.split(self.tk.call( ! self._w, 'itemconfigure', index, '-'+cnf)) ! return (x[0][1:],) + x[1:] ! self.tk.call((self._w, 'itemconfigure', index) + ! self._options(cnf, kw)) itemconfig = itemconfigure --- 2373,2377 ---- Valid resource names: background, bg, foreground, fg, selectbackground, selectforeground.""" ! return self._configure(('itemconfigure', index), cnf, kw) itemconfig = itemconfigure *************** *** 2482,2497 **** def entryconfigure(self, index, cnf=None, **kw): """Configure a menu item at INDEX.""" ! if cnf is None and not kw: ! cnf = {} ! for x in self.tk.split(self.tk.call( ! (self._w, 'entryconfigure', index))): ! cnf[x[0][1:]] = (x[0][1:],) + x[1:] ! return cnf ! if type(cnf) == StringType and not kw: ! x = self.tk.split(self.tk.call( ! (self._w, 'entryconfigure', index, '-'+cnf))) ! return (x[0][1:],) + x[1:] ! self.tk.call((self._w, 'entryconfigure', index) ! + self._options(cnf, kw)) entryconfig = entryconfigure def index(self, index): --- 2460,2464 ---- def entryconfigure(self, index, cnf=None, **kw): """Configure a menu item at INDEX.""" ! return self._configure(('entryconfigure', index), cnf, kw) entryconfig = entryconfigure def index(self, index): *************** *** 2720,2735 **** option = option[:-1] return self.tk.call(self._w, "image", "cget", index, option) ! def image_configure(self, index, cnf={}, **kw): """Configure an embedded image at INDEX.""" ! if not cnf and not kw: ! cnf = {} ! for x in self.tk.split( ! self.tk.call( ! self._w, "image", "configure", index)): ! cnf[x[0][1:]] = (x[0][1:],) + x[1:] ! return cnf ! apply(self.tk.call, ! (self._w, "image", "configure", index) ! + self._options(cnf, kw)) def image_create(self, index, cnf={}, **kw): """Create an embedded image at INDEX.""" --- 2687,2693 ---- option = option[:-1] return self.tk.call(self._w, "image", "cget", index, option) ! def image_configure(self, index, cnf=None, **kw): """Configure an embedded image at INDEX.""" ! return self._configure(('image', 'configure', index), cnf, kw) def image_create(self, index, cnf={}, **kw): """Create an embedded image at INDEX.""" *************** *** 2822,2834 **** option = option[:-1] return self.tk.call(self._w, 'tag', 'cget', tagName, option) ! def tag_configure(self, tagName, cnf={}, **kw): """Configure a tag TAGNAME.""" ! if type(cnf) == StringType: ! x = self.tk.split(self.tk.call( ! self._w, 'tag', 'configure', tagName, '-'+cnf)) ! return (x[0][1:],) + x[1:] ! self.tk.call( ! (self._w, 'tag', 'configure', tagName) ! + self._options(cnf, kw)) tag_config = tag_configure def tag_delete(self, *tagNames): --- 2780,2786 ---- option = option[:-1] return self.tk.call(self._w, 'tag', 'cget', tagName, option) ! def tag_configure(self, tagName, cnf=None, **kw): """Configure a tag TAGNAME.""" ! return self._configure(('tag', 'configure', tagName), cnf, kw) tag_config = tag_configure def tag_delete(self, *tagNames): *************** *** 2875,2888 **** option = option[:-1] return self.tk.call(self._w, 'window', 'cget', index, option) ! def window_configure(self, index, cnf={}, **kw): """Configure an embedded window at INDEX.""" ! if type(cnf) == StringType: ! x = self.tk.split(self.tk.call( ! self._w, 'window', 'configure', ! index, '-'+cnf)) ! return (x[0][1:],) + x[1:] ! self.tk.call( ! (self._w, 'window', 'configure', index) ! + self._options(cnf, kw)) window_config = window_configure def window_create(self, index, cnf={}, **kw): --- 2827,2833 ---- option = option[:-1] return self.tk.call(self._w, 'window', 'cget', index, option) ! def window_configure(self, index, cnf=None, **kw): """Configure an embedded window at INDEX.""" ! return self._configure(('window', 'configure', index), cnf, kw) window_config = window_configure def window_create(self, index, cnf={}, **kw): From loewis@users.sourceforge.net Thu Oct 10 15:36:16 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 07:36:16 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.207,1.208 NEWS,1.496,1.497 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv7095/Misc Modified Files: ACKS NEWS Log Message: Patch #612602: Streamline configure methods. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** ACKS 9 Oct 2002 16:37:03 -0000 1.207 --- ACKS 10 Oct 2002 14:36:13 -0000 1.208 *************** *** 415,418 **** --- 415,419 ---- John Redford Terry Reedy + Steve Reeves Ofir Reichenberg Sean Reifschneider Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.496 retrieving revision 1.497 diff -C2 -d -r1.496 -r1.497 *** NEWS 9 Oct 2002 21:40:48 -0000 1.496 --- NEWS 10 Oct 2002 14:36:13 -0000 1.497 *************** *** 355,358 **** --- 355,362 ---- ------- + - Various configure methods of Tkinter have been stream-lined, so + that tag_configure, image_configure, window_configure now return + a dictionary when invoked with no argument. + - Importing the readline module now no longer has the side effect of calling setlocale(LC_CTYPE, ""). The initial "C" locale, or From gvanrossum@users.sourceforge.net Thu Oct 10 16:04:06 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:04:06 -0700 Subject: [Python-checkins] python/dist/src Makefile.pre.in,1.99,1.100 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv19886 Modified Files: Makefile.pre.in Log Message: Add .PHONY targets, to declare targets that aren't real files. Immediate benefit: when you use "make -t" to avoid a global recompile after a trivial header file touchup, Make will no longer create files named all, oldsharedmods, and sharedmods. (Not sure if I tracked down all such targets. Not sure if I care.) Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Makefile.pre.in 29 Aug 2002 15:04:37 -0000 1.99 --- Makefile.pre.in 10 Oct 2002 15:04:04 -0000 1.100 *************** *** 930,932 **** --- 930,940 ---- Python/thread.o: @THREADHEADERS@ + # Declare targets that aren't real files + .PHONY: all sharedmods oldsharedmods test quicktest memtest + .PHONY: install altinstall oldsharedinstall bininstall altbininstall + .PHONY: maninstall libinstall inclinstall libainstall sharedinstall + .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure + .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools + .PHONY: recheck autoconf clean clobber distclean smelly funny + # IF YOU PUT ANYTHING HERE IT WILL GO AWAY From bwarsaw@users.sourceforge.net Thu Oct 10 16:11:23 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:11:23 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv22654 Modified Files: Charset.py Log Message: __init__(): RFC 2046 $4.1.2 says charsets are not case sensitive. Coerce the argument to lower case. Also, since body encodings can't be SHORTEST, default the CHARSETS failobj's second item to BASE64. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Charset.py 1 Oct 2002 00:02:33 -0000 1.7 --- Charset.py 10 Oct 2002 15:11:20 -0000 1.8 *************** *** 178,181 **** --- 178,183 ---- """ def __init__(self, input_charset=DEFAULT_CHARSET): + # RFC 2046, $4.1.2 says charsets are not case sensitive + input_charset = input_charset.lower() # Set the input charset after filtering through the aliases self.input_charset = ALIASES.get(input_charset, input_charset) *************** *** 184,188 **** # it. henc, benc, conv = CHARSETS.get(self.input_charset, ! (SHORTEST, SHORTEST, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc --- 186,190 ---- # it. henc, benc, conv = CHARSETS.get(self.input_charset, ! (SHORTEST, BASE64, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc From bwarsaw@users.sourceforge.net Thu Oct 10 16:13:29 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:13:29 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Message.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv23530 Modified Files: Message.py Log Message: get_content_charset(): RFC 2046 $4.1.2 says charsets are not case sensitive. Coerce the argument to lower case. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Message.py 30 Sep 2002 18:17:35 -0000 1.27 --- Message.py 10 Oct 2002 15:13:26 -0000 1.28 *************** *** 761,766 **** """Return the charset parameter of the Content-Type header. ! If there is no Content-Type header, or if that header has no charset ! parameter, failobj is returned. """ missing = [] --- 761,767 ---- """Return the charset parameter of the Content-Type header. ! The returned string is always coerced to lower case. If there is no ! Content-Type header, or if that header has no charset parameter, ! failobj is returned. """ missing = [] *************** *** 770,775 **** if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! return unicode(charset[2], charset[0]).encode('us-ascii') ! return charset def get_charsets(self, failobj=None): --- 771,777 ---- if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! charset = unicode(charset[2], charset[0]).encode('us-ascii') ! # RFC 2046, $4.1.2 says charsets are not case sensitive ! return charset.lower() def get_charsets(self, failobj=None): From bwarsaw@users.sourceforge.net Thu Oct 10 16:14:25 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:14:25 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv23990 Modified Files: test_email.py Log Message: New tests to verify that charsets are case insensitive, and that by default get_body_encoding() cannot be SHORTEST. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_email.py 7 Oct 2002 17:27:55 -0000 1.18 --- test_email.py 10 Oct 2002 15:14:22 -0000 1.19 *************** *** 1690,1693 **** --- 1690,1727 ---- eq(msg.get_filename(), 'foo\\wacky"name') + def test_get_body_encoding_with_bogus_charset(self): + charset = Charset('not a charset') + self.assertEqual(charset.get_body_encoding(), 'base64') + + def test_get_body_encoding_with_uppercase_charset(self): + eq = self.assertEqual + msg = Message() + msg['Content-Type'] = 'text/plain; charset=UTF-8' + eq(msg['content-type'], 'text/plain; charset=UTF-8') + charsets = msg.get_charsets() + eq(len(charsets), 1) + eq(charsets[0], 'utf-8') + charset = Charset(charsets[0]) + eq(charset.get_body_encoding(), 'base64') + msg.set_payload('hello world', charset=charset) + eq(msg.get_payload(), 'hello world') + eq(msg['content-transfer-encoding'], 'base64') + # Try another one + msg = Message() + msg['Content-Type'] = 'text/plain; charset="US-ASCII"' + charsets = msg.get_charsets() + eq(len(charsets), 1) + eq(charsets[0], 'us-ascii') + charset = Charset(charsets[0]) + eq(charset.get_body_encoding(), Encoders.encode_7or8bit) + msg.set_payload('hello world', charset=charset) + eq(msg.get_payload(), 'hello world') + eq(msg['content-transfer-encoding'], '7bit') + + def test_charsets_case_insensitive(self): + lc = Charset('us-ascii') + uc = Charset('US-ASCII') + self.assertEqual(lc.get_body_encoding(), uc.get_body_encoding()) + From bwarsaw@users.sourceforge.net Thu Oct 10 16:19:49 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:19:49 -0700 Subject: [Python-checkins] python/dist/src/Lib/email __init__.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv26152 Modified Files: __init__.py Log Message: Bump version number to 2.4.2 to pick up the latest minor bug fixes. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** __init__.py 7 Oct 2002 17:20:25 -0000 1.18 --- __init__.py 10 Oct 2002 15:19:46 -0000 1.19 *************** *** 5,9 **** """ ! __version__ = '2.4.1' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.2' __all__ = [ From bwarsaw@users.sourceforge.net Thu Oct 10 16:22:18 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:22:18 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv27346 Modified Files: emailmessage.tex Log Message: Document that get_content_charset() coerces its return value to lower case. Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** emailmessage.tex 1 Oct 2002 14:29:58 -0000 1.8 --- emailmessage.tex 10 Oct 2002 15:22:16 -0000 1.9 *************** *** 444,449 **** \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} Return the \code{charset} parameter of the \mailheader{Content-Type} ! header. If there is no \mailheader{Content-Type} header, or if that ! header has no \code{charset} parameter, \var{failobj} is returned. Note that this method differs from \method{get_charset()} which --- 444,450 ---- \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} Return the \code{charset} parameter of the \mailheader{Content-Type} ! header, coerced to lower case. If there is no ! \mailheader{Content-Type} header, or if that header has no ! \code{charset} parameter, \var{failobj} is returned. Note that this method differs from \method{get_charset()} which From bwarsaw@users.sourceforge.net Thu Oct 10 16:23:41 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:23:41 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailcharsets.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv27774 Modified Files: emailcharsets.tex Log Message: Document that the Charset constructor coerces its argument to lower case. Index: emailcharsets.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailcharsets.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** emailcharsets.tex 1 Oct 2002 04:33:14 -0000 1.1 --- emailcharsets.tex 10 Oct 2002 15:23:38 -0000 1.2 *************** *** 24,31 **** converted outright, and are not allowed in email. ! Optional \var{input_charset} is as described below. After being alias ! normalized it is also used as a lookup into the registry of character ! sets to find out the header encoding, body encoding, and output ! conversion codec to be used for the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is --- 24,32 ---- converted outright, and are not allowed in email. ! Optional \var{input_charset} is as described below; it is always ! coerced to lower case. After being alias normalized it is also used ! as a lookup into the registry of character sets to find out the header ! encoding, body encoding, and output conversion codec to be used for ! the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is From loewis@users.sourceforge.net Thu Oct 10 16:26:50 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:26:50 -0700 Subject: [Python-checkins] python/dist/src configure,1.279.6.15,1.279.6.16 configure.in,1.288.6.15,1.288.6.16 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv28436 Modified Files: Tag: release22-maint configure configure.in Log Message: Expand AC_CHECK_SIZEOF inline to overcome a autoconf 2.13 weakness. Fixes #620791. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.279.6.15 retrieving revision 1.279.6.16 diff -C2 -d -r1.279.6.15 -r1.279.6.16 *** configure 7 Oct 2002 11:57:02 -0000 1.279.6.15 --- configure 10 Oct 2002 15:26:41 -0000 1.279.6.16 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.288.6.14 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.288.6.15 # Guess values for system-dependent variables and create Makefiles. *************** *** 7013,7019 **** if test "$wchar_h" = yes then ! echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6 echo "configure:7017: checking size of wchar_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_sizeof_wchar_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 7013,7019 ---- if test "$wchar_h" = yes then ! echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6 echo "configure:7017: checking size of wchar_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_sizeof_wchar_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 7024,7037 **** #line 7025 "configure" #include "confdefs.h" ! #include ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(wchar_t)); ! exit(0); ! } EOF ! if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_wchar_t=`cat conftestval` --- 7024,7039 ---- #line 7025 "configure" #include "confdefs.h" ! ! #include ! #include ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(wchar_t)); ! exit(0); ! } EOF ! if { (eval echo configure:7038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_wchar_t=`cat conftestval` *************** *** 7045,7059 **** fi fi ! echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 ! cat >> confdefs.h <&6 ! echo "configure:7058: checking what type to use for unicode" >&5 # Check whether --enable-unicode or --disable-unicode was given. if test "${enable_unicode+set}" = set; then --- 7047,7062 ---- fi + fi ! ! echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 ! cat >> confdefs.h <&6 ! echo "configure:7061: checking what type to use for unicode" >&5 # Check whether --enable-unicode or --disable-unicode was given. if test "${enable_unicode+set}" = set; then *************** *** 7130,7134 **** # check for endianness echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:7133: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7133,7137 ---- # check for endianness echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:7136: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 7137,7141 **** # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < --- 7140,7144 ---- # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < *************** *** 7148,7156 **** ; return 0; } EOF ! if { (eval echo configure:7151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < --- 7151,7159 ---- ; return 0; } EOF ! if { (eval echo configure:7154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < *************** *** 7163,7167 **** ; return 0; } EOF ! if { (eval echo configure:7166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes --- 7166,7170 ---- ; return 0; } EOF ! if { (eval echo configure:7169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes *************** *** 7183,7187 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no --- 7199,7203 ---- } EOF ! if { (eval echo configure:7202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no *************** *** 7223,7227 **** # or fills with zeros (like the Cray J90, according to Tim Peters). echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6 ! echo "configure:7226: checking whether right shift extends the sign bit" >&5 if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7226,7230 ---- # or fills with zeros (like the Cray J90, according to Tim Peters). echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6 ! echo "configure:7229: checking whether right shift extends the sign bit" >&5 if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 7232,7236 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_rshift_extends_sign=yes --- 7244,7248 ---- EOF ! if { (eval echo configure:7247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_rshift_extends_sign=yes *************** *** 7266,7270 **** # check for getc_unlocked and related locking functions echo $ac_n "checking for getc_unlocked() and friends""... $ac_c" 1>&6 ! echo "configure:7269: checking for getc_unlocked() and friends" >&5 if eval "test \"`echo '$''{'ac_cv_have_getc_unlocked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7269,7273 ---- # check for getc_unlocked and related locking functions echo $ac_n "checking for getc_unlocked() and friends""... $ac_c" 1>&6 ! echo "configure:7272: checking for getc_unlocked() and friends" >&5 if eval "test \"`echo '$''{'ac_cv_have_getc_unlocked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 7272,7276 **** cat > conftest.$ac_ext < --- 7275,7279 ---- cat > conftest.$ac_ext < *************** *** 7284,7288 **** ; return 0; } EOF ! if { (eval echo configure:7287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_have_getc_unlocked=yes --- 7287,7291 ---- ; return 0; } EOF ! if { (eval echo configure:7290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_have_getc_unlocked=yes *************** *** 7307,7311 **** # check for readline 4.0 echo $ac_n "checking for rl_pre_input_hook in -lreadline""... $ac_c" 1>&6 ! echo "configure:7310: checking for rl_pre_input_hook in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_pre_input_hook | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 7310,7314 ---- # check for readline 4.0 echo $ac_n "checking for rl_pre_input_hook in -lreadline""... $ac_c" 1>&6 ! echo "configure:7313: checking for rl_pre_input_hook in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_pre_input_hook | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 7315,7319 **** LIBS="-lreadline -ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 7329,7333 ---- ; return 0; } EOF ! if { (eval echo configure:7332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 7352,7356 **** # check for readline 4.2 echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6 ! echo "configure:7355: checking for rl_completion_matches in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 7355,7359 ---- # check for readline 4.2 echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6 ! echo "configure:7358: checking for rl_completion_matches in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 7360,7364 **** LIBS="-lreadline -ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 7374,7378 ---- ; return 0; } EOF ! if { (eval echo configure:7377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 7396,7400 **** echo $ac_n "checking for broken nice()""... $ac_c" 1>&6 ! echo "configure:7399: checking for broken nice()" >&5 if eval "test \"`echo '$''{'ac_cv_broken_nice'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7399,7403 ---- echo $ac_n "checking for broken nice()""... $ac_c" 1>&6 ! echo "configure:7402: checking for broken nice()" >&5 if eval "test \"`echo '$''{'ac_cv_broken_nice'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 7405,7409 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_nice=yes --- 7420,7424 ---- EOF ! if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_nice=yes *************** *** 7442,7451 **** # On HP/UX 11.0, mvwdelch is a block with a return statement echo $ac_n "checking whether mvwdelch is an expression""... $ac_c" 1>&6 ! echo "configure:7445: checking whether mvwdelch is an expression" >&5 if eval "test \"`echo '$''{'ac_cv_mvwdelch_is_expression'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 7445,7454 ---- # On HP/UX 11.0, mvwdelch is a block with a return statement echo $ac_n "checking whether mvwdelch is an expression""... $ac_c" 1>&6 ! echo "configure:7448: checking whether mvwdelch is an expression" >&5 if eval "test \"`echo '$''{'ac_cv_mvwdelch_is_expression'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7457,7461 **** ; return 0; } EOF ! if { (eval echo configure:7460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mvwdelch_is_expression=yes --- 7460,7464 ---- ; return 0; } EOF ! if { (eval echo configure:7463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mvwdelch_is_expression=yes *************** *** 7480,7489 **** echo $ac_n "checking whether WINDOW has _flags""... $ac_c" 1>&6 ! echo "configure:7483: checking whether WINDOW has _flags" >&5 if eval "test \"`echo '$''{'ac_cv_window_has_flags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 7483,7492 ---- echo $ac_n "checking whether WINDOW has _flags""... $ac_c" 1>&6 ! echo "configure:7486: checking whether WINDOW has _flags" >&5 if eval "test \"`echo '$''{'ac_cv_window_has_flags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7495,7499 **** ; return 0; } EOF ! if { (eval echo configure:7498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_window_has_flags=yes --- 7498,7502 ---- ; return 0; } EOF ! if { (eval echo configure:7501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_window_has_flags=yes *************** *** 7526,7535 **** EOF echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 ! echo "configure:7529: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 7529,7538 ---- EOF echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 ! echo "configure:7532: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7587,7591 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7590: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7590,7594 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7593: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.288.6.15 retrieving revision 1.288.6.16 diff -C2 -d -r1.288.6.15 -r1.288.6.16 *** configure.in 7 Oct 2002 11:57:04 -0000 1.288.6.15 --- configure.in 10 Oct 2002 15:26:46 -0000 1.288.6.16 *************** *** 1907,1911 **** if test "$wchar_h" = yes then ! AC_CHECK_SIZEOF(wchar_t, 4, [#include ]) fi --- 1907,1931 ---- if test "$wchar_h" = yes then ! dnl autoconf 2.13 fails to automatically include additional headers ! dnl Therefore, we expand ! dnl AC_CHECK_SIZEOF(wchar_t, 4, [#include ]) ! dnl inline ! AC_MSG_CHECKING(size of wchar_t) ! AC_CACHE_VAL(ac_cv_sizeof_wchar_t, ! [AC_TRY_RUN([ ! #include ! #include ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(wchar_t)); ! exit(0); ! }], ac_cv_sizeof_wchar_t=`cat conftestval`, ! ac_cv_sizeof_wchar_t=0, ! ac_cv_sizeof_wchar_t=4) ! ]) ! AC_MSG_RESULT($ac_cv_sizeof_wchar_t) ! AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T,$ac_cv_sizeof_wchar_t) fi From bwarsaw@users.sourceforge.net Thu Oct 10 16:58:22 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 08:58:22 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib mimelib.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv9210 Modified Files: mimelib.tex Log Message: Update email micro release number. Index: mimelib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/mimelib.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mimelib.tex 1 Oct 2002 18:20:16 -0000 1.3 --- mimelib.tex 10 Oct 2002 15:58:19 -0000 1.4 *************** *** 13,17 **** \date{\today} ! \release{2.4} % software release, not documentation \setreleaseinfo{} % empty for final release \setshortversion{2.4} % major.minor only for software --- 13,17 ---- \date{\today} ! \release{2.4.2} % software release, not documentation \setreleaseinfo{} % empty for final release \setshortversion{2.4} % major.minor only for software From akuchling@users.sourceforge.net Thu Oct 10 17:04:15 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu, 10 Oct 2002 09:04:15 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.58,1.59 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv11185 Modified Files: whatsnew23.tex Log Message: Add new posix functions Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** whatsnew23.tex 10 Oct 2002 11:32:30 -0000 1.58 --- whatsnew23.tex 10 Oct 2002 16:04:08 -0000 1.59 *************** *** 984,990 **** input values measured in radians. (Contributed by Raymond Hettinger.) ! \item Four new functions, \function{getpgid()}, \function{killpg()}, \function{lchown()}, and \function{mknod()}, were added to the \module{posix} module that ! underlies the \module{os} module. (Contributed by Gustavo Niemeyer ! and Geert Jansen.) \item The parser objects provided by the \module{pyexpat} module --- 984,992 ---- input values measured in radians. (Contributed by Raymond Hettinger.) ! \item Seven new functions, \function{getpgid()}, \function{killpg()}, ! \function{lchown()}, \function{major()}, \function{makedev()}, ! \function{minor()}, and \function{mknod()}, were added to the ! \module{posix} module that underlies the \module{os} module. ! (Contributed by Gustavo Niemeyer and Geert Jansen.) \item The parser objects provided by the \module{pyexpat} module From fdrake@users.sourceforge.net Thu Oct 10 17:16:09 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 10 Oct 2002 09:16:09 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libunittest.tex,1.7.8.2,1.7.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16073 Modified Files: Tag: release22-maint libunittest.tex Log Message: Document when unittest was added to Python. Index: libunittest.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libunittest.tex,v retrieving revision 1.7.8.2 retrieving revision 1.7.8.3 diff -C2 -d -r1.7.8.2 -r1.7.8.3 *** libunittest.tex 2 Jul 2002 22:46:53 -0000 1.7.8.2 --- libunittest.tex 10 Oct 2002 16:16:03 -0000 1.7.8.3 *************** *** 8,11 **** --- 8,12 ---- \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} + \versionadded{2.1} The Python unit testing framework, often referred to as ``PyUnit,'' is From fdrake@users.sourceforge.net Thu Oct 10 17:16:28 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 10 Oct 2002 09:16:28 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libunittest.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16243 Modified Files: libunittest.tex Log Message: Document when unittest was added to Python. Index: libunittest.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libunittest.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libunittest.tex 2 Jul 2002 22:46:42 -0000 1.9 --- libunittest.tex 10 Oct 2002 16:16:25 -0000 1.10 *************** *** 8,11 **** --- 8,12 ---- \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} + \versionadded{2.1} The Python unit testing framework, often referred to as ``PyUnit,'' is From loewis@users.sourceforge.net Thu Oct 10 19:17:11 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:17:11 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_dospath.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv462 Removed Files: test_dospath.py Log Message: Remove more DOS support. --- test_dospath.py DELETED --- From loewis@users.sourceforge.net Thu Oct 10 19:24:59 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:24:59 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.172,1.173 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv3651/tut Modified Files: tut.tex Log Message: Remove mentionings of DOS. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** tut.tex 6 Sep 2002 18:06:04 -0000 1.172 --- tut.tex 10 Oct 2002 18:24:54 -0000 1.173 *************** *** 177,181 **** Typing an end-of-file character (\kbd{Control-D} on \UNIX, ! \kbd{Control-Z} on DOS or Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn't work, you can exit the interpreter by typing the following commands: --- 177,181 ---- Typing an end-of-file character (\kbd{Control-D} on \UNIX, ! \kbd{Control-Z} on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn't work, you can exit the interpreter by typing the following commands: From loewis@users.sourceforge.net Thu Oct 10 19:25:23 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:25:23 -0700 Subject: [Python-checkins] python/dist/src/Doc/api init.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv3651/api Modified Files: init.tex Log Message: Remove mentionings of DOS. Index: init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** init.tex 9 Apr 2002 21:09:42 -0000 1.3 --- init.tex 10 Oct 2002 18:24:50 -0000 1.4 *************** *** 234,238 **** directory names separated by a platform dependent delimiter character. The delimiter character is \character{:} on \UNIX, ! \character{;} on DOS/Windows, and \character{\e n} (the \ASCII{} newline character) on Macintosh. The returned string points into static storage; the caller should not modify its value. The value --- 234,238 ---- directory names separated by a platform dependent delimiter character. The delimiter character is \character{:} on \UNIX, ! \character{;} on Windows, and \character{\e n} (the \ASCII{} newline character) on Macintosh. The returned string points into static storage; the caller should not modify its value. The value From loewis@users.sourceforge.net Thu Oct 10 19:25:24 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:25:24 -0700 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv3651/doc Modified Files: doc.tex Log Message: Remove mentionings of DOS. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** doc.tex 25 Sep 2002 21:41:22 -0000 1.70 --- doc.tex 10 Oct 2002 18:24:50 -0000 1.71 *************** *** 928,933 **** The name of an executable program. This may differ from the file name for the executable for some platforms. In particular, ! the \file{.exe} (or other) extension should be omitted for DOS ! and Windows programs. \end{macrodesc} --- 928,933 ---- The name of an executable program. This may differ from the file name for the executable for some platforms. In particular, ! the \file{.exe} (or other) extension should be omitted for ! Windows programs. \end{macrodesc} From loewis@users.sourceforge.net Thu Oct 10 19:25:27 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:25:27 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref2.tex,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv3651/ref Modified Files: ref2.tex Log Message: Remove mentionings of DOS. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ref2.tex 24 Sep 2002 21:08:37 -0000 1.44 --- ref2.tex 10 Oct 2002 18:24:54 -0000 1.45 *************** *** 57,61 **** A physical line ends in whatever the current platform's convention is for terminating lines. On \UNIX, this is the \ASCII{} LF (linefeed) ! character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return followed by linefeed). On Macintosh, it is the \ASCII{} CR (return) character. --- 57,61 ---- A physical line ends in whatever the current platform's convention is for terminating lines. On \UNIX, this is the \ASCII{} LF (linefeed) ! character. On Windows, it is the \ASCII{} sequence CR LF (return followed by linefeed). On Macintosh, it is the \ASCII{} CR (return) character. From loewis@users.sourceforge.net Thu Oct 10 19:25:28 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 11:25:28 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.98,1.99 libundoc.tex,1.81,1.82 libuu.tex,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv3651/lib Modified Files: libos.tex libundoc.tex libuu.tex Log Message: Remove mentionings of DOS. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** libos.tex 10 Oct 2002 14:27:30 -0000 1.98 --- libos.tex 10 Oct 2002 18:24:52 -0000 1.99 *************** *** 65,69 **** The name of the operating system dependent module imported. The following names have currently been registered: \code{'posix'}, ! \code{'nt'}, \code{'dos'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, \code{'java'}, \code{'riscos'}. \end{datadesc} --- 65,69 ---- The name of the operating system dependent module imported. The following names have currently been registered: \code{'posix'}, ! \code{'nt'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, \code{'java'}, \code{'riscos'}. \end{datadesc} *************** *** 1445,1449 **** An alternative character used by the operating system to separate pathname components, or \code{None} if only one separator character exists. This is ! set to \character{/} on DOS and Windows systems where \code{sep} is a backslash. \end{datadesc} --- 1445,1449 ---- An alternative character used by the operating system to separate pathname components, or \code{None} if only one separator character exists. This is ! set to \character{/} on Windows systems where \code{sep} is a backslash. \end{datadesc} *************** *** 1452,1456 **** The character conventionally used by the operating system to separate search patch components (as in \envvar{PATH}), such as \character{:} for ! \POSIX{} or \character{;} for DOS and Windows. \end{datadesc} --- 1452,1456 ---- The character conventionally used by the operating system to separate search patch components (as in \envvar{PATH}), such as \character{:} for ! \POSIX{} or \character{;} for Windows. \end{datadesc} *************** *** 1465,1468 **** current platform. This may be a single character, such as \code{'\e n'} for \POSIX{} or \code{'\e r'} for Mac OS, or multiple characters, ! for example, \code{'\e r\e n'} for DOS and Windows. \end{datadesc} --- 1465,1468 ---- current platform. This may be a single character, such as \code{'\e n'} for \POSIX{} or \code{'\e r'} for Mac OS, or multiple characters, ! for example, \code{'\e r\e n'} for Windows. \end{datadesc} Index: libundoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** libundoc.tex 26 Nov 2001 21:38:50 -0000 1.81 --- libundoc.tex 10 Oct 2002 18:24:53 -0000 1.82 *************** *** 47,53 **** \begin{description} - \item[\module{dospath}] - --- Implementation of \module{os.path} on MS-DOS. - \item[\module{ntpath}] --- Implementation on \module{os.path} on Win32, Win64, WinCE, and --- 47,50 ---- Index: libuu.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuu.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libuu.tex 17 Aug 2001 20:01:06 -0000 1.11 --- libuu.tex 10 Oct 2002 18:24:54 -0000 1.12 *************** *** 15,19 **** standard input or output. However, this interface is deprecated; it's better for the caller to open the file itself, and be sure that, when ! required, the mode is \code{'rb'} or \code{'wb'} on Windows or DOS. This code was contributed by Lance Ellinghouse, and modified by Jack --- 15,19 ---- standard input or output. However, this interface is deprecated; it's better for the caller to open the file itself, and be sure that, when ! required, the mode is \code{'rb'} or \code{'wb'} on Windows. This code was contributed by Lance Ellinghouse, and modified by Jack From bwarsaw@users.sourceforge.net Thu Oct 10 20:09:27 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 12:09:27 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.17.2.2,1.17.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv19449/Lib/email/test Modified Files: Tag: release22-maint test_email.py Log Message: Backport email 2.4.2 changes from Python 2.3. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17.2.2 retrieving revision 1.17.2.3 diff -C2 -d -r1.17.2.2 -r1.17.2.3 *** test_email.py 7 Oct 2002 17:05:28 -0000 1.17.2.2 --- test_email.py 10 Oct 2002 19:09:24 -0000 1.17.2.3 *************** *** 1690,1693 **** --- 1690,1727 ---- eq(msg.get_filename(), 'foo\\wacky"name') + def test_get_body_encoding_with_bogus_charset(self): + charset = Charset('not a charset') + self.assertEqual(charset.get_body_encoding(), 'base64') + + def test_get_body_encoding_with_uppercase_charset(self): + eq = self.assertEqual + msg = Message() + msg['Content-Type'] = 'text/plain; charset=UTF-8' + eq(msg['content-type'], 'text/plain; charset=UTF-8') + charsets = msg.get_charsets() + eq(len(charsets), 1) + eq(charsets[0], 'utf-8') + charset = Charset(charsets[0]) + eq(charset.get_body_encoding(), 'base64') + msg.set_payload('hello world', charset=charset) + eq(msg.get_payload(), 'hello world') + eq(msg['content-transfer-encoding'], 'base64') + # Try another one + msg = Message() + msg['Content-Type'] = 'text/plain; charset="US-ASCII"' + charsets = msg.get_charsets() + eq(len(charsets), 1) + eq(charsets[0], 'us-ascii') + charset = Charset(charsets[0]) + eq(charset.get_body_encoding(), Encoders.encode_7or8bit) + msg.set_payload('hello world', charset=charset) + eq(msg.get_payload(), 'hello world') + eq(msg['content-transfer-encoding'], '7bit') + + def test_charsets_case_insensitive(self): + lc = Charset('us-ascii') + uc = Charset('US-ASCII') + self.assertEqual(lc.get_body_encoding(), uc.get_body_encoding()) + From bwarsaw@users.sourceforge.net Thu Oct 10 20:09:27 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 12:09:27 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.7.2.1,1.7.2.2 Message.py,1.9.6.1,1.9.6.2 __init__.py,1.4.10.2,1.4.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv19449/Lib/email Modified Files: Tag: release22-maint Charset.py Message.py __init__.py Log Message: Backport email 2.4.2 changes from Python 2.3. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** Charset.py 4 Oct 2002 17:24:23 -0000 1.7.2.1 --- Charset.py 10 Oct 2002 19:09:23 -0000 1.7.2.2 *************** *** 178,181 **** --- 178,183 ---- """ def __init__(self, input_charset=DEFAULT_CHARSET): + # RFC 2046, $4.1.2 says charsets are not case sensitive + input_charset = input_charset.lower() # Set the input charset after filtering through the aliases self.input_charset = ALIASES.get(input_charset, input_charset) *************** *** 184,188 **** # it. henc, benc, conv = CHARSETS.get(self.input_charset, ! (SHORTEST, SHORTEST, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc --- 186,190 ---- # it. henc, benc, conv = CHARSETS.get(self.input_charset, ! (SHORTEST, BASE64, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.9.6.1 retrieving revision 1.9.6.2 diff -C2 -d -r1.9.6.1 -r1.9.6.2 *** Message.py 4 Oct 2002 17:24:24 -0000 1.9.6.1 --- Message.py 10 Oct 2002 19:09:24 -0000 1.9.6.2 *************** *** 761,766 **** """Return the charset parameter of the Content-Type header. ! If there is no Content-Type header, or if that header has no charset ! parameter, failobj is returned. """ missing = [] --- 761,767 ---- """Return the charset parameter of the Content-Type header. ! The returned string is always coerced to lower case. If there is no ! Content-Type header, or if that header has no charset parameter, ! failobj is returned. """ missing = [] *************** *** 770,775 **** if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! return unicode(charset[2], charset[0]).encode('us-ascii') ! return charset def get_charsets(self, failobj=None): --- 771,777 ---- if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! charset = unicode(charset[2], charset[0]).encode('us-ascii') ! # RFC 2046, $4.1.2 says charsets are not case sensitive ! return charset.lower() def get_charsets(self, failobj=None): Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.4.10.2 retrieving revision 1.4.10.3 diff -C2 -d -r1.4.10.2 -r1.4.10.3 *** __init__.py 7 Oct 2002 17:18:52 -0000 1.4.10.2 --- __init__.py 10 Oct 2002 19:09:24 -0000 1.4.10.3 *************** *** 5,9 **** """ ! __version__ = '2.4.1' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.2' __all__ = [ From bwarsaw@users.sourceforge.net Thu Oct 10 20:10:48 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 10 Oct 2002 12:10:48 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib emailcharsets.tex,1.1.2.1,1.1.2.2 emailmessage.tex,1.4.8.1,1.4.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19900/lib Modified Files: Tag: release22-maint emailcharsets.tex emailmessage.tex Log Message: Backport email 2.4.2 changes from Python 2.3. Index: emailcharsets.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailcharsets.tex,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** emailcharsets.tex 4 Oct 2002 17:24:23 -0000 1.1.2.1 --- emailcharsets.tex 10 Oct 2002 19:10:45 -0000 1.1.2.2 *************** *** 24,31 **** converted outright, and are not allowed in email. ! Optional \var{input_charset} is as described below. After being alias ! normalized it is also used as a lookup into the registry of character ! sets to find out the header encoding, body encoding, and output ! conversion codec to be used for the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is --- 24,32 ---- converted outright, and are not allowed in email. ! Optional \var{input_charset} is as described below; it is always ! coerced to lower case. After being alias normalized it is also used ! as a lookup into the registry of character sets to find out the header ! encoding, body encoding, and output conversion codec to be used for ! the character set. For example, if \var{input_charset} is \code{iso-8859-1}, then headers and bodies will be encoded using quoted-printable and no output conversion codec is Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.4.8.1 retrieving revision 1.4.8.2 diff -C2 -d -r1.4.8.1 -r1.4.8.2 *** emailmessage.tex 4 Oct 2002 17:24:23 -0000 1.4.8.1 --- emailmessage.tex 10 Oct 2002 19:10:45 -0000 1.4.8.2 *************** *** 444,449 **** \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} Return the \code{charset} parameter of the \mailheader{Content-Type} ! header. If there is no \mailheader{Content-Type} header, or if that ! header has no \code{charset} parameter, \var{failobj} is returned. Note that this method differs from \method{get_charset()} which --- 444,450 ---- \begin{methoddesc}[Message]{get_content_charset}{\optional{failobj}} Return the \code{charset} parameter of the \mailheader{Content-Type} ! header, coerced to lower case. If there is no ! \mailheader{Content-Type} header, or if that header has no ! \code{charset} parameter, \var{failobj} is returned. Note that this method differs from \method{get_charset()} which From jackjansen@users.sourceforge.net Thu Oct 10 21:46:36 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 13:46:36 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_atexit.py,1.3.24.2,1.3.24.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv25976 Modified Files: Tag: release22-maint test_atexit.py Log Message: Backport of 1.7: Reorganized so the test is skipped if os.popen() doesn't exist (in stead of fail ing). Index: test_atexit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_atexit.py,v retrieving revision 1.3.24.2 retrieving revision 1.3.24.3 diff -C2 -d -r1.3.24.2 -r1.3.24.3 *** test_atexit.py 17 Jul 2002 00:42:52 -0000 1.3.24.2 --- test_atexit.py 10 Oct 2002 20:46:33 -0000 1.3.24.3 *************** *** 2,6 **** from test_support import TESTFN, vereq import atexit ! import os import sys --- 2,6 ---- from test_support import TESTFN, vereq import atexit ! from os import popen, unlink import sys *************** *** 24,28 **** f.close() ! p = os.popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() --- 24,28 ---- f.close() ! p = popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() *************** *** 52,56 **** f.close() ! p = os.popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() --- 52,56 ---- f.close() ! p = popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() *************** *** 60,62 **** """) ! os.unlink(fname) --- 60,62 ---- """) ! unlink(fname) From jackjansen@users.sourceforge.net Thu Oct 10 22:13:51 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 14:13:51 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_httplib,1.1.22.1,1.1.22.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv4444/Python 2.2/Lib/test/output Modified Files: Tag: release22-maint test_httplib Log Message: Use \n as line separator in stead of \r\n, which causes problems in MacPython 2.2. Index: test_httplib =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_httplib,v retrieving revision 1.1.22.1 retrieving revision 1.1.22.2 diff -C2 -d -r1.1.22.1 -r1.1.22.2 *** test_httplib 12 Jul 2002 15:52:26 -0000 1.1.22.1 --- test_httplib 10 Oct 2002 21:13:48 -0000 1.1.22.2 *************** *** 1,10 **** test_httplib ! reply: 'HTTP/1.1 200 Ok\r\n' Text ! reply: 'HTTP/1.1 400.100 Not Ok\r\n' BadStatusLine raised as expected InvalidURL raised as expected InvalidURL raised as expected ! reply: 'HTTP/1.1 200 OK\r\n' ! header: Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme" ! header: Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme" --- 1,10 ---- test_httplib ! reply: 'HTTP/1.1 200 Ok\n' Text ! reply: 'HTTP/1.1 400.100 Not Ok\n' BadStatusLine raised as expected InvalidURL raised as expected InvalidURL raised as expected ! reply: 'HTTP/1.1 200 OK\n' ! header: Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme" ! header: Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme" From jackjansen@users.sourceforge.net Thu Oct 10 22:13:55 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 14:13:55 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_httplib.py,1.2.12.3,1.2.12.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv4517/Python 2.2/Lib/test Modified Files: Tag: release22-maint test_httplib.py Log Message: Use \n as line separator in stead of \r\n, which causes problems in MacPython 2.2. Index: test_httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_httplib.py,v retrieving revision 1.2.12.3 retrieving revision 1.2.12.4 diff -C2 -d -r1.2.12.3 -r1.2.12.4 *** test_httplib.py 7 Oct 2002 01:18:17 -0000 1.2.12.3 --- test_httplib.py 10 Oct 2002 21:13:53 -0000 1.2.12.4 *************** *** 14,18 **** # Test HTTP status lines ! body = "HTTP/1.1 200 Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) --- 14,18 ---- # Test HTTP status lines ! body = "HTTP/1.1 200 Ok\n\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) *************** *** 21,25 **** resp.close() ! body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) --- 21,25 ---- resp.close() ! body = "HTTP/1.1 400.100 Not Ok\n\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) *************** *** 42,51 **** # test response with multiple message headers with the same field name. ! text = ('HTTP/1.1 200 OK\r\n' ! 'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n' 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";' ! ' Path="/acme"\r\n' ! '\r\n' ! 'No body\r\n') hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"' ', ' --- 42,51 ---- # test response with multiple message headers with the same field name. ! text = ('HTTP/1.1 200 OK\n' ! 'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\n' 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";' ! ' Path="/acme"\n' ! '\n' ! 'No body\n') hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"' ', ' From jackjansen@users.sourceforge.net Thu Oct 10 22:15:33 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 14:15:33 -0700 Subject: [Python-checkins] python/dist/src/Mac/Build PythonInterpreter.mcp,1.18,1.18.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5235/Python 2.2/Mac/Build Modified Files: Tag: release22-maint PythonInterpreter.mcp Log Message: Upped the stack limit to 256K to make test_class pass. Index: PythonInterpreter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonInterpreter.mcp,v retrieving revision 1.18 retrieving revision 1.18.4.1 diff -C2 -d -r1.18 -r1.18.4.1 Binary files /tmp/cvssxW2eY and /tmp/cvsGaASoN differ From jackjansen@users.sourceforge.net Thu Oct 10 22:16:10 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 14:16:10 -0700 Subject: [Python-checkins] python/dist/src/Mac/Build PythonStandSmall.mcp,1.33,1.33.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5453/Python 2.2/Mac/Build Modified Files: Tag: release22-maint PythonStandSmall.mcp Log Message: Upped the stack limit to 256K to make test_class pass. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.33 retrieving revision 1.33.4.1 diff -C2 -d -r1.33 -r1.33.4.1 Binary files /tmp/cvsuTF7Gh and /tmp/cvsmMtuLw differ From jackjansen@users.sourceforge.net Thu Oct 10 23:18:54 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Thu, 10 Oct 2002 15:18:54 -0700 Subject: [Python-checkins] python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,1.6.4.2.2.3,1.6.4.2.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv31570/Python 2.2/Mac/Distributions/(vise) Modified Files: Tag: release22-maint Python 2.2.vct Log Message: Updated for VISE 8, and for 2.2.2b1 distribution. Index: Python 2.2.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Attic/Python 2.2.vct,v retrieving revision 1.6.4.2.2.3 retrieving revision 1.6.4.2.2.4 diff -C2 -d -r1.6.4.2.2.3 -r1.6.4.2.2.4 Binary files /tmp/cvssrNexy and /tmp/cvskdDSwc differ From nnorwitz@users.sourceforge.net Thu Oct 10 23:49:36 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 10 Oct 2002 15:49:36 -0700 Subject: [Python-checkins] python/dist/src/Lib webbrowser.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15006/Lib Modified Files: webbrowser.py Log Message: SF # 585913, Adds Galeon support to webbrowser.py Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** webbrowser.py 2 Jun 2002 03:04:52 -0000 1.32 --- webbrowser.py 10 Oct 2002 22:49:29 -0000 1.33 *************** *** 136,139 **** --- 136,166 ---- + class Galeon: + """Launcher class for Galeon browsers.""" + def __init__(self, name): + self.name = name + self.basename = os.path.basename(name) + + def _remote(self, action, autoraise): + raise_opt = ("--noraise", "")[autoraise] + cmd = "%s %s %s >/dev/null 2>&1" % (self.name, raise_opt, action) + rc = os.system(cmd) + if rc: + import time + os.system("%s >/dev/null 2>&1 &" % self.name) + time.sleep(PROCESS_CREATION_DELAY) + rc = os.system(cmd) + return not rc + + def open(self, url, new=0, autoraise=1): + if new: + self._remote("-w '%s'" % url, autoraise) + else: + self._remote("-n '%s'" % url, autoraise) + + def open_new(self, url): + self.open(url, 1) + + class Konqueror: """Controller for the KDE File Manager (kfm, or Konqueror). *************** *** 235,239 **** # an xterm. if os.environ.get("TERM") or os.environ.get("DISPLAY"): ! _tryorder = ["mozilla","netscape","kfm","grail","links","lynx","w3m"] # Easy cases first -- register console browsers if we have them. --- 262,267 ---- # an xterm. if os.environ.get("TERM") or os.environ.get("DISPLAY"): ! _tryorder = ["galeon", "mozilla", "netscape", "kfm", ! "grail", "links", "lynx", "w3m",] # Easy cases first -- register console browsers if we have them. *************** *** 261,264 **** --- 289,296 ---- register("mosaic", None, GenericBrowser( "mosaic '%s' >/dev/null &")) + + # Gnome's Galeon + if _iscommand("galeon"): + register("galeon", None, Galeon("galeon")) # Konqueror/kfm, the KDE browser. From nnorwitz@users.sourceforge.net Thu Oct 10 23:50:55 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 10 Oct 2002 15:50:55 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.208,1.209 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv15659/Misc Modified Files: ACKS Log Message: Add Greg Copeland for SF # 585913, Adds Galeon support to webbrowser.py Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** ACKS 10 Oct 2002 14:36:13 -0000 1.208 --- ACKS 10 Oct 2002 22:50:53 -0000 1.209 *************** *** 108,111 **** --- 108,112 ---- Matt Conway David M. Cooke + Greg Copeland David Costanzo Scott Cotton From gvanrossum@users.sourceforge.net Fri Oct 11 01:09:54 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 10 Oct 2002 17:09:54 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.147.6.9,2.147.6.10 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11255 Modified Files: Tag: release22-maint stringobject.c Log Message: Backport the relevant part of 2.192: The string formatting code has a test to switch to Unicode when %s sees a Unicode argument. Unfortunately this test was also executed for %r, because %s and %r share almost all of their code. This meant that, if u is a unicode object while repr(u) is an 8-bit string containing ASCII characters, '%r' % u is a *unicode* string containing only ASCII characters! Fixed by executing the test only for %s. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.147.6.9 retrieving revision 2.147.6.10 diff -C2 -d -r2.147.6.9 -r2.147.6.10 *** stringobject.c 23 Sep 2002 21:17:27 -0000 2.147.6.9 --- stringobject.c 11 Oct 2002 00:09:51 -0000 2.147.6.10 *************** *** 3503,3507 **** break; case 's': - case 'r': #ifdef Py_USING_UNICODE if (PyUnicode_Check(v)) { --- 3503,3506 ---- *************** *** 3511,3514 **** --- 3510,3515 ---- } #endif + /* Fall through */ + case 'r': if (c == 's') temp = PyObject_Str(v); From gvanrossum@users.sourceforge.net Fri Oct 11 01:22:24 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 10 Oct 2002 17:22:24 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.24,2.126.4.25 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15319 Modified Files: Tag: release22-maint typeobject.c Log Message: New in 2.2.2! In inherit_slots(), get rid of the COPYSLOT(tp_dictoffset). Copying the offset from a non-dominant base makes no sense: either the non-dominant base has a nonzero tp_dictoffset, and then we should have already copied it from the dominant base (at the very end of inherit_special()), or the non-dominant base has no tp_dictoffset and for some reason type_new() decided not to add one. The tp_dictoffset from a non-dominant base is likely to conflict with the instance layout of the dominant base, so copying the tp_dictoffset from the non-dominant base would be a really bad idea in that case. This bug can only be triggered by multiple inheritance from an extension class that doesn't set tp_dictoffset and a new-style user-level class that does have one. There are no such extension classes in the distribution, but there are 3rd party ones. (Zope3 now has one, that's how I found this. :-) I've asked a few heavy users of new-style classes, extension classes and metaclasses (David Abrahams and Kevin Jacobs), and neither of them found any problems in their test suite after applying this fix, so I assume it's safe. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126.4.24 retrieving revision 2.126.4.25 diff -C2 -d -r2.126.4.24 -r2.126.4.25 *** typeobject.c 7 Oct 2002 18:08:27 -0000 2.126.4.24 --- typeobject.c 11 Oct 2002 00:22:22 -0000 2.126.4.25 *************** *** 2088,2092 **** COPYSLOT(tp_descr_get); COPYSLOT(tp_descr_set); - COPYSLOT(tp_dictoffset); COPYSLOT(tp_init); COPYSLOT(tp_alloc); --- 2088,2091 ---- From gvanrossum@users.sourceforge.net Fri Oct 11 01:43:50 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 10 Oct 2002 17:43:50 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.193,2.194 unicodeobject.c,2.171,2.172 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv19831 Modified Files: stringobject.c unicodeobject.c Log Message: Fix a nasty endcase reported by Armin Rigo in SF bug 618623: '%2147483647d' % -123 segfaults. This was because an integer overflow in a comparison caused the string resize to be skipped. After fixing the overflow, this could call _PyString_Resize() with a negative size, so I (1) test for that and raise MemoryError instead; (2) also added a test for negative newsize to _PyString_Resize(), raising SystemError as for all bad arguments. An identical bug existed in unicodeobject.c, of course. Will backport to 2.2.2. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.193 retrieving revision 2.194 diff -C2 -d -r2.193 -r2.194 *** stringobject.c 9 Oct 2002 19:14:30 -0000 2.193 --- stringobject.c 11 Oct 2002 00:43:48 -0000 2.194 *************** *** 3320,3324 **** register PyStringObject *sv; v = *pv; ! if (!PyString_Check(v) || v->ob_refcnt != 1) { *pv = 0; Py_DECREF(v); --- 3320,3324 ---- register PyStringObject *sv; v = *pv; ! if (!PyString_Check(v) || v->ob_refcnt != 1 || newsize < 0) { *pv = 0; Py_DECREF(v); *************** *** 3960,3967 **** if (width < len) width = len; ! if (rescnt < width + (sign != 0)) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; if (_PyString_Resize(&result, reslen) < 0) return NULL; --- 3960,3971 ---- if (width < len) width = len; ! if (rescnt - (sign != 0) < width) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; + if (reslen < 0) { + Py_DECREF(result); + return PyErr_NoMemory(); + } if (_PyString_Resize(&result, reslen) < 0) return NULL; Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.171 retrieving revision 2.172 diff -C2 -d -r2.171 -r2.172 *** unicodeobject.c 24 Sep 2002 09:32:14 -0000 2.171 --- unicodeobject.c 11 Oct 2002 00:43:48 -0000 2.172 *************** *** 262,266 **** } v = (PyUnicodeObject *)*unicode; ! if (v == NULL || !PyUnicode_Check(v) || v->ob_refcnt != 1) { PyErr_BadInternalCall(); return -1; --- 262,266 ---- } v = (PyUnicodeObject *)*unicode; ! if (v == NULL || !PyUnicode_Check(v) || v->ob_refcnt != 1 || length < 0) { PyErr_BadInternalCall(); return -1; *************** *** 6484,6491 **** if (width < len) width = len; ! if (rescnt < width + (sign != 0)) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; if (_PyUnicode_Resize(&result, reslen) < 0) return NULL; --- 6484,6495 ---- if (width < len) width = len; ! if (rescnt - (sign != 0) < width) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; + if (reslen < 0) { + Py_DECREF(result); + return PyErr_NoMemory(); + } if (_PyUnicode_Resize(&result, reslen) < 0) return NULL; From gvanrossum@users.sourceforge.net Fri Oct 11 01:47:23 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 10 Oct 2002 17:47:23 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.147.6.10,2.147.6.11 unicodeobject.c,2.124.6.16,2.124.6.17 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv22726 Modified Files: Tag: release22-maint stringobject.c unicodeobject.c Log Message: Backport stringobject.c 2.194 and unicodeobject.c 2.172: Fix a nasty endcase reported by Armin Rigo in SF bug 618623: '%2147483647d' % -123 segfaults. This was because an integer overflow in a comparison caused the string resize to be skipped. After fixing the overflow, this could call _PyString_Resize() with a negative size, so I (1) test for that and raise MemoryError instead; (2) also added a test for negative newsize to _PyString_Resize(), raising SystemError as for all bad arguments. An identical bug existed in unicodeobject.c, of course. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.147.6.10 retrieving revision 2.147.6.11 diff -C2 -d -r2.147.6.10 -r2.147.6.11 *** stringobject.c 11 Oct 2002 00:09:51 -0000 2.147.6.10 --- stringobject.c 11 Oct 2002 00:47:19 -0000 2.147.6.11 *************** *** 2989,2993 **** register PyStringObject *sv; v = *pv; ! if (!PyString_Check(v) || v->ob_refcnt != 1) { *pv = 0; Py_DECREF(v); --- 2989,2993 ---- register PyStringObject *sv; v = *pv; ! if (!PyString_Check(v) || v->ob_refcnt != 1 || newsize < 0) { *pv = 0; Py_DECREF(v); *************** *** 3601,3608 **** if (width < len) width = len; ! if (rescnt < width + (sign != 0)) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; if (_PyString_Resize(&result, reslen) < 0) return NULL; --- 3601,3612 ---- if (width < len) width = len; ! if (rescnt - (sign != 0) < width) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; + if (reslen < 0) { + Py_DECREF(result); + return PyErr_NoMemory(); + } if (_PyString_Resize(&result, reslen) < 0) return NULL; Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.124.6.16 retrieving revision 2.124.6.17 diff -C2 -d -r2.124.6.16 -r2.124.6.17 *** unicodeobject.c 7 Oct 2002 12:32:56 -0000 2.124.6.16 --- unicodeobject.c 11 Oct 2002 00:47:20 -0000 2.124.6.17 *************** *** 262,266 **** } v = (PyUnicodeObject *)*unicode; ! if (v == NULL || !PyUnicode_Check(v) || v->ob_refcnt != 1) { PyErr_BadInternalCall(); return -1; --- 262,266 ---- } v = (PyUnicodeObject *)*unicode; ! if (v == NULL || !PyUnicode_Check(v) || v->ob_refcnt != 1 || length < 0) { PyErr_BadInternalCall(); return -1; *************** *** 5732,5739 **** if (width < len) width = len; ! if (rescnt < width + (sign != 0)) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; if (_PyUnicode_Resize(&result, reslen) < 0) return NULL; --- 5732,5743 ---- if (width < len) width = len; ! if (rescnt - (sign != 0) < width) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; + if (reslen < 0) { + Py_DECREF(result); + return PyErr_NoMemory(); + } if (_PyUnicode_Resize(&result, reslen) < 0) return NULL; From loewis@users.sourceforge.net Fri Oct 11 06:38:02 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 22:38:02 -0700 Subject: [Python-checkins] python/dist/src/Objects stringobject.c,2.194,2.195 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30657/Objects Modified Files: stringobject.c Log Message: Back out #479898. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.194 retrieving revision 2.195 diff -C2 -d -r2.194 -r2.195 *** stringobject.c 11 Oct 2002 00:43:48 -0000 2.194 --- stringobject.c 11 Oct 2002 05:37:59 -0000 2.195 *************** *** 27,44 **** - #if defined(HAVE_MBTOWC) && defined(HAVE_WCHAR_H) && defined(HAVE_WCTYPE_H) - # define PRINT_MULTIBYTE_STRING - # include - # include - # include - # if defined(HAVE_ISWPRINT) - # define _isprint iswprint - # else - # define _isprint isprint - # endif - #endif - - static const char *hexchars = "0123456789abcdef"; - /* For both PyString_FromString() and PyString_FromStringAndSize(), the --- 27,30 ---- *************** *** 764,775 **** string_print(PyStringObject *op, FILE *fp, int flags) { - #ifndef PRINT_MULTIBYTE_STRING int i; char c; - #else - char *scur, *send; - wchar_t c; - int cr; - #endif int quote; --- 750,755 ---- *************** *** 797,830 **** fputc(quote, fp); - #ifndef PRINT_MULTIBYTE_STRING for (i = 0; i < op->ob_size; i++) { c = op->ob_sval[i]; - #else - for (scur = op->ob_sval, send = op->ob_sval + op->ob_size; - scur < send; scur += cr) { - if ((cr = mbtowc(&c, scur, send - scur)) <= 0) - goto non_printable; - #endif if (c == quote || c == '\\') ! fputc('\\', fp), fputc(c, fp); else if (c == '\t') ! fputs("\\t", fp); else if (c == '\n') ! fputs("\\n", fp); else if (c == '\r') ! fputs("\\r", fp); ! #ifndef PRINT_MULTIBYTE_STRING ! else if (' ' <= c && c < 0x7f) ! fputc(c, fp); else ! fprintf(fp, "\\x%02x", c & 0xff); ! #else ! else if (_isprint(c)) ! fwrite(scur, cr, 1, fp); ! else { ! non_printable: cr = 1; /* unit to move cursor */ ! fprintf(fp, "\\x%02x", *scur & 0xff); ! } ! #endif } fputc(quote, fp); --- 777,794 ---- fputc(quote, fp); for (i = 0; i < op->ob_size; i++) { c = op->ob_sval[i]; if (c == quote || c == '\\') ! fprintf(fp, "\\%c", c); else if (c == '\t') ! fprintf(fp, "\\t"); else if (c == '\n') ! fprintf(fp, "\\n"); else if (c == '\r') ! fprintf(fp, "\\r"); ! else if (c < ' ' || c >= 0x7f) ! fprintf(fp, "\\x%02x", c & 0xff); else ! fputc(c, fp); } fputc(quote, fp); *************** *** 847,858 **** } else { - #ifndef PRINT_MULTIBYTE_STRING register int i; register char c; - #else - register char *scur, *send; - wchar_t c; - int cr; - #endif register char *p; int quote; --- 811,816 ---- *************** *** 867,871 **** p = PyString_AS_STRING(v); *p++ = quote; - #ifndef PRINT_MULTIBYTE_STRING for (i = 0; i < op->ob_size; i++) { /* There's at least enough room for a hex escape --- 825,828 ---- *************** *** 873,882 **** assert(newsize - (p - PyString_AS_STRING(v)) >= 5); c = op->ob_sval[i]; - #else - for (scur = op->ob_sval, send = op->ob_sval + op->ob_size; - scur < send; scur += cr) { - if ((cr = mbtowc(&c, scur, send - scur)) <= 0) - goto non_printable; - #endif if (c == quote || c == '\\') *p++ = '\\', *p++ = c; --- 830,833 ---- *************** *** 887,904 **** else if (c == '\r') *p++ = '\\', *p++ = 'r'; ! #ifndef PRINT_MULTIBYTE_STRING ! else if (' ' <= c && c < 0x7f) ! *p++ = c; ! else { ! #else ! else if (_isprint(c)) ! memcpy(p, scur, cr), p += cr; ! else { ! non_printable: cr = 1; c = *scur; ! #endif ! *p++ = '\\'; *p++ = 'x'; ! *p++ = hexchars[(c >> 4) & 0x0f]; ! *p++ = hexchars[c & 0x0f]; } } assert(newsize - (p - PyString_AS_STRING(v)) >= 1); --- 838,850 ---- else if (c == '\r') *p++ = '\\', *p++ = 'r'; ! else if (c < ' ' || c >= 0x7f) { ! /* For performance, we don't want to call ! PyOS_snprintf here (extra layers of ! function call). */ ! sprintf(p, "\\x%02x", c & 0xff); ! p += 4; } + else + *p++ = c; } assert(newsize - (p - PyString_AS_STRING(v)) >= 1); From loewis@users.sourceforge.net Fri Oct 11 06:38:02 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu, 10 Oct 2002 22:38:02 -0700 Subject: [Python-checkins] python/dist/src configure,1.345,1.346 configure.in,1.356,1.357 pyconfig.h.in,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv30657 Modified Files: configure configure.in pyconfig.h.in Log Message: Back out #479898. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.345 retrieving revision 1.346 diff -C2 -d -r1.345 -r1.346 *** configure 10 Oct 2002 14:27:27 -0000 1.345 --- configure 11 Oct 2002 05:37:58 -0000 1.346 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.355 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.356 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 902,906 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 902,906 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *************** *** 3891,3895 **** - for ac_header in dlfcn.h fcntl.h grp.h limits.h langinfo.h \ libintl.h locale.h ncurses.h poll.h pthread.h \ --- 3891,3894 ---- *************** *** 3897,3901 **** sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h wctype.h libutil.h \ sys/resource.h netpacket/packet.h do --- 3896,3900 ---- sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ sys/resource.h netpacket/packet.h do *************** *** 11935,11945 **** - - for ac_func in alarm chown chroot clock confstr ctermid ctermid_r execv \ fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton iswprint kill killpg lchown link lstat mbtowc mkfifo \ ! mknod mktime mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ --- 11934,11942 ---- for ac_func in alarm chown chroot clock confstr ctermid ctermid_r execv \ fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton kill killpg lchown link lstat mkfifo mknod mktime \ ! mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ *************** *** 17176,17180 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 17173,17177 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.356 retrieving revision 1.357 diff -C2 -d -r1.356 -r1.357 *** configure.in 10 Oct 2002 14:27:30 -0000 1.356 --- configure.in 11 Oct 2002 05:37:59 -0000 1.357 *************** *** 619,623 **** sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h wctype.h libutil.h \ sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT --- 619,623 ---- sys/audioio.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ ! sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT *************** *** 1681,1686 **** fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton iswprint kill killpg lchown link lstat mbtowc mkfifo \ ! mknod mktime mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ --- 1681,1686 ---- fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ ! hstrerror inet_pton kill killpg lchown link lstat mkfifo mknod mktime \ ! mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ select setegid seteuid setgid setgroups \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** pyconfig.h.in 10 Oct 2002 14:27:30 -0000 1.53 --- pyconfig.h.in 11 Oct 2002 05:37:59 -0000 1.54 *************** *** 200,206 **** #undef HAVE_INTTYPES_H - /* Define to 1 if you have the `iswprint' function. */ - #undef HAVE_ISWPRINT - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL --- 200,203 ---- *************** *** 254,260 **** #undef HAVE_MAKEDEV - /* Define to 1 if you have the `mbtowc' function. */ - #undef HAVE_MBTOWC - /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE --- 251,254 ---- *************** *** 595,601 **** /* Define if the compiler provides a wchar.h header file. */ #undef HAVE_WCHAR_H - - /* Define to 1 if you have the header file. */ - #undef HAVE_WCTYPE_H /* Define to 1 if you have the `_getpty' function. */ --- 589,592 ---- From gvanrossum@users.sourceforge.net Fri Oct 11 12:47:32 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 04:47:32 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.497,1.498 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv18217 Modified Files: NEWS Log Message: Back out news about SF patch 479898 -- it's withdrawn. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.497 retrieving revision 1.498 diff -C2 -d -r1.497 -r1.498 *** NEWS 10 Oct 2002 14:36:13 -0000 1.497 --- NEWS 11 Oct 2002 11:47:28 -0000 1.498 *************** *** 67,76 **** ----------------- - - The repr() function for 8-bit strings now preserves all characters - that are considered printable in the current locale. (Previously, - all bytes that are not printable ASCII would be encoded in hex.) - This requires the user to set the current locale; in the initial "C" - locale the old behavior is maintained. [SF patch 479898] - - Unicode file name processing for Windows (PEP 277) is implemented. All platforms now have an os.path.supports_unicode_filenames attribute, --- 67,70 ---- From mwh@users.sourceforge.net Fri Oct 11 14:46:40 2002 From: mwh@users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri, 11 Oct 2002 06:46:40 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_format.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv24501 Modified Files: test_format.py Log Message: A test for the recent overflow-in-format-crash bug. Only runs when sys.maxint == 2**32 - 1; different things go wrong on a 64-bit box. Index: test_format.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_format.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_format.py 8 Aug 2002 20:19:19 -0000 1.16 --- test_format.py 11 Oct 2002 13:46:32 -0000 1.17 *************** *** 184,193 **** testboth("%x", 0x42, "42") ! # testboth("%x", -0x42, "ffffffbe") # Alas, that's specific to 32-bit machines testboth("%x", 0x42L, "42") testboth("%x", -0x42L, "-42") testboth("%o", 042, "42") ! # testboth("%o", -042, "37777777736") # Alas, that's specific to 32-bit machines testboth("%o", 042L, "42") testboth("%o", -042L, "-42") --- 184,193 ---- testboth("%x", 0x42, "42") ! # testboth("%x", -0x42, "ffffffbe") # specific to 32-bit boxes; see below testboth("%x", 0x42L, "42") testboth("%x", -0x42L, "-42") testboth("%o", 042, "42") ! # testboth("%o", -042, "37777777736") # specific to 32-bit boxes; see below testboth("%o", 042L, "42") testboth("%o", -042L, "-42") *************** *** 222,223 **** --- 222,235 ---- test_exc('%d', '1', TypeError, "int argument required") test_exc('%g', '1', TypeError, "float argument required") + + if sys.maxint == 2**32-1: + # crashes 2.2.1 and earlier: + try: + "%*d"%(sys.maxint, -127) + except MemoryError: + pass + else: + raise TestFailed, '"%*d"%(sys.maxint, -127) should fail' + # (different things go wrong on a 64 bit box...) + testboth("%x", -0x42, "ffffffbe") + testboth("%o", -042, "37777777736") From jhylton@users.sourceforge.net Fri Oct 11 15:36:28 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 07:36:28 -0700 Subject: [Python-checkins] python/dist/src/Lib urllib.py,1.152,1.153 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11512 Modified Files: urllib.py Log Message: Use fdopen() to create file from fd. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** urllib.py 12 Sep 2002 20:14:04 -0000 1.152 --- urllib.py 11 Oct 2002 14:36:24 -0000 1.153 *************** *** 224,228 **** (fd, filename) = tempfile.mkstemp(suffix) self.__tempfiles.append(filename) ! tfp = os.open(fd, 'wb') result = filename, headers if self.tempcache is not None: --- 224,228 ---- (fd, filename) = tempfile.mkstemp(suffix) self.__tempfiles.append(filename) ! tfp = os.fdopen(fd, 'wb') result = filename, headers if self.tempcache is not None: From jackjansen@users.sourceforge.net Fri Oct 11 16:00:45 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri, 11 Oct 2002 08:00:45 -0700 Subject: [Python-checkins] python/dist/src/Mac/Build PythonCore.mcp,1.31.2.1.2.1,1.31.2.1.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv20676 Modified Files: Tag: release22-maint PythonCore.mcp Log Message: Added a debug target for PythonCoreCarbon Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.31.2.1.2.1 retrieving revision 1.31.2.1.2.2 diff -C2 -d -r1.31.2.1.2.1 -r1.31.2.1.2.2 Binary files /tmp/cvstSbJ2a and /tmp/cvsydhY9H differ From jhylton@users.sourceforge.net Fri Oct 11 16:51:32 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 08:51:32 -0700 Subject: [Python-checkins] python/dist/src/Lib rexec.py,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7153 Modified Files: rexec.py Log Message: Add hexversion to list of safe sys names (SF bug 621447). Bug fix candidate. Index: rexec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** rexec.py 15 Sep 2002 06:00:43 -0000 1.41 --- rexec.py 11 Oct 2002 15:51:29 -0000 1.42 *************** *** 144,148 **** 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'platform', 'exit', 'maxint') --- 144,148 ---- 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'hexversion', 'platform', 'exit', 'maxint') From jhylton@users.sourceforge.net Fri Oct 11 16:55:20 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 08:55:20 -0700 Subject: [Python-checkins] python/dist/src/Lib rexec.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv8318 Modified Files: rexec.py Log Message: Sort names alphabetically. Index: rexec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** rexec.py 11 Oct 2002 15:51:29 -0000 1.42 --- rexec.py 11 Oct 2002 15:55:17 -0000 1.43 *************** *** 144,149 **** 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'hexversion', ! 'platform', 'exit', 'maxint') nok_builtin_names = ('open', 'file', 'reload', '__import__') --- 144,149 ---- 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('copyright', 'exit', 'hexversion', 'version', ! 'maxint', 'platform', 'ps1', 'ps2') nok_builtin_names = ('open', 'file', 'reload', '__import__') From fdrake@acm.org Fri Oct 11 17:01:52 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 11 Oct 2002 12:01:52 -0400 Subject: [Python-checkins] python/dist/src/Lib rexec.py,1.42,1.43 In-Reply-To: References: Message-ID: <15782.62960.465319.394898@grendel.zope.com> jhylton@users.sourceforge.net writes: > Modified Files: > rexec.py > Log Message: > Sort names alphabetically. ... > ! ok_sys_names = ('copyright', 'exit', 'hexversion', 'version', > ! 'maxint', 'platform', 'ps1', 'ps2') In what alphabet??? I can sympathize with wanting version and hexversion together, but don't call version, maxint alphabetical! I think version_info could be added as well -- It's just a tuple with the same information as hexversion. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From jhylton@users.sourceforge.net Fri Oct 11 17:05:13 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 09:05:13 -0700 Subject: [Python-checkins] python/dist/src/Lib rexec.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11996 Modified Files: rexec.py Log Message: Trying alphabet again Index: rexec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** rexec.py 11 Oct 2002 15:55:17 -0000 1.43 --- rexec.py 11 Oct 2002 16:05:07 -0000 1.44 *************** *** 144,149 **** 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('copyright', 'exit', 'hexversion', 'version', ! 'maxint', 'platform', 'ps1', 'ps2') nok_builtin_names = ('open', 'file', 'reload', '__import__') --- 144,149 ---- 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('copyright', 'exit', 'hexversion', 'maxint', 'platform', ! 'ps1', 'ps2', 'version') nok_builtin_names = ('open', 'file', 'reload', '__import__') From fdrake@users.sourceforge.net Fri Oct 11 17:20:48 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 11 Oct 2002 09:20:48 -0700 Subject: [Python-checkins] python/dist/src/Lib rexec.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19612 Modified Files: rexec.py Log Message: Allow restricted code to get byteorder, getdefaultencoding(), getrefcount(), maxunicode, and version_info. Index: rexec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** rexec.py 11 Oct 2002 16:05:07 -0000 1.44 --- rexec.py 11 Oct 2002 16:20:45 -0000 1.45 *************** *** 144,149 **** 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('copyright', 'exit', 'hexversion', 'maxint', 'platform', ! 'ps1', 'ps2', 'version') nok_builtin_names = ('open', 'file', 'reload', '__import__') --- 144,150 ---- 'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid') ! ok_sys_names = ('byteorder', 'copyright', 'exit', 'getdefaultencoding', ! 'getrefcount', 'hexversion', 'maxint', 'maxunicode', ! 'platform', 'ps1', 'ps2', 'version', 'version_info') nok_builtin_names = ('open', 'file', 'reload', '__import__') From jhylton@users.sourceforge.net Fri Oct 11 18:26:49 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 10:26:49 -0700 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11038 Modified Files: urllib2.py Log Message: Fix for SF bug #599836: Don't duplicate headers. If the request object has a header, it should override the default header provided by the OpenerDirector. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** urllib2.py 9 Oct 2002 23:17:04 -0000 1.35 --- urllib2.py 11 Oct 2002 17:26:46 -0000 1.36 *************** *** 248,252 **** def __init__(self): server_version = "Python-urllib/%s" % __version__ ! self.addheaders = [('User-agent', server_version)] # manage the individual handlers self.handlers = [] --- 248,252 ---- def __init__(self): server_version = "Python-urllib/%s" % __version__ ! self.addheaders = [('User-Agent', server_version)] # manage the individual handlers self.handlers = [] *************** *** 772,776 **** h.putheader('Host', sel_host or host) for args in self.parent.addheaders: ! h.putheader(*args) for k, v in req.headers.items(): h.putheader(k, v) --- 772,777 ---- h.putheader('Host', sel_host or host) for args in self.parent.addheaders: ! if name not in req.headers: ! h.putheader(*args) for k, v in req.headers.items(): h.putheader(k, v) From jhylton@users.sourceforge.net Fri Oct 11 18:27:57 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri, 11 Oct 2002 10:27:57 -0700 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11412 Modified Files: urllib2.py Log Message: Typo in docstring Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** urllib2.py 11 Oct 2002 17:26:46 -0000 1.36 --- urllib2.py 11 Oct 2002 17:27:55 -0000 1.37 *************** *** 6,10 **** object; the returned object has some extra methods described below. ! The OpenerDirectory manages a collection of Handler objects that do all the actual work. Each Handler implements a particular protocol or option. The OpenerDirector is a composite object that invokes the --- 6,10 ---- object; the returned object has some extra methods described below. ! The OpenerDirector manages a collection of Handler objects that do all the actual work. Each Handler implements a particular protocol or option. The OpenerDirector is a composite object that invokes the From tim_one@users.sourceforge.net Fri Oct 11 18:51:46 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 11 Oct 2002 10:51:46 -0700 Subject: [Python-checkins] python/dist/src/PC python_nt.rc,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv18872/python/PC Modified Files: python_nt.rc Log Message: Repair the DLL name -- this has to match the major.minor version numbers. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** python_nt.rc 24 Jan 2002 00:04:37 -0000 1.17 --- python_nt.rc 11 Oct 2002 17:51:44 -0000 1.18 *************** *** 16,20 **** #ifndef PYTHON_DLL_NAME ! #define PYTHON_DLL_NAME "python22.dll" #endif --- 16,20 ---- #ifndef PYTHON_DLL_NAME ! #define PYTHON_DLL_NAME "python23.dll" #endif From tim_one@users.sourceforge.net Fri Oct 11 19:25:54 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 11 Oct 2002 11:25:54 -0700 Subject: [Python-checkins] python/dist/src/PC python_nt.rc,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv29153/python/PC Modified Files: python_nt.rc Log Message: The MS resource compiler simply cannot be convinced to do arithmetic correctly. So field3.py is a Python program that can. This injects another manual step into the Python release process for Windows; so it goes. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** python_nt.rc 11 Oct 2002 17:51:44 -0000 1.18 --- python_nt.rc 11 Oct 2002 18:25:52 -0000 1.19 *************** *** 20,26 **** /* Nothing below this should need to be changed except for copyright ! * notices and company name. */ /* e.g., 2.1a2 * PY_VERSION comes from patchevel.h --- 20,46 ---- /* Nothing below this should need to be changed except for copyright ! * notices, company name, and FIELD3. Unfortunately, all attempts ! * to get the resource compiler to do arithmetic in macros have ! * failed miserably -- it gives syntax errors, ignores operators, ! * or does stuff that's simply bizarre. */ + + /* This is what we'd like FIELD3 to be: + * + * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) + * + * but that neither gives an error nor comes anywhere close to working. The + * following comment and #define are output from PCbuild\field3.py: + * + * For 2.3a0, + * PY_MICRO_VERSION = 0 + * PY_RELEASE_LEVEL = 'alpha' = 0xa + * PY_RELEASE_SERIAL = 1 + * + * and 0*1000 + 10*10 + 1 = 101 + */ + #define FIELD3 101 + /* e.g., 2.1a2 * PY_VERSION comes from patchevel.h *************** *** 38,42 **** # error "PY_RELEASE_SERIAL > 9" #endif - #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) #define PYVERSION64 PY_MAJOR_VERSION, PY_MINOR_VERSION, FIELD3, PYTHON_API_VERSION --- 58,61 ---- From tim_one@users.sourceforge.net Fri Oct 11 19:25:55 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 11 Oct 2002 11:25:55 -0700 Subject: [Python-checkins] python/dist/src/PCbuild field3.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv29153/python/PCbuild Added Files: field3.py Log Message: The MS resource compiler simply cannot be convinced to do arithmetic correctly. So field3.py is a Python program that can. This injects another manual step into the Python release process for Windows; so it goes. --- NEW FILE: field3.py --- # An absurd workaround for the lack of arithmetic in MS's resource compiler. # After building Python, run this, then paste the output into the appropriate # part of PC\python_nt.rc. # Example output: # # * For 2.3a0, # * PY_MICRO_VERSION = 0 # * PY_RELEASE_LEVEL = 'alpha' = 0xA # * PY_RELEASE_SERIAL = 1 # * # * and 0*1000 + 10*10 + 1 = 101. # */ # #define FIELD3 101 import sys major, minor, micro, level, serial = sys.version_info levelnum = {'alpha': 0xA, 'beta': 0xB, 'candidate': 0xC, 'final': 0xF, }[level] string = sys.version.split()[0] # like '2.3a0' print " * For %s," % string print " * PY_MICRO_VERSION = %d" % micro print " * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum)) print " * PY_RELEASE_SERIAL = %d" % serial print " *" field3 = micro * 1000 + levelnum * 10 + serial print " * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3) print " */" print "#define FIELD3", field3 From tim_one@users.sourceforge.net Fri Oct 11 19:29:56 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 11 Oct 2002 11:29:56 -0700 Subject: [Python-checkins] python/dist/src/PCbuild field3.py,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv30448 Added Files: Tag: release22-maint field3.py Log Message: Backporting a new file from 2.3 needed to worm around that MS's resource compiler can't do correct arithmetic. The 3rd 16-bit int in the "binary file version" we produce on Windows has been nonsense as a result. I'll fix that next. --- NEW FILE: field3.py --- # An absurd workaround for the lack of arithmetic in MS's resource compiler. # After building Python, run this, then paste the output into the appropriate # part of PC\python_nt.rc. # Example output: # # * For 2.3a0, # * PY_MICRO_VERSION = 0 # * PY_RELEASE_LEVEL = 'alpha' = 0xA # * PY_RELEASE_SERIAL = 1 # * # * and 0*1000 + 10*10 + 1 = 101. # */ # #define FIELD3 101 import sys major, minor, micro, level, serial = sys.version_info levelnum = {'alpha': 0xA, 'beta': 0xB, 'candidate': 0xC, 'final': 0xF, }[level] string = sys.version.split()[0] # like '2.3a0' print " * For %s," % string print " * PY_MICRO_VERSION = %d" % micro print " * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum)) print " * PY_RELEASE_SERIAL = %d" % serial print " *" field3 = micro * 1000 + levelnum * 10 + serial print " * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3) print " */" print "#define FIELD3", field3 From tim_one@users.sourceforge.net Fri Oct 11 19:38:23 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Fri, 11 Oct 2002 11:38:23 -0700 Subject: [Python-checkins] python/dist/src/PC python_nt.rc,1.15.14.1,1.15.14.2 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv893/22/PC Modified Files: Tag: release22-maint python_nt.rc Log Message: SF bug 621507: python22.dll incorrect "File version". The MS resource compiler can't do arithmetic. Fixed it by hand. Note that the new PCbuild\field3.py was added to help with this, and injects another manual step into the Python Windows release process. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.15.14.1 retrieving revision 1.15.14.2 diff -C2 -d -r1.15.14.1 -r1.15.14.2 *** python_nt.rc 28 Feb 2002 07:43:20 -0000 1.15.14.1 --- python_nt.rc 11 Oct 2002 18:38:20 -0000 1.15.14.2 *************** *** 21,27 **** /* Nothing below this should need to be changed except for copyright ! * notices and company name. */ /* e.g., 2.1a2 * PY_VERSION comes from patchevel.h --- 21,47 ---- /* Nothing below this should need to be changed except for copyright ! * notices, company name, and FIELD3. Unfortunately, all attempts ! * to get the resource compiler to do arithmetic in macros have ! * failed miserably -- it gives syntax errors, ignores operators, ! * or does stuff that's simply bizarre. */ + + /* This is what we'd like FIELD3 to be: + * + * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) + * + * but that neither gives an error nor comes anywhere close to working. The + * following comment and #define are output from PCbuild\field3.py: + * + * For 2.2.2b1, + * PY_MICRO_VERSION = 2 + * PY_RELEASE_LEVEL = 'beta' = 0xb + * PY_RELEASE_SERIAL = 1 + * + * and 2*1000 + 11*10 + 1 = 2111 + */ + #define FIELD3 2111 + /* e.g., 2.1a2 * PY_VERSION comes from patchevel.h *************** *** 39,43 **** # error "PY_RELEASE_SERIAL > 9" #endif - #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) #define PYVERSION64 PY_MAJOR_VERSION, PY_MINOR_VERSION, FIELD3, PYTHON_API_VERSION --- 59,62 ---- From gvanrossum@users.sourceforge.net Fri Oct 11 21:37:26 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 13:37:26 -0700 Subject: [Python-checkins] python/dist/src/Objects object.c,2.192,2.193 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv7786 Modified Files: object.c Log Message: PyObject_Init[Var] is almost always called from the PyObject_NEW[_VAR] macros. The 'op' argument is then the result from PyObject_MALLOC, and that can of course be NULL. In that case, PyObject_Init[Var] would raise a SystemError with "NULL object passed to PyObject_Init[Var]". But there's nothing the caller of the macro can do about this. So PyObject_Init[Var] should call just PyErr_NoMemory. Will backport. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.192 retrieving revision 2.193 diff -C2 -d -r2.192 -r2.193 *** object.c 24 Aug 2002 06:31:34 -0000 2.192 --- object.c 11 Oct 2002 20:37:24 -0000 2.193 *************** *** 110,118 **** PyObject_Init(PyObject *op, PyTypeObject *tp) { ! if (op == NULL) { ! PyErr_SetString(PyExc_SystemError, ! "NULL object passed to PyObject_Init"); ! return op; ! } /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; --- 110,115 ---- PyObject_Init(PyObject *op, PyTypeObject *tp) { ! if (op == NULL) ! return PyErr_NoMemory(); /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; *************** *** 124,132 **** PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, int size) { ! if (op == NULL) { ! PyErr_SetString(PyExc_SystemError, ! "NULL object passed to PyObject_InitVar"); ! return op; ! } /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; --- 121,126 ---- PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, int size) { ! if (op == NULL) ! return (PyVarObject *) PyErr_NoMemory(); /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; From gvanrossum@users.sourceforge.net Fri Oct 11 21:38:00 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 13:38:00 -0700 Subject: [Python-checkins] python/dist/src/Objects object.c,2.162.6.5,2.162.6.6 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv7961 Modified Files: Tag: release22-maint object.c Log Message: Backport 2.193: PyObject_Init[Var] is almost always called from the PyObject_NEW[_VAR] macros. The 'op' argument is then the result from PyObject_MALLOC, and that can of course be NULL. In that case, PyObject_Init[Var] would raise a SystemError with "NULL object passed to PyObject_Init[Var]". But there's nothing the caller of the macro can do about this. So PyObject_Init[Var] should call just PyErr_NoMemory. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.162.6.5 retrieving revision 2.162.6.6 diff -C2 -d -r2.162.6.5 -r2.162.6.6 *** object.c 8 Jul 2002 22:30:52 -0000 2.162.6.5 --- object.c 11 Oct 2002 20:37:58 -0000 2.162.6.6 *************** *** 100,108 **** PyObject_Init(PyObject *op, PyTypeObject *tp) { ! if (op == NULL) { ! PyErr_SetString(PyExc_SystemError, ! "NULL object passed to PyObject_Init"); ! return op; ! } /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; --- 100,105 ---- PyObject_Init(PyObject *op, PyTypeObject *tp) { ! if (op == NULL) ! return PyErr_NoMemory(); /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; *************** *** 114,122 **** PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, int size) { ! if (op == NULL) { ! PyErr_SetString(PyExc_SystemError, ! "NULL object passed to PyObject_InitVar"); ! return op; ! } /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; --- 111,116 ---- PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, int size) { ! if (op == NULL) ! return (PyVarObject *) PyErr_NoMemory(); /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; From rhettinger@users.sourceforge.net Fri Oct 11 22:00:00 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:00:00 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.53.4.8,1.53.4.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv15753 Modified Files: Tag: release22-maint ref5.tex Log Message: Clarify impending deprecation of the floor div operator, modulo operator, and divmod() function for complex numbers. Closes SF Bug 621708: Unclear deprecation. Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.53.4.8 retrieving revision 1.53.4.9 diff -C2 -d -r1.53.4.8 -r1.53.4.9 *** ref5.tex 7 Oct 2002 16:26:28 -0000 1.53.4.8 --- ref5.tex 11 Oct 2002 20:59:57 -0000 1.53.4.9 *************** *** 717,725 **** }. ! Complex floor division operator, modulo operator, and ! \function{divmod()}. ! ! \deprecated{2.3}{Instead convert to float using \function{abs()} ! if appropriate.} The \code{+} (addition) operator yields the sum of its arguments. --- 717,724 ---- }. ! \deprecated{2.3}{The floor division operator, the modulo operator, ! and the \function{divmod()} function are no longer defined for complex ! numbers. Instead, convert to a floating point number using the ! \function{abs()} function if appropriate.} The \code{+} (addition) operator yields the sum of its arguments. From gvanrossum@users.sourceforge.net Fri Oct 11 22:05:59 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:05:59 -0700 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.136,2.137 tupleobject.c,2.74,2.75 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18889 Modified Files: listobject.c tupleobject.c Log Message: Add checks for size overflow on list*n, list+list, tuple+tuple. Will backport. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.136 retrieving revision 2.137 diff -C2 -d -r2.136 -r2.137 *** listobject.c 5 Sep 2002 21:32:55 -0000 2.136 --- listobject.c 11 Oct 2002 21:05:55 -0000 2.137 *************** *** 392,395 **** --- 392,397 ---- #define b ((PyListObject *)bb) size = a->ob_size + b->ob_size; + if (size < 0) + return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); if (np == NULL) { *************** *** 420,423 **** --- 422,427 ---- n = 0; size = a->ob_size * n; + if (size/a->ob_size != n) + return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); if (np == NULL) Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.74 retrieving revision 2.75 diff -C2 -d -r2.74 -r2.75 *** tupleobject.c 5 Sep 2002 21:32:55 -0000 2.74 --- tupleobject.c 11 Oct 2002 21:05:56 -0000 2.75 *************** *** 331,334 **** --- 331,336 ---- #define b ((PyTupleObject *)bb) size = a->ob_size + b->ob_size; + if (size < 0) + return PyErr_NoMemory(); np = (PyTupleObject *) PyTuple_New(size); if (np == NULL) { From rhettinger@users.sourceforge.net Fri Oct 11 22:08:04 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:08:04 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.65,1.66 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv19911 Modified Files: ref5.tex Log Message: Clarify deprecation of the floor div operator, modulo operator, and divmod() function for complex numbers. Closes SF Bug 621708: Unclear deprecation. Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** ref5.tex 7 Oct 2002 16:28:38 -0000 1.65 --- ref5.tex 11 Oct 2002 21:08:02 -0000 1.66 *************** *** 701,709 **** }. ! Complex floor division operator, modulo operator, and ! \function{divmod()}. ! ! \deprecated{2.3}{Instead convert to float using \function{abs()} ! if appropriate.} The \code{+} (addition) operator yields the sum of its arguments. --- 701,708 ---- }. ! \deprecated{2.3}{The floor division operator, the modulo operator, ! and the \function{divmod()} function are no longer defined for complex ! numbers. Instead, convert to a floating point number using the ! \function{abs()} function if appropriate.} The \code{+} (addition) operator yields the sum of its arguments. From gvanrossum@users.sourceforge.net Fri Oct 11 22:13:16 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:13:16 -0700 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.103.6.2,2.103.6.3 tupleobject.c,2.62.6.1,2.62.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21718 Modified Files: Tag: release22-maint listobject.c tupleobject.c Log Message: Backport listobject.c 2.137 and tupleobject.c 2.75: Add checks for size overflow on list*n, list+list, tuple+tuple. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.103.6.2 retrieving revision 2.103.6.3 diff -C2 -d -r2.103.6.2 -r2.103.6.3 *** listobject.c 23 May 2002 13:02:35 -0000 2.103.6.2 --- listobject.c 11 Oct 2002 21:13:13 -0000 2.103.6.3 *************** *** 400,403 **** --- 400,405 ---- #define b ((PyListObject *)bb) size = a->ob_size + b->ob_size; + if (size < 0) + return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); if (np == NULL) { *************** *** 428,431 **** --- 430,435 ---- n = 0; size = a->ob_size * n; + if (size/a->ob_size != n) + return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); if (np == NULL) Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.62.6.1 retrieving revision 2.62.6.2 diff -C2 -d -r2.62.6.1 -r2.62.6.2 *** tupleobject.c 28 Mar 2002 20:36:50 -0000 2.62.6.1 --- tupleobject.c 11 Oct 2002 21:13:14 -0000 2.62.6.2 *************** *** 338,341 **** --- 338,343 ---- #define b ((PyTupleObject *)bb) size = a->ob_size + b->ob_size; + if (size < 0) + return PyErr_NoMemory(); np = (PyTupleObject *) PyTuple_New(size); if (np == NULL) { From nnorwitz@users.sourceforge.net Fri Oct 11 22:53:04 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:53:04 -0700 Subject: [Python-checkins] python/dist/src/Modules md5module.c,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1630/Modules Modified Files: md5module.c Log Message: SF #621948, update docstring for md5 by David M. Cooke. Will backport. Index: md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** md5module.c 2 Aug 2002 02:27:13 -0000 2.33 --- md5module.c 11 Oct 2002 21:53:01 -0000 2.34 *************** *** 186,189 **** --- 186,190 ---- update() -- updates the current digest with an additional string\n\ digest() -- return the current digest value\n\ + hexdigest() -- return the current digest as a string of hexadecimal digits\n\ copy() -- return a copy of the current md5 object"); From nnorwitz@users.sourceforge.net Fri Oct 11 22:55:16 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 11 Oct 2002 14:55:16 -0700 Subject: [Python-checkins] python/dist/src/Modules md5module.c,2.27,2.27.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2309/Modules Modified Files: Tag: release22-maint md5module.c Log Message: Backport 2.34. SF #621948, update docstring for md5 by David M. Cooke Index: md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.27 retrieving revision 2.27.6.1 diff -C2 -d -r2.27 -r2.27.6.1 *** md5module.c 8 Dec 2001 18:02:57 -0000 2.27 --- md5module.c 11 Oct 2002 21:55:13 -0000 2.27.6.1 *************** *** 197,200 **** --- 197,201 ---- update() -- updates the current digest with an additional string\n\ digest() -- return the current digest value\n\ + hexdigest() -- return the current digest as a string of hexadecimal digits\n\ copy() -- return a copy of the current md5 object\n\ "; From nnorwitz@users.sourceforge.net Fri Oct 11 23:04:25 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 11 Oct 2002 15:04:25 -0700 Subject: [Python-checkins] python/dist/src/Lib webbrowser.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4884/Lib Modified Files: webbrowser.py Log Message: SF # 539360, webbrowser.py and konqueror, by Andy McKay Fix Konqueror so it can start when calling open(). The assert needed to be on the raw URL, not openURL 'url...' Will backport. Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** webbrowser.py 10 Oct 2002 22:49:29 -0000 1.33 --- webbrowser.py 11 Oct 2002 22:04:22 -0000 1.34 *************** *** 177,182 **** def _remote(self, action): ! assert "'" not in action ! cmd = "kfmclient '%s' >/dev/null 2>&1" % action rc = os.system(cmd) if rc: --- 177,181 ---- def _remote(self, action): ! cmd = "kfmclient %s >/dev/null 2>&1" % action rc = os.system(cmd) if rc: *************** *** 193,196 **** --- 192,196 ---- # XXX Currently I know no way to prevent KFM from # opening a new win. + assert "'" not in url self._remote("openURL '%s'" % url) From nnorwitz@users.sourceforge.net Fri Oct 11 23:06:15 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 11 Oct 2002 15:06:15 -0700 Subject: [Python-checkins] python/dist/src/Lib webbrowser.py,1.26.6.2,1.26.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv6042/Lib Modified Files: Tag: release22-maint webbrowser.py Log Message: Backport 1.34. SF # 539360, webbrowser.py and konqueror, by Andy McKay Fix Konqueror so it can start when calling open(). The assert needed to be on the raw URL, not openURL 'url...' Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.26.6.2 retrieving revision 1.26.6.3 diff -C2 -d -r1.26.6.2 -r1.26.6.3 *** webbrowser.py 6 Oct 2002 03:10:26 -0000 1.26.6.2 --- webbrowser.py 11 Oct 2002 22:06:12 -0000 1.26.6.3 *************** *** 150,155 **** def _remote(self, action): ! assert "'" not in action ! cmd = "kfmclient '%s' >/dev/null 2>&1" % action rc = os.system(cmd) if rc: --- 150,154 ---- def _remote(self, action): ! cmd = "kfmclient %s >/dev/null 2>&1" % action rc = os.system(cmd) if rc: *************** *** 166,169 **** --- 165,169 ---- # XXX Currently I know no way to prevent KFM from # opening a new win. + assert "'" not in url self._remote("openURL '%s'" % url) From nnorwitz@users.sourceforge.net Fri Oct 11 23:19:45 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 11 Oct 2002 15:19:45 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.265,2.266 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv10325/Modules Modified Files: posixmodule.c Log Message: Fix a few docstrings, remove extra commas Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.265 retrieving revision 2.266 diff -C2 -d -r2.265 -r2.266 *** posixmodule.c 10 Oct 2002 14:27:30 -0000 2.265 --- posixmodule.c 11 Oct 2002 22:19:42 -0000 2.266 *************** *** 4970,4974 **** PyDoc_STRVAR(posix_fdopen__doc__, ! "fdopen(fd, [, mode='r' [, bufsize]]) -> file_object\n\n\ Return an open file object connected to a file descriptor."); --- 4970,4974 ---- PyDoc_STRVAR(posix_fdopen__doc__, ! "fdopen(fd [, mode='r' [, bufsize]]) -> file_object\n\n\ Return an open file object connected to a file descriptor."); *************** *** 5065,5069 **** #ifdef HAVE_MKFIFO PyDoc_STRVAR(posix_mkfifo__doc__, ! "mkfifo(filename, [, mode=0666])\n\n\ Create a FIFO (a POSIX named pipe)."); --- 5065,5069 ---- #ifdef HAVE_MKFIFO PyDoc_STRVAR(posix_mkfifo__doc__, ! "mkfifo(filename [, mode=0666])\n\n\ Create a FIFO (a POSIX named pipe)."); *************** *** 5089,5093 **** #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) PyDoc_STRVAR(posix_mknod__doc__, ! "mknod(filename, [, mode=0600, device])\n\n\ Create a filesystem node (file, device special file or named pipe)\n\ named filename. mode specifies both the permissions to use and the\n\ --- 5089,5093 ---- #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) PyDoc_STRVAR(posix_mknod__doc__, ! "mknod(filename [, mode=0600, device])\n\n\ Create a filesystem node (file, device special file or named pipe)\n\ named filename. mode specifies both the permissions to use and the\n\ From neal@metaslash.com Fri Oct 11 23:46:14 2002 From: neal@metaslash.com (Neal Norwitz) Date: Fri, 11 Oct 2002 18:46:14 -0400 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.264,2.265 In-Reply-To: References: Message-ID: <20021011224614.GA27230@epoch.metaslash.com> On Thu, Oct 10, 2002 at 07:27:33AM -0700, loewis@users.sourceforge.net wrote: > > Modified Files: > posixmodule.c > Log Message: > Patch #569139: Implementation of major, minor and makedev. [snip] > ! if (!PyArg_ParseTuple(args, "s|iii:mknod", &filename, &mode, &device)) > return NULL; Shouldn't the format string to PyArg_ParseTuple() be "s|ii:mknod" (ie, drop one i)? Neal From gvanrossum@users.sourceforge.net Sat Oct 12 00:39:37 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 16:39:37 -0700 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.137,2.138 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30716 Modified Files: listobject.c Log Message: Darn! Don't divide by zero. Bad fix. :-) Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.137 retrieving revision 2.138 diff -C2 -d -r2.137 -r2.138 *** listobject.c 11 Oct 2002 21:05:55 -0000 2.137 --- listobject.c 11 Oct 2002 23:39:35 -0000 2.138 *************** *** 422,426 **** n = 0; size = a->ob_size * n; ! if (size/a->ob_size != n) return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); --- 422,426 ---- n = 0; size = a->ob_size * n; ! if (n && size/n != a->ob_size) return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); From gvanrossum@users.sourceforge.net Sat Oct 12 00:39:56 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 11 Oct 2002 16:39:56 -0700 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.103.6.3,2.103.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30796 Modified Files: Tag: release22-maint listobject.c Log Message: Darn! Don't divide by zero. Bad fix. :-) Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.103.6.3 retrieving revision 2.103.6.4 diff -C2 -d -r2.103.6.3 -r2.103.6.4 *** listobject.c 11 Oct 2002 21:13:13 -0000 2.103.6.3 --- listobject.c 11 Oct 2002 23:39:54 -0000 2.103.6.4 *************** *** 430,434 **** n = 0; size = a->ob_size * n; ! if (size/a->ob_size != n) return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); --- 430,434 ---- n = 0; size = a->ob_size * n; ! if (n && size/n != a->ob_size) return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); From bsb@xlab.net Sun Oct 13 14:03:47 2002 From: bsb@xlab.net (Siggy Brentrup) Date: Sun, 13 Oct 2002 15:03:47 +0200 Subject: [Python-checkins] Apology for accidental spamming :-( Message-ID: Hello, in an attempt to transfer the contents of a mailbox to another location, I made a big mistake resulting in a lot of messages being resent to their original receipients. Please kindly accept my apologies, it will not happen again. Siggy Brentrup ------------------------------ Log entries for messages erroneously sent to you: 2002-10-13 13:49:31 180hFN-0001Vh-00 => python-checkins@python.org R=lookuphost T=remote_smtp H=mail.python.org [12.155.117.29]* 2002-10-13 13:49:42 180hFU-0001Xa-00 => python-checkins@python.org R=lookuphost T=remote_smtp H=mail.python.org [12.155.117.29]* From gward@users.sourceforge.net Sun Oct 13 20:23:20 2002 From: gward@users.sourceforge.net (gward@users.sourceforge.net) Date: Sun, 13 Oct 2002 12:23:20 -0700 Subject: [Python-checkins] python/dist/src/Lib textwrap.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14639 Modified Files: textwrap.py Log Message: Fix copyright date: the core of this code actually dates back to 1999 (rev. 1.4 of distutils/fancy_getopt.py). Index: textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** textwrap.py 2 Oct 2002 15:47:05 -0000 1.16 --- textwrap.py 13 Oct 2002 19:23:18 -0000 1.17 *************** *** 2,6 **** """ ! # Copyright (C) 2001 Gregory P. Ward. # Copyright (C) 2002 Python Software Foundation. # Written by Greg Ward --- 2,6 ---- """ ! # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002 Python Software Foundation. # Written by Greg Ward *************** *** 57,61 **** wordsep_re = re.compile(r'(\s+|' # any whitespace r'-*\w{2,}-(?=\w{2,})|' # hyphenated words ! r'(?<=\S)-{2,}(?=\S))') # em-dash # XXX will there be a locale-or-charset-aware version of --- 57,61 ---- wordsep_re = re.compile(r'(\s+|' # any whitespace r'-*\w{2,}-(?=\w{2,})|' # hyphenated words ! r'(?<=\S)-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of From akuchling@users.sourceforge.net Sun Oct 13 21:20:25 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun, 13 Oct 2002 13:20:25 -0700 Subject: [Python-checkins] python/nondist/peps pep-0262.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv30879 Modified Files: pep-0262.txt Log Message: Add two methods to interface (old change) Index: pep-0262.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0262.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0262.txt 29 May 2002 21:24:23 -0000 1.7 --- pep-0262.txt 13 Oct 2002 20:20:23 -0000 1.8 *************** *** 134,137 **** --- 134,145 ---- """ + def find_package (self, path): + """find_file(path:string) : Package + Search and return the package containing the file 'path'. + Returns None if the file doesn't belong to any package + that the InstallationDatabase knows about. + XXX should this work for directories? + """ + class Package: """Instance attributes: *************** *** 164,167 **** --- 172,188 ---- """ + def has_file (self, path): + """has_file(path:string) : Boolean + Returns true if the specified path belongs to a file in this + package. + """ + + def check_file (self, path): + """check_file(path:string) : Boolean + Checks whether the file's size, checksum, and ownership match, + returning true if they do. + """ + + Deliverables From akuchling@users.sourceforge.net Sun Oct 13 21:21:19 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun, 13 Oct 2002 13:21:19 -0700 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.214,1.215 pep-0262.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv31166 Modified Files: pep-0000.txt pep-0262.txt Log Message: Mark PEP 262 as deferred Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.214 retrieving revision 1.215 diff -C2 -d -r1.214 -r1.215 *** pep-0000.txt 7 Oct 2002 18:38:47 -0000 1.214 --- pep-0000.txt 13 Oct 2002 20:21:17 -0000 1.215 *************** *** 77,81 **** S 256 Docstring Processing System Framework Goodger S 258 Docutils Design Specification Goodger - S 262 Database of Installed Python Packages Kuchling S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro --- 77,80 ---- *************** *** 161,164 **** --- 160,164 ---- SR 244 The `directive' Statement von Loewis SR 259 Omit printing newline after newline van Rossum + SD 262 Database of Installed Python Packages Kuchling SR 271 Prefixing sys.path by command line option Giacometti SD 288 Generators Attributes and Exceptions Hettinger Index: pep-0262.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0262.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0262.txt 13 Oct 2002 20:20:23 -0000 1.8 --- pep-0262.txt 13 Oct 2002 20:21:17 -0000 1.9 *************** *** 5,9 **** Type: Standards Track Created: 08-Jul-2001 ! Status: Draft Post-History: 27-Mar-2002 --- 5,9 ---- Type: Standards Track Created: 08-Jul-2001 ! Status: Deferred Post-History: 27-Mar-2002 From akuchling@users.sourceforge.net Sun Oct 13 21:22:47 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun, 13 Oct 2002 13:22:47 -0700 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.215,1.216 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv31424 Modified Files: pep-0000.txt Log Message: Forgot the numeric list -- mark PEP 262 as deferred Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.215 retrieving revision 1.216 diff -C2 -d -r1.215 -r1.216 *** pep-0000.txt 13 Oct 2002 20:21:17 -0000 1.215 --- pep-0000.txt 13 Oct 2002 20:22:45 -0000 1.216 *************** *** 254,258 **** SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod ! S 262 Database of Installed Python Packages Kuchling SF 263 Defining Python Source Code Encodings Lemburg SF 264 Future statements in simulated shells Hudson --- 254,258 ---- SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod ! SD 262 Database of Installed Python Packages Kuchling SF 263 Defining Python Source Code Encodings Lemburg SF 264 Future statements in simulated shells Hudson From akuchling@users.sourceforge.net Sun Oct 13 22:02:37 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun, 13 Oct 2002 14:02:37 -0700 Subject: [Python-checkins] python/nondist/peps pep-0218.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv9839 Modified Files: pep-0218.txt Log Message: Update description of sets to match the 2.3 sets.py Index: pep-0218.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0218.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0218.txt 20 Aug 2002 14:00:44 -0000 1.6 --- pep-0218.txt 13 Oct 2002 21:02:35 -0000 1.7 *************** *** 10,23 **** - Cautionary note - - Much of this PEP has been implemented in the new "sets" module, - added to Python 2.3. The sets module differs in a number of - aspects from this PEP; in particular its approach to mutability is - different. It is my hope that this PEP's author will update his - PEP to match the sets module more closely. [note added by Guido - van Rossum] - - Introduction --- 10,13 ---- *************** *** 104,111 **** do nothing if it is not. ! S.popitem() Remove and return an arbitrary element, raising a LookupError if the element is not present. and one new built-in conversion function: --- 94,103 ---- do nothing if it is not. ! S.pop() Remove and return an arbitrary element, raising a LookupError if the element is not present. + S.clear() Remove all elements from this set. + and one new built-in conversion function: *************** *** 129,132 **** --- 121,125 ---- "ValueError", because set elements are neither keys nor values. + Short-Term Proposal *************** *** 141,155 **** This class will use a dictionary internally to contain set values. ! In order to avoid having to duplicate values (e.g. for iteration ! through the set), the class will rely on the iterators which are ! scheduled to appear in Python 2.2. Tim Peters believes that the class's constructor should take a single sequence as an argument, and populate the set with that sequence's elements. His argument is that in most cases, ! programmers will be created sets from pre-existing sequences, so ! that common case should be usual. However, this would require ! users to remember an extra set of parentheses when initializing a ! set with known values: >>> Set((1, 2, 3, 4)) # case 1 --- 134,148 ---- This class will use a dictionary internally to contain set values. ! To avoid having to duplicate values (e.g. for iteration through ! the set), the class will rely on the iterators added in Python ! 2.2. Tim Peters believes that the class's constructor should take a single sequence as an argument, and populate the set with that sequence's elements. His argument is that in most cases, ! programmers will be creating sets from pre-existing sequences, so ! that this case should be the common one. However, this would ! require users to remember an extra set of parentheses when ! initializing a set with known values: >>> Set((1, 2, 3, 4)) # case 1 *************** *** 165,169 **** notation for sets in the future, then case 2 will become redundant. We have therefore adopted the first strategy, in which ! the initializer takes a single sequence argument. --- 158,162 ---- notation for sets in the future, then case 2 will become redundant. We have therefore adopted the first strategy, in which ! the initializer takes a single iterable argument. *************** *** 177,187 **** widely used in graph algorithms and other applications). ! At Tim Peters' suggestion, we will implement the following ! compromise. A set may only contain immutable elements, but is ! itself mutable *until* its hash code is calculated. As soon as ! that happens, the set is "frozen", i.e. becomes immutable. Thus, ! a set may be used as a dictionary key, or as a set element, but ! cannot be updated after this is done. Peters reports that this ! behavior rarely causes problems in practice. --- 170,180 ---- widely used in graph algorithms and other applications). ! There are two classes implemented in the "sets" module. Instances ! of the Set class can be modified by the addition or removal of ! elements, and the ImmutableSet class is "frozen", with an ! unchangeable collection of elements. Therefore, an ImmutableSet ! may be used as a dictionary key or as a set element, but cannot be ! updated. Both types of set require that their elements are ! immutable, hashable objects. From gvanrossum@users.sourceforge.net Mon Oct 14 13:21:20 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 05:21:20 -0700 Subject: [Python-checkins] python/dist/src/Lib sre.py,1.44,1.44.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18281 Modified Files: Tag: release22-maint sre.py Log Message: Add finditer to __all__ (when defining it at all). SF bug 585882. Will forward-port. Index: sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v retrieving revision 1.44 retrieving revision 1.44.8.1 diff -C2 -d -r1.44 -r1.44.8.1 *** sre.py 28 Oct 2001 20:15:40 -0000 1.44 --- sre.py 14 Oct 2002 12:21:16 -0000 1.44.8.1 *************** *** 167,170 **** --- 167,171 ---- if sys.hexversion >= 0x02020000: + __all__.append("finditer") def finditer(pattern, string): """Return an iterator over all non-overlapping matches in the From gvanrossum@users.sourceforge.net Mon Oct 14 13:22:19 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 05:22:19 -0700 Subject: [Python-checkins] python/dist/src/Lib sre.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18627 Modified Files: sre.py Log Message: Add finditer to __all__ (when defining it at all). SF bug 585882. Will forward-port. Index: sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** sre.py 28 Oct 2001 20:15:40 -0000 1.44 --- sre.py 14 Oct 2002 12:22:17 -0000 1.45 *************** *** 167,170 **** --- 167,171 ---- if sys.hexversion >= 0x02020000: + __all__.append("finditer") def finditer(pattern, string): """Return an iterator over all non-overlapping matches in the From gvanrossum@users.sourceforge.net Mon Oct 14 13:25:22 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 05:25:22 -0700 Subject: [Python-checkins] python/dist/src/Include patchlevel.h,2.60.2.1.2.8,2.60.2.1.2.9 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv19855 Modified Files: Tag: release22-maint patchlevel.h Log Message: Bump release version to 2.2.2 -- the final release is imminent. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.60.2.1.2.8 retrieving revision 2.60.2.1.2.9 diff -C2 -d -r2.60.2.1.2.8 -r2.60.2.1.2.9 *** patchlevel.h 8 Oct 2002 01:04:34 -0000 2.60.2.1.2.8 --- patchlevel.h 14 Oct 2002 12:25:20 -0000 2.60.2.1.2.9 *************** *** 23,31 **** #define PY_MINOR_VERSION 2 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2.2b1+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 23,31 ---- #define PY_MINOR_VERSION 2 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL ! #define PY_RELEASE_SERIAL 0 /* Version as a string */ ! #define PY_VERSION "2.2.2" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From gvanrossum@users.sourceforge.net Mon Oct 14 13:35:55 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 05:35:55 -0700 Subject: [Python-checkins] python/dist/src README,1.136.4.8,1.136.4.9 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv23882 Modified Files: Tag: release22-maint README Log Message: Bump release version to 2.2.2 -- the final release is imminent. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.136.4.8 retrieving revision 1.136.4.9 diff -C2 -d -r1.136.4.8 -r1.136.4.9 *** README 7 Oct 2002 18:14:18 -0000 1.136.4.8 --- README 14 Oct 2002 12:35:53 -0000 1.136.4.9 *************** *** 1,4 **** ! This is Python version 2.2.2b1 ! ============================== Copyright (c) 2001, 2002 Python Software Foundation. --- 1,4 ---- ! This is Python version 2.2.2 ! ============================ Copyright (c) 2001, 2002 Python Software Foundation. From fdrake@users.sourceforge.net Mon Oct 14 15:33:42 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 14 Oct 2002 07:33:42 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.235.2.1.2.13,1.235.2.1.2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv9328 Modified Files: Tag: release22-maint Makefile Log Message: Update release information for 2.2.2 final. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.235.2.1.2.13 retrieving revision 1.235.2.1.2.14 diff -C2 -d -r1.235.2.1.2.13 -r1.235.2.1.2.14 *** Makefile 7 Oct 2002 18:47:48 -0000 1.235.2.1.2.13 --- Makefile 14 Oct 2002 14:33:35 -0000 1.235.2.1.2.14 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2b1 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2 PYTHON= python From fdrake@users.sourceforge.net Mon Oct 14 15:33:43 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 14 Oct 2002 07:33:43 -0700 Subject: [Python-checkins] python/dist/src/Doc/texinputs boilerplate.tex,1.70.2.1.2.7,1.70.2.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv9328/texinputs Modified Files: Tag: release22-maint boilerplate.tex Log Message: Update release information for 2.2.2 final. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.70.2.1.2.7 retrieving revision 1.70.2.1.2.8 diff -C2 -d -r1.70.2.1.2.7 -r1.70.2.1.2.8 *** boilerplate.tex 4 Oct 2002 20:40:45 -0000 1.70.2.1.2.7 --- boilerplate.tex 14 Oct 2002 14:33:39 -0000 1.70.2.1.2.8 *************** *** 6,11 **** } ! \date{\today} % XXX update before release! \release{2.2.2} % software release, not documentation ! \setreleaseinfo{b1} % empty for final release \setshortversion{2.2} % major.minor only for software --- 6,11 ---- } ! \date{October 14, 2002} % XXX update before release! \release{2.2.2} % software release, not documentation ! \setreleaseinfo{} % empty for final release \setshortversion{2.2} % major.minor only for software From tim_one@users.sourceforge.net Mon Oct 14 16:01:53 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:01:53 -0700 Subject: [Python-checkins] python/dist/src/PCbuild BUILDno.txt,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv21151/python/PCbuild Modified Files: BUILDno.txt Log Message: Update list of Windows buildnos for 2.2.2 final. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** BUILDno.txt 6 Oct 2002 04:04:46 -0000 1.39 --- BUILDno.txt 14 Oct 2002 15:01:44 -0000 1.40 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 37 2.2.2 (final) + 14-Oct-2002 36 2.2.2b1 7-Oct-2002 From tim_one@users.sourceforge.net Mon Oct 14 16:02:28 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:02:28 -0700 Subject: [Python-checkins] python/dist/src/PCbuild BUILDno.txt,1.26.4.8,1.26.4.9 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv21379/22/PCbuild Modified Files: Tag: release22-maint BUILDno.txt Log Message: Update list of Windows buildnos for 2.2.2 final. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.26.4.8 retrieving revision 1.26.4.9 diff -C2 -d -r1.26.4.8 -r1.26.4.9 *** BUILDno.txt 6 Oct 2002 04:14:18 -0000 1.26.4.8 --- BUILDno.txt 14 Oct 2002 15:02:11 -0000 1.26.4.9 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 37 2.2.2 (final) + 14-Oct-2002 36 2.2.2b1 7-Oct-2002 From tim_one@users.sourceforge.net Mon Oct 14 16:03:58 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:03:58 -0700 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.dsp,1.30.4.4,1.30.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv21963/22/PCbuild Modified Files: Tag: release22-maint pythoncore.dsp Log Message: Update Windows buildno for 2.2.2 final. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.30.4.4 retrieving revision 1.30.4.5 diff -C2 -d -r1.30.4.4 -r1.30.4.5 *** pythoncore.dsp 6 Oct 2002 04:14:18 -0000 1.30.4.4 --- pythoncore.dsp 14 Oct 2002 15:03:43 -0000 1.30.4.5 *************** *** 740,748 **** !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=36 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=36 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" --- 740,748 ---- !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=37 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=37 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" From fdrake@users.sourceforge.net Mon Oct 14 16:04:41 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:04:41 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkpkglist,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv22420 Modified Files: mkpkglist Log Message: Minor refactoring to avoid code duplication. Index: mkpkglist =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkpkglist,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkpkglist 8 Dec 2001 00:26:07 -0000 1.1 --- mkpkglist 14 Oct 2002 15:04:33 -0000 1.2 *************** *** 60,63 **** --- 60,70 ---- return int(round(os.path.getsize(fn) / 1024.0)) + def get_file_cell(prefix, ext, have): + if have: + kb = get_size(prefix, ext) + return FILE_TEMPLATE % (release, prefix, release, ext, kb) + else: + return NO_FILE_TEMPLATE + for name, prefix in PKG_TYPES: zip_fn = "%s-%s.zip" % (prefix, release) *************** *** 72,92 **** print " %s" % name ! if have_zip: ! kb = get_size(prefix, ".zip") ! print FILE_TEMPLATE % (release, prefix, release, ".zip", kb) ! else: ! print NO_FILE_TEMPLATE ! ! if have_tgz: ! kb = get_size(prefix, ".tgz") ! print FILE_TEMPLATE % (release, prefix, release, ".tgz", kb) ! else: ! print NO_FILE_TEMPLATE ! ! if have_bz2: ! kb = get_size(prefix, ".tar.bz2") ! print FILE_TEMPLATE % (release, prefix, release, ".tar.bz2", kb) ! else: ! print NO_FILE_TEMPLATE print " " --- 79,85 ---- print " %s" % name ! print get_file_cell(prefix, ".zip", have_zip) ! print get_file_cell(prefix, ".tgz", have_tgz) ! print get_file_cell(prefix, ".tar.bz2", have_bz2) print " " From bwarsaw@users.sourceforge.net Mon Oct 14 16:07:01 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:07:01 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv23342/email Modified Files: Charset.py Log Message: CHARSETS: Add faux '8bit' encoding for representing raw 8-bit data for which we know nothing else. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Charset.py 13 Oct 2002 04:00:45 -0000 1.9 --- Charset.py 14 Oct 2002 15:06:55 -0000 1.10 *************** *** 44,47 **** --- 44,49 ---- 'koi8-r': (BASE64, BASE64, None), 'utf-8': (SHORTEST, BASE64, 'utf-8'), + # We're making this one up to represent raw unencoded 8-bit + '8bit': (None, BASE64, 'utf-8'), } From tim_one@users.sourceforge.net Mon Oct 14 16:07:41 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:07:41 -0700 Subject: [Python-checkins] python/dist/src/PC python_nt.rc,1.15.14.2,1.15.14.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv23401/PC Modified Files: Tag: release22-maint python_nt.rc Log Message: Update FIELD3 of Windows 64-bit binary version # for 2.2.2. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.15.14.2 retrieving revision 1.15.14.3 diff -C2 -d -r1.15.14.2 -r1.15.14.3 *** python_nt.rc 11 Oct 2002 18:38:20 -0000 1.15.14.2 --- python_nt.rc 14 Oct 2002 15:07:34 -0000 1.15.14.3 *************** *** 35,46 **** * following comment and #define are output from PCbuild\field3.py: * ! * For 2.2.2b1, * PY_MICRO_VERSION = 2 ! * PY_RELEASE_LEVEL = 'beta' = 0xb ! * PY_RELEASE_SERIAL = 1 * ! * and 2*1000 + 11*10 + 1 = 2111 */ ! #define FIELD3 2111 /* e.g., 2.1a2 --- 35,46 ---- * following comment and #define are output from PCbuild\field3.py: * ! * For 2.2.2, * PY_MICRO_VERSION = 2 ! * PY_RELEASE_LEVEL = 'final' = 0xf ! * PY_RELEASE_SERIAL = 0 * ! * and 2*1000 + 15*10 + 0 = 2150 */ ! #define FIELD3 2150 /* e.g., 2.1a2 From tim_one@users.sourceforge.net Mon Oct 14 16:09:23 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:09:23 -0700 Subject: [Python-checkins] python/dist/src/PCbuild python20.wse,1.98.4.9,1.98.4.10 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv24083/PCbuild Modified Files: Tag: release22-maint python20.wse Log Message: Update version strings in Windows installer for 2.2.2. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.98.4.9 retrieving revision 1.98.4.10 diff -C2 -d -r1.98.4.9 -r1.98.4.10 *** python20.wse 7 Oct 2002 00:59:01 -0000 1.98.4.9 --- python20.wse 14 Oct 2002 15:09:12 -0000 1.98.4.10 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2.2b1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=8.14 ! Title=Python 2.2.2 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 19,25 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2.2b1.exe Dialogs Version=8 ! Version File=2.2.2b1 Version Description=Python Programming Language Version Copyright=©2002 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2.2.exe Dialogs Version=8 ! Version File=2.2.2 Version Description=Python Programming Language Version Copyright=©2002 Python Software Foundation *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2.2b1 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2.2 end item: Remark From bwarsaw@users.sourceforge.net Mon Oct 14 16:09:36 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:09:36 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Generator.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv24305/email Modified Files: Generator.py Log Message: _split_header(): If we have a header which is a byte string containing 8-bit data, we cannot split it safely, so return the original string unchanged. _is8bitstring(): Helper function which returns True when we have a byte string that contains non-ascii characters (i.e. mysterious 8-bit data). Index: Generator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Generator.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Generator.py 28 Sep 2002 18:04:55 -0000 1.16 --- Generator.py 14 Oct 2002 15:09:30 -0000 1.17 *************** *** 9,13 **** import random ! from types import ListType from cStringIO import StringIO --- 9,13 ---- import random ! from types import ListType, StringType from cStringIO import StringIO *************** *** 36,39 **** --- 36,47 ---- fcre = re.compile(r'^From ', re.MULTILINE) + def _is8bitstring(s): + if isinstance(s, StringType): + try: + unicode(s, 'us-ascii') + except UnicodeError: + return True + return False + *************** *** 174,177 **** --- 182,193 ---- # No line was actually longer than maxheaderlen characters, so # just return the original unchanged. + return text + # If we have raw 8bit data in a byte string, we have no idea what the + # encoding is. I think there is no safe way to split this string. If + # it's ascii-subset, then we could do a normal ascii split, but if + # it's multibyte then we could break the string. There's no way to + # know so the least harm seems to be to not split the string and risk + # it being too long. + if _is8bitstring(text): return text # The `text' argument already has the field name prepended, so don't From bwarsaw@users.sourceforge.net Mon Oct 14 16:13:29 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:13:29 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Header.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv25569/email Modified Files: Header.py Log Message: __init__(): Fix an invariant, that the charset item in a chunk tuple must be a Charset instance, not a string. The bug here was that self._charset wasn't being converted to a Charset instance so later .append() calls which used the default charset would break. _split(): If the charset of the chunk is '8bit', return the chunk unchanged. We can't safely split it, so this is the avenue of least harm. Index: Header.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Header.py 13 Oct 2002 04:06:28 -0000 1.14 --- Header.py 14 Oct 2002 15:13:17 -0000 1.15 *************** *** 154,157 **** --- 154,159 ---- if charset is None: charset = USASCII + if not isinstance(charset, Charset): + charset = Charset(charset) self._charset = charset self._continuation_ws = continuation_ws *************** *** 234,239 **** def _split(self, s, charset, firstline=False): ! # Split up a header safely for use with encode_chunks. BAW: this ! # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) --- 236,240 ---- def _split(self, s, charset, firstline=False): ! # Split up a header safely for use with encode_chunks. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) *************** *** 242,245 **** --- 243,254 ---- if elen <= self._maxlinelen: return [(encoded, charset)] + # If we have undetermined raw 8bit characters sitting in a byte + # string, we really don't know what the right thing to do is. We + # can't really split it because it might be multibyte data which we + # could break if we split it between pairs. The least harm seems to + # be to not split the header at all, but that means they could go out + # longer than maxlinelen. + elif charset == '8bit': + return [(s, charset)] # BAW: I'm not sure what the right test here is. What we're trying to # do is be faithful to RFC 2822's recommendation that ($2.2.3): From bwarsaw@users.sourceforge.net Mon Oct 14 16:24:26 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:24:26 -0700 Subject: [Python-checkins] python/dist/src/Lib/email __init__.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv28950 Modified Files: __init__.py Log Message: Bump the __version__ Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** __init__.py 10 Oct 2002 15:19:46 -0000 1.19 --- __init__.py 14 Oct 2002 15:24:18 -0000 1.20 *************** *** 5,9 **** """ ! __version__ = '2.4.2' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.3' __all__ = [ From bwarsaw@users.sourceforge.net Mon Oct 14 16:26:24 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:26:24 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv29763 Modified Files: test_email.py Log Message: Two new tests for splitting (or not splitting) 8-bit header data. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_email.py 10 Oct 2002 15:14:22 -0000 1.19 --- test_email.py 14 Oct 2002 15:26:17 -0000 1.20 *************** *** 704,707 **** --- 704,728 ---- \tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""") + def test_long_8bit_header(self): + eq = self.ndiffAssertEqual + msg = Message() + h = Header('Britische Regierung gibt', 'iso-8859-1') + h.append('gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte') + msg['Subject'] = h + eq(msg.as_string(), """\ + Subject: =?iso-8859-1?q?Britische_Regierung_gibt?= + =?iso-8859-1?q?gr=FCnes_Licht_f=FCr_Offshore-Windkraftprojekte?= + + """) + + def test_long_8bit_header_no_charset(self): + eq = self.ndiffAssertEqual + msg = Message() + msg['Reply-To'] = 'Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte ' + eq(msg.as_string(), """\ + Reply-To: Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte + + """) + From gvanrossum@users.sourceforge.net Mon Oct 14 16:37:12 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:37:12 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.44,1.337.2.4.2.45 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv628 Modified Files: Tag: release22-maint NEWS Log Message: Add boilerplate for 2.2.2 final. (Will add actual news next.) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.44 retrieving revision 1.337.2.4.2.45 diff -C2 -d -r1.337.2.4.2.44 -r1.337.2.4.2.45 *** NEWS 9 Oct 2002 03:53:10 -0000 1.337.2.4.2.44 --- NEWS 14 Oct 2002 15:37:08 -0000 1.337.2.4.2.45 *************** *** 3,10 **** ==================================== - What's New in Python 2.2.2b1? - Release date: 7-Oct-2002 - ============================= - Almost everything in this release is a pure bugfix and is backported from a corresponding bugfix already applied to Python 2.3. While at --- 3,6 ---- *************** *** 17,20 **** --- 13,52 ---- Tip: to quickly find SourceForge bug or patch NNNNNN, use an URL of the form www.python.org/sf/NNNNNN. + + Here are the changes since the 2.2.2b1 release. Below are the changes + since 2.2.1. + + Core and builtins + + - XXX + + Extension modules + + - XXX + + Library + + - XXX + + Build + + - XXX + + C API + + - XXX + + Windows + + - XXX + + Other + + - XXX + + + What's New in Python 2.2.2b1? + Release date: 7-Oct-2002 + ============================= Core and builtins From fdrake@users.sourceforge.net Mon Oct 14 16:45:19 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 14 Oct 2002 08:45:19 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkpkglist,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv3718 Modified Files: mkpkglist Log Message: Use the same shade of blue as the site navigation areas. Index: mkpkglist =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkpkglist,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mkpkglist 14 Oct 2002 15:04:33 -0000 1.2 --- mkpkglist 14 Oct 2002 15:45:11 -0000 1.3 *************** *** 41,48 **** ! ! ''' --- 41,48 ----
Content Format
ZIPGZipBZip2
! ! ''' From gvanrossum@users.sourceforge.net Mon Oct 14 17:04:11 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 09:04:11 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.45,1.337.2.4.2.46 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv10358 Modified Files: Tag: release22-maint NEWS Log Message: Added all the non-doc news for 2.2.2 (final). Barry may want to update the news item about email 2.4.3 with more details. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.45 retrieving revision 1.337.2.4.2.46 diff -C2 -d -r1.337.2.4.2.45 -r1.337.2.4.2.46 *** NEWS 14 Oct 2002 15:37:08 -0000 1.337.2.4.2.45 --- NEWS 14 Oct 2002 16:03:55 -0000 1.337.2.4.2.46 *************** *** 1,4 **** What's New in Python 2.2.2 (final) ? ! Release date: dd-Mmm-yyyy ==================================== --- 1,4 ---- What's New in Python 2.2.2 (final) ? ! Release date: 14-Oct-2002 ==================================== *************** *** 14,47 **** the form www.python.org/sf/NNNNNN. ! Here are the changes since the 2.2.2b1 release. Below are the changes ! since 2.2.1. Core and builtins ! - XXX ! Extension modules ! - XXX Library ! - XXX Build ! - XXX ! C API ! - XXX Windows ! - XXX Other ! - XXX --- 14,83 ---- the form www.python.org/sf/NNNNNN. ! Here are all the changes since the 2.2.2b1 release last week, except ! for documentation changes. Below it are the (much more numerous!) ! changes since the 2.2.1 release in April. Core and builtins ! - In listobject.c and tupleobject.c: added overflow checks for ! list*int, list+list, and tuple+tuple. ! - In object.c: changed misleading SystemError exceptions raised in ! PyObject_Init() and PyObject_InitVar() to MemoryError. ! - In stringobject.c: added an overflow check to string formatting; ! this example could segfault: '%2147483647d' % -1. [SF bug 618623] ! ! - In typeobject.c: removed COPYSLOT(tp_dictoffset) from ! inherit_slots(). For more info, read this python-dev thread: ! http://mail.python.org/pipermail/python-dev/2002-October/029502.html ! ! - In stringobject.c: fixed another string formatting nit: "%r" % u"..." ! would return a Unicode string, even though repr(u"...") returns an ! 8-bit string. Now "%r" also returns an 8-bit string. ! ! - In pystate.c: initialize the tick_counter to zero. Library ! - This release includes the email package version 2.4.3, which fixes ! some minor bugs found in email 2.4.1 since its release. ! ! - In re.py: the finditer() function was accidentally not defined. [SF ! bug 585882] ! ! - In webbrowser.py: fixed Konqueror support. [SF patch 539360] ! ! - In xml/sax/expatreader.py: fixed a bug in the expat-based SAX reader ! that allows it to work with arbitrary versions of Expat. ! ! - In distutils/sysconfig.py: added a no-op version of ! set_python_build() back, to avoid breaking code that might call ! this. (It remains no longer needed and hence deprecated, though.) Build ! - In configure[.in]: expand AC_CHECK_SIZEOF inline to overcome a ! autoconf 2.13 weakness. [SF bug 620791] ! - In setup.py: Be more conservative about adding a -R flag for the SSL ! code; it is needed on Solaris 8 and broke on Mac OSX 10.2. The -R ! flag is now only added for Solaris. ! Tests ! ! - The test list(xrange(sys.maxint / 4)) test in test_b1.py was changed ! to use sys.maxint / 2 instead. This means that the test will not ! attempt to allocate any memory, but merely check that the overflow ! detection code works correctly (as was intended). Windows ! - Fixed the "File version" field in the DLL. This has apparently been ! broken forever. Other ! - Updated the Misc/ACKS file to acknowledge many new contributors. From mal@lemburg.com Mon Oct 14 17:04:27 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Mon, 14 Oct 2002 18:04:27 +0200 Subject: [Python-checkins] python/dist/src/Lib/email Generator.py,1.16,1.17 References: Message-ID: <3DAAEB0B.5080300@lemburg.com> bwarsaw@users.sourceforge.net wrote: > + def _is8bitstring(s): > + if isinstance(s, StringType): > + try: > + unicode(s, 'us-ascii') Note that 'ascii' will be faster since there are short-cuts in the C code which map this directly to the ASCII codec. > + except UnicodeError: > + return True > + return False > + Since this kind of function occurs quite often in string related code, wouldn't be better to code it in C and publish it through e.g. the _codecs module ?! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From barry@python.org Mon Oct 14 17:36:26 2002 From: barry@python.org (Barry A. Warsaw) Date: Mon, 14 Oct 2002 12:36:26 -0400 Subject: [Python-checkins] python/dist/src/Lib/email Generator.py,1.16,1.17 References: <3DAAEB0B.5080300@lemburg.com> Message-ID: <15786.62090.52007.933271@gargle.gargle.HOWL> >>>>> "MAL" == M writes: >> + def _is8bitstring(s): + if isinstance(s, StringType): + try: >> + unicode(s, 'us-ascii') MAL> Note that 'ascii' will be faster since there are short-cuts MAL> in the C code which map this directly to the ASCII codec. Ah cool, thanks for the tip. I'll make that change. >> + except UnicodeError: + return True + return False + MAL> Since this kind of function occurs quite often in string MAL> related code, wouldn't be better to code it in C and MAL> publish it through e.g. the _codecs module ?! Probably so, or something like it. I'll see if I can't factor out the tests I tend to do and make a proposal. -Barry From bwarsaw@users.sourceforge.net Mon Oct 14 17:52:43 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 09:52:43 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Header.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv27982 Modified Files: Header.py Log Message: append(): Fixing the test for convertability after consultation with Ben. If s is a byte string, make sure it can be converted to unicode with the input codec, and from unicode with the output codec, or raise a UnicodeError exception early. Skip this test (and the unicode->byte string conversion) when the charset is our faux 8bit raw charset. Index: Header.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Header.py 14 Oct 2002 15:13:17 -0000 1.15 --- Header.py 14 Oct 2002 16:52:41 -0000 1.16 *************** *** 219,236 **** elif not isinstance(charset, Charset): charset = Charset(charset) ! # Normalize and check the string ! if isinstance(s, StringType): ! # Possibly raise UnicodeError if it can't be encoded ! unicode(s, charset.get_output_charset()) ! elif isinstance(s, UnicodeType): ! # Convert Unicode to byte string for later concatenation ! for charset in USASCII, charset, UTF8: ! try: ! s = s.encode(charset.get_output_charset()) ! break ! except UnicodeError: ! pass ! else: ! assert False, 'Could not encode to utf-8' self._chunks.append((s, charset)) --- 219,250 ---- elif not isinstance(charset, Charset): charset = Charset(charset) ! # If the charset is our faux 8bit charset, leave the string unchanged ! if charset <> '8bit': ! # We need to test that the string can be converted to unicode and ! # back to a byte string, given the input and output codecs of the ! # charset. ! if isinstance(s, StringType): ! # Possibly raise UnicodeError if the byte string can't be ! # converted to a unicode with the input codec of the charset. ! incodec = charset.input_codec or 'us-ascii' ! ustr = unicode(s, incodec) ! # Now make sure that the unicode could be converted back to a ! # byte string with the output codec, which may be different ! # than the iput coded. Still, use the original byte string. ! outcodec = charset.output_codec or 'us-ascii' ! ustr.encode(outcodec) ! elif isinstance(s, UnicodeType): ! # Now we have to be sure the unicode string can be converted ! # to a byte string with a reasonable output codec. We want to ! # use the byte string in the chunk. ! for charset in USASCII, charset, UTF8: ! try: ! outcodec = charset.output_codec or 'us-ascii' ! s = s.encode(outcodec) ! break ! except UnicodeError: ! pass ! else: ! assert False, 'utf-8 conversion failed' self._chunks.append((s, charset)) From bwarsaw@users.sourceforge.net Mon Oct 14 18:26:07 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 10:26:07 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.17.2.3,1.17.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv8082/Lib/email/test Modified Files: Tag: release22-maint test_email.py Log Message: Backport bugfix microrelease of email 2.4.3 from cvs trunk. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -C2 -d -r1.17.2.3 -r1.17.2.4 *** test_email.py 10 Oct 2002 19:09:24 -0000 1.17.2.3 --- test_email.py 14 Oct 2002 17:26:03 -0000 1.17.2.4 *************** *** 704,707 **** --- 704,728 ---- \tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""") + def test_long_8bit_header(self): + eq = self.ndiffAssertEqual + msg = Message() + h = Header('Britische Regierung gibt', 'iso-8859-1') + h.append('gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte') + msg['Subject'] = h + eq(msg.as_string(), """\ + Subject: =?iso-8859-1?q?Britische_Regierung_gibt?= + =?iso-8859-1?q?gr=FCnes_Licht_f=FCr_Offshore-Windkraftprojekte?= + + """) + + def test_long_8bit_header_no_charset(self): + eq = self.ndiffAssertEqual + msg = Message() + msg['Reply-To'] = 'Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte ' + eq(msg.as_string(), """\ + Reply-To: Britische Regierung gibt gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte + + """) + From bwarsaw@users.sourceforge.net Mon Oct 14 18:26:06 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 10:26:06 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.7.2.2,1.7.2.3 Generator.py,1.6.10.2,1.6.10.3 Header.py,1.13.2.1,1.13.2.2 __init__.py,1.4.10.3,1.4.10.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv8082/Lib/email Modified Files: Tag: release22-maint Charset.py Generator.py Header.py __init__.py Log Message: Backport bugfix microrelease of email 2.4.3 from cvs trunk. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** Charset.py 10 Oct 2002 19:09:23 -0000 1.7.2.2 --- Charset.py 14 Oct 2002 17:26:00 -0000 1.7.2.3 *************** *** 44,47 **** --- 44,49 ---- 'koi8-r': (BASE64, BASE64, None), 'utf-8': (SHORTEST, BASE64, 'utf-8'), + # We're making this one up to represent raw unencoded 8-bit + '8bit': (None, BASE64, 'utf-8'), } *************** *** 54,72 **** } ! # Map charsets to their Unicode codec strings. Note that the Japanese ! # examples included below do not (yet) come with Python! They are available ! # from http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/ ! ! # The Chinese and Korean codecs are available from SourceForge: ! # ! # http://sourceforge.net/projects/python-codecs/ ! # ! # although you'll need to check them out of cvs since they haven't been file ! # released yet. You might also try to use # ! # http://www.freshports.org/port-description.php3?port=6702 # ! # if you can get logged in. AFAICT, both the Chinese and Korean codecs are ! # fairly experimental at this point. CODEC_MAP = { 'euc-jp': 'japanese.euc-jp', --- 56,69 ---- } ! # Map charsets to their Unicode codec strings. Note that Python doesn't come ! # with any Asian codecs by default. Here's where to get them: # ! # Japanese -- http://www.asahi-net.or.jp/~rd6t-kjym/python ! # Korean -- http://sf.net/projects/koco ! # Chinese -- http://sf.net/projects/python-codecs # ! # Note that these codecs have their own lifecycle and may be in varying states ! # of stability and useability. ! CODEC_MAP = { 'euc-jp': 'japanese.euc-jp', Index: Generator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Generator.py,v retrieving revision 1.6.10.2 retrieving revision 1.6.10.3 diff -C2 -d -r1.6.10.2 -r1.6.10.3 *** Generator.py 4 Oct 2002 17:24:23 -0000 1.6.10.2 --- Generator.py 14 Oct 2002 17:26:01 -0000 1.6.10.3 *************** *** 9,13 **** import random ! from types import ListType from cStringIO import StringIO --- 9,13 ---- import random ! from types import ListType, StringType from cStringIO import StringIO *************** *** 36,39 **** --- 36,47 ---- fcre = re.compile(r'^From ', re.MULTILINE) + def _is8bitstring(s): + if isinstance(s, StringType): + try: + unicode(s, 'us-ascii') + except UnicodeError: + return True + return False + *************** *** 174,177 **** --- 182,193 ---- # No line was actually longer than maxheaderlen characters, so # just return the original unchanged. + return text + # If we have raw 8bit data in a byte string, we have no idea what the + # encoding is. I think there is no safe way to split this string. If + # it's ascii-subset, then we could do a normal ascii split, but if + # it's multibyte then we could break the string. There's no way to + # know so the least harm seems to be to not split the string and risk + # it being too long. + if _is8bitstring(text): return text # The `text' argument already has the field name prepended, so don't Index: Header.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** Header.py 4 Oct 2002 17:24:24 -0000 1.13.2.1 --- Header.py 14 Oct 2002 17:26:02 -0000 1.13.2.2 *************** *** 154,157 **** --- 154,159 ---- if charset is None: charset = USASCII + if not isinstance(charset, Charset): + charset = Charset(charset) self._charset = charset self._continuation_ws = continuation_ws *************** *** 217,239 **** elif not isinstance(charset, Charset): charset = Charset(charset) ! # Normalize and check the string ! if isinstance(s, StringType): ! # Possibly raise UnicodeError if it can't e encoded ! unicode(s, charset.get_output_charset()) ! elif isinstance(s, UnicodeType): ! # Convert Unicode to byte string for later concatenation ! for charset in USASCII, charset, UTF8: ! try: ! s = s.encode(charset.get_output_charset()) ! break ! except UnicodeError: ! pass ! else: ! assert False, 'Could not encode to utf-8' self._chunks.append((s, charset)) def _split(self, s, charset, firstline=False): ! # Split up a header safely for use with encode_chunks. BAW: this ! # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) --- 219,254 ---- elif not isinstance(charset, Charset): charset = Charset(charset) ! # If the charset is our faux 8bit charset, leave the string unchanged ! if charset <> '8bit': ! # We need to test that the string can be converted to unicode and ! # back to a byte string, given the input and output codecs of the ! # charset. ! if isinstance(s, StringType): ! # Possibly raise UnicodeError if the byte string can't be ! # converted to a unicode with the input codec of the charset. ! incodec = charset.input_codec or 'us-ascii' ! ustr = unicode(s, incodec) ! # Now make sure that the unicode could be converted back to a ! # byte string with the output codec, which may be different ! # than the iput coded. Still, use the original byte string. ! outcodec = charset.output_codec or 'us-ascii' ! ustr.encode(outcodec) ! elif isinstance(s, UnicodeType): ! # Now we have to be sure the unicode string can be converted ! # to a byte string with a reasonable output codec. We want to ! # use the byte string in the chunk. ! for charset in USASCII, charset, UTF8: ! try: ! outcodec = charset.output_codec or 'us-ascii' ! s = s.encode(outcodec) ! break ! except UnicodeError: ! pass ! else: ! assert False, 'utf-8 conversion failed' self._chunks.append((s, charset)) def _split(self, s, charset, firstline=False): ! # Split up a header safely for use with encode_chunks. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) *************** *** 242,245 **** --- 257,268 ---- if elen <= self._maxlinelen: return [(encoded, charset)] + # If we have undetermined raw 8bit characters sitting in a byte + # string, we really don't know what the right thing to do is. We + # can't really split it because it might be multibyte data which we + # could break if we split it between pairs. The least harm seems to + # be to not split the header at all, but that means they could go out + # longer than maxlinelen. + elif charset == '8bit': + return [(s, charset)] # BAW: I'm not sure what the right test here is. What we're trying to # do is be faithful to RFC 2822's recommendation that ($2.2.3): *************** *** 347,371 **** return [(chunk, charset) for chunk in rtn] ! def _encode_chunks(self): ! """MIME-encode a header with many different charsets and/or encodings. ! ! Given a list of pairs (string, charset), return a MIME-encoded string ! suitable for use in a header field. Each pair may have different ! charsets and/or encodings, and the resulting header will accurately ! reflect each setting. ! ! Each encoding can be email.Utils.QP (quoted-printable, for ASCII-like ! character sets like iso-8859-1), email.Utils.BASE64 (Base64, for ! non-ASCII like character sets like KOI8-R and iso-2022-jp), or None ! (no encoding). ! ! Each pair will be represented on a separate line; the resulting string ! will be in the format: ! ! "=?charset1?q?Mar=EDa_Gonz=E1lez_Alonso?=\n ! =?charset2?b?SvxyZ2VuIEL2aW5n?=" ! """ chunks = [] ! for header, charset in self._chunks: if charset is None or charset.header_encoding is None: # There's no encoding for this chunk's charsets --- 370,394 ---- return [(chunk, charset) for chunk in rtn] ! def _encode_chunks(self, newchunks): ! # MIME-encode a header with many different charsets and/or encodings. ! # ! # Given a list of pairs (string, charset), return a MIME-encoded ! # string suitable for use in a header field. Each pair may have ! # different charsets and/or encodings, and the resulting header will ! # accurately reflect each setting. ! # ! # Each encoding can be email.Utils.QP (quoted-printable, for ! # ASCII-like character sets like iso-8859-1), email.Utils.BASE64 ! # (Base64, for non-ASCII like character sets like KOI8-R and ! # iso-2022-jp), or None (no encoding). ! # ! # Each pair will be represented on a separate line; the resulting ! # string will be in the format: ! # ! # =?charset1?q?Mar=EDa_Gonz=E1lez_Alonso?=\n ! # =?charset2?b?SvxyZ2VuIEL2aW5n?=" ! # chunks = [] ! for header, charset in newchunks: if charset is None or charset.header_encoding is None: # There's no encoding for this chunk's charsets *************** *** 398,401 **** for s, charset in self._chunks: newchunks += self._split(s, charset, True) ! self._chunks = newchunks ! return self._encode_chunks() --- 421,423 ---- for s, charset in self._chunks: newchunks += self._split(s, charset, True) ! return self._encode_chunks(newchunks) Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.4.10.3 retrieving revision 1.4.10.4 diff -C2 -d -r1.4.10.3 -r1.4.10.4 *** __init__.py 10 Oct 2002 19:09:24 -0000 1.4.10.3 --- __init__.py 14 Oct 2002 17:26:02 -0000 1.4.10.4 *************** *** 5,9 **** """ ! __version__ = '2.4.2' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.4.3' __all__ = [ From bwarsaw@users.sourceforge.net Mon Oct 14 19:03:10 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:03:10 -0700 Subject: [Python-checkins] python/dist/src README,1.136.4.9,1.136.4.10 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv21013 Modified Files: Tag: release22-maint README Log Message: There was a typo in the MacOSX section regarding the stacksize issue. There's no limit command near as I can tell. Should be the bash builtin ulimit command. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.136.4.9 retrieving revision 1.136.4.10 diff -C2 -d -r1.136.4.9 -r1.136.4.10 *** README 14 Oct 2002 12:35:53 -0000 1.136.4.9 --- README 14 Oct 2002 18:03:04 -0000 1.136.4.10 *************** *** 450,456 **** future release. ! Mac OS X 10: One of the regular expression tests fails ! with a SEGV due to the small stack size used by default, if you do ! "limit stacksize 2048" before "make test" it should work. On naked Darwin you may want to add the configure option --- 450,458 ---- future release. ! MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. Do ! "ulimit -s 2048" before "make test" to avoid the failure. ! Note that this is a built-in bash command so if you're using a ! different shell, the command may be different too. On naked Darwin you may want to add the configure option From bwarsaw@users.sourceforge.net Mon Oct 14 19:04:44 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:04:44 -0700 Subject: [Python-checkins] python/dist/src README,1.153,1.154 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv21712 Modified Files: README Log Message: There was a typo in the MacOSX section regarding the stacksize issue. There's no limit command near as I can tell. Should be the bash builtin ulimit command. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** README 23 Sep 2002 14:02:18 -0000 1.153 --- README 14 Oct 2002 18:04:39 -0000 1.154 *************** *** 456,463 **** future release. ! Mac OS X 10: One of the regular expression tests fails with a segmentation ! violation (SIGSEGV) due to the small stack size used by default, ! if you give the command "limit stacksize 2048" before "make test" ! it should work. On naked Darwin you may want to add the configure option --- 456,464 ---- future release. ! MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. Do ! "ulimit -s 2048" before "make test" to avoid the failure. ! Note that this is a built-in bash command so if you're using a ! different shell, the command may be different too. On naked Darwin you may want to add the configure option From bwarsaw@users.sourceforge.net Mon Oct 14 19:04:05 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:04:05 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.46,1.337.2.4.2.47 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv21251 Modified Files: Tag: release22-maint NEWS Log Message: Add a note about how to successfully complete the tests on MacOSX. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.46 retrieving revision 1.337.2.4.2.47 diff -C2 -d -r1.337.2.4.2.46 -r1.337.2.4.2.47 *** NEWS 14 Oct 2002 16:03:55 -0000 1.337.2.4.2.46 --- NEWS 14 Oct 2002 18:03:52 -0000 1.337.2.4.2.47 *************** *** 72,75 **** --- 72,81 ---- detection code works correctly (as was intended). + - The MacOSX (both 10.1 and 10.2) tests will crash with SEGV in + test_re and test_sre due to the small default stack size. Do + "ulimit -s 2048" before "make test" to avoid the failure. Note that + this is a built-in bash command so if you're using a different + shell, the command may be different too. + Windows From bwarsaw@users.sourceforge.net Mon Oct 14 19:13:37 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:13:37 -0700 Subject: [Python-checkins] python/dist/src README,1.136.4.10,1.136.4.11 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25526 Modified Files: Tag: release22-maint README Log Message: I'd forgotten that tcsh was the default for 10.1, but SF's 10.1 system uses bash and so does my 10.2 system. "limit stacksize 2048" is the right invocation for tcsh/csh. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.136.4.10 retrieving revision 1.136.4.11 diff -C2 -d -r1.136.4.10 -r1.136.4.11 *** README 14 Oct 2002 18:03:04 -0000 1.136.4.10 --- README 14 Oct 2002 18:13:24 -0000 1.136.4.11 *************** *** 451,458 **** MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. Do ! "ulimit -s 2048" before "make test" to avoid the failure. ! Note that this is a built-in bash command so if you're using a ! different shell, the command may be different too. On naked Darwin you may want to add the configure option --- 451,459 ---- MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. If ! you set the stack size to 2048 before doing a "make test" the ! failure can be avoided. If you're using the tcsh (the default ! on OSX), or csh shells use "limit stacksize 2048" and for the ! bash shell, use "ulimit -s 2048". On naked Darwin you may want to add the configure option From bwarsaw@users.sourceforge.net Mon Oct 14 19:15:43 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:15:43 -0700 Subject: [Python-checkins] python/dist/src README,1.154,1.155 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv26203 Modified Files: README Log Message: I'd forgotten that tcsh was the default for 10.1, but SF's 10.1 system uses bash and so does my 10.2 system. "limit stacksize 2048" is the right invocation for tcsh/csh. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** README 14 Oct 2002 18:04:39 -0000 1.154 --- README 14 Oct 2002 18:15:35 -0000 1.155 *************** *** 457,464 **** MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. Do ! "ulimit -s 2048" before "make test" to avoid the failure. ! Note that this is a built-in bash command so if you're using a ! different shell, the command may be different too. On naked Darwin you may want to add the configure option --- 457,465 ---- MacOSX: The tests will crash on both 10.1 and 10.2 with SEGV in ! test_re and test_sre due to the small default stack size. If ! you set the stack size to 2048 before doing a "make test" the ! failure can be avoided. If you're using the tcsh (the default ! on OSX), or csh shells use "limit stacksize 2048" and for the ! bash shell, use "ulimit -s 2048". On naked Darwin you may want to add the configure option From bwarsaw@users.sourceforge.net Mon Oct 14 19:22:03 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 14 Oct 2002 11:22:03 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.47,1.337.2.4.2.48 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv30182 Modified Files: Tag: release22-maint NEWS Log Message: I'd forgotten that tcsh was the default for 10.1, but SF's 10.1 system uses bash and so does my 10.2 system. "limit stacksize 2048" is the right invocation for tcsh/csh. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.47 retrieving revision 1.337.2.4.2.48 diff -C2 -d -r1.337.2.4.2.47 -r1.337.2.4.2.48 *** NEWS 14 Oct 2002 18:03:52 -0000 1.337.2.4.2.47 --- NEWS 14 Oct 2002 18:21:49 -0000 1.337.2.4.2.48 *************** *** 73,80 **** - The MacOSX (both 10.1 and 10.2) tests will crash with SEGV in ! test_re and test_sre due to the small default stack size. Do ! "ulimit -s 2048" before "make test" to avoid the failure. Note that ! this is a built-in bash command so if you're using a different ! shell, the command may be different too. Windows --- 73,81 ---- - The MacOSX (both 10.1 and 10.2) tests will crash with SEGV in ! test_re and test_sre due to the small default stack size. If you ! set the stack size to 2048 before doing a "make test" the failure ! can be avoided. If you're using the tcsh (the default on OSX), or ! csh shells use "limit stacksize 2048" and for the bash shell, use ! "ulimit -s 2048". Windows From gvanrossum@users.sourceforge.net Mon Oct 14 20:56:05 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 12:56:05 -0700 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3677 Modified Files: urlparse.py Log Message: Fix for 1.33: urlsplit() should only add '//' if scheme != ''. Will add test and backport. Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** urlparse.py 25 Sep 2002 19:20:10 -0000 1.33 --- urlparse.py 14 Oct 2002 19:56:03 -0000 1.34 *************** *** 129,133 **** def urlunsplit((scheme, netloc, url, query, fragment)): ! if netloc or (scheme in uses_netloc and url[:2] != '//'): if url and url[:1] != '/': url = '/' + url url = '//' + (netloc or '') + url --- 129,133 ---- def urlunsplit((scheme, netloc, url, query, fragment)): ! if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'): if url and url[:1] != '/': url = '/' + url url = '//' + (netloc or '') + url From gvanrossum@users.sourceforge.net Mon Oct 14 20:59:57 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 12:59:57 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_urlparse.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv4798 Modified Files: test_urlparse.py Log Message: Fix for 1.33: urlsplit() should only add '//' if scheme != ''. Will add test and backport. Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_urlparse.py 25 Sep 2002 19:20:12 -0000 1.7 --- test_urlparse.py 14 Oct 2002 19:59:54 -0000 1.8 *************** *** 28,32 **** def checkJoin(self, base, relurl, expected): ! self.assertEqual(urlparse.urljoin(base, relurl), expected) def test_RFC1808(self): --- 28,37 ---- def checkJoin(self, base, relurl, expected): ! self.assertEqual(urlparse.urljoin(base, relurl), expected, ! (base, relurl, expected)) ! ! def test_unparse_parse(self): ! for u in ['Python', './Python']: ! self.assertEqual(urlparse.urlunparse(urlparse.urlparse(u)), u) def test_RFC1808(self): From loewis@users.sourceforge.net Mon Oct 14 21:03:44 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 14 Oct 2002 13:03:44 -0700 Subject: [Python-checkins] python/dist/src/Lib string.py,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv6186 Modified Files: string.py Log Message: Convert empty string literal to string. Speed up creation of idmap. Index: string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** string.py 3 Jun 2002 15:58:32 -0000 1.64 --- string.py 14 Oct 2002 20:03:40 -0000 1.65 *************** *** 35,41 **** # Case conversion helpers ! _idmap = '' ! for i in range(256): _idmap = _idmap + chr(i) ! del i # Backward compatible names for exceptions --- 35,42 ---- # Case conversion helpers ! # Use str to convert Unicode literal in case of -U ! l = map(chr, xrange(256)) ! _idmap = str('').join(l) ! del l # Backward compatible names for exceptions From gvanrossum@users.sourceforge.net Mon Oct 14 21:08:53 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 13:08:53 -0700 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.31.6.2,1.31.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv8066 Modified Files: Tag: release22-maint urlparse.py Log Message: Backporting urlparse.py:1.34, test_urlparse.py:1.8: Fix for 1.33: urlsplit() should only add '//' if scheme != ''. [SF bug 620705] Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.31.6.2 retrieving revision 1.31.6.3 diff -C2 -d -r1.31.6.2 -r1.31.6.3 *** urlparse.py 25 Sep 2002 19:22:10 -0000 1.31.6.2 --- urlparse.py 14 Oct 2002 20:08:49 -0000 1.31.6.3 *************** *** 129,133 **** def urlunsplit((scheme, netloc, url, query, fragment)): ! if netloc or (scheme in uses_netloc and url[:2] != '//'): if url and url[:1] != '/': url = '/' + url url = '//' + (netloc or '') + url --- 129,133 ---- def urlunsplit((scheme, netloc, url, query, fragment)): ! if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'): if url and url[:1] != '/': url = '/' + url url = '//' + (netloc or '') + url From gvanrossum@users.sourceforge.net Mon Oct 14 21:08:53 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 13:08:53 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_urlparse.py,1.2.24.3,1.2.24.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8066/test Modified Files: Tag: release22-maint test_urlparse.py Log Message: Backporting urlparse.py:1.34, test_urlparse.py:1.8: Fix for 1.33: urlsplit() should only add '//' if scheme != ''. [SF bug 620705] Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.2.24.3 retrieving revision 1.2.24.4 diff -C2 -d -r1.2.24.3 -r1.2.24.4 *** test_urlparse.py 7 Oct 2002 01:18:17 -0000 1.2.24.3 --- test_urlparse.py 14 Oct 2002 20:08:50 -0000 1.2.24.4 *************** *** 88,89 **** --- 88,94 ---- print errors, "errors" + + # One more test backported from 2.3 + for u in ['Python', './Python']: + if urlparse.urlunparse(urlparse.urlparse(u)) != u: + print "*** urlparse/urlunparse failure for", `u` From gvanrossum@users.sourceforge.net Mon Oct 14 21:12:06 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 13:12:06 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.337.2.4.2.48,1.337.2.4.2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv9585 Modified Files: Tag: release22-maint NEWS Log Message: News about last-minute fix for SF bug 620705 (urlparse). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.48 retrieving revision 1.337.2.4.2.49 diff -C2 -d -r1.337.2.4.2.48 -r1.337.2.4.2.49 *** NEWS 14 Oct 2002 18:21:49 -0000 1.337.2.4.2.48 --- NEWS 14 Oct 2002 20:11:50 -0000 1.337.2.4.2.49 *************** *** 44,47 **** --- 44,51 ---- some minor bugs found in email 2.4.1 since its release. + - In urlparse.py: a one-character fix to urlunsplit() caused breakage + when parsing relative URLs, so added a fix for the fix and a test + for the fix. [SF bug 620705] + - In re.py: the finditer() function was accidentally not defined. [SF bug 585882] From gvanrossum@users.sourceforge.net Mon Oct 14 21:48:12 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 13:48:12 -0700 Subject: [Python-checkins] python/dist/src setup.py,1.111,1.112 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv24519 Modified Files: setup.py Log Message: [SF bug 620364] In build_extensions(), don't proceed if srcdir is None. Probably somebody who tried this on Windows. :-) Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** setup.py 25 Sep 2002 14:59:57 -0000 1.111 --- setup.py 14 Oct 2002 20:48:09 -0000 1.112 *************** *** 87,90 **** --- 87,93 ---- # with Modules/ and adding Python's include directory to the path. (srcdir,) = sysconfig.get_config_vars('srcdir') + if not srcdir: + # Maybe running on Windows but not using CYGWIN? + raise ValueError("No source directory; cannot proceed.") # Figure out the location of the source code for extension modules From loewis@users.sourceforge.net Mon Oct 14 22:06:05 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 14 Oct 2002 14:06:05 -0700 Subject: [Python-checkins] python/dist/src/Lib warnings.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv31373 Modified Files: warnings.py Log Message: Allow Unicode strings as message and module name. Index: warnings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/warnings.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** warnings.py 11 Sep 2002 13:22:35 -0000 1.17 --- warnings.py 14 Oct 2002 21:06:02 -0000 1.18 *************** *** 129,136 **** assert action in ("error", "ignore", "always", "default", "module", "once"), "invalid action: %s" % `action` ! assert isinstance(message, str), "message must be a string" assert isinstance(category, types.ClassType), "category must be a class" assert issubclass(category, Warning), "category must be a Warning subclass" ! assert isinstance(module, str), "module must be a string" assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" --- 129,136 ---- assert action in ("error", "ignore", "always", "default", "module", "once"), "invalid action: %s" % `action` ! assert isinstance(message, basestring), "message must be a string" assert isinstance(category, types.ClassType), "category must be a class" assert issubclass(category, Warning), "category must be a Warning subclass" ! assert isinstance(module, basestring), "module must be a string" assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" From loewis@users.sourceforge.net Mon Oct 14 22:07:32 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 14 Oct 2002 14:07:32 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.179,2.180 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv31900 Modified Files: typeobject.c Log Message: Allow Unicode strings in __slots__, converting them to byte strings. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.179 retrieving revision 2.180 diff -C2 -d -r2.179 -r2.180 *** typeobject.c 16 Aug 2002 17:01:08 -0000 2.179 --- typeobject.c 14 Oct 2002 21:07:28 -0000 2.180 *************** *** 1004,1007 **** --- 1004,1039 ---- } + #ifdef Py_USING_UNICODE + /* Replace Unicode objects in slots. */ + + static PyObject * + _unicode_to_string(PyObject *slots, int nslots) + { + PyObject *tmp = slots; + PyObject *o, *o1; + int i; + intintargfunc copy = slots->ob_type->tp_as_sequence->sq_slice; + for (i = 0; i < nslots; i++) { + if (PyUnicode_Check(o = PyTuple_GET_ITEM(tmp, i))) { + if (tmp == slots) { + tmp = copy(slots, 0, PyTuple_GET_SIZE(slots)); + if (tmp == NULL) + return NULL; + } + o1 = _PyUnicode_AsDefaultEncodedString + (o, NULL); + if (o1 == NULL) { + Py_DECREF(tmp); + return 0; + } + Py_INCREF(o1); + Py_DECREF(o); + PyTuple_SET_ITEM(tmp, i, o1); + } + } + return tmp; + } + #endif + static PyObject * type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) *************** *** 1136,1139 **** --- 1168,1178 ---- } + #ifdef Py_USING_UNICODE + tmp = _unicode_to_string(slots, nslots); + Py_DECREF(slots); + slots = tmp; + if (!tmp) + return NULL; + #endif /* Check for valid slot names and two special cases */ for (i = 0; i < nslots; i++) { From loewis@users.sourceforge.net Mon Oct 14 22:11:38 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon, 14 Oct 2002 14:11:38 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.180,2.181 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv1644 Modified Files: typeobject.c Log Message: Don't drop old slots if _unicode_to_string did not change anything. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.180 retrieving revision 2.181 diff -C2 -d -r2.180 -r2.181 *** typeobject.c 14 Oct 2002 21:07:28 -0000 2.180 --- typeobject.c 14 Oct 2002 21:11:34 -0000 2.181 *************** *** 1170,1175 **** #ifdef Py_USING_UNICODE tmp = _unicode_to_string(slots, nslots); ! Py_DECREF(slots); ! slots = tmp; if (!tmp) return NULL; --- 1170,1177 ---- #ifdef Py_USING_UNICODE tmp = _unicode_to_string(slots, nslots); ! if (tmp != slots) { ! Py_DECREF(slots); ! slots = tmp; ! } if (!tmp) return NULL; From akuchling@users.sourceforge.net Tue Oct 15 01:24:15 2002 From: akuchling@users.sourceforge.net (akuchling@users.sourceforge.net) Date: Mon, 14 Oct 2002 17:24:15 -0700 Subject: [Python-checkins] python/nondist/peps pep-0218.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2201 Modified Files: pep-0218.txt Log Message: BDFL ruling: Add section on open issues and leave it at that Index: pep-0218.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0218.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0218.txt 13 Oct 2002 21:02:35 -0000 1.7 --- pep-0218.txt 15 Oct 2002 00:24:12 -0000 1.8 *************** *** 122,125 **** --- 122,144 ---- + Open Issues for the Long-Term Proposal + + Earlier drafts of PEP 218 had only a single set type, but the + sets.py implementation in Python 2.3 has two, Set and + ImmutableSet. The long-term proposal has a single built-in + conversion function, set(iterable); how should instances of a + built-in immutable set type be created? Possibilities include a + second immutable_set() built-in, or perhaps the set() function + could take an additional argument, + e.g. set(iterable, immutable=True)? + + The PEP proposes {1,2,3} as the set notation and {-} for the empty + set. Would there be different syntax for an immutable and a + mutable set? Perhaps the built-in syntax would only be for + mutable sets, and an immutable set would be created from a mutable + set using the appropriate built-in function, + e.g. immutable_set({1,2,3}). + + Short-Term Proposal From gvanrossum@users.sourceforge.net Tue Oct 15 01:57:31 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 17:57:31 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.181,2.182 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv9333 Modified Files: typeobject.c Log Message: For some reason (probably cut and paste), __ipow__ for new-style classes was called with three arguments. This makes no sense, there's no way to pass in the "modulo" 3rd argument as for __pow__, and classic classes don't do this. [SF bug 620179] I don't want to backport this to 2.2.2, because it could break existing code that has developed a work-around. Code in 2.2.2 that wants to use __ipow__ and wants to be forward compatible with 2.3 should be written like this: def __ipow__(self, exponent, modulo=None): ... Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.181 retrieving revision 2.182 diff -C2 -d -r2.181 -r2.182 *** typeobject.c 14 Oct 2002 21:11:34 -0000 2.181 --- typeobject.c 15 Oct 2002 00:57:28 -0000 2.182 *************** *** 3400,3404 **** SLOT1(slot_nb_inplace_divide, "__idiv__", PyObject *, "O") SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O") ! SLOT2(slot_nb_inplace_power, "__ipow__", PyObject *, PyObject *, "OO") SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O") SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O") --- 3400,3404 ---- SLOT1(slot_nb_inplace_divide, "__idiv__", PyObject *, "O") SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O") ! SLOT1(slot_nb_inplace_power, "__ipow__", PyObject *, "O") SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O") SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O") *************** *** 4039,4043 **** wrap_binaryfunc, "%"), IBSLOT("__ipow__", nb_inplace_power, slot_nb_inplace_power, ! wrap_ternaryfunc, "**"), IBSLOT("__ilshift__", nb_inplace_lshift, slot_nb_inplace_lshift, wrap_binaryfunc, "<<"), --- 4039,4043 ---- wrap_binaryfunc, "%"), IBSLOT("__ipow__", nb_inplace_power, slot_nb_inplace_power, ! wrap_binaryfunc, "**"), IBSLOT("__ilshift__", nb_inplace_lshift, slot_nb_inplace_lshift, wrap_binaryfunc, "<<"), From gvanrossum@users.sourceforge.net Tue Oct 15 02:01:56 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon, 14 Oct 2002 18:01:56 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py,1.156,1.157 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10494 Modified Files: test_descr.py Log Message: For some reason (probably cut and paste), __ipow__ for new-style classes was called with three arguments. This makes no sense, there's no way to pass in the "modulo" 3rd argument as for __pow__, and classic classes don't do this. [SF bug 620179] I don't want to backport this to 2.2.2, because it could break existing code that has developed a work-around. Code in 2.2.2 that wants to use __ipow__ and wants to be forward compatible with 2.3 should be written like this: def __ipow__(self, exponent, modulo=None): ... Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** test_descr.py 23 Aug 2002 18:21:26 -0000 1.156 --- test_descr.py 15 Oct 2002 01:01:53 -0000 1.157 *************** *** 3307,3310 **** --- 3307,3320 ---- vereq(2.2*a, "rmul") + def testipow(): + # [SF bug 620179] + if verbose: + print "Testing correct invocation of __ipow__..." + class C(object): + def __ipow__(self, other): + pass + a = C() + a **= 2 + def do_this_first(): if verbose: *************** *** 3402,3405 **** --- 3412,3416 ---- slotmultipleinheritance() testrmul() + testipow() if verbose: print "All OK" From theller@users.sourceforge.net Tue Oct 15 15:52:02 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 07:52:02 -0700 Subject: [Python-checkins] python/dist/src/Lib/distutils/command bdist_wininst.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv5080 Modified Files: bdist_wininst.py Log Message: Revert the previous checkin - it didn't work anyway. Index: bdist_wininst.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_wininst.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** bdist_wininst.py 9 Aug 2002 16:37:34 -0000 1.35 --- bdist_wininst.py 15 Oct 2002 14:51:58 -0000 1.36 *************** *** 131,137 **** # And make an archive relative to the root of the # pseudo-installation tree. ! from tempfile import NamedTemporaryFile ! arc = NamedTemporaryFile(".zip") ! archive_basename = arc.name[:-4] fullname = self.distribution.get_fullname() arcname = self.make_archive(archive_basename, "zip", --- 131,136 ---- # And make an archive relative to the root of the # pseudo-installation tree. ! from tempfile import mktemp ! archive_basename = mktemp() fullname = self.distribution.get_fullname() arcname = self.make_archive(archive_basename, "zip", *************** *** 141,145 **** # remove the zip-file again log.debug("removing temporary file '%s'", arcname) ! arc.close() if not self.keep_temp: --- 140,144 ---- # remove the zip-file again log.debug("removing temporary file '%s'", arcname) ! os.remove(arcname) if not self.keep_temp: From theller@users.sourceforge.net Tue Oct 15 16:02:04 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:02:04 -0700 Subject: [Python-checkins] distutils/misc .cvsignore,NONE,1.1 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv10777 Added Files: .cvsignore Log Message: Ignore the MSVC temporary files and directories. --- NEW FILE: .cvsignore --- temp-debug temp-release wininst.ncb wininst.plg From loewis@users.sourceforge.net Tue Oct 15 16:11:16 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:11:16 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.500,1.501 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv14777/Misc Modified Files: NEWS Log Message: Patch #572628: Optional timeouts for put and get. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.500 retrieving revision 1.501 diff -C2 -d -r1.500 -r1.501 *** NEWS 13 Oct 2002 10:28:04 -0000 1.500 --- NEWS 15 Oct 2002 15:11:13 -0000 1.501 *************** *** 349,352 **** --- 349,354 ---- ------- + - Queue.Queue.{put,get} now support an optional timeout argument. + - Various features of Tk 8.4 are exposed in Tkinter.py. The multiple option of tkFileDialog is exposed as function askopenfile{,name}s. From loewis@users.sourceforge.net Tue Oct 15 16:11:15 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:11:15 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_queue.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14777/Lib/test Modified Files: test_queue.py Log Message: Patch #572628: Optional timeouts for put and get. Index: test_queue.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_queue.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_queue.py 23 Jul 2002 19:03:59 -0000 1.2 --- test_queue.py 15 Oct 2002 15:11:13 -0000 1.3 *************** *** 61,66 **** for i in range(queue_size-1): q.put(i) - q.fail_next_put = True # Test a failing non-blocking put. try: q.put("oops", block=0) --- 61,66 ---- for i in range(queue_size-1): q.put(i) # Test a failing non-blocking put. + q.fail_next_put = True try: q.put("oops", block=0) *************** *** 68,75 **** except FailingQueueException: pass q.put("last") verify(q.full(), "Queue should be full") - q.fail_next_put = True # Test a failing blocking put try: _doBlockingTest( q.put, ("full",), q.get, ()) --- 68,81 ---- except FailingQueueException: pass + q.fail_next_put = True + try: + q.put("oops", timeout=0.1) + raise TestFailed("The queue didn't fail when it should have") + except FailingQueueException: + pass q.put("last") verify(q.full(), "Queue should be full") # Test a failing blocking put + q.fail_next_put = True try: _doBlockingTest( q.put, ("full",), q.get, ()) *************** *** 80,83 **** --- 86,99 ---- # put failed, but get succeeded - re-add q.put("last") + # Test a failing timeout put + q.fail_next_put = True + try: + _doBlockingTest( q.put, ("full", True, 0.2), q.get, ()) + raise TestFailed("The queue didn't fail when it should have") + except FailingQueueException: + pass + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put("last") verify(q.full(), "Queue should be full") q.get() *************** *** 99,102 **** --- 115,125 ---- pass verify(not q.empty(), "Queue should not be empty") + q.fail_next_get = True + try: + q.get(timeout=0.1) + raise TestFailed("The queue didn't fail when it should have") + except FailingQueueException: + pass + verify(not q.empty(), "Queue should not be empty") q.get() verify(q.empty(), "Queue should be empty") *************** *** 129,134 **** --- 152,163 ---- except Queue.Full: pass + try: + q.put("full", timeout=0.1) + raise TestFailed("Didn't appear to time-out with a full queue") + except Queue.Full: + pass # Test a blocking put _doBlockingTest( q.put, ("full",), q.get, ()) + _doBlockingTest( q.put, ("full", True, 0.2), q.get, ()) # Empty it for i in range(queue_size): *************** *** 140,145 **** --- 169,180 ---- except Queue.Empty: pass + try: + q.get(timeout=0.1) + raise TestFailed("Didn't appear to time-out with an empty queue") + except Queue.Empty: + pass # Test a blocking get _doBlockingTest( q.get, (), q.put, ('empty',)) + _doBlockingTest( q.get, (True, 0.2), q.put, ('empty',)) def test(): From loewis@users.sourceforge.net Tue Oct 15 16:11:15 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:11:15 -0700 Subject: [Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14777/Lib Modified Files: Queue.py Log Message: Patch #572628: Optional timeouts for put and get. Index: Queue.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Queue.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Queue.py 30 Jun 2002 03:39:14 -0000 1.16 --- Queue.py 15 Oct 2002 15:11:13 -0000 1.17 *************** *** 1,4 **** --- 1,6 ---- """A multi-producer, multi-consumer queue.""" + from time import time as _time, sleep as _sleep + class Empty(Exception): "Exception raised by Queue.get(block=0)/get_nowait()." *************** *** 30,34 **** def empty(self): ! """Return 1 if the queue is empty, 0 otherwise (not reliable!).""" self.mutex.acquire() n = self._empty() --- 32,36 ---- def empty(self): ! """Return True if the queue is empty, False otherwise (not reliable!).""" self.mutex.acquire() n = self._empty() *************** *** 37,41 **** def full(self): ! """Return 1 if the queue is full, 0 otherwise (not reliable!).""" self.mutex.acquire() n = self._full() --- 39,43 ---- def full(self): ! """Return True if the queue is full, False otherwise (not reliable!).""" self.mutex.acquire() n = self._full() *************** *** 43,56 **** return n ! def put(self, item, block=1): """Put an item into the queue. ! If optional arg 'block' is 1 (the default), block if ! necessary until a free slot is available. Otherwise (block ! is 0), put an item on the queue if a free slot is immediately ! available, else raise the Full exception. """ if block: ! self.fsema.acquire() elif not self.fsema.acquire(0): raise Full --- 45,83 ---- return n ! def put(self, item, block=True, timeout=None): """Put an item into the queue. ! If optional args 'block' is true and 'timeout' is None (the default), ! block if necessary until a free slot is available. If 'timeout' is ! a positive number, it blocks at most 'timeout' seconds and raises ! the Full exception if no free slot was available within that time. ! Otherwise ('block' is false), put an item on the queue if a free slot ! is immediately available, else raise the Full exception ('timeout' ! is ignored in that case). """ if block: ! if timeout is None: ! # blocking, w/o timeout, i.e. forever ! self.fsema.acquire() ! elif timeout >= 0: ! # waiting max. 'timeout' seconds. ! # this code snipped is from threading.py: _Event.wait(): ! # Balancing act: We can't afford a pure busy loop, so we ! # have to sleep; but if we sleep the whole timeout time, ! # we'll be unresponsive. The scheme here sleeps very ! # little at first, longer as time goes on, but never longer ! # than 20 times per second (or the timeout time remaining). ! delay = 0.0005 # 500 us -> initial delay of 1 ms ! endtime = _time() + timeout ! while True: ! if self.fsema.acquire(0): ! break ! remaining = endtime - _time() ! if remaining <= 0: #time is over and no slot was free ! raise Full ! delay = min(delay * 2, remaining, .05) ! _sleep(delay) #reduce CPU usage by using a sleep ! else: ! raise ValueError("'timeout' must be a positive number") elif not self.fsema.acquire(0): raise Full *************** *** 81,96 **** Otherwise raise the Full exception. """ ! return self.put(item, 0) ! def get(self, block=1): """Remove and return an item from the queue. ! If optional arg 'block' is 1 (the default), block if ! necessary until an item is available. Otherwise (block is 0), ! return an item if one is immediately available, else raise the ! Empty exception. """ if block: ! self.esema.acquire() elif not self.esema.acquire(0): raise Empty --- 108,148 ---- Otherwise raise the Full exception. """ ! return self.put(item, False) ! def get(self, block=True, timeout=None): """Remove and return an item from the queue. ! If optional args 'block' is true and 'timeout' is None (the default), ! block if necessary until an item is available. If 'timeout' is ! a positive number, it blocks at most 'timeout' seconds and raises ! the Empty exception if no item was available within that time. ! Otherwise ('block' is false), return an item if one is immediately ! available, else raise the Empty exception ('timeout' is ignored ! in that case). """ if block: ! if timeout is None: ! # blocking, w/o timeout, i.e. forever ! self.esema.acquire() ! elif timeout >= 0: ! # waiting max. 'timeout' seconds. ! # this code snipped is from threading.py: _Event.wait(): ! # Balancing act: We can't afford a pure busy loop, so we ! # have to sleep; but if we sleep the whole timeout time, ! # we'll be unresponsive. The scheme here sleeps very ! # little at first, longer as time goes on, but never longer ! # than 20 times per second (or the timeout time remaining). ! delay = 0.0005 # 500 us -> initial delay of 1 ms ! endtime = _time() + timeout ! while 1: ! if self.esema.acquire(0): ! break ! remaining = endtime - _time() ! if remaining <= 0: #time is over and no element arrived ! raise Empty ! delay = min(delay * 2, remaining, .05) ! _sleep(delay) #reduce CPU usage by using a sleep ! else: ! raise ValueError("'timeout' must be a positive number") elif not self.esema.acquire(0): raise Empty *************** *** 116,123 **** """Remove and return an item from the queue without blocking. ! Only get an item if one is immediately available. Otherwise raise the Empty exception. """ ! return self.get(0) # Override these methods to implement other queue organizations --- 168,175 ---- """Remove and return an item from the queue without blocking. ! Only get an item if one is immediately available. Otherwise raise the Empty exception. """ ! return self.get(False) # Override these methods to implement other queue organizations From loewis@users.sourceforge.net Tue Oct 15 16:11:15 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:11:15 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libqueue.tex,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv14777/Doc/lib Modified Files: libqueue.tex Log Message: Patch #572628: Optional timeouts for put and get. Index: libqueue.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libqueue.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libqueue.tex 26 Jun 2002 05:22:08 -0000 1.12 --- libqueue.tex 15 Oct 2002 15:11:13 -0000 1.13 *************** *** 55,88 **** \begin{methoddesc}{empty}{} ! Return \code{1} if the queue is empty, \code{0} otherwise. Because ! of multithreading semantics, this is not reliable. \end{methoddesc} \begin{methoddesc}{full}{} ! Return \code{1} if the queue is full, \code{0} otherwise. Because of ! multithreading semantics, this is not reliable. \end{methoddesc} ! \begin{methoddesc}{put}{item\optional{, block}} ! Put \var{item} into the queue. If optional argument \var{block} is 1 ! (the default), block if necessary until a free slot is available. ! Otherwise (\var{block} is 0), put \var{item} on the queue if a free slot is immediately available, else raise the \exception{Full} ! exception. \end{methoddesc} \begin{methoddesc}{put_nowait}{item} ! Equivalent to \code{put(\var{item}, 0)}. \end{methoddesc} ! \begin{methoddesc}{get}{\optional{block}} ! Remove and return an item from the queue. If optional argument ! \var{block} is 1 (the default), block if necessary until an item is ! available. Otherwise (\var{block} is 0), return an item if one is ! immediately available, else raise the ! \exception{Empty} exception. \end{methoddesc} \begin{methoddesc}{get_nowait}{} ! Equivalent to \code{get(0)}. \end{methoddesc} --- 55,100 ---- \begin{methoddesc}{empty}{} ! Return \code{True} if the queue is empty, \code{False} otherwise. ! Becauseof multithreading semantics, this is not reliable. \end{methoddesc} \begin{methoddesc}{full}{} ! Return \code{True} if the queue is full, \code{False} otherwise. ! Because of multithreading semantics, this is not reliable. \end{methoddesc} ! \begin{methoddesc}{put}{item\optional{, block\optional{, timeout}}} ! Put \var{item} into the queue. If optional args \var{block} is true ! and \var{timeout} is None (the default), block if necessary until a ! free slot is available. If \var{timeout} is a positive number, it ! blocks at most \var{timeout} seconds and raises the \exception{Full} ! exception if no free slot was available within that time. ! Otherwise (\var{block} is false), put an item on the queue if a free slot is immediately available, else raise the \exception{Full} ! exception (\var{timeout} is ignored in that case). ! ! \versionadded[the timeout parameter]{2.3} ! \end{methoddesc} \begin{methoddesc}{put_nowait}{item} ! Equivalent to \code{put(\var{item}, False)}. \end{methoddesc} ! \begin{methoddesc}{get}{\optional{block\optional{, timeout}}} ! Remove and return an item from the queue. If optional args ! \var{block} is true and \var{timeout} is None (the default), ! block if necessary until an item is available. If \var{timeout} is ! a positive number, it blocks at most \var{timeout} seconds and raises ! the \exception{Empty} exception if no item was available within that ! time. Otherwise (\var{block} is false), return an item if one is ! immediately available, else raise the \exception{Empty} exception ! (\var{timeout} is ignored in that case). ! ! \versionadded[the timeout parameter]{2.3} ! \end{methoddesc} \begin{methoddesc}{get_nowait}{} ! Equivalent to \code{get(False)}. \end{methoddesc} From theller@users.sourceforge.net Tue Oct 15 16:11:47 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 08:11:47 -0700 Subject: [Python-checkins] distutils/misc install.c,1.17,1.18 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv15222 Modified Files: install.c Log Message: We have to check the return value of RegOpen* and RegQuery* functions, otherwise we may display nonexisting Python versions. Index: install.c =================================================================== RCS file: /cvsroot/python/distutils/misc/install.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** install.c 20 Mar 2002 14:37:25 -0000 1.17 --- install.c 15 Oct 2002 15:11:45 -0000 1.18 *************** *** 1132,1147 **** wsprintf (vers_name, "Python Version %s (found in registry)", core_version); - itemindex = SendMessage (hwnd, LB_ADDSTRING, 0, - (LPARAM)(LPSTR)vers_name); wsprintf (subkey_name, "Software\\Python\\PythonCore\\%s\\InstallPath", core_version); value_size = sizeof (subkey_name); ! RegOpenKeyEx (hkRoot, subkey_name, 0, KEY_READ, &hk); ! RegQueryValueEx (hk, NULL, NULL, NULL, prefix_buf, ! &value_size); ! RegCloseKey (hk); ! SendMessage (hwnd, LB_SETITEMDATA, itemindex, ! (LPARAM)(LPSTR)strdup (prefix_buf)); } RegCloseKey (hKey); --- 1132,1149 ---- wsprintf (vers_name, "Python Version %s (found in registry)", core_version); wsprintf (subkey_name, "Software\\Python\\PythonCore\\%s\\InstallPath", core_version); value_size = sizeof (subkey_name); ! if (ERROR_SUCCESS == RegOpenKeyEx(hkRoot, subkey_name, 0, KEY_READ, &hk)) { ! if (ERROR_SUCCESS == RegQueryValueEx(hk, NULL, NULL, NULL, prefix_buf, ! &value_size)) { ! itemindex = SendMessage (hwnd, LB_ADDSTRING, 0, ! (LPARAM)(LPSTR)vers_name); ! SendMessage (hwnd, LB_SETITEMDATA, itemindex, ! (LPARAM)(LPSTR)strdup (prefix_buf)); ! } ! RegCloseKey(hk); ! } } RegCloseKey (hKey); From theller@users.sourceforge.net Tue Oct 15 20:41:26 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 12:41:26 -0700 Subject: [Python-checkins] distutils/misc install.c,1.18,1.19 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv3730 Modified Files: install.c Log Message: Better error handling. Now requires admin rights for installation and uninstallation, previously it was possible do this without admin rights, but changing the registry could fail without proper permissions. Index: install.c =================================================================== RCS file: /cvsroot/python/distutils/misc/install.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** install.c 15 Oct 2002 15:11:45 -0000 1.18 --- install.c 15 Oct 2002 19:41:24 -0000 1.19 *************** *** 1322,1326 **** } ! static void OpenLogfile(char *dir) { char buffer[_MAX_PATH+1]; --- 1322,1326 ---- } ! static BOOL OpenLogfile(char *dir) { char buffer[_MAX_PATH+1]; *************** *** 1329,1336 **** --- 1329,1355 ---- long result; HKEY hKey, hSubkey; + char subkey_name[256]; static char KeyName[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; DWORD disposition; + result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + KeyName, + 0, + KEY_CREATE_SUB_KEY, + &hKey); + if (result != ERROR_SUCCESS) { + if (result == ERROR_ACCESS_DENIED) { + MessageBox(GetFocus(), + "You do not seem to have sufficient access rights\n" + "on this machine to install this software", + NULL, + MB_OK | MB_ICONSTOP); + return FALSE; + } else { + MessageBox(GetFocus(), KeyName, "Could not open key", MB_OK); + } + } + sprintf(buffer, "%s\\%s-wininst.log", dir, meta_name); logfile = fopen(buffer, "a"); *************** *** 1343,1360 **** fprintf(logfile, "Source: %s\n", modulename); ! result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ! KeyName, ! 0, ! KEY_ALL_ACCESS, ! &hKey); ! ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), "Could not open key", KeyName, MB_OK); ! ! sprintf(buffer, "%s-py%d.%d", meta_name, py_major, py_minor); ! result = RegCreateKeyEx(hKey, buffer, 0, NULL, 0, ! KEY_ALL_ACCESS, NULL, &hSubkey, --- 1362,1370 ---- fprintf(logfile, "Source: %s\n", modulename); ! sprintf(subkey_name, "%s-py%d.%d", meta_name, py_major, py_minor); ! result = RegCreateKeyEx(hKey, subkey_name, 0, NULL, 0, ! KEY_WRITE, NULL, &hSubkey, *************** *** 1362,1382 **** if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), "Could not create key", buffer, MB_OK); RegCloseKey(hKey); if (disposition == REG_CREATED_NEW_KEY) ! fprintf(logfile, "020 Reg DB Key: [%s]%s\n", KeyName, buffer); sprintf(buffer, "Python %d.%d %s", py_major, py_minor, title); ! RegSetValueEx(hSubkey, "DisplayName", ! 0, ! REG_SZ, ! buffer, ! strlen(buffer)+1); ! fprintf(logfile, "040 Reg DB Value: [%s]%s=%s\n", ! KeyName, "DisplayName", buffer); { --- 1372,1395 ---- if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), subkey_name, "Could not create key", MB_OK); RegCloseKey(hKey); if (disposition == REG_CREATED_NEW_KEY) ! fprintf(logfile, "020 Reg DB Key: [%s]%s\n", KeyName, subkey_name); sprintf(buffer, "Python %d.%d %s", py_major, py_minor, title); ! result = RegSetValueEx(hSubkey, "DisplayName", ! 0, ! REG_SZ, ! buffer, ! strlen(buffer)+1); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), buffer, "Could not set key value", MB_OK); ! ! fprintf(logfile, "040 Reg DB Value: [%s\\%s]%s=%s\n", ! KeyName, subkey_name, "DisplayName", buffer); { *************** *** 1390,1402 **** dir, meta_name, dir, meta_name); ! RegSetValueEx(hSubkey, "UninstallString", ! 0, ! REG_SZ, ! buffer, ! strlen(buffer)+1); ! fprintf(logfile, "040 Reg DB Value: [%s]%s=%s\n", ! KeyName, "UninstallString", buffer); } } --- 1403,1419 ---- dir, meta_name, dir, meta_name); ! result = RegSetValueEx(hSubkey, "UninstallString", ! 0, ! REG_SZ, ! buffer, ! strlen(buffer)+1); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), buffer, "Could not set key value", MB_OK); ! ! fprintf(logfile, "040 Reg DB Value: [%s\\%s]%s=%s\n", ! KeyName, subkey_name, "UninstallString", buffer); } + return TRUE; } *************** *** 1473,1477 **** python_dir[strlen(python_dir)-1] = '\0'; ! OpenLogfile(python_dir); /* --- 1490,1495 ---- python_dir[strlen(python_dir)-1] = '\0'; ! if (!OpenLogfile(python_dir)) ! break; /* *************** *** 1812,1816 **** } ! void DeleteRegistryKey(char *line) { char *keyname; --- 1830,1834 ---- } ! void DeleteRegistryKey(char *string) { char *keyname; *************** *** 1818,1821 **** --- 1836,1843 ---- char *delim; HKEY hKey; + long result; + char *line; + + line = strdup(string); /* so we can change it */ keyname = strchr(line, '['); *************** *** 1832,1846 **** *delim = '\0'; ! RegOpenKeyEx(HKEY_LOCAL_MACHINE, ! keyname, ! 0, ! KEY_ALL_ACCESS, ! &hKey); ! RegDeleteKey(hKey, subkeyname); ! RegCloseKey(hKey); } ! void DeleteRegistryValue(char *line) { char *keyname; --- 1854,1875 ---- *delim = '\0'; ! result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ! keyname, ! 0, ! KEY_WRITE, ! &hKey); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), string, "Could not open key", MB_OK); ! else { ! result = RegDeleteKey(hKey, subkeyname); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), string, "Could not delete key", MB_OK); ! RegCloseKey(hKey); ! } ! free(line); } ! void DeleteRegistryValue(char *string) { char *keyname; *************** *** 1848,1851 **** --- 1877,1885 ---- char *value; HKEY hKey; + long result; + char *line; + + line = strdup(string); /* so we can change it */ + /* Format is 'Reg DB Value: [key]name=value' */ keyname = strchr(line, '['); *************** *** 1863,1874 **** *value++ = '\0'; ! RegOpenKeyEx(HKEY_LOCAL_MACHINE, ! keyname, ! 0, ! KEY_ALL_ACCESS, ! &hKey); ! ! RegDeleteValue(hKey, valuename); ! RegCloseKey(hKey); } --- 1897,1914 ---- *value++ = '\0'; ! result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ! keyname, ! 0, ! KEY_WRITE, ! &hKey); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), string, "Could not open key", MB_OK); ! else { ! result = RegDeleteValue(hKey, valuename); ! if (result != ERROR_SUCCESS) ! MessageBox(GetFocus(), string, "Could not delete value", MB_OK); ! RegCloseKey(hKey); ! } ! free(line); } *************** *** 1980,1983 **** --- 2020,2045 ---- MB_OK); return 1; /* Error */ + } + + { + DWORD result; + HKEY hKey; + static char KeyName[] = + "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; + + result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + KeyName, + 0, + KEY_CREATE_SUB_KEY, + &hKey); + if (result == ERROR_ACCESS_DENIED) { + MessageBox(GetFocus(), + "You do not seem to have sufficient access rights\n" + "on this machine to uninstall this software", + NULL, + MB_OK | MB_ICONSTOP); + return 1; /* Error */ + } + RegCloseKey(hKey); } From theller@users.sourceforge.net Tue Oct 15 20:44:18 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 12:44:18 -0700 Subject: [Python-checkins] distutils/misc wininst.exe,1.14,1.15 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv5207 Modified Files: wininst.exe Log Message: Recreated after source changes. Index: wininst.exe =================================================================== RCS file: /cvsroot/python/distutils/misc/wininst.exe,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 Binary files /tmp/cvsWDPuCB and /tmp/cvsA9HGP2 differ From Jack.Jansen@oratrix.com Tue Oct 15 22:33:12 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 15 Oct 2002 23:33:12 +0200 Subject: [Python-checkins] python/dist/src README,1.153,1.154 In-Reply-To: Message-ID: On maandag, oktober 14, 2002, at 08:04 , bwarsaw@users.sourceforge.net wrote: > Update of /cvsroot/python/python/dist/src > In directory usw-pr-cvs1:/tmp/cvs-serv21712 > > Modified Files: > README > Log Message: > There was a typo in the MacOSX section regarding the stacksize issue. > There's no limit command near as I can tell. Should be the bash > builtin ulimit command. Barry, I don't think I agree with this fix. The default shell on OSX is tcsh (boo! hiss! :-), and the "limit stacksize 2048" command is what you need there. Maybe but the bash version in parentheses after it ("or "ulimit -s 2048" if you use bash as your shell" or somesuch). -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From barry@python.org Tue Oct 15 22:40:12 2002 From: barry@python.org (Barry A. Warsaw) Date: Tue, 15 Oct 2002 17:40:12 -0400 Subject: [Python-checkins] python/dist/src README,1.153,1.154 References: Message-ID: <15788.35644.368569.902908@gargle.gargle.HOWL> >>>>> "JJ" == Jack Jansen writes: JJ> Barry, I don't think I agree with this fix. The default shell JJ> on OSX is tcsh (boo! hiss! :-), and the "limit stacksize 2048" JJ> command is what you need there. Maybe but the bash version in JJ> parentheses after it ("or "ulimit -s 2048" if you use bash as JJ> your shell" or somesuch). You haven't gotten to my second checkin yet, have you? :) -Barry From guido@python.org Wed Oct 16 01:31:35 2002 From: guido@python.org (Guido van Rossum) Date: Tue, 15 Oct 2002 20:31:35 -0400 Subject: [Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17 In-Reply-To: Your message of "Tue, 15 Oct 2002 08:11:15 PDT." References: Message-ID: <200210160031.g9G0VZX20140@pcp02138704pcs.reston01.va.comcast.net> > ! # waiting max. 'timeout' seconds. > ! # this code snipped is from threading.py: _Event.wait(): > ! # Balancing act: We can't afford a pure busy loop, so we > ! # have to sleep; but if we sleep the whole timeout time, > ! # we'll be unresponsive. The scheme here sleeps very > ! # little at first, longer as time goes on, but never longer > ! # than 20 times per second (or the timeout time remaining). > ! delay = 0.0005 # 500 us -> initial delay of 1 ms > ! endtime = _time() + timeout > ! while True: > ! if self.fsema.acquire(0): > ! break > ! remaining = endtime - _time() > ! if remaining <= 0: #time is over and no slot was free > ! raise Full > ! delay = min(delay * 2, remaining, .05) > ! _sleep(delay) #reduce CPU usage by using a sleep Hm, I wonder if the threading module should make this operation (wait for a lock with a timeout) available natively. Then on some platforms maybe the lock implementation can support this natively and we can get rid of the silly sleeps there. --Guido van Rossum (home page: http://www.python.org/~guido/) From theller@users.sourceforge.net Tue Oct 15 20:45:28 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Tue, 15 Oct 2002 12:45:28 -0700 Subject: [Python-checkins] distutils/distutils/command bdist_wininst.py,1.36,1.37 Message-ID: Update of /cvsroot/python/distutils/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv6630/distutils/command Modified Files: bdist_wininst.py Log Message: Recreated after source changes. Index: bdist_wininst.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** bdist_wininst.py 15 Oct 2002 14:51:58 -0000 1.36 --- bdist_wininst.py 15 Oct 2002 19:45:25 -0000 1.37 *************** *** 265,269 **** ZGUuDQ0KJAAAAAAAAAAtOHsRaVkVQmlZFUJpWRVCEkUZQmpZFUIGRh9CYlkVQupFG0JrWRVCBkYR QmtZFUJpWRVCZlkVQmlZFELjWRVCC0YGQmRZFUJveh9Ca1kVQq5fE0JoWRVCUmljaGlZFUIAAAAA ! AAAAAAAAAAAAAAAAUEUAAEwBAwAQIUU9AAAAAAAAAADgAA8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UJQpUdmDXNJ4pmZwN2manCQd9PU2kLQndKlhB3 ! oIUi1oE2Qz0qSYrAoXozk9ZasWZXSxUI2TCDZB9VcGQcZ91s5jCFmG4Lh2WaAWjJZWupNETRljU2 ! EXJtI5Dh5EjLRQNMFTH7AkPeb6w9ERN1BdxyDwELR2ABDeqgMxOcAxBMYtF7kXALA7IEmmzJBxfw ! qdkb2NkMEAcGABXxiHj8dIK3AgT6p1gSoac+wytsSAIeLnSXyVjdhX3BkOsQIyAVLjhspIpymEz7 ! IGfNZUMDAkAuJgDZG4Hi6DsAkzAHJw22tE3AT3PFAOvQW2Elg0/AhA34AABon3dj5wMkAAAA/wAA ! AABgvgDAQACNvgBQ//9Xg83/6xCQkJCQkJCKBkaIB0cB23UHix6D7vwR23LtuAEAAAAB23UHix6D ! 7vwR2xHAAdtz73UJix6D7vwR23PkMcmD6ANyDcHgCIoGRoPw/3R0icUB23UHix6D7vwR2xHJAdt1 ! B4seg+78EdsRyXUgQQHbdQeLHoPu/BHbEckB23PvdQmLHoPu/BHbc+SDwQKB/QDz//+D0QGNFC+D ! /fx2D4oCQogHR0l19+lj////kIsCg8IEiQeDxwSD6QR38QHP6Uz///9eife5zgAAAIoHRyzoPAF3 ! 94A/BnXyiweKXwRmwegIwcAQhsQp+IDr6AHwiQeDxwWJ2OLZjb4A4AAAiwcJwHQ8i18EjYQwMAEB ! AAHzUIPHCP+W5AEBAJWKB0cIwHTciflXSPKuVf+W6AEBAAnAdAeJA4PDBOvh/5bsAQEAYenoXv// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgACAAAAIAAAgAUAAABgAACAAAAAAAAA From fdrake@users.sourceforge.net Wed Oct 16 15:59:05 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 07:59:05 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools custlib.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv14544 Modified Files: custlib.py Log Message: Use string methods; minor code cleanup. Index: custlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/custlib.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** custlib.py 7 Oct 2000 12:50:05 -0000 1.2 --- custlib.py 16 Oct 2002 14:59:02 -0000 1.3 *************** *** 3,49 **** # Phase I: list all the things that can be imported ! import glob, os, sys, string ! modules={} for modname in sys.builtin_module_names: ! modules[modname]=modname for dir in sys.path: # Look for *.py files ! filelist=glob.glob(os.path.join(dir, '*.py')) for file in filelist: path, file = os.path.split(file) ! base, ext=os.path.splitext(file) ! modules[string.lower(base)]=base # Look for shared library files ! filelist=(glob.glob(os.path.join(dir, '*.so')) + ! glob.glob(os.path.join(dir, '*.sl')) + ! glob.glob(os.path.join(dir, '*.o')) ) for file in filelist: path, file = os.path.split(file) ! base, ext=os.path.splitext(file) ! if base[-6:]=='module': base=base[:-6] ! modules[string.lower(base)]=base # Minor oddity: the types module is documented in libtypes2.tex if modules.has_key('types'): ! del modules['types'] ; modules['types2']=None # Phase II: find all documentation files (lib*.tex) # and eliminate modules that don't have one. ! docs={} ! filelist=glob.glob('lib*.tex') for file in filelist: ! modname=file[3:-4] ! docs[modname]=modname ! mlist=modules.keys() ! mlist=filter(lambda x, docs=docs: docs.has_key(x), mlist) mlist.sort() ! mlist=map(lambda x, docs=docs: docs[x], mlist) ! modules=mlist # Phase III: write custlib.tex --- 3,54 ---- # Phase I: list all the things that can be imported ! import glob ! import os.path ! import sys ! ! modules = {} for modname in sys.builtin_module_names: ! modules[modname] = modname for dir in sys.path: # Look for *.py files ! filelist = glob.glob(os.path.join(dir, '*.py')) for file in filelist: path, file = os.path.split(file) ! base, ext = os.path.splitext(file) ! modules[base.lower()] = base # Look for shared library files ! filelist = (glob.glob(os.path.join(dir, '*.so')) + ! glob.glob(os.path.join(dir, '*.sl')) + ! glob.glob(os.path.join(dir, '*.o')) ) for file in filelist: path, file = os.path.split(file) ! base, ext = os.path.splitext(file) ! if base[-6:] == 'module': ! base = base[:-6] ! modules[base.lower()] = base # Minor oddity: the types module is documented in libtypes2.tex if modules.has_key('types'): ! del modules['types'] ! modules['types2'] = None # Phase II: find all documentation files (lib*.tex) # and eliminate modules that don't have one. ! docs = {} ! filelist = glob.glob('lib*.tex') for file in filelist: ! modname = file[3:-4] ! docs[modname] = modname ! mlist = modules.keys() ! mlist = filter(lambda x, docs=docs: docs.has_key(x), mlist) mlist.sort() ! mlist = map(lambda x, docs=docs: docs[x], mlist) ! modules = mlist # Phase III: write custlib.tex From fdrake@users.sourceforge.net Wed Oct 16 16:27:07 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 08:27:07 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools buildindex.py,1.12,1.13 indfix.py,1.5,1.6 keywords.py,1.2,1.3 refcounts.py,1.3,1.4 rewrite.py,1.1,1.2 toc2bkm.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv26400 Modified Files: buildindex.py indfix.py keywords.py refcounts.py rewrite.py toc2bkm.py Log Message: Use string methods. Index: buildindex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/buildindex.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** buildindex.py 26 Dec 2001 19:55:14 -0000 1.12 --- buildindex.py 16 Oct 2002 15:27:01 -0000 1.13 *************** *** 3,7 **** __version__ = '$Revision$' ! import os import re import string --- 3,7 ---- __version__ = '$Revision$' ! import os.path import re import string *************** *** 50,54 **** def dump(self): return "%s\1%s###%s\n" \ ! % (string.join(self.links, "\1"), bang_join(self.text), self.seqno) --- 50,54 ---- def dump(self): return "%s\1%s###%s\n" \ ! % ("\1".join(self.links), bang_join(self.text), self.seqno) *************** *** 295,299 **** s = "%s" % (letter, letter) items.append(s) ! s = ["
\n%s
\n" % string.join(items, " |\n")] for letter, nodes in letter_groups: s.append(format_letter(letter)) --- 295,299 ---- s = "%s" % (letter, letter) items.append(s) ! s = ["
\n%s
\n" % " |\n".join(items)] for letter, nodes in letter_groups: s.append(format_letter(letter)) Index: indfix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/indfix.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** indfix.py 7 Oct 2000 12:50:04 -0000 1.5 --- indfix.py 16 Oct 2002 15:27:01 -0000 1.6 *************** *** 20,30 **** import re - import string import StringIO import sys ! def cmp_entries(e1, e2, lower=string.lower): ! return cmp(lower(e1[1]), lower(e2[1])) or cmp(e1, e2) --- 20,29 ---- import re import StringIO import sys ! def cmp_entries(e1, e2): ! return cmp(e1[1].lower(), e2[1].lower()) or cmp(e1, e2) Index: keywords.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/keywords.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** keywords.py 9 Apr 1999 14:53:35 -0000 1.2 --- keywords.py 16 Oct 2002 15:27:02 -0000 1.3 *************** *** 3,11 **** # This Python program sorts and reformats the table of keywords in ref2.tex - import string l = [] try: while 1: ! l = l + string.split(raw_input()) except EOFError: pass --- 3,10 ---- # This Python program sorts and reformats the table of keywords in ref2.tex l = [] try: while 1: ! l = l + raw_input().split() except EOFError: pass *************** *** 17,20 **** for i in range(nrows): for j in range(i, len(l), nrows): ! print string.ljust(l[j], 10), print --- 16,19 ---- for i in range(nrows): for j in range(i, len(l), nrows): ! print l[j].ljust(10), print Index: refcounts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/refcounts.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** refcounts.py 29 May 2001 15:25:51 -0000 1.3 --- refcounts.py 16 Oct 2002 15:27:02 -0000 1.4 *************** *** 3,7 **** import os - import string import sys --- 3,6 ---- *************** *** 11,15 **** p = os.path.dirname(__file__) except NameError: ! p = sys.path[0] p = os.path.normpath(os.path.join(os.getcwd(), p, os.pardir, "api", "refcounts.dat")) --- 10,14 ---- p = os.path.dirname(__file__) except NameError: ! p = os.path.dirname(sys.argv[0]) p = os.path.normpath(os.path.join(os.getcwd(), p, os.pardir, "api", "refcounts.dat")) *************** *** 28,36 **** if not line: break ! line = string.strip(line) if line[:1] in ("", "#"): # blank lines and comments continue ! parts = string.split(line, ":", 4) if len(parts) != 5: raise ValueError("Not enough fields in " + `line`) --- 27,35 ---- if not line: break ! line = line.strip() if line[:1] in ("", "#"): # blank lines and comments continue ! parts = line.split(":", 4) if len(parts) != 5: raise ValueError("Not enough fields in " + `line`) Index: rewrite.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/rewrite.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rewrite.py 17 Jul 2001 16:46:14 -0000 1.1 --- rewrite.py 16 Oct 2002 15:27:02 -0000 1.2 *************** *** 4,8 **** """ - import string import sys import time --- 4,7 ---- *************** *** 13,19 **** d = {} ! start = string.find(s, r"\date{") if start >= 0: ! end = string.find(s, "}", start) date = s[start+6:end] if date == r"\today": --- 12,18 ---- d = {} ! start = s.find(r"\date{") if start >= 0: ! end = s.find("}", start) date = s[start+6:end] if date == r"\today": *************** *** 29,40 **** d = get_info(open(sys.argv[1])) for arg in sys.argv[2:]: ! name, value = string.split(arg, "=", 1) d[name] = value start = 0 while 1: ! start = string.find(s, "@", start) if start < 0: break ! end = string.find(s, "@", start+1) name = s[start+1:end] if name: --- 28,39 ---- d = get_info(open(sys.argv[1])) for arg in sys.argv[2:]: ! name, value = arg.split("=", 1) d[name] = value start = 0 while 1: ! start = s.find("@", start) if start < 0: break ! end = s.find("@", start+1) name = s[start+1:end] if name: Index: toc2bkm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/toc2bkm.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** toc2bkm.py 7 Oct 2000 12:50:05 -0000 1.10 --- toc2bkm.py 16 Oct 2002 15:27:02 -0000 1.11 *************** *** 59,63 **** stype, snum, title, pageno = m.group(1, 2, 3, 4) title = clean_title(title) ! entry = (stype, snum, title, string.atoi(pageno), []) if stype == level: toc.append(entry) --- 59,63 ---- stype, snum, title, pageno = m.group(1, 2, 3, 4) title = clean_title(title) ! entry = (stype, snum, title, int(pageno), []) if stype == level: toc.append(entry) *************** *** 100,104 **** else: break ! title = string.translate(title, title_trans, "{}") return title --- 100,104 ---- else: break ! title = title.translate(title_trans, "{}") return title From fdrake@users.sourceforge.net Wed Oct 16 16:29:11 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 08:29:11 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools mkmodindex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv27426 Modified Files: mkmodindex Log Message: Use string methods. Organize the imports in Python Normal Form. Index: mkmodindex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkmodindex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mkmodindex 5 Apr 2002 17:34:50 -0000 1.13 --- mkmodindex 16 Oct 2002 15:29:07 -0000 1.14 *************** *** 26,36 **** Documentation Index'. """ - import buildindex import os import re - import string - import support import sys class IndexOptions(support.Options): --- 26,36 ---- Documentation Index'. """ import os import re import sys + import buildindex + import support + class IndexOptions(support.Options): *************** *** 120,127 **** if has_plat_flag: parts.insert(1, PLAT_DISCUSS) ! html = string.join(parts, '') program = os.path.basename(sys.argv[0]) fp = options.get_output_file() ! fp.write(string.rstrip(html) + "\n") if options.outputfile == "-": sys.stderr.write("%s: %d index nodes\n" % (program, num_nodes)) --- 120,127 ---- if has_plat_flag: parts.insert(1, PLAT_DISCUSS) ! html = ''.join(parts) program = os.path.basename(sys.argv[0]) fp = options.get_output_file() ! fp.write(html.rstrip() + "\n") if options.outputfile == "-": sys.stderr.write("%s: %d index nodes\n" % (program, num_nodes)) From fdrake@users.sourceforge.net Wed Oct 16 16:30:22 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 08:30:22 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools support.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv27901 Modified Files: support.py Log Message: Use string methods. Index: support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/support.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** support.py 5 Apr 2002 17:34:50 -0000 1.6 --- support.py 16 Oct 2002 15:30:17 -0000 1.7 *************** *** 9,13 **** import getopt - import string import sys --- 9,12 ---- *************** *** 72,76 **** for opt, val in opts: if opt in ("-a", "--address"): ! val = string.strip(val) if val: val = "
\n%s\n
\n" % val --- 71,75 ---- for opt, val in opts: if opt in ("-a", "--address"): ! val = val.strip() if val: val = "
\n%s\n
\n" % val From BPettersen@NAREX.com Wed Oct 16 17:00:13 2002 From: BPettersen@NAREX.com (Bjorn Pettersen) Date: Wed, 16 Oct 2002 10:00:13 -0600 Subject: [Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17 Message-ID: <60FB8BB7F0EFC7409B75EEEC13E2019201773E37@admin56.narex.com> > From: Guido van Rossum [mailto:guido@python.org]=20 [snip Queue.py change] >=20 > Hm, I wonder if the threading module should make this=20 > operation (wait for a lock with a timeout) available natively. >=20 > Then on some platforms maybe the lock implementation can=20 > support this natively and we can get rid of the silly sleeps there. The locks in Queue.py are created using thread.allocate_lock(). The aquire on the resulting lock takes an optional timeout... (I'm assuming that's portable..? -- at least it works on windows ) -- bjorn From fdrake@users.sourceforge.net Wed Oct 16 17:00:46 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 09:00:46 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools/sgmlconv latex2esis.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv8115 Modified Files: latex2esis.py Log Message: Modernization: Use string methods, use str instead of types.StringType, inherit from list instead of UserList. Index: latex2esis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/latex2esis.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** latex2esis.py 10 Apr 2002 04:20:33 -0000 1.30 --- latex2esis.py 16 Oct 2002 16:00:42 -0000 1.31 *************** *** 20,31 **** import os import re - import string import sys - import UserList import xml.sax import xml.sax.saxutils - from types import ListType, StringType, TupleType - from esistools import encode --- 20,27 ---- *************** *** 75,95 **** ! class _Stack(UserList.UserList): def append(self, entry): ! if type(entry) is not StringType: raise LaTeXFormatError("cannot push non-string on stack: " + `entry`) #dbgmsg("%s<%s>" % (" "*len(self.data), entry)) ! self.data.append(entry) def pop(self, index=-1): ! entry = self.data[index] ! del self.data[index] ! #dbgmsg("%s" % (" "*len(self.data), entry)) def __delitem__(self, index): ! entry = self.data[index] ! del self.data[index] ! #dbgmsg("%s" % (" "*len(self.data), entry)) --- 71,91 ---- ! class _Stack(list): def append(self, entry): ! if not isinstance(entry, str): raise LaTeXFormatError("cannot push non-string on stack: " + `entry`) #dbgmsg("%s<%s>" % (" "*len(self.data), entry)) ! list.append(self, entry) def pop(self, index=-1): ! entry = self[index] ! del self[index] ! #dbgmsg("%s" % (" " * len(self), entry)) def __delitem__(self, index): ! entry = self[index] ! list.__delitem__(self, index) ! #dbgmsg("%s" % (" " * len(self), entry)) *************** *** 97,101 **** if DEBUG: return _Stack() ! return [] --- 93,98 ---- if DEBUG: return _Stack() ! else: ! return [] *************** *** 107,111 **** L = [s.rstrip() for s in ifp.readlines()] L.append("") ! self.line = string.join(L, "\n") self.preamble = 1 --- 104,108 ---- L = [s.rstrip() for s in ifp.readlines()] L.append("") ! self.line = "\n".join(L) self.preamble = 1 *************** *** 341,345 **** if stack: raise LaTeXFormatError("elements remain on stack: " ! + string.join(stack, ", ")) # otherwise we just ran out of input here... --- 338,342 ---- if stack: raise LaTeXFormatError("elements remain on stack: " ! + ", ".join(stack)) # otherwise we just ran out of input here... *************** *** 547,551 **** for opt, arg in opts: if opt in ("-D", "--debug"): ! DEBUG = DEBUG + 1 if len(args) == 0: ifp = sys.stdin --- 544,548 ---- for opt, arg in opts: if opt in ("-D", "--debug"): ! DEBUG += 1 if len(args) == 0: ifp = sys.stdin From fdrake@users.sourceforge.net Wed Oct 16 17:02:14 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 09:02:14 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools/sgmlconv esistools.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv9115 Modified Files: esistools.py Log Message: Only reset _is_empty if needed. Index: esistools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/esistools.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** esistools.py 28 Sep 2001 16:26:13 -0000 1.8 --- esistools.py 16 Oct 2002 16:02:08 -0000 1.9 *************** *** 167,174 **** if self._is_empty: self._empties[data] = 1 if handler: handler.startElement(data, self._attributes) self._attrs.clear() - self._is_empty = 0 elif token == 'A': name, value = data.split(' ', 1) --- 167,174 ---- if self._is_empty: self._empties[data] = 1 + self._is_empty = 0 if handler: handler.startElement(data, self._attributes) self._attrs.clear() elif token == 'A': name, value = data.split(' ', 1) From guido@python.org Wed Oct 16 17:10:30 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 16 Oct 2002 12:10:30 -0400 Subject: [Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17 In-Reply-To: Your message of "Wed, 16 Oct 2002 10:00:13 MDT." <60FB8BB7F0EFC7409B75EEEC13E2019201773E37@admin56.narex.com> References: <60FB8BB7F0EFC7409B75EEEC13E2019201773E37@admin56.narex.com> Message-ID: <200210161610.g9GGAUp02273@odiug.zope.com> > > Hm, I wonder if the threading module should make this > > operation (wait for a lock with a timeout) available natively. > > > > Then on some platforms maybe the lock implementation can > > support this natively and we can get rid of the silly sleeps there. > > The locks in Queue.py are created using thread.allocate_lock(). The > aquire on the resulting lock takes an optional timeout... (I'm assuming > that's portable..? -- at least it works on windows ) No, the optional argument on acquire() is not a timeout. It's a block/noblock flag. --Guido van Rossum (home page: http://www.python.org/~guido/) From fdrake@users.sourceforge.net Wed Oct 16 17:06:12 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 09:06:12 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools/sgmlconv esis2sgml.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv11237 Modified Files: esis2sgml.py Log Message: Use string methods. Re-organize imports to Python Normal Form. Index: esis2sgml.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/esis2sgml.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** esis2sgml.py 28 Sep 2001 16:25:00 -0000 1.16 --- esis2sgml.py 16 Oct 2002 16:06:07 -0000 1.17 *************** *** 11,15 **** import errno - import esistools import os import re --- 11,14 ---- *************** *** 18,21 **** --- 17,22 ---- from xml.sax.saxutils import escape + import esistools + AUTOCLOSE = () *************** *** 64,68 **** if parts: parts.insert(0, '') ! return string.join(parts) --- 65,69 ---- if parts: parts.insert(0, '') ! return " ".join(parts) *************** *** 172,176 **** gilist = d.keys() gilist.sort() ! fp.write(string.join(gilist, "\n")) fp.write("\n") fp.close() --- 173,177 ---- gilist = d.keys() gilist.sort() ! fp.write("\n".join(gilist)) fp.write("\n") fp.close() From BPettersen@NAREX.com Wed Oct 16 17:45:55 2002 From: BPettersen@NAREX.com (Bjorn Pettersen) Date: Wed, 16 Oct 2002 10:45:55 -0600 Subject: [Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17 Message-ID: <60FB8BB7F0EFC7409B75EEEC13E2019201773E3A@admin56.narex.com> > From: Guido van Rossum [mailto:guido@python.org]=20 >=20 > > > Hm, I wonder if the threading module should make this > > > operation (wait for a lock with a timeout) available natively. > > >=20 > > > Then on some platforms maybe the lock implementation can > > > support this natively and we can get rid of the silly=20 > sleeps there. > >=20 > > The locks in Queue.py are created using thread.allocate_lock(). The=20 > > aquire on the resulting lock takes an optional timeout... (I'm=20 > > assuming that's portable..? -- at least it works on windows ) >=20 > No, the optional argument on acquire() is not a timeout. =20 > It's a block/noblock flag. Argh. You're right. In my defense I converted this to C++ before I ran into the problem ;-) -- bjorn From gvanrossum@users.sourceforge.net Wed Oct 16 17:52:14 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 16 Oct 2002 09:52:14 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.266,2.267 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31979 Modified Files: posixmodule.c Log Message: posix_execve(): add missing argument for "et" format in PyArg_Parse() call. This caused mysterious crashes (hard to debug because it was happening in a child process). Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.266 retrieving revision 2.267 diff -C2 -d -r2.266 -r2.267 *** posixmodule.c 11 Oct 2002 22:19:42 -0000 2.266 --- posixmodule.c 16 Oct 2002 16:52:11 -0000 2.267 *************** *** 2008,2011 **** --- 2008,2012 ---- if (!PyArg_Parse((*getitem)(argv, i), "et;execve() arg 2 must contain only strings", + Py_FileSystemDefaultEncoding, &argvlist[i])) { From theller@users.sourceforge.net Wed Oct 16 18:49:01 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Wed, 16 Oct 2002 10:49:01 -0700 Subject: [Python-checkins] distutils/misc install.c,1.19,1.20 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv6020 Modified Files: install.c Log Message: More functions for the pre/post install script: file_created(path) - mark a file for deletion by the uninstaller directory_created(path) - mark a directory for deletion by the uninstaller Return None from functions which have nothing to return. Index: install.c =================================================================== RCS file: /cvsroot/python/distutils/misc/install.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** install.c 15 Oct 2002 19:41:24 -0000 1.19 --- install.c 16 Oct 2002 17:48:58 -0000 1.20 *************** *** 352,355 **** --- 352,373 ---- #define DIM(a) (sizeof(a) / sizeof((a)[0])) + static PyObject *FileCreated(PyObject *self, PyObject *args) + { + char *path; + if (!g_PyArg_ParseTuple(args, "s", &path)) + return NULL; + notify(FILE_CREATED, path); + return g_Py_BuildValue(""); + } + + static PyObject *DirectoryCreated(PyObject *self, PyObject *args) + { + char *path; + if (!g_PyArg_ParseTuple(args, "s", &path)) + return NULL; + notify(DIR_CREATED, path); + return g_Py_BuildValue(""); + } + static PyObject *GetSpecialFolderPath(PyObject *self, PyObject *args) { *************** *** 482,486 **** ps1->lpVtbl->Release(ps1); CoUninitialize(); ! return g_Py_BuildValue("i", 0); error: --- 500,504 ---- ps1->lpVtbl->Release(ps1); CoUninitialize(); ! return g_Py_BuildValue(""); error: *************** *** 501,504 **** --- 519,524 ---- {"create_shortcut", CreateShortcut, METH_VARARGS, NULL}, {"get_special_folder_path", GetSpecialFolderPath, METH_VARARGS, NULL}, + {"file_created", FileCreated, METH_VARARGS, NULL}, + {"directory_created", DirectoryCreated, METH_VARARGS, NULL}, }; *************** *** 553,560 **** mod = PyImport_ImportModule("__builtin__"); if (mod) { g_PyExc_ValueError = PyObject_GetAttrString(mod, "ValueError"); g_PyExc_OSError = PyObject_GetAttrString(mod, "OSError"); ! PyObject_SetAttrString(mod, "create_shortcut", PyCFunction_New(&meth[0], NULL)); ! PyObject_SetAttrString(mod, "get_special_folder_path", PyCFunction_New(&meth[1], NULL)); } --- 573,584 ---- mod = PyImport_ImportModule("__builtin__"); if (mod) { + int i; + g_PyExc_ValueError = PyObject_GetAttrString(mod, "ValueError"); g_PyExc_OSError = PyObject_GetAttrString(mod, "OSError"); ! for (i = 0; i < DIM(meth); ++i) { ! PyObject_SetAttrString(mod, meth[i].ml_name, ! PyCFunction_New(&meth[i], NULL)); ! } } *************** *** 1608,1613 **** fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - CloseLogfile(); - tempname = tmpnam(NULL); --- 1632,1635 ---- *************** *** 1646,1649 **** --- 1668,1672 ---- SetCursor(hCursor); + CloseLogfile(); } From theller@users.sourceforge.net Wed Oct 16 18:51:41 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Wed, 16 Oct 2002 10:51:41 -0700 Subject: [Python-checkins] distutils/misc wininst.exe,1.15,1.16 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv8759/misc Modified Files: wininst.exe Log Message: Recreated after source changes. Index: wininst.exe =================================================================== RCS file: /cvsroot/python/distutils/misc/wininst.exe,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsif9eFl and /tmp/cvsMJH04w differ From loewis@users.sourceforge.net Wed Oct 16 19:27:40 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:27:40 -0700 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.59,1.60 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory usw-pr-cvs1:/tmp/cvs-serv7316/Doc/whatsnew Modified Files: whatsnew23.tex Log Message: Add PyStructSequence_UnnamedField. Add stat_float_times. Use integers in stat tuple, optionally floats in named fields. Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** whatsnew23.tex 10 Oct 2002 16:04:08 -0000 1.59 --- whatsnew23.tex 16 Oct 2002 18:27:38 -0000 1.60 *************** *** 1068,1071 **** --- 1068,1096 ---- the \method{toxml()} and \method{toprettyxml()} methods of DOM nodes. + \item The \function{stat} family of functions can now report fractions + of a second in a time stamp. Similar to \function{time.time}, such + time stamps are represented as floats. + + During testing, it was found that some applications break if time + stamps are floats. For compatibility, when using the tuple interface + of the \class{stat_result}, time stamps are represented as integers. + When using named fields (first introduced in Python 2.2), time stamps + are still represented as ints, unless \function{os.stat_float_times} + is invoked: + + \begin{verbatim} + >>> os.stat_float_times(True) + >>> os.stat("/tmp").st_mtime + 1034791200.6335014 + \end{verbatim} + + In Python 2.4, the default will change to return floats. + + Application developers should use this feature only if all their + libraries work properly when confronted with floating point time + stamps (or use the tuple API). If used, the feature should be + activated on application level, instead of trying to activate it on a + per-use basis. + \end{itemize} From loewis@users.sourceforge.net Wed Oct 16 19:27:40 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:27:40 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.99,1.100 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv7316/Doc/lib Modified Files: libos.tex Log Message: Add PyStructSequence_UnnamedField. Add stat_float_times. Use integers in stat tuple, optionally floats in named fields. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** libos.tex 10 Oct 2002 18:24:52 -0000 1.99 --- libos.tex 16 Oct 2002 18:27:38 -0000 1.100 *************** *** 855,861 **** (time of most recent content modification or metadata change). ! \versionchanged [The time values are floats, measuring ! seconds. Fractions of a second may be reported if the system ! supports that]{2.3} On some Unix systems (such as Linux), the following attributes may --- 855,862 ---- (time of most recent content modification or metadata change). ! \versionchanged [If \function{stat_float_times} returns true, the time ! values are floats, measuring seconds. Fractions of a second may be ! reported if the system supports that. On Mac OS, the times are always ! floats. See \function{stat_float_times} for further discussion. ]{2.3} On some Unix systems (such as Linux), the following attributes may *************** *** 898,901 **** --- 899,928 ---- \versionchanged [Added access to values as attributes of the returned object]{2.2} + \end{funcdesc} + + \begin{funcdesc}{stat_float_times}{\optional{newvalue}} + Determine whether \class{stat_result} represents time stamps as float + objects. If newval is True, future calls to stat() return floats, if + it is False, future calls return ints. If newval is omitted, return + the current setting. + + For compatibility with older Python versions, accessing + \class{stat_result} as a tuple always returns integers. For + compatibility with Python 2.2, accessing the time stamps by field name + also returns integers. Applications that want to determine the + fractions of a second in a time stamp can use this function to have + time stamps represented as floats. Whether they will actually observe + non-zero fractions depends on the system. + + Future Python releases will change the default of this settings; + applications that cannot deal with floating point time stamps can then + use this function to turn the feature off. + + It is recommended that this setting is only changed at program startup + time in the \var{__main__} module; libraries should never change this + setting. If an application uses a library that works incorrectly if + floating point time stamps are processed, this application should turn + the feature off until the library has been corrected. + \end{funcdesc} From loewis@users.sourceforge.net Wed Oct 16 19:27:40 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:27:40 -0700 Subject: [Python-checkins] python/dist/src/Include structseq.h,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv7316/Include Modified Files: structseq.h Log Message: Add PyStructSequence_UnnamedField. Add stat_float_times. Use integers in stat tuple, optionally floats in named fields. Index: structseq.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/structseq.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** structseq.h 12 Aug 2002 07:21:57 -0000 1.2 --- structseq.h 16 Oct 2002 18:27:38 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- } PyStructSequence_Desc; + extern char* PyStructSequence_UnnamedField; + PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc); From loewis@users.sourceforge.net Wed Oct 16 19:27:41 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:27:41 -0700 Subject: [Python-checkins] python/dist/src/Objects structseq.c,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv7316/Objects Modified Files: structseq.c Log Message: Add PyStructSequence_UnnamedField. Add stat_float_times. Use integers in stat tuple, optionally floats in named fields. Index: structseq.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/structseq.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** structseq.c 12 Apr 2002 03:05:37 -0000 1.8 --- structseq.c 16 Oct 2002 18:27:39 -0000 1.9 *************** *** 9,12 **** --- 9,16 ---- static char real_length_key[] = "n_fields"; + /* Fields with this name have only a field index, not a field name. + They are only allowed for indices < n_visible_fields. */ + char *PyStructSequence_UnnamedField = "unnamed field"; + #define VISIBLE_SIZE(op) ((op)->ob_size) #define VISIBLE_SIZE_TP(tp) PyInt_AsLong( \ *************** *** 333,340 **** PyObject *dict; PyMemberDef* members; ! int n_members, i; for (i = 0; desc->fields[i].name != NULL; ++i) ! ; n_members = i; --- 337,346 ---- PyObject *dict; PyMemberDef* members; ! int n_members, n_unnamed_members, i, k; + n_unnamed_members = 0; for (i = 0; desc->fields[i].name != NULL; ++i) ! if (desc->fields[0].name == PyStructSequence_UnnamedField) ! n_unnamed_members++; n_members = i; *************** *** 346,360 **** type->tp_itemsize = 0; ! members = PyMem_NEW(PyMemberDef, n_members+1); ! for (i = 0; i < n_members; ++i) { ! members[i].name = desc->fields[i].name; ! members[i].type = T_OBJECT; ! members[i].offset = offsetof(PyStructSequence, ob_item) + i * sizeof(PyObject*); ! members[i].flags = READONLY; ! members[i].doc = desc->fields[i].doc; } ! members[n_members].name = NULL; type->tp_members = members; --- 352,369 ---- type->tp_itemsize = 0; ! members = PyMem_NEW(PyMemberDef, n_members-n_unnamed_members+1); ! for (i = k = 0; i < n_members; ++i) { ! if (desc->fields[i].name == PyStructSequence_UnnamedField) ! continue; ! members[k].name = desc->fields[i].name; ! members[k].type = T_OBJECT; ! members[k].offset = offsetof(PyStructSequence, ob_item) + i * sizeof(PyObject*); ! members[k].flags = READONLY; ! members[k].doc = desc->fields[i].doc; ! k++; } ! members[k].name = NULL; type->tp_members = members; From loewis@users.sourceforge.net Wed Oct 16 19:27:41 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:27:41 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.267,2.268 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv7316/Modules Modified Files: posixmodule.c Log Message: Add PyStructSequence_UnnamedField. Add stat_float_times. Use integers in stat tuple, optionally floats in named fields. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.267 retrieving revision 2.268 diff -C2 -d -r2.267 -r2.268 *** posixmodule.c 16 Oct 2002 16:52:11 -0000 2.267 --- posixmodule.c 16 Oct 2002 18:27:38 -0000 2.268 *************** *** 679,682 **** --- 679,686 ---- {"st_gid", "group ID of owner"}, {"st_size", "total size, in bytes"}, + /* The NULL is replaced with PyStructSequence_UnnamedField later. */ + {NULL, "integer time of last access"}, + {NULL, "integer time of last modification"}, + {NULL, "integer time of last change"}, {"st_atime", "time of last access"}, {"st_mtime", "time of last modification"}, *************** *** 695,701 **** #ifdef HAVE_ST_BLKSIZE ! #define ST_BLKSIZE_IDX 10 #else ! #define ST_BLKSIZE_IDX 9 #endif --- 699,705 ---- #ifdef HAVE_ST_BLKSIZE ! #define ST_BLKSIZE_IDX 13 #else ! #define ST_BLKSIZE_IDX 12 #endif *************** *** 750,760 **** static PyTypeObject StatResultType; static PyTypeObject StatVFSResultType; static void fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) { ! PyObject *val; ! val = PyFloat_FromDouble(sec + 1e-9*nsec); ! PyStructSequence_SET_ITEM(v, index, val); } --- 754,824 ---- static PyTypeObject StatResultType; static PyTypeObject StatVFSResultType; + static newfunc structseq_new; + + static PyObject * + statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyStructSequence *result; + int i; + + result = (PyStructSequence*)structseq_new(type, args, kwds); + if (!result) + return NULL; + /* If we have been initialized from a tuple, + st_?time might be set to None. Initialize it + from the int slots. */ + for (i = 7; i <= 9; i++) { + if (result->ob_item[i+3] == Py_None) { + Py_DECREF(Py_None); + Py_INCREF(result->ob_item[i]); + result->ob_item[i+3] = result->ob_item[i]; + } + } + return (PyObject*)result; + } + + + + /* If true, st_?time is float. */ + static int _stat_float_times = 0; + + PyDoc_STRVAR(stat_float_times__doc__, + "stat_float_times([newval]) -> oldval\n\n\ + Determine whether os.[lf]stat represents time stamps as float objects.\n\ + If newval is True, future calls to stat() return floats, if it is False,\n\ + future calls return ints. \n\ + If newval is omitted, return the current setting.\n"); + + static PyObject* + stat_float_times(PyObject* self, PyObject *args) + { + int newval = -1; + if (!PyArg_ParseTuple(args, "|i:stat_float_times", &newval)) + return NULL; + if (newval == -1) + /* Return old value */ + return PyBool_FromLong(_stat_float_times); + _stat_float_times = newval; + Py_INCREF(Py_None); + return Py_None; + } static void fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) { ! PyObject *fval,*ival; ! #if SIZEOF_TIME_T > SIZEOF_LONG ! ival = PyLong_FromLongLong((LONG_LONG)sec); ! #else ! ival = PyInt_FromLong((long)sec); ! #endif ! if (_stat_float_times) { ! fval = PyFloat_FromDouble(sec + 1e-9*nsec); ! } else { ! fval = ival; ! Py_INCREF(fval); ! } ! PyStructSequence_SET_ITEM(v, index, ival); ! PyStructSequence_SET_ITEM(v, index+3, fval); } *************** *** 6803,6806 **** --- 6867,6871 ---- {"rmdir", posix_rmdir, METH_VARARGS, posix_rmdir__doc__}, {"stat", posix_stat, METH_VARARGS, posix_stat__doc__}, + {"stat_float_times", stat_float_times, METH_VARARGS, stat_float_times__doc__}, #ifdef HAVE_SYMLINK {"symlink", posix_symlink, METH_VARARGS, posix_symlink__doc__}, *************** *** 7297,7301 **** --- 7362,7371 ---- stat_result_desc.name = MODNAME ".stat_result"; + stat_result_desc.fields[7].name = PyStructSequence_UnnamedField; + stat_result_desc.fields[8].name = PyStructSequence_UnnamedField; + stat_result_desc.fields[9].name = PyStructSequence_UnnamedField; PyStructSequence_InitType(&StatResultType, &stat_result_desc); + structseq_new = StatResultType.tp_new; + StatResultType.tp_new = statresult_new; Py_INCREF((PyObject*) &StatResultType); PyModule_AddObject(m, "stat_result", (PyObject*) &StatResultType); From loewis@users.sourceforge.net Wed Oct 16 19:28:39 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 11:28:39 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.501,1.502 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv9342/Misc Modified Files: NEWS Log Message: Correct stat_result float time stamps entry. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.501 retrieving revision 1.502 diff -C2 -d -r1.501 -r1.502 *** NEWS 15 Oct 2002 15:11:13 -0000 1.501 --- NEWS 16 Oct 2002 18:28:36 -0000 1.502 *************** *** 299,303 **** - cPickle.BadPickleGet is now a class. ! - The time stamps in os.stat_result are floating point numbers now. - If the size passed to mmap.mmap() is larger than the length of the --- 299,304 ---- - cPickle.BadPickleGet is now a class. ! - The time stamps in os.stat_result are floating point numbers ! after stat_float_times has been called. - If the size passed to mmap.mmap() is larger than the length of the From loewis@users.sourceforge.net Wed Oct 16 20:10:08 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 12:10:08 -0700 Subject: [Python-checkins] python/dist/src/Objects structseq.c,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv6052 Modified Files: structseq.c Log Message: Add n_unnamed_fields into the type. Index: structseq.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/structseq.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** structseq.c 16 Oct 2002 18:27:39 -0000 1.9 --- structseq.c 16 Oct 2002 19:10:03 -0000 1.10 *************** *** 8,11 **** --- 8,12 ---- static char visible_length_key[] = "n_sequence_fields"; static char real_length_key[] = "n_fields"; + static char unnamed_fields_key[] = "n_unnamed_fields"; /* Fields with this name have only a field index, not a field name. *************** *** 21,24 **** --- 22,29 ---- #define REAL_SIZE(op) REAL_SIZE_TP((op)->ob_type) + #define UNNAMED_FIELDS_TP(tp) PyInt_AsLong( \ + PyDict_GetItemString((tp)->tp_dict, unnamed_fields_key)) + #define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP((op)->ob_type) + PyObject * *************** *** 92,96 **** PyObject *ob; PyStructSequence *res = NULL; ! int len, min_len, max_len, i; static char *kwlist[] = {"sequence", "dict", 0}; --- 97,101 ---- PyObject *ob; PyStructSequence *res = NULL; ! int len, min_len, max_len, i, n_unnamed_fields; static char *kwlist[] = {"sequence", "dict", 0}; *************** *** 116,119 **** --- 121,125 ---- min_len = VISIBLE_SIZE_TP(type); max_len = REAL_SIZE_TP(type); + n_unnamed_fields = UNNAMED_FIELDS_TP(type); if (min_len != max_len) { *************** *** 152,156 **** for (; i < max_len; ++i) { if (dict && (ob = PyDict_GetItemString( ! dict, type->tp_members[i].name))) { } else { --- 158,162 ---- for (; i < max_len; ++i) { if (dict && (ob = PyDict_GetItemString( ! dict, type->tp_members[i-n_unnamed_fields].name))) { } else { *************** *** 239,247 **** PyObject* dict; PyObject* result; ! long n_fields, n_visible_fields; int i; n_fields = REAL_SIZE(self); n_visible_fields = VISIBLE_SIZE(self); tup = PyTuple_New(n_visible_fields); if (!tup) { --- 245,254 ---- PyObject* dict; PyObject* result; ! long n_fields, n_visible_fields, n_unnamed_fields; int i; n_fields = REAL_SIZE(self); n_visible_fields = VISIBLE_SIZE(self); + n_unnamed_fields = UNNAMED_FIELDS(self); tup = PyTuple_New(n_visible_fields); if (!tup) { *************** *** 261,265 **** for (; i < n_fields; i++) { ! PyDict_SetItemString(dict, self->ob_type->tp_members[i].name, self->ob_item[i]); } --- 268,273 ---- for (; i < n_fields; i++) { ! char *n = self->ob_type->tp_members[i-n_unnamed_fields].name; ! PyDict_SetItemString(dict, n, self->ob_item[i]); } *************** *** 341,345 **** n_unnamed_members = 0; for (i = 0; desc->fields[i].name != NULL; ++i) ! if (desc->fields[0].name == PyStructSequence_UnnamedField) n_unnamed_members++; n_members = i; --- 349,353 ---- n_unnamed_members = 0; for (i = 0; desc->fields[i].name != NULL; ++i) ! if (desc->fields[i].name == PyStructSequence_UnnamedField) n_unnamed_members++; n_members = i; *************** *** 378,381 **** --- 386,391 ---- PyDict_SetItemString(dict, real_length_key, PyInt_FromLong((long) n_members)); + PyDict_SetItemString(dict, unnamed_fields_key, + PyInt_FromLong((long) n_unnamed_members)); PyDict_SetItemString(dict, "__safe_for_unpickling__", PyInt_FromLong(1)); From fdrake@users.sourceforge.net Wed Oct 16 21:07:58 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 13:07:58 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib liburlparse.tex,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17212 Modified Files: liburlparse.tex Log Message: Document urldefrag(). Index: liburlparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburlparse.tex,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** liburlparse.tex 16 Nov 2001 03:22:15 -0000 1.20 --- liburlparse.tex 16 Oct 2002 20:07:54 -0000 1.21 *************** *** 106,109 **** --- 106,116 ---- \end{funcdesc} + \begin{funcdesc}{urldefrag}{url} + If \var{url} contains a fragment identifier, returns a modified + version of \var{url} with no fragment identifier, and the fragment + identifier as a separate string. If there is no fragment identifier + in \var{url}, returns \var{url} unmodified and an empty string. + \end{funcdesc} + \begin{seealso} From loewis@users.sourceforge.net Wed Oct 16 21:28:26 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 13:28:26 -0700 Subject: [Python-checkins] python/dist/src configure,1.346,1.347 configure.in,1.357,1.358 pyconfig.h.in,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv31547 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #623780: Replace obsolete struct macros. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.346 retrieving revision 1.347 diff -C2 -d -r1.346 -r1.347 *** configure 11 Oct 2002 05:37:58 -0000 1.346 --- configure 16 Oct 2002 20:28:22 -0000 1.347 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.356 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.357 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 13334,13338 **** fi - echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6 --- 13334,13337 ---- *************** *** 13389,13400 **** - cat >>confdefs.h <<\_ACEOF - #define HAVE_ST_RDEV 1 - _ACEOF - fi - - echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 --- 13388,13393 ---- *************** *** 13451,13460 **** - cat >>confdefs.h <<\_ACEOF - #define HAVE_ST_BLKSIZE 1 - _ACEOF - fi - echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 --- 13444,13448 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.357 retrieving revision 1.358 diff -C2 -d -r1.357 -r1.358 *** configure.in 11 Oct 2002 05:37:59 -0000 1.357 --- configure.in 16 Oct 2002 20:28:24 -0000 1.358 *************** *** 1861,1866 **** AC_STRUCT_TM AC_STRUCT_TIMEZONE ! AC_STRUCT_ST_RDEV ! AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLOCKS --- 1861,1866 ---- AC_STRUCT_TM AC_STRUCT_TIMEZONE ! AC_CHECK_MEMBERS([struct stat.st_rdev]) ! AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_STRUCT_ST_BLOCKS Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** pyconfig.h.in 11 Oct 2002 05:37:59 -0000 1.54 --- pyconfig.h.in 16 Oct 2002 20:28:24 -0000 1.55 *************** *** 441,455 **** #undef HAVE_STRUCT_TM_TM_ZONE - /* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use - `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ - #undef HAVE_ST_BLKSIZE - /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ #undef HAVE_ST_BLOCKS - - /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use - `HAVE_STRUCT_STAT_ST_RDEV' instead. */ - #undef HAVE_ST_RDEV /* Define to 1 if you have the `symlink' function. */ --- 441,447 ---- From loewis@users.sourceforge.net Wed Oct 16 21:28:27 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed, 16 Oct 2002 13:28:27 -0700 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c,2.268,2.269 timemodule.c,2.131,2.132 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31547/Modules Modified Files: posixmodule.c timemodule.c Log Message: Patch #623780: Replace obsolete struct macros. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.268 retrieving revision 2.269 diff -C2 -d -r2.268 -r2.269 *** posixmodule.c 16 Oct 2002 18:27:38 -0000 2.268 --- posixmodule.c 16 Oct 2002 20:28:24 -0000 2.269 *************** *** 686,696 **** {"st_mtime", "time of last modification"}, {"st_ctime", "time of last change"}, ! #ifdef HAVE_ST_BLKSIZE {"st_blksize", "blocksize for filesystem I/O"}, #endif ! #ifdef HAVE_ST_BLOCKS {"st_blocks", "number of blocks allocated"}, #endif ! #ifdef HAVE_ST_RDEV {"st_rdev", "device type (if inode device)"}, #endif --- 686,696 ---- {"st_mtime", "time of last modification"}, {"st_ctime", "time of last change"}, ! #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE {"st_blksize", "blocksize for filesystem I/O"}, #endif ! #ifdef HAVE_STRUCT_STAT_ST_BLOCKS {"st_blocks", "number of blocks allocated"}, #endif ! #ifdef HAVE_STRUCT_STAT_ST_RDEV {"st_rdev", "device type (if inode device)"}, #endif *************** *** 698,702 **** }; ! #ifdef HAVE_ST_BLKSIZE #define ST_BLKSIZE_IDX 13 #else --- 698,702 ---- }; ! #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE #define ST_BLKSIZE_IDX 13 #else *************** *** 704,708 **** #endif ! #ifdef HAVE_ST_BLOCKS #define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1) #else --- 704,708 ---- #endif ! #ifdef HAVE_STRUCT_STAT_ST_BLOCKS #define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1) #else *************** *** 710,714 **** #endif ! #ifdef HAVE_ST_RDEV #define ST_RDEV_IDX (ST_BLOCKS_IDX+1) #else --- 710,714 ---- #endif ! #ifdef HAVE_STRUCT_STAT_ST_RDEV #define ST_RDEV_IDX (ST_BLOCKS_IDX+1) #else *************** *** 867,879 **** fill_time(v, 9, st.st_ctime, cnsec); ! #ifdef HAVE_ST_BLKSIZE PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX, PyInt_FromLong((long)st.st_blksize)); #endif ! #ifdef HAVE_ST_BLOCKS PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX, PyInt_FromLong((long)st.st_blocks)); #endif ! #ifdef HAVE_ST_RDEV PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, PyInt_FromLong((long)st.st_rdev)); --- 867,879 ---- fill_time(v, 9, st.st_ctime, cnsec); ! #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX, PyInt_FromLong((long)st.st_blksize)); #endif ! #ifdef HAVE_STRUCT_STAT_ST_BLOCKS PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX, PyInt_FromLong((long)st.st_blocks)); #endif ! #ifdef HAVE_STRUCT_STAT_ST_RDEV PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, PyInt_FromLong((long)st.st_rdev)); Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.131 retrieving revision 2.132 diff -C2 -d -r2.131 -r2.132 *** timemodule.c 2 Aug 2002 02:27:13 -0000 2.131 --- timemodule.c 16 Oct 2002 20:28:25 -0000 2.132 *************** *** 654,658 **** Py_BuildValue("(zz)", tzname[0], tzname[1])); #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ ! #ifdef HAVE_TM_ZONE { #define YEAR ((time_t)((365 * 24 + 6) * 3600)) --- 654,658 ---- Py_BuildValue("(zz)", tzname[0], tzname[1])); #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ ! #ifdef HAVE_STRUCT_TM_TM_ZONE { #define YEAR ((time_t)((365 * 24 + 6) * 3600)) *************** *** 703,707 **** PyModule_AddObject(m, "tzname", Py_BuildValue("(zz)", "", "")); #endif /* macintosh */ ! #endif /* HAVE_TM_ZONE */ #ifdef __CYGWIN__ tzset(); --- 703,707 ---- PyModule_AddObject(m, "tzname", Py_BuildValue("(zz)", "", "")); #endif /* macintosh */ ! #endif /* HAVE_STRUCT_TM_TM_ZONE */ #ifdef __CYGWIN__ tzset(); From gvanrossum@users.sourceforge.net Wed Oct 16 22:00:48 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:00:48 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv2419/cgi Log Message: Directory /cvsroot/python/python/dist/src/Demo/cgi added to the repository From gvanrossum@users.sourceforge.net Wed Oct 16 22:01:29 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:01:29 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi cgi0.sh,NONE,1.1 cgi1.py,NONE,1.1 cgi2.py,NONE,1.1 cgi3.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv3125 Added Files: cgi0.sh cgi1.py cgi2.py cgi3.py Log Message: Some really simple cgi examples. cgi3 is a MiniWiki. --- NEW FILE: cgi0.sh --- #! /bin/sh # If you can't get this to work, your web server isn't set up right echo Content-type: text/plain echo echo Hello world echo This is cgi0.sh --- NEW FILE: cgi1.py --- #!/usr/local/bin/python """CGI test 1 - check server setup.""" # Until you get this to work, your web server isn't set up right or # your Python isn't set up right. # If cgi0.sh works but cgi1.py, check the #! line and the file # permissions. The docs for the cgi.py module have debugging tips. print "Content-type: text/html" print print "

Hello world

" print "

This is cgi1.py" --- NEW FILE: cgi2.py --- #!/usr/local/bin/python """CGI test 2 - basic use of cgi module.""" import cgitb; cgitb.enable() import cgi def main(): form = cgi.FieldStorage() print "Content-type: text/html" print if not form: print "

No Form Keys

" else: print "

Form Keys

" for key in form.keys(): value = form[key].value print "

", cgi.escape(key), ":", cgi.escape(value) if __name__ == "__main__": main() --- NEW FILE: cgi3.py --- #!/usr/local/bin/python """CGI test 3 (persistent data).""" import cgitb; cgitb.enable() import os, re, cgi, sys escape = cgi.escape def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" wiki = WikiPage(page) wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) class WikiPage: homedir = os.path.dirname(sys.argv[0]) scripturl = os.path.basename(sys.argv[0]) def __init__(self, name): self.name = name self.load() def cmd_view(self, form): print "

", escape(self.splitwikiword(self.name)), "

" print "

" for line in self.data.splitlines(): line = line.rstrip() if not line: print "

" continue words = re.split('(\W+)', line) for i in range(len(words)): word = words[i] if self.iswikiword(word): if os.path.isfile(self.mkfile(word)): word = self.mklink("view", word, word) else: word = self.mklink("new", word, word + "*") else: word = escape(word) words[i] = word print "".join(words) print "


" print "

", self.mklink("edit", self.name, "Edit this page") + "," print self.mklink("view", "FrontPage", "go to front page") + "." def cmd_edit(self, form, label="Change"): print "

", label, self.name, "

" print '
' % self.scripturl s = '' print s % self.data print '' print '' % self.name print '
' print '' % label print "" def cmd_create(self, form): self.data = form.getvalue("text", "").strip() self.store() self.cmd_view(form) def cmd_new(self, form): self.cmd_edit(form, label="Create Page") def iswikiword(self, word): return re.match("[A-Z][a-z]+([A-Z][a-z]*)+", word) def splitwikiword(self, word): chars = [] for c in word: if chars and c.isupper(): chars.append(' ') chars.append(c) return "".join(chars) def mkfile(self, name=None): if name is None: name = self.name return os.path.join(self.homedir, name) def mklink(self, cmd, page, text): link = self.scripturl + "?cmd=" + cmd + "&page=" + page return '%s' % (link, text) def load(self): try: f = open(self.mkfile()) data = f.read().strip() f.close() except IOError: data = "" self.data = data def store(self): data = self.data try: f = open(self.mkfile(), "w") f.write(data) f.close() return "" except IOError, err: return "IOError: %s" % str(err) if __name__ == "__main__": main() From fdrake@users.sourceforge.net Wed Oct 16 22:02:38 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:02:38 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_urlparse.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv4190 Modified Files: test_urlparse.py Log Message: Make sure we test urlsplit() / urlunsplit() directly, rather than guessing that urlparse() / urlunparse() use them. Add tests of urldefrag(). Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_urlparse.py 14 Oct 2002 19:59:54 -0000 1.8 --- test_urlparse.py 16 Oct 2002 21:02:36 -0000 1.9 *************** *** 10,30 **** class UrlParseTestCase(unittest.TestCase): def test_frags(self): ! for url, expected in [('http://www.python.org', ! ('http', 'www.python.org', '', '', '', '')), ! ('http://www.python.org#abc', ! ('http', 'www.python.org', '', '', '', 'abc')), ! ('http://www.python.org/#abc', ! ('http', 'www.python.org', '/', '', '', 'abc')), ! (RFC1808_BASE, ! ('http', 'a', '/b/c/d', 'p', 'q', 'f')), ! ('file:///tmp/junk.txt', ! ('file', '', '/tmp/junk.txt', '', '', '')), ! ]: result = urlparse.urlparse(url) ! self.assertEqual(result, expected) # put it back together and it should be the same result2 = urlparse.urlunparse(result) self.assertEqual(result2, url) def checkJoin(self, base, relurl, expected): self.assertEqual(urlparse.urljoin(base, relurl), expected, --- 10,42 ---- class UrlParseTestCase(unittest.TestCase): def test_frags(self): ! for url, parsed, split in [ ! ('http://www.python.org', ! ('http', 'www.python.org', '', '', '', ''), ! ('http', 'www.python.org', '', '', '')), ! ('http://www.python.org#abc', ! ('http', 'www.python.org', '', '', '', 'abc'), ! ('http', 'www.python.org', '', '', 'abc')), ! ('http://www.python.org/#abc', ! ('http', 'www.python.org', '/', '', '', 'abc'), ! ('http', 'www.python.org', '/', '', 'abc')), ! (RFC1808_BASE, ! ('http', 'a', '/b/c/d', 'p', 'q', 'f'), ! ('http', 'a', '/b/c/d;p', 'q', 'f')), ! ('file:///tmp/junk.txt', ! ('file', '', '/tmp/junk.txt', '', '', ''), ! ('file', '', '/tmp/junk.txt', '', '')), ! ]: result = urlparse.urlparse(url) ! self.assertEqual(result, parsed) # put it back together and it should be the same result2 = urlparse.urlunparse(result) self.assertEqual(result2, url) + # check the roundtrip using urlsplit() as well + result = urlparse.urlsplit(url) + self.assertEqual(result, split) + result2 = urlparse.urlunsplit(result) + self.assertEqual(result2, url) + def checkJoin(self, base, relurl, expected): self.assertEqual(urlparse.urljoin(base, relurl), expected, *************** *** 33,36 **** --- 45,49 ---- def test_unparse_parse(self): for u in ['Python', './Python']: + self.assertEqual(urlparse.urlunsplit(urlparse.urlsplit(u)), u) self.assertEqual(urlparse.urlunparse(urlparse.urlparse(u)), u) *************** *** 128,131 **** --- 141,159 ---- self.checkJoin(RFC2396_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x') self.checkJoin(RFC2396_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x') + + def test_urldefrag(self): + for url, defrag, frag in [ + ('http://python.org#frag', 'http://python.org', 'frag'), + ('http://python.org', 'http://python.org', ''), + ('http://python.org/#frag', 'http://python.org/', 'frag'), + ('http://python.org/', 'http://python.org/', ''), + ('http://python.org/?q#frag', 'http://python.org/?q', 'frag'), + ('http://python.org/?q', 'http://python.org/?q', ''), + ('http://python.org/p#frag', 'http://python.org/p', 'frag'), + ('http://python.org/p?q', 'http://python.org/p?q', ''), + (RFC1808_BASE, 'http://a/b/c/d;p?q', 'f'), + (RFC2396_BASE, 'http://a/b/c/d;p?q', ''), + ]: + self.assertEqual(urlparse.urldefrag(url), (defrag, frag)) def test_main(): From fdrake@users.sourceforge.net Wed Oct 16 22:21:43 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:21:43 -0700 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20296 Modified Files: urlparse.py Log Message: Added missing entries to __all__. Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** urlparse.py 14 Oct 2002 19:56:03 -0000 1.34 --- urlparse.py 16 Oct 2002 21:21:39 -0000 1.35 *************** *** 5,9 **** """ ! __all__ = ["urlparse", "urlunparse", "urljoin"] # A classification of schemes ('' means apply by default) --- 5,10 ---- """ ! __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", ! "urlsplit", "urlunsplit"] # A classification of schemes ('' means apply by default) From fdrake@users.sourceforge.net Wed Oct 16 22:24:55 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:24:55 -0700 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.31.6.3,1.31.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22904 Modified Files: Tag: release22-maint urlparse.py Log Message: Added missing entries to __all__. Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.31.6.3 retrieving revision 1.31.6.4 diff -C2 -d -r1.31.6.3 -r1.31.6.4 *** urlparse.py 14 Oct 2002 20:08:49 -0000 1.31.6.3 --- urlparse.py 16 Oct 2002 21:24:52 -0000 1.31.6.4 *************** *** 5,9 **** """ ! __all__ = ["urlparse", "urlunparse", "urljoin"] # A classification of schemes ('' means apply by default) --- 5,10 ---- """ ! __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", ! "urlsplit", "urlunsplit"] # A classification of schemes ('' means apply by default) From fdrake@users.sourceforge.net Wed Oct 16 22:26:04 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 16 Oct 2002 14:26:04 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib liburlparse.tex,1.20,1.20.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23860 Modified Files: Tag: release22-maint liburlparse.tex Log Message: Document urldefrag(). Index: liburlparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburlparse.tex,v retrieving revision 1.20 retrieving revision 1.20.6.1 diff -C2 -d -r1.20 -r1.20.6.1 *** liburlparse.tex 16 Nov 2001 03:22:15 -0000 1.20 --- liburlparse.tex 16 Oct 2002 21:26:01 -0000 1.20.6.1 *************** *** 106,109 **** --- 106,116 ---- \end{funcdesc} + \begin{funcdesc}{urldefrag}{url} + If \var{url} contains a fragment identifier, returns a modified + version of \var{url} with no fragment identifier, and the fragment + identifier as a separate string. If there is no fragment identifier + in \var{url}, returns \var{url} unmodified and an empty string. + \end{funcdesc} + \begin{seealso} From gvanrossum@users.sourceforge.net Thu Oct 17 12:45:56 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 04:45:56 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi cgi3.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv9178 Modified Files: cgi3.py Log Message: Security fixes: reject non-wiki-word page names; set homedir to /tmp. Show errors returned by store(). A few nits. Index: cgi3.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/cgi3.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cgi3.py 16 Oct 2002 21:01:27 -0000 1.1 --- cgi3.py 17 Oct 2002 11:45:54 -0000 1.2 *************** *** 12,17 **** print "Content-type: text/html" print ! cmd = form.getvalue("cmd") or "view" ! page = form.getvalue("page") or "FrontPage" wiki = WikiPage(page) wiki.load() --- 12,17 ---- print "Content-type: text/html" print ! cmd = form.getvalue("cmd", "view") ! page = form.getvalue("page", "FrontPage") wiki = WikiPage(page) wiki.load() *************** *** 21,28 **** class WikiPage: ! homedir = os.path.dirname(sys.argv[0]) scripturl = os.path.basename(sys.argv[0]) def __init__(self, name): self.name = name self.load() --- 21,30 ---- class WikiPage: ! homedir = "/tmp" scripturl = os.path.basename(sys.argv[0]) def __init__(self, name): + if not self.iswikiword(name): + raise ValueError, "page name is not a wiki word" self.name = name self.load() *************** *** 49,53 **** print "".join(words) print "
" ! print "

", self.mklink("edit", self.name, "Edit this page") + "," print self.mklink("view", "FrontPage", "go to front page") + "." --- 51,55 ---- print "".join(words) print "


" ! print "

", self.mklink("edit", self.name, "Edit this page") + ";" print self.mklink("view", "FrontPage", "go to front page") + "." *************** *** 65,70 **** def cmd_create(self, form): self.data = form.getvalue("text", "").strip() ! self.store() ! self.cmd_view(form) def cmd_new(self, form): --- 67,77 ---- def cmd_create(self, form): self.data = form.getvalue("text", "").strip() ! error = self.store() ! if error: ! print "

I'm sorry. That didn't work

" ! print "

An error occurred while attempting to write the file:" ! print "

", escape(error) ! else: ! self.cmd_view(form) def cmd_new(self, form): From gvanrossum@users.sourceforge.net Thu Oct 17 14:34:04 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 06:34:04 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi cgi3.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv14871 Modified Files: cgi3.py Log Message: Add trailing newline when saving. Index: cgi3.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/cgi3.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cgi3.py 17 Oct 2002 11:45:54 -0000 1.2 --- cgi3.py 17 Oct 2002 13:34:01 -0000 1.3 *************** *** 112,115 **** --- 112,117 ---- f = open(self.mkfile(), "w") f.write(data) + if data and not data.endswith('\n'): + f.write('\n') f.close() return "" From theller@users.sourceforge.net Wed Oct 16 18:51:40 2002 From: theller@users.sourceforge.net (theller@users.sourceforge.net) Date: Wed, 16 Oct 2002 10:51:40 -0700 Subject: [Python-checkins] distutils/distutils/command bdist_wininst.py,1.37,1.38 Message-ID: Update of /cvsroot/python/distutils/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv8759/distutils/command Modified Files: bdist_wininst.py Log Message: Recreated after source changes. Index: bdist_wininst.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** bdist_wininst.py 15 Oct 2002 19:45:25 -0000 1.37 --- bdist_wininst.py 16 Oct 2002 17:51:38 -0000 1.38 *************** *** 265,269 **** ZGUuDQ0KJAAAAAAAAAAtOHsRaVkVQmlZFUJpWRVCEkUZQmpZFUIGRh9CYlkVQupFG0JrWRVCBkYR QmtZFUJpWRVCZlkVQmlZFELjWRVCC0YGQmRZFUJveh9Ca1kVQq5fE0JoWRVCUmljaGlZFUIAAAAA ! AAAAAAAAAAAAAAAAUEUAAEwBAwDeb6w9AAAAAAAAAADgAA8BCwEGAABQAAAAEAAAALAAAGAGAQAA wAAAABABAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAEAAAQAAAAAAAACAAAAAAAQAAAQ AAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAwEQEA5AEAAAAQAQAwAQAAAAAAAAAAAAAAAAAAAAAA --- 265,269 ---- ZGUuDQ0KJAAAAAAAAAAtOHsRaVkVQmlZFUJpWRVCEkUZQmpZFUIGRh9CYlkVQupFG0JrWRVCBkYR QmtZFUJpWRVCZlkVQmlZFELjWRVCC0YGQ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Gb2xkZXJQYXRoQQAA AEdldERDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --- 615,619 ---- Q1JULmRsbABvbGUzMi5kbGwAU0hFTEwzMi5kbGwAVVNFUjMyLmRsbAAATG9hZExpYnJhcnlBAABH ZXRQcm9jQWRkcmVzcwAARXhpdFByb2Nlc3MAAABSZWdDbG9zZUtleQAAAFByb3BlcnR5U2hlZXRB ! AABUZXh0T3V0QQAAZnJlZQAAQ29Jbml0aWFsaXplAABTSEdldFNwZWNpYWxGb2xkZXJQYXRoQQAA AEdldERDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA From bwarsaw@users.sourceforge.net Thu Oct 17 16:32:20 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu, 17 Oct 2002 08:32:20 -0700 Subject: [Python-checkins] python/nondist/peps pep-0008.txt,1.17,1.18 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3154 Modified Files: pep-0008.txt Log Message: Added a note on compound statements after remarks from David Goodger. Make the code samples agree with this recommendation. ;) Index: pep-0008.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pep-0008.txt 7 Oct 2002 13:40:41 -0000 1.17 --- pep-0008.txt 17 Oct 2002 15:32:18 -0000 1.18 *************** *** 239,242 **** --- 239,253 ---- return magic(r=real, i=imag) + - Compound statements (multiple statements on the same line) are + generally discouraged. + + No: if foo == 'blah': do_blah_thing() + Yes: if foo == 'blah': + do_blah_thing() + + No: do_one(); do_two(); do_three() + Yes: do_one() + do_two() + do_three() Comments *************** *** 581,586 **** types are new in Python 2.3): ! No: if greeting == True: print "Hello world" ! Yes: if greeting: print "Hello world" --- 592,597 ---- types are new in Python 2.3): ! No: if greeting == True: ! Yes: if greeting: From gvanrossum@users.sourceforge.net Thu Oct 17 16:53:04 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 08:53:04 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi wiki.py,NONE,1.1 cgi3.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv16897 Modified Files: cgi3.py Added Files: wiki.py Log Message: Restructure: move all wiki code into a separate module. --- NEW FILE: wiki.py --- """Wiki main program. Imported and run by cgi3.py.""" import os, re, cgi, sys escape = cgi.escape def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd", "view") page = form.getvalue("page", "FrontPage") wiki = WikiPage(page) wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) class WikiPage: homedir = "/tmp" scripturl = os.path.basename(sys.argv[0]) def __init__(self, name): if not self.iswikiword(name): raise ValueError, "page name is not a wiki word" self.name = name self.load() def cmd_view(self, form): print "

", escape(self.splitwikiword(self.name)), "

" print "

" for line in self.data.splitlines(): line = line.rstrip() if not line: print "

" continue words = re.split('(\W+)', line) for i in range(len(words)): word = words[i] if self.iswikiword(word): if os.path.isfile(self.mkfile(word)): word = self.mklink("view", word, word) else: word = self.mklink("new", word, word + "*") else: word = escape(word) words[i] = word print "".join(words) print "


" print "

", self.mklink("edit", self.name, "Edit this page") + ";" print self.mklink("view", "FrontPage", "go to front page") + "." def cmd_edit(self, form, label="Change"): print "

", label, self.name, "

" print '
' % self.scripturl s = '' print s % self.data print '' print '' % self.name print '
' print '' % label print "" def cmd_create(self, form): self.data = form.getvalue("text", "").strip() error = self.store() if error: print "

I'm sorry. That didn't work

" print "

An error occurred while attempting to write the file:" print "

", escape(error) else: self.cmd_view(form) def cmd_new(self, form): self.cmd_edit(form, label="Create Page") def iswikiword(self, word): return re.match("[A-Z][a-z]+([A-Z][a-z]*)+", word) def splitwikiword(self, word): chars = [] for c in word: if chars and c.isupper(): chars.append(' ') chars.append(c) return "".join(chars) def mkfile(self, name=None): if name is None: name = self.name return os.path.join(self.homedir, name + ".txt") def mklink(self, cmd, page, text): link = self.scripturl + "?cmd=" + cmd + "&page=" + page return '%s' % (link, text) def load(self): try: f = open(self.mkfile()) data = f.read().strip() f.close() except IOError: data = "" self.data = data def store(self): data = self.data try: f = open(self.mkfile(), "w") f.write(data) if data and not data.endswith('\n'): f.write('\n') f.close() return "" except IOError, err: return "IOError: %s" % str(err) Index: cgi3.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/cgi3.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cgi3.py 17 Oct 2002 13:34:01 -0000 1.3 --- cgi3.py 17 Oct 2002 15:53:02 -0000 1.4 *************** *** 5,121 **** import cgitb; cgitb.enable() ! import os, re, cgi, sys ! escape = cgi.escape ! ! def main(): ! form = cgi.FieldStorage() ! print "Content-type: text/html" ! print ! cmd = form.getvalue("cmd", "view") ! page = form.getvalue("page", "FrontPage") ! wiki = WikiPage(page) ! wiki.load() ! method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view ! method(form) ! ! class WikiPage: ! ! homedir = "/tmp" ! scripturl = os.path.basename(sys.argv[0]) ! ! def __init__(self, name): ! if not self.iswikiword(name): ! raise ValueError, "page name is not a wiki word" ! self.name = name ! self.load() ! ! def cmd_view(self, form): ! print "

", escape(self.splitwikiword(self.name)), "

" ! print "

" ! for line in self.data.splitlines(): ! line = line.rstrip() ! if not line: ! print "

" ! continue ! words = re.split('(\W+)', line) ! for i in range(len(words)): ! word = words[i] ! if self.iswikiword(word): ! if os.path.isfile(self.mkfile(word)): ! word = self.mklink("view", word, word) ! else: ! word = self.mklink("new", word, word + "*") ! else: ! word = escape(word) ! words[i] = word ! print "".join(words) ! print "


" ! print "

", self.mklink("edit", self.name, "Edit this page") + ";" ! print self.mklink("view", "FrontPage", "go to front page") + "." ! ! def cmd_edit(self, form, label="Change"): ! print "

", label, self.name, "

" ! print '
' % self.scripturl ! s = '' ! print s % self.data ! print '' ! print '' % self.name ! print '
' ! print '' % label ! print "" ! ! def cmd_create(self, form): ! self.data = form.getvalue("text", "").strip() ! error = self.store() ! if error: ! print "

I'm sorry. That didn't work

" ! print "

An error occurred while attempting to write the file:" ! print "

", escape(error) ! else: ! self.cmd_view(form) ! ! def cmd_new(self, form): ! self.cmd_edit(form, label="Create Page") ! ! def iswikiword(self, word): ! return re.match("[A-Z][a-z]+([A-Z][a-z]*)+", word) ! ! def splitwikiword(self, word): ! chars = [] ! for c in word: ! if chars and c.isupper(): ! chars.append(' ') ! chars.append(c) ! return "".join(chars) ! ! def mkfile(self, name=None): ! if name is None: ! name = self.name ! return os.path.join(self.homedir, name) ! ! def mklink(self, cmd, page, text): ! link = self.scripturl + "?cmd=" + cmd + "&page=" + page ! return '%s' % (link, text) ! ! def load(self): ! try: ! f = open(self.mkfile()) ! data = f.read().strip() ! f.close() ! except IOError: ! data = "" ! self.data = data ! ! def store(self): ! data = self.data ! try: ! f = open(self.mkfile(), "w") ! f.write(data) ! if data and not data.endswith('\n'): ! f.write('\n') ! f.close() ! return "" ! except IOError, err: ! return "IOError: %s" % str(err) if __name__ == "__main__": --- 5,9 ---- import cgitb; cgitb.enable() ! from wiki import main if __name__ == "__main__": From gvanrossum@users.sourceforge.net Thu Oct 17 17:21:39 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 09:21:39 -0700 Subject: [Python-checkins] python/dist/src/Lib CGIHTTPServer.py,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv27193 Modified Files: CGIHTTPServer.py Log Message: Must catch TypeError from int(length). Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** CGIHTTPServer.py 20 Aug 2002 20:07:10 -0000 1.28 --- CGIHTTPServer.py 17 Oct 2002 16:21:35 -0000 1.29 *************** *** 235,239 **** try: nbytes = int(length) ! except ValueError: nbytes = 0 files = popenx(cmdline, 'b') --- 235,239 ---- try: nbytes = int(length) ! except (TypeError, ValueError): nbytes = 0 files = popenx(cmdline, 'b') From gvanrossum@users.sourceforge.net Thu Oct 17 17:26:47 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 09:26:47 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi wiki.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv29166 Modified Files: wiki.py Log Message: Use tempfile.gettempdir() to get the temp directory rather than hardcoding "/tmp". Index: wiki.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/wiki.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wiki.py 17 Oct 2002 15:53:02 -0000 1.1 --- wiki.py 17 Oct 2002 16:26:45 -0000 1.2 *************** *** 1,5 **** """Wiki main program. Imported and run by cgi3.py.""" ! import os, re, cgi, sys escape = cgi.escape --- 1,5 ---- """Wiki main program. Imported and run by cgi3.py.""" ! import os, re, cgi, sys, tempfile escape = cgi.escape *************** *** 17,21 **** class WikiPage: ! homedir = "/tmp" scripturl = os.path.basename(sys.argv[0]) --- 17,21 ---- class WikiPage: ! homedir = tempfile.gettempdir() scripturl = os.path.basename(sys.argv[0]) From gvanrossum@users.sourceforge.net Thu Oct 17 17:33:42 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 09:33:42 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi cgi1.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv31612 Modified Files: cgi1.py Log Message: Grammar repair in comment. Index: cgi1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/cgi1.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cgi1.py 16 Oct 2002 21:01:27 -0000 1.1 --- cgi1.py 17 Oct 2002 16:33:40 -0000 1.2 *************** *** 6,10 **** # your Python isn't set up right. ! # If cgi0.sh works but cgi1.py, check the #! line and the file # permissions. The docs for the cgi.py module have debugging tips. --- 6,10 ---- # your Python isn't set up right. ! # If cgi0.sh works but cgi1.py doesn't, check the #! line and the file # permissions. The docs for the cgi.py module have debugging tips. From fdrake@users.sourceforge.net Thu Oct 17 20:23:46 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 12:23:46 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib liburlparse.tex,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv9917 Modified Files: liburlparse.tex Log Message: Typo(!): "normal" -> "number" Index: liburlparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburlparse.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** liburlparse.tex 16 Oct 2002 20:07:54 -0000 1.21 --- liburlparse.tex 17 Oct 2002 19:23:43 -0000 1.22 *************** *** 120,124 **** \seerfc{1808}{Relative Uniform Resource Locators}{ This Request For Comments includes the rules for joining an ! absolute and a relative URL, including a fair normal of ``Abnormal Examples'' which govern the treatment of border cases.} --- 120,124 ---- \seerfc{1808}{Relative Uniform Resource Locators}{ This Request For Comments includes the rules for joining an ! absolute and a relative URL, including a fair number of ``Abnormal Examples'' which govern the treatment of border cases.} From gvanrossum@users.sourceforge.net Thu Oct 17 20:30:42 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 12:30:42 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi wiki.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv12254 Modified Files: wiki.py Log Message: Remove redundant load() call. Index: wiki.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/wiki.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wiki.py 17 Oct 2002 16:26:45 -0000 1.2 --- wiki.py 17 Oct 2002 19:30:39 -0000 1.3 *************** *** 11,15 **** page = form.getvalue("page", "FrontPage") wiki = WikiPage(page) - wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) --- 11,14 ---- From fdrake@users.sourceforge.net Thu Oct 17 20:48:29 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 12:48:29 -0700 Subject: [Python-checkins] python/dist/src/Include structseq.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv18388 Modified Files: structseq.h Log Message: Clean up some whitespace to be consistent with Python's C style. Index: structseq.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/structseq.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** structseq.h 16 Oct 2002 18:27:38 -0000 1.3 --- structseq.h 17 Oct 2002 19:48:27 -0000 1.4 *************** *** 7,11 **** extern "C" { #endif ! typedef struct PyStructSequence_Field { char *name; --- 7,11 ---- extern "C" { #endif ! typedef struct PyStructSequence_Field { char *name; *************** *** 22,28 **** extern char* PyStructSequence_UnnamedField; ! PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, ! PyStructSequence_Desc *desc); ! PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); --- 22,28 ---- extern char* PyStructSequence_UnnamedField; ! PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, ! PyStructSequence_Desc *desc); ! PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); From fdrake@users.sourceforge.net Thu Oct 17 21:36:10 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 13:36:10 -0700 Subject: [Python-checkins] python/dist/src/Lib/test regrtest.py,1.100,1.101 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3217 Modified Files: regrtest.py Log Message: Remove spurious cruft from the output. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** regrtest.py 9 Oct 2002 01:07:11 -0000 1.100 --- regrtest.py 17 Oct 2002 20:36:08 -0000 1.101 *************** *** 370,374 **** except (ImportError, test_support.TestSkipped), msg: if not quiet: ! print "test", test, "skipped --", msg sys.stdout.flush() return -1 --- 370,374 ---- except (ImportError, test_support.TestSkipped), msg: if not quiet: ! print test, "skipped --", msg sys.stdout.flush() return -1 From fdrake@users.sourceforge.net Thu Oct 17 21:37:52 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 13:37:52 -0700 Subject: [Python-checkins] python/dist/src/Modules main.c,1.69,1.70 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3799 Modified Files: main.c Log Message: Fix minor whitespace nit, for consistency with Python's C style rules. Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** main.c 9 Aug 2002 13:35:18 -0000 1.69 --- main.c 17 Oct 2002 20:37:50 -0000 1.70 *************** *** 396,400 **** Py_Finalize(); #ifdef RISCOS ! if(Py_RISCOSWimpFlag) fprintf(stderr, "\x0cq\x0c"); /* make frontend quit */ #endif --- 396,400 ---- Py_Finalize(); #ifdef RISCOS ! if (Py_RISCOSWimpFlag) fprintf(stderr, "\x0cq\x0c"); /* make frontend quit */ #endif From fdrake@users.sourceforge.net Thu Oct 17 22:25:01 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 14:25:01 -0700 Subject: [Python-checkins] python/dist/src/Python pythonrun.c,2.167,2.168 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv22540 Modified Files: pythonrun.c Log Message: If we have a filename and __main__.__file__ hasn't already been set, set it. Closes SF issue #624729. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.167 retrieving revision 2.168 diff -C2 -d -r2.167 -r2.168 *** pythonrun.c 5 Oct 2002 01:47:34 -0000 2.167 --- pythonrun.c 17 Oct 2002 21:24:58 -0000 2.168 *************** *** 676,679 **** --- 676,689 ---- return -1; d = PyModule_GetDict(m); + if (PyDict_GetItemString(d, "__file__") == NULL) { + PyObject *f = PyString_FromString(filename); + if (f == NULL) + return -1; + if (PyDict_SetItemString(d, "__file__", f) < 0) { + Py_DECREF(f); + return -1; + } + Py_DECREF(f); + } ext = filename + strlen(filename) - 4; if (maybe_pyc_file(fp, filename, ext, closeit)) { *************** *** 681,685 **** if (closeit) fclose(fp); ! if( (fp = fopen(filename, "rb")) == NULL ) { fprintf(stderr, "python: Can't reopen .pyc file\n"); return -1; --- 691,695 ---- if (closeit) fclose(fp); ! if ((fp = fopen(filename, "rb")) == NULL) { fprintf(stderr, "python: Can't reopen .pyc file\n"); return -1; From gvanrossum@users.sourceforge.net Thu Oct 17 22:41:46 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 14:41:46 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi wiki.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv30448 Modified Files: wiki.py Log Message: In cmd_create(), use a redirect directive instead of viewing the page; this avoids resubmitting POST data. Remove redundant 'Page' from label passed from cmd_new(). Index: wiki.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/wiki.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wiki.py 17 Oct 2002 19:30:39 -0000 1.3 --- wiki.py 17 Oct 2002 21:41:42 -0000 1.4 *************** *** 68,75 **** print "

", escape(error) else: ! self.cmd_view(form) def cmd_new(self, form): ! self.cmd_edit(form, label="Create Page") def iswikiword(self, word): --- 68,82 ---- print "

", escape(error) else: ! # Use a redirect directive, to avoid "reload page" problems ! print "" ! s = '' ! print s % (self.scripturl + "?cmd=view&page=" + self.name) ! print "" ! print "

OK

" ! print "

If nothing happens, please click here:", ! print self.mklink("view", self.name, self.name) def cmd_new(self, form): ! self.cmd_edit(form, label="Create") def iswikiword(self, word): From gvanrossum@users.sourceforge.net Thu Oct 17 22:43:50 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu, 17 Oct 2002 14:43:50 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi wiki.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv31109 Modified Files: wiki.py Log Message: Refactor cmd_view(): move line formatting to a helper method. Index: wiki.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/cgi/wiki.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wiki.py 17 Oct 2002 21:41:42 -0000 1.4 --- wiki.py 17 Oct 2002 21:43:47 -0000 1.5 *************** *** 32,51 **** if not line: print "

" ! continue ! words = re.split('(\W+)', line) ! for i in range(len(words)): ! word = words[i] ! if self.iswikiword(word): ! if os.path.isfile(self.mkfile(word)): ! word = self.mklink("view", word, word) ! else: ! word = self.mklink("new", word, word + "*") ! else: ! word = escape(word) ! words[i] = word ! print "".join(words) print "


" print "

", self.mklink("edit", self.name, "Edit this page") + ";" print self.mklink("view", "FrontPage", "go to front page") + "." def cmd_edit(self, form, label="Change"): --- 32,53 ---- if not line: print "

" ! else: ! print self.formatline(line) print "


" print "

", self.mklink("edit", self.name, "Edit this page") + ";" print self.mklink("view", "FrontPage", "go to front page") + "." + + def formatline(self, line): + words = [] + for word in re.split('(\W+)', line): + if self.iswikiword(word): + if os.path.isfile(self.mkfile(word)): + word = self.mklink("view", word, word) + else: + word = self.mklink("new", word, word + "*") + else: + word = escape(word) + words.append(word) + return "".join(words) def cmd_edit(self, form, label="Change"): From fdrake@users.sourceforge.net Thu Oct 17 23:09:07 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:09:07 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_tempfile.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv7625 Modified Files: test_tempfile.py Log Message: Don't call warnings.resetwarnings(); that does bad things that cause other tests to generate warning when they didn't before. In particular, this cancels not only filters set by -W, but also from test.regrtest. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_tempfile.py 22 Aug 2002 20:02:03 -0000 1.10 --- test_tempfile.py 17 Oct 2002 22:09:03 -0000 1.11 *************** *** 11,14 **** --- 11,18 ---- from test import test_support + warnings.filterwarnings("ignore", + category=RuntimeWarning, + message="mktemp", module=__name__) + if hasattr(os, 'stat'): import stat *************** *** 479,485 **** def setUp(self): self.dir = tempfile.mkdtemp() - warnings.filterwarnings("ignore", - category=RuntimeWarning, - message="mktemp") def tearDown(self): --- 483,486 ---- *************** *** 487,492 **** os.rmdir(self.dir) self.dir = None - # XXX This clobbers any -W options. - warnings.resetwarnings() class mktemped: --- 488,491 ---- From fdrake@users.sourceforge.net Thu Oct 17 23:13:31 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:13:31 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_regex.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9106 Modified Files: test_regex.py Log Message: Continue to work even though the test can be named test.test_regex these days. Index: test_regex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_regex.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_regex.py 23 Jul 2002 19:03:59 -0000 1.12 --- test_regex.py 17 Oct 2002 22:13:28 -0000 1.13 *************** *** 2,6 **** import warnings warnings.filterwarnings("ignore", "the regex module is deprecated", ! DeprecationWarning, r'test_regex$') import regex from regex_syntax import * --- 2,6 ---- import warnings warnings.filterwarnings("ignore", "the regex module is deprecated", ! DeprecationWarning, __name__) import regex from regex_syntax import * From nnorwitz@users.sourceforge.net Thu Oct 17 23:15:35 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:15:35 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.210,1.211 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv9688/Misc Modified Files: ACKS Log Message: Add new encoding for Ukrainian Cyrillic Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** ACKS 13 Oct 2002 10:22:07 -0000 1.210 --- ACKS 17 Oct 2002 22:15:32 -0000 1.211 *************** *** 141,144 **** --- 141,145 ---- Gary Duzan Eugene Dvurechenski + Maxim Dzumanenko Hans Eckardt Grant Edwards From nnorwitz@users.sourceforge.net Thu Oct 17 23:15:35 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:15:35 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings koi8_u.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv9688/Lib/encodings Added Files: koi8_u.py Log Message: Add new encoding for Ukrainian Cyrillic --- NEW FILE: koi8_u.py --- """ Python Character Mapping Codec for KOI8U. This character scheme is compliant to RFC2319 Written by Marc-Andre Lemburg (mal@lemburg.com). Modified by Maxim Dzumanenko . (c) Copyright 2002, Python Software Foundation. """#" import codecs, koi8_r ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decode(input,errors,decoding_map) class StreamWriter(Codec,codecs.StreamWriter): pass class StreamReader(Codec,codecs.StreamReader): pass ### encodings module API def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) ### Decoding Map decoding_map = koi8_r.decoding_map.copy() decoding_map.update({ 0x00a4: 0x0454, # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00a6: 0x0456, # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00a7: 0x0457, # CYRILLIC SMALL LETTER YI (UKRAINIAN) 0x00ad: 0x0491, # CYRILLIC SMALL LETTER UKRAINIAN GHE WITH UPTURN 0x00b4: 0x0403, # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00b6: 0x0406, # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00b7: 0x0407, # CYRILLIC CAPITAL LETTER YI (UKRAINIAN) 0x00bd: 0x0490, # CYRILLIC CAPITAL LETTER UKRAINIAN GHE WITH UPTURN }) ### Encoding Map encoding_map = codecs.make_encoding_map(decoding_map) From nnorwitz@users.sourceforge.net Thu Oct 17 23:17:45 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:17:45 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.149.4.12,1.149.4.13 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv10238/Misc Modified Files: Tag: release22-maint ACKS Log Message: Add new encoding for Ukrainian Cyrillic Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.149.4.12 retrieving revision 1.149.4.13 diff -C2 -d -r1.149.4.12 -r1.149.4.13 *** ACKS 9 Oct 2002 16:38:18 -0000 1.149.4.12 --- ACKS 17 Oct 2002 22:17:41 -0000 1.149.4.13 *************** *** 140,143 **** --- 140,144 ---- Gary Duzan Eugene Dvurechenski + Maxim Dzumanenko Hans Eckardt Grant Edwards From nnorwitz@users.sourceforge.net Thu Oct 17 23:17:46 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 17 Oct 2002 15:17:46 -0700 Subject: [Python-checkins] python/dist/src/Lib/encodings koi8_u.py,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv10238/Lib/encodings Added Files: Tag: release22-maint koi8_u.py Log Message: Add new encoding for Ukrainian Cyrillic --- NEW FILE: koi8_u.py --- """ Python Character Mapping Codec for KOI8U. This character scheme is compliant to RFC2319 Written by Marc-Andre Lemburg (mal@lemburg.com). Modified by Maxim Dzumanenko . (c) Copyright 2002, Python Software Foundation. """#" import codecs, koi8_r ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decode(input,errors,decoding_map) class StreamWriter(Codec,codecs.StreamWriter): pass class StreamReader(Codec,codecs.StreamReader): pass ### encodings module API def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) ### Decoding Map decoding_map = koi8_r.decoding_map.copy() decoding_map.update({ 0x00a4: 0x0454, # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00a6: 0x0456, # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00a7: 0x0457, # CYRILLIC SMALL LETTER YI (UKRAINIAN) 0x00ad: 0x0491, # CYRILLIC SMALL LETTER UKRAINIAN GHE WITH UPTURN 0x00b4: 0x0403, # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00b6: 0x0406, # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00b7: 0x0407, # CYRILLIC CAPITAL LETTER YI (UKRAINIAN) 0x00bd: 0x0490, # CYRILLIC CAPITAL LETTER UKRAINIAN GHE WITH UPTURN }) ### Encoding Map encoding_map = codecs.make_encoding_map(decoding_map) From nnorwitz@users.sourceforge.net Fri Oct 18 03:05:49 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Thu, 17 Oct 2002 19:05:49 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools node2label.pl,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv6084/tools Modified Files: node2label.pl Log Message: Try to fix the broken links caused by multiple \ref on the same line. SF bug #217195. Not sure if chomp() is correct, but chop() definitely has problems. This change seems to have no ill effects. Backport candidate if Fred agrees. Index: node2label.pl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/node2label.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** node2label.pl 2 May 2002 20:42:30 -0000 1.13 --- node2label.pl 18 Oct 2002 02:05:47 -0000 1.14 *************** *** 50,54 **** for $node (@parts) { $node =~ s/[\#\"\'].*$//g; ! chop($node); if (defined($nodes{$node})) { $label = $nodes{$node}; --- 50,54 ---- for $node (@parts) { $node =~ s/[\#\"\'].*$//g; ! chomp($node); if (defined($nodes{$node})) { $label = $nodes{$node}; From goodger@users.sourceforge.net Fri Oct 18 06:19:11 2002 From: goodger@users.sourceforge.net (goodger@users.sourceforge.net) Date: Thu, 17 Oct 2002 22:19:11 -0700 Subject: [Python-checkins] python/nondist/peps pep2html.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv19390 Modified Files: pep2html.py Log Message: updated for Docutils API changes Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** pep2html.py 12 Sep 2002 02:31:38 -0000 1.44 --- pep2html.py 18 Oct 2002 05:19:08 -0000 1.45 *************** *** 42,46 **** REQUIRES = {'python': '2.2', ! 'docutils': '0.2.3'} PROGRAM = sys.argv[0] RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html' --- 42,46 ---- REQUIRES = {'python': '2.2', ! 'docutils': '0.2.6'} PROGRAM = sys.argv[0] RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html' *************** *** 281,287 **** ! docutils_options = None ! """Option value object used by Docutils. Can be set by the client application ! when this module is imported.""" def fix_rst_pep(inpath, input_lines, outfile): --- 281,287 ---- ! docutils_settings = None ! """Runtime settings object used by Docutils. Can be set by the client ! application when this module is imported.""" def fix_rst_pep(inpath, input_lines, outfile): *************** *** 291,305 **** parser=None) pub.set_writer(writer_name='pep_html') ! if docutils_options: ! options = docutils_options ! pub.options = options else: ! options = pub.set_options() ! options._source = inpath ! options._destination = outfile.name pub.source = io.StringInput( ! options, source=''.join(input_lines), source_path=inpath) pub.destination = io.FileOutput( ! options, destination=outfile, destination_path=outfile.name, autoclose=0) pub.publish() --- 291,305 ---- parser=None) pub.set_writer(writer_name='pep_html') ! if docutils_settings: ! settings = docutils_settings ! pub.settings = settings else: ! settings = pub.get_settings() ! settings._source = inpath ! settings._destination = outfile.name pub.source = io.StringInput( ! settings, source=''.join(input_lines), source_path=inpath) pub.destination = io.FileOutput( ! settings, destination=outfile, destination_path=outfile.name, autoclose=0) pub.publish() From goodger@users.sourceforge.net Fri Oct 18 06:19:42 2002 From: goodger@users.sourceforge.net (goodger@users.sourceforge.net) Date: Thu, 17 Oct 2002 22:19:42 -0700 Subject: [Python-checkins] python/nondist/peps pep.css,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv19493 Modified Files: pep.css Log Message: vertical whitespace improvements Index: pep.css =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep.css 30 Aug 2002 03:18:22 -0000 1.2 --- pep.css 18 Oct 2002 05:19:39 -0000 1.3 *************** *** 9,12 **** --- 9,18 ---- */ + .first { + margin-top: 0 } + + .last { + margin-bottom: 0 } + .navigation { width: 100% ; *************** *** 175,181 **** font-size: smaller } - p.first { - margin-top: 0 } - p.label { white-space: nowrap } --- 181,184 ---- *************** *** 186,190 **** pre.line-block { - margin-left: 2em ; font-family: serif ; font-size: 100% } --- 189,192 ---- *************** *** 203,209 **** font-weight: bold } - span.field-argument { - font-style: italic } - span.interpreted { font-family: sans-serif } --- 205,208 ---- *************** *** 225,232 **** padding-left: 0.5em ; padding-right: 0.5em ; ! vertical-align: baseline } ! ! td > :first-child, th > :first-child { ! margin-top: 0em } td.num { --- 224,228 ---- padding-left: 0.5em ; padding-right: 0.5em ; ! vertical-align: top } td.num { *************** *** 235,239 **** th.field-name { font-weight: bold ; ! text-align: right } h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { --- 231,236 ---- th.field-name { font-weight: bold ; ! text-align: left ; ! white-space: nowrap } h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { From loewis@users.sourceforge.net Fri Oct 18 09:58:17 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 01:58:17 -0700 Subject: [Python-checkins] python/dist/src/Lib shelve.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18725 Modified Files: shelve.py Log Message: Patch #624936: Implement __contains__. Index: shelve.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/shelve.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shelve.py 15 Feb 2001 22:15:13 -0000 1.15 --- shelve.py 18 Oct 2002 08:58:14 -0000 1.16 *************** *** 20,24 **** del d[key] # delete data stored at key (raises KeyError # if no such key) ! flag = d.has_key(key) # true if the key exists list = d.keys() # a list of all existing keys (slow!) --- 20,24 ---- del d[key] # delete data stored at key (raises KeyError # if no such key) ! flag = d.has_key(key) # true if the key exists; same as "key in d" list = d.keys() # a list of all existing keys (slow!) *************** *** 60,63 **** --- 60,66 ---- def has_key(self, key): + return self.dict.has_key(key) + + def __contains__(self, key): return self.dict.has_key(key) From gvanrossum@users.sourceforge.net Fri Oct 18 14:41:49 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 06:41:49 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.182,2.183 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5985 Modified Files: typeobject.c Log Message: Fix memory leak in add_subclass() found by NealN with valgrind. Will backport. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.182 retrieving revision 2.183 diff -C2 -d -r2.182 -r2.183 *** typeobject.c 15 Oct 2002 00:57:28 -0000 2.182 --- typeobject.c 18 Oct 2002 13:41:47 -0000 2.183 *************** *** 2469,2474 **** ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) ! return PyList_SetItem(list, i, new); } i = PyList_Append(list, new); --- 2469,2477 ---- ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) { ! i = PyList_SetItem(list, i, new); ! Py_DECREF(new); ! return i; ! } } i = PyList_Append(list, new); From gvanrossum@users.sourceforge.net Fri Oct 18 14:42:24 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 06:42:24 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.25,2.126.4.26 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv6416 Modified Files: Tag: release22-maint typeobject.c Log Message: Backport of 2.183: Fix memory leak in add_subclass() found by NealN with valgrind. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126.4.25 retrieving revision 2.126.4.26 diff -C2 -d -r2.126.4.25 -r2.126.4.26 *** typeobject.c 11 Oct 2002 00:22:22 -0000 2.126.4.25 --- typeobject.c 18 Oct 2002 13:42:21 -0000 2.126.4.26 *************** *** 2250,2255 **** ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) ! return PyList_SetItem(list, i, new); } i = PyList_Append(list, new); --- 2250,2258 ---- ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) { ! i = PyList_SetItem(list, i, new); ! Py_DECREF(new); ! return i; ! } } i = PyList_Append(list, new); From gvanrossum@users.sourceforge.net Fri Oct 18 14:51:51 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 06:51:51 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.183,2.184 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11911 Modified Files: typeobject.c Log Message: Sigh. That wasn't a memory leak, that was Guido committing before running tests. Withdraw 2.183 and its backport. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.183 retrieving revision 2.184 diff -C2 -d -r2.183 -r2.184 *** typeobject.c 18 Oct 2002 13:41:47 -0000 2.183 --- typeobject.c 18 Oct 2002 13:51:49 -0000 2.184 *************** *** 2469,2477 **** ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) { ! i = PyList_SetItem(list, i, new); ! Py_DECREF(new); ! return i; ! } } i = PyList_Append(list, new); --- 2469,2474 ---- ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) ! return PyList_SetItem(list, i, new); } i = PyList_Append(list, new); From gvanrossum@users.sourceforge.net Fri Oct 18 14:52:45 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 06:52:45 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.26,2.126.4.27 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12479 Modified Files: Tag: release22-maint typeobject.c Log Message: Sigh. That wasn't a memory leak, that was Guido committing before running tests. Withdraw 2.183 and its backport. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126.4.26 retrieving revision 2.126.4.27 diff -C2 -d -r2.126.4.26 -r2.126.4.27 *** typeobject.c 18 Oct 2002 13:42:21 -0000 2.126.4.26 --- typeobject.c 18 Oct 2002 13:52:42 -0000 2.126.4.27 *************** *** 2250,2258 **** ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) { ! i = PyList_SetItem(list, i, new); ! Py_DECREF(new); ! return i; ! } } i = PyList_Append(list, new); --- 2250,2255 ---- ref = PyList_GET_ITEM(list, i); assert(PyWeakref_CheckRef(ref)); ! if (PyWeakref_GET_OBJECT(ref) == Py_None) ! return PyList_SetItem(list, i, new); } i = PyList_Append(list, new); From gvanrossum@users.sourceforge.net Fri Oct 18 15:06:06 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 07:06:06 -0700 Subject: [Python-checkins] python/dist/src/Objects classobject.c,2.154.8.1,2.154.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv20726 Modified Files: Tag: release22-maint classobject.c Log Message: Fix (real! :-) memory leaks in half_cmp and half_binop. Perhaps found by NealN and valgrind. Will forward port. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.154.8.1 retrieving revision 2.154.8.2 diff -C2 -d -r2.154.8.1 -r2.154.8.2 *** classobject.c 13 Jun 2002 21:36:35 -0000 2.154.8.1 --- classobject.c 18 Oct 2002 14:06:02 -0000 2.154.8.2 *************** *** 1316,1319 **** --- 1316,1320 ---- args = Py_BuildValue("(O)", w); if (args == NULL) { + Py_DECREF(coercefunc); return NULL; } *************** *** 1508,1513 **** args = Py_BuildValue("(O)", w); ! if (args == NULL) return -2; result = PyEval_CallObject(cmp_func, args); --- 1509,1516 ---- args = Py_BuildValue("(O)", w); ! if (args == NULL) { ! Py_DECREF(cmp_func); return -2; + } result = PyEval_CallObject(cmp_func, args); From gvanrossum@users.sourceforge.net Fri Oct 18 15:15:35 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 07:15:35 -0700 Subject: [Python-checkins] python/dist/src/Objects classobject.c,2.162,2.163 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv26067 Modified Files: classobject.c Log Message: Fix (real! :-) memory leaks in half_cmp and half_binop. Perhaps found by NealN and valgrind. Will forward port. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.162 retrieving revision 2.163 diff -C2 -d -r2.162 -r2.163 *** classobject.c 20 Aug 2002 14:31:35 -0000 2.162 --- classobject.c 18 Oct 2002 14:15:33 -0000 2.163 *************** *** 1358,1361 **** --- 1358,1362 ---- args = Py_BuildValue("(O)", w); if (args == NULL) { + Py_DECREF(coercefunc); return NULL; } *************** *** 1554,1559 **** args = Py_BuildValue("(O)", w); ! if (args == NULL) return -2; result = PyEval_CallObject(cmp_func, args); --- 1555,1562 ---- args = Py_BuildValue("(O)", w); ! if (args == NULL) { ! Py_DECREF(cmp_func); return -2; + } result = PyEval_CallObject(cmp_func, args); From fdrake@users.sourceforge.net Fri Oct 18 15:38:27 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 07:38:27 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools node2label.pl,1.12,1.12.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv2818 Modified Files: Tag: release22-maint node2label.pl Log Message: Backport Neal Norwitz's patch from revision 1.14: Don't screw up the names of the nodes we're looking up. This fixes two SF bugs: 217195 - Broken \ref link in documentation 484967 - bad links at Ref Guide Index: node2label.pl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/node2label.pl,v retrieving revision 1.12 retrieving revision 1.12.18.1 diff -C2 -d -r1.12 -r1.12.18.1 *** node2label.pl 23 Jun 2001 04:35:09 -0000 1.12 --- node2label.pl 18 Oct 2002 14:38:25 -0000 1.12.18.1 *************** *** 45,49 **** for $node (@parts) { $node =~ s/[\#\"\'].*$//g; ! chop($node); if (defined($nodes{$node})) { $label = $nodes{$node}; --- 45,49 ---- for $node (@parts) { $node =~ s/[\#\"\'].*$//g; ! chomp($node); if (defined($nodes{$node})) { $label = $nodes{$node}; From fdrake@users.sourceforge.net Fri Oct 18 16:03:45 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:03:45 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref4.tex,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv13146 Modified Files: ref4.tex Log Message: Make sure section numbers wrap together with the preceeding word ("section"). Index: ref4.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref4.tex,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ref4.tex 28 Aug 2002 01:14:57 -0000 1.34 --- ref4.tex 18 Oct 2002 15:03:42 -0000 1.35 *************** *** 205,208 **** \end{notice} ! See also the description of the \keyword{try} statement in section ! \ref{try} and \keyword{raise} statement in section \ref{raise}. --- 205,209 ---- \end{notice} ! See also the description of the \keyword{try} statement in ! section~\ref{try} and \keyword{raise} statement in ! section~\ref{raise}. From fdrake@users.sourceforge.net Fri Oct 18 16:18:24 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:18:24 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref6.tex,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv19045 Modified Files: ref6.tex Log Message: Added cross-references to related material on exceptions. Closes SF bug #217195. Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** ref6.tex 25 Jun 2002 13:36:41 -0000 1.55 --- ref6.tex 18 Oct 2002 15:18:18 -0000 1.56 *************** *** 560,563 **** --- 560,566 ---- the current scope. + Additional information on exceptions can be found in + section~\ref{exceptions}, and information about handling exceptions is + in section~\ref{try}. From fdrake@users.sourceforge.net Fri Oct 18 16:19:13 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:19:13 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref6.tex,1.47.4.3,1.47.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv19469 Modified Files: Tag: release22-maint ref6.tex Log Message: Added cross-references to related material on exceptions. Closes SF bug #217195. Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.47.4.3 retrieving revision 1.47.4.4 diff -C2 -d -r1.47.4.3 -r1.47.4.4 *** ref6.tex 5 Oct 2002 06:12:08 -0000 1.47.4.3 --- ref6.tex 18 Oct 2002 15:19:11 -0000 1.47.4.4 *************** *** 560,563 **** --- 560,566 ---- the current scope. + Additional information on exceptions can be found in + section~\ref{exceptions}, and information about handling exceptions is + in section~\ref{try}. From fdrake@users.sourceforge.net Fri Oct 18 16:20:39 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:20:39 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv20044 Modified Files: ref7.tex Log Message: Added cross-references to related material on exceptions. Closes SF bug #217195. Make sure section numbers wrap together with the preceeding word ("section"). Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ref7.tex 1 Apr 2002 21:34:28 -0000 1.34 --- ref7.tex 18 Oct 2002 15:20:32 -0000 1.35 *************** *** 84,88 **** It selects exactly one of the suites by evaluating the expressions one ! by one until one is found to be true (see section \ref{Booleans} for the definition of true and false); then that suite is executed (and no other part of the \keyword{if} statement is executed or evaluated). If --- 84,88 ---- It selects exactly one of the suites by evaluating the expressions one ! by one until one is found to be true (see section~\ref{Booleans} for the definition of true and false); then that suite is executed (and no other part of the \keyword{if} statement is executed or evaluated). If *************** *** 252,256 **** the object identifying the exception; \code{sys.exc_value} receives the exception's parameter; \code{sys.exc_traceback} receives a ! traceback object\obindex{traceback} (see section \ref{traceback}) identifying the point in the program where the exception occurred. These details are also available through the \function{sys.exc_info()} --- 252,256 ---- the object identifying the exception; \code{sys.exc_value} receives the exception's parameter; \code{sys.exc_traceback} receives a ! traceback object\obindex{traceback} (see section~\ref{traceback}) identifying the point in the program where the exception occurred. These details are also available through the \function{sys.exc_info()} *************** *** 300,303 **** --- 300,307 ---- \stindex{continue} + Additional information on exceptions can be found in + section~\ref{exceptions}, and information on using the \keyword{raise} + statement to generate exceptions may be found in section~\ref{raise}. + \section{Function definitions\label{function}} *************** *** 306,310 **** A function definition defines a user-defined function object (see ! section \ref{types}): \obindex{user-defined function} \obindex{function} --- 310,314 ---- A function definition defines a user-defined function object (see ! section~\ref{types}): \obindex{user-defined function} \obindex{function} *************** *** 369,374 **** \end{verbatim} ! Function call semantics are described in more detail in section ! \ref{calls}. A function call always assigns values to all parameters mentioned in the parameter list, either from position arguments, from keyword --- 373,378 ---- \end{verbatim} ! Function call semantics are described in more detail in ! section~\ref{calls}. A function call always assigns values to all parameters mentioned in the parameter list, either from position arguments, from keyword *************** *** 382,386 **** It is also possible to create anonymous functions (functions not bound to a name), for immediate use in expressions. This uses lambda forms, ! described in section \ref{lambda}. Note that the lambda form is merely a shorthand for a simplified function definition; a function defined in a ``\keyword{def}'' statement can be passed around or --- 386,390 ---- It is also possible to create anonymous functions (functions not bound to a name), for immediate use in expressions. This uses lambda forms, ! described in section~\ref{lambda}. Note that the lambda form is merely a shorthand for a simplified function definition; a function defined in a ``\keyword{def}'' statement can be passed around or *************** *** 394,398 **** local function that can be returned or passed around. Free variables used in the nested function can access the local variables of the ! function containing the def. See section \ref{naming} for details. --- 398,402 ---- local function that can be returned or passed around. Free variables used in the nested function can access the local variables of the ! function containing the def. See section~\ref{naming} for details. *************** *** 401,405 **** \stindex{class} ! A class definition defines a class object (see section \ref{types}): \obindex{class} --- 405,409 ---- \stindex{class} ! A class definition defines a class object (see section~\ref{types}): \obindex{class} *************** *** 417,421 **** inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section \ref{naming}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the --- 421,425 ---- inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section~\ref{naming}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the From fdrake@users.sourceforge.net Fri Oct 18 16:21:33 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:21:33 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.29.8.5,1.29.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv20466 Modified Files: Tag: release22-maint ref7.tex Log Message: Added cross-references to related material on exceptions. Closes SF bug #217195. Make sure section numbers wrap together with the preceeding word ("section"). Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.29.8.5 retrieving revision 1.29.8.6 diff -C2 -d -r1.29.8.5 -r1.29.8.6 *** ref7.tex 6 Oct 2002 22:47:12 -0000 1.29.8.5 --- ref7.tex 18 Oct 2002 15:21:29 -0000 1.29.8.6 *************** *** 84,88 **** It selects exactly one of the suites by evaluating the expressions one ! by one until one is found to be true (see section \ref{Booleans} for the definition of true and false); then that suite is executed (and no other part of the \keyword{if} statement is executed or evaluated). If --- 84,88 ---- It selects exactly one of the suites by evaluating the expressions one ! by one until one is found to be true (see section~\ref{Booleans} for the definition of true and false); then that suite is executed (and no other part of the \keyword{if} statement is executed or evaluated). If *************** *** 252,256 **** the object identifying the exception; \code{sys.exc_value} receives the exception's parameter; \code{sys.exc_traceback} receives a ! traceback object\obindex{traceback} (see section \ref{traceback}) identifying the point in the program where the exception occurred. These details are also available through the \function{sys.exc_info()} --- 252,256 ---- the object identifying the exception; \code{sys.exc_value} receives the exception's parameter; \code{sys.exc_traceback} receives a ! traceback object\obindex{traceback} (see section~\ref{traceback}) identifying the point in the program where the exception occurred. These details are also available through the \function{sys.exc_info()} *************** *** 300,303 **** --- 300,307 ---- \stindex{continue} + Additional information on exceptions can be found in + section~\ref{exceptions}, and information on using the \keyword{raise} + statement to generate exceptions may be found in section~\ref{raise}. + \section{Function definitions\label{function}} *************** *** 306,310 **** A function definition defines a user-defined function object (see ! section \ref{types}): \obindex{user-defined function} \obindex{function} --- 310,314 ---- A function definition defines a user-defined function object (see ! section~\ref{types}): \obindex{user-defined function} \obindex{function} *************** *** 369,374 **** \end{verbatim} ! Function call semantics are described in more detail in section ! \ref{calls}. A function call always assigns values to all parameters mentioned in the parameter list, either from position arguments, from keyword --- 373,378 ---- \end{verbatim} ! Function call semantics are described in more detail in ! section~\ref{calls}. A function call always assigns values to all parameters mentioned in the parameter list, either from position arguments, from keyword *************** *** 382,386 **** It is also possible to create anonymous functions (functions not bound to a name), for immediate use in expressions. This uses lambda forms, ! described in section \ref{lambda}. Note that the lambda form is merely a shorthand for a simplified function definition; a function defined in a ``\keyword{def}'' statement can be passed around or --- 386,390 ---- It is also possible to create anonymous functions (functions not bound to a name), for immediate use in expressions. This uses lambda forms, ! described in section~\ref{lambda}. Note that the lambda form is merely a shorthand for a simplified function definition; a function defined in a ``\keyword{def}'' statement can be passed around or *************** *** 394,398 **** local function that can be returned or passed around. Free variables used in the nested function can access the local variables of the ! function containing the def. See section \ref{naming} for details. --- 398,402 ---- local function that can be returned or passed around. Free variables used in the nested function can access the local variables of the ! function containing the def. See section~\ref{naming} for details. *************** *** 401,405 **** \stindex{class} ! A class definition defines a class object (see section \ref{types}): \obindex{class} --- 405,409 ---- \stindex{class} ! A class definition defines a class object (see section~\ref{types}): \obindex{class} *************** *** 417,421 **** inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section \ref{naming}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the --- 421,425 ---- inheritance list, if present. Each item in the inheritance list should evaluate to a class object. The class's suite is then executed ! in a new execution frame (see section~\ref{naming}), using a newly created local namespace and the original global namespace. (Usually, the suite contains only function definitions.) When the From gvanrossum@users.sourceforge.net Fri Oct 18 16:35:45 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:35:45 -0700 Subject: [Python-checkins] python/dist/src/Demo/cgi README,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/cgi In directory usw-pr-cvs1:/tmp/cvs-serv26334 Added Files: README Log Message: Add description of what's here. --- NEW FILE: README --- CGI Examples ------------ Here are some example CGI programs. For a larger example, see ../../Tools/faqwiz/. cgi0.sh -- A shell script to test your server is configured for CGI cgi1.py -- A Python script to test your server is configured for CGI cgi2.py -- A Python script showing how to parse a form cgi3.py -- A Python script for driving an arbitrary CGI application wiki.py -- Sample CGI application: a minimal Wiki implementation From gvanrossum@users.sourceforge.net Fri Oct 18 16:36:34 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:36:34 -0700 Subject: [Python-checkins] python/dist/src/Demo README,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Demo In directory usw-pr-cvs1:/tmp/cvs-serv26672 Modified Files: README Log Message: Add description of the cgi directory. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/README,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** README 17 Sep 2002 20:36:40 -0000 1.16 --- README 18 Oct 2002 15:36:31 -0000 1.17 *************** *** 14,17 **** --- 14,19 ---- + cgi CGI examples (see also ../Tools/faqwiz/.) + classes Some examples of how to use classes. From gvanrossum@users.sourceforge.net Fri Oct 18 16:39:26 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:39:26 -0700 Subject: [Python-checkins] python/dist/src/Demo/classes README,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/classes In directory usw-pr-cvs1:/tmp/cvs-serv27949 Modified Files: README Log Message: Update docs. Remove old classes.doc. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 17 Dec 1993 14:23:52 -0000 1.4 --- README 18 Oct 2002 15:39:24 -0000 1.5 *************** *** 11,14 **** (For straightforward examples of basic class features, such as use of ! methods and inheritance, see the library code -- especially the window ! modules are full of them.) --- 11,13 ---- (For straightforward examples of basic class features, such as use of ! methods and inheritance, see the library code.) From gvanrossum@users.sourceforge.net Fri Oct 18 16:40:15 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 08:40:15 -0700 Subject: [Python-checkins] python/dist/src/Demo/classes class.doc,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Demo/classes In directory usw-pr-cvs1:/tmp/cvs-serv28403 Removed Files: class.doc Log Message: Update docs. Remove old classes.doc. --- class.doc DELETED --- From loewis@users.sourceforge.net Fri Oct 18 17:11:56 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:11:56 -0700 Subject: [Python-checkins] python/dist/src/Objects unicodectype.c,2.11,2.12 unicodetype_db.h,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv10274/Objects Modified Files: unicodectype.c unicodetype_db.h Log Message: Update to Unicode 3.2 database. Index: unicodectype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodectype.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** unicodectype.c 27 Jun 2001 22:08:26 -0000 2.11 --- unicodectype.c 18 Oct 2002 16:11:53 -0000 2.12 *************** *** 37,41 **** int index; ! if (code >= 65536) index = 0; else { --- 37,41 ---- int index; ! if (code >= 0x110000) index = 0; else { Index: unicodetype_db.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodetype_db.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unicodetype_db.h 21 Jan 2001 17:01:31 -0000 1.4 --- unicodetype_db.h 18 Oct 2002 16:11:54 -0000 1.5 *************** *** 1,3 **** ! /* this file was generated by tools\unicode\makeunicodedata.py 2.1 */ /* a list of unique character type descriptors */ --- 1,3 ---- ! /* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */ /* a list of unique character type descriptors */ *************** *** 39,42 **** --- 39,43 ---- [...1420 lines suppressed...] ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ! 0, 0, }; From loewis@users.sourceforge.net Fri Oct 18 17:11:56 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:11:56 -0700 Subject: [Python-checkins] python/dist/src/Tools/unicode makeunicodedata.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/unicode In directory usw-pr-cvs1:/tmp/cvs-serv10274/Tools/unicode Modified Files: makeunicodedata.py Log Message: Update to Unicode 3.2 database. Index: makeunicodedata.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/unicode/makeunicodedata.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** makeunicodedata.py 11 Sep 2002 20:36:01 -0000 1.12 --- makeunicodedata.py 18 Oct 2002 16:11:54 -0000 1.13 *************** *** 449,453 **** def __init__(self, filename, expand=1): file = open(filename) ! table = [None] * 65536 while 1: s = file.readline() --- 449,453 ---- def __init__(self, filename, expand=1): file = open(filename) ! table = [None] * 0x110000 while 1: s = file.readline() *************** *** 477,481 **** self.filename = filename self.table = table ! self.chars = range(65536) # unicode def uselatin1(self): --- 477,481 ---- self.filename = filename self.table = table ! self.chars = range(0x110000) # unicode 3.2 def uselatin1(self): From loewis@users.sourceforge.net Fri Oct 18 17:12:00 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:12:00 -0700 Subject: [Python-checkins] python/dist/src/Modules unicodedata.c,2.19,2.20 unicodedata_db.h,1.5,1.6 unicodename_db.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv10274/Modules Modified Files: unicodedata.c unicodedata_db.h unicodename_db.h Log Message: Update to Unicode 3.2 database. Index: unicodedata.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** unicodedata.c 23 Jul 2002 06:31:14 -0000 2.19 --- unicodedata.c 18 Oct 2002 16:11:51 -0000 2.20 *************** *** 37,41 **** code = (int) *PyUnicode_AS_UNICODE(v); ! if (code < 0 || code >= 65536) index = 0; else { --- 37,41 ---- code = (int) *PyUnicode_AS_UNICODE(v); ! if (code < 0 || code >= 0x110000) index = 0; else { *************** *** 220,224 **** code = (int) *PyUnicode_AS_UNICODE(v); ! if (code < 0 || code >= 65536) index = 0; else { --- 220,224 ---- code = (int) *PyUnicode_AS_UNICODE(v); ! if (code < 0 || code >= 0x110000) index = 0; else { *************** *** 285,289 **** unsigned char* w; ! if (code >= 65536) return 0; --- 285,289 ---- unsigned char* w; ! if (code >= 0x110000) return 0; Index: unicodedata_db.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata_db.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** unicodedata_db.h 21 Jan 2001 22:41:08 -0000 1.5 --- unicodedata_db.h 18 Oct 2002 16:11:51 -0000 1.6 *************** *** 1,3 **** ! /* this file was generated by tools\unicode\makeunicodedata.py 2.1 */ /* a list of unique database records */ --- 1,3 ---- ! /* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */ /* a list of unique database records */ *************** *** 43,46 **** --- 43,47 ---- [...4554 lines suppressed...] ! 12766, 12768, 12770, 12772, 12774, 12776, 12778, 12780, 12782, 12784, ! 12786, 12788, 12790, 12792, 12794, 12796, 12798, 12800, 12802, 12804, ! 12806, 12808, 12810, 12812, 12814, 12816, 12818, 12820, 12822, 12824, ! 12826, 12828, 12830, 12832, 12834, 12836, 12838, 12840, 12842, 12844, ! 12846, 12848, 12850, 12852, 12854, 12856, 12858, 12860, 12862, 12864, ! 12866, 12868, 12870, 12872, 12874, 12876, 12878, 12880, 12882, 12884, ! 12886, 12888, 12890, 12892, 12894, 12896, 12898, 12900, 12902, 12904, ! 12906, 12908, 12910, 12912, 12914, 12916, 12918, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, }; Index: unicodename_db.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodename_db.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** unicodename_db.h 21 Jan 2001 22:41:07 -0000 1.3 --- unicodename_db.h 18 Oct 2002 16:11:51 -0000 1.4 *************** *** 1,3 **** ! /* this file was generated by tools\unicode\makeunicodedata.py 2.1 */ #define NAME_MAXLEN 256 --- 1,3 ---- ! /* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */ #define NAME_MAXLEN 256 *************** *** 5,7535 **** /* lexicon */ [...17793 lines suppressed...] ! 8692, 6022, 119052, 10005, 12329, 41333, 0, 43, 1942, 0, 0, 41107, 12619, ! 41121, 3885, 92, 64023, 64022, 64021, 64020, 0, 12451, 64025, 41412, ! 41485, 12035, 119208, 6254, 10501, 64018, 8890, 12457, 66587, 194837, 0, ! 64778, 118915, 194834, 120193, 0, 66637, 7995, 8759, 41411, 13094, 12449, ! 8546, 41414, 65109, 3179, 0, 4720, 10165, 0, 119249, 0, 10751, 0, 12915, ! 120180, 10535, 0, 0, 0, 6168, 10934, 1946, 294, 41874, 5494, 4639, 0, ! 12040, 6196, 4498, 0, 64028, 64027, 41789, 41788, 2960, 118786, 118795, ! 8969, 119887, 10197, 0, 119886, 2950, 11998, 6210, 119890, 370, 3549, ! 64790, 7801, 4953, 119967, 0, 0, 3297, 10681, 120693, 1135, 194783, 0, ! 5063, 3517, 2964, 119257, 0, 2552, 41546, 60, 10627, 8649, 8252, 729, ! 120598, 0, 10541, 0, 64923, 41770, 41547, 9032, 0, 0, 119899, 41215, ! 119897, 119898, 12832, 119904, 8081, 3761, 3537, 119908, 9137, 119906, ! 8999, 65343, 3850, 3466, 4327, 0, 9373, 0, 908, 6282, 8611, 9813, 0, ! 41655, 537, 41511, 4179, 8978, 120540, 119135, 1842, 10527, 120409, 9628, ! 3848, 12081, 9826, 64502, 1767, 5336, 120200, 64659, 663, 194846, 10780, ! 0, 13108, 120574, 120204, 120198, 120205, 347, 42112, 40992, 4100, 920, ! 1811, 1355, 7739, 917547, 3592, 10078, 5318, 0, 0, 120073, 0, 6224, ! 120470, 9381, 0, 64345, 0, 9281, 3296, 12865, 0, 0, }; From loewis@users.sourceforge.net Fri Oct 18 17:12:23 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:12:23 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_ucn,1.2,1.3 test_unicodedata,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv10274/Lib/test/output Modified Files: test_ucn test_unicodedata Log Message: Update to Unicode 3.2 database. Index: test_ucn =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_ucn,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ucn 19 Jan 2001 11:13:46 -0000 1.2 --- test_ucn 18 Oct 2002 16:11:50 -0000 1.3 *************** *** 3,7 **** Testing name to code mapping.... done. Testing code to name mapping for all characters.... done. ! Found 10538 characters in the unicode name database Testing misc. symbols for unicode character name expansion.... done. Testing unicode character name expansion strict error handling.... done. --- 3,7 ---- Testing name to code mapping.... done. Testing code to name mapping for all characters.... done. ! Found 11556 characters in the unicode name database Testing misc. symbols for unicode character name expansion.... done. Testing unicode character name expansion strict error handling.... done. Index: test_unicodedata =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_unicodedata,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_unicodedata 7 Feb 2002 11:33:49 -0000 1.5 --- test_unicodedata 18 Oct 2002 16:11:51 -0000 1.6 *************** *** 1,5 **** test_unicodedata Testing Unicode Database... ! Methods: 84b72943b1d4320bc1e64a4888f7cdf62eea219a ! Functions: 41e1d4792185d6474a43c83ce4f593b1bdb01f8a API: ok --- 1,5 ---- test_unicodedata Testing Unicode Database... ! Methods: a37276dc2c158bef6dfd908ad34525c97180fad9 ! Functions: 79b4425f140f5f31179fde6db05772d21e75c228 API: ok From nnorwitz@users.sourceforge.net Fri Oct 18 17:33:15 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:33:15 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.184,2.185 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18066/Objects Modified Files: typeobject.c Log Message: Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman Don't crash when getting value of a property raises an exception Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.184 retrieving revision 2.185 diff -C2 -d -r2.184 -r2.185 *** typeobject.c 18 Oct 2002 13:51:49 -0000 2.184 --- typeobject.c 18 Oct 2002 16:33:12 -0000 2.185 *************** *** 3146,3151 **** if ((f = func->ob_type->tp_descr_get) == NULL) Py_INCREF(func); ! else func = f(func, self, (PyObject *)(self->ob_type)); ival = PyInt_FromLong(i); if (ival != NULL) { --- 3146,3155 ---- if ((f = func->ob_type->tp_descr_get) == NULL) Py_INCREF(func); ! else { func = f(func, self, (PyObject *)(self->ob_type)); + if (func == NULL) { + return NULL; + } + } ival = PyInt_FromLong(i); if (ival != NULL) { From nnorwitz@users.sourceforge.net Fri Oct 18 17:33:15 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:33:15 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py,1.157,1.158 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18066/Lib/test Modified Files: test_descr.py Log Message: Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman Don't crash when getting value of a property raises an exception Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** test_descr.py 15 Oct 2002 01:01:53 -0000 1.157 --- test_descr.py 18 Oct 2002 16:33:13 -0000 1.158 *************** *** 1815,1818 **** --- 1815,1830 ---- "readonly %r attr on a property" % attr) + class D(object): + __getitem__ = property(lambda s: 1/0) + + d = D() + try: + for i in d: + str(i) + except ZeroDivisionError: + pass + else: + raise TestFailed, "expected ZeroDivisionError from bad property" + def supers(): if verbose: print "Testing super..." From fdrake@users.sourceforge.net Fri Oct 18 17:33:32 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:33:32 -0700 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory usw-pr-cvs1:/tmp/cvs-serv18704 Modified Files: inst.tex Log Message: Fix markup for tilde in URL. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** inst.tex 24 May 2002 17:06:17 -0000 1.40 --- inst.tex 18 Oct 2002 16:33:30 -0000 1.41 *************** *** 978,982 **** including links to the download pages.} ! \seetitle[http://www.cyberus.ca/~g_will/pyExtenDL.shtml] {Creating Python Extensions Using Borland's Free Compiler} {Document describing how to use Borland's free command-line C++ --- 978,982 ---- including links to the download pages.} ! \seetitle[http://www.cyberus.ca/\~{}g_will/pyExtenDL.shtml] {Creating Python Extensions Using Borland's Free Compiler} {Document describing how to use Borland's free command-line C++ From fdrake@users.sourceforge.net Fri Oct 18 17:34:28 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:34:28 -0700 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.37,1.37.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory usw-pr-cvs1:/tmp/cvs-serv19052 Modified Files: Tag: release22-maint inst.tex Log Message: Fix markup for tilde in URL. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.37 retrieving revision 1.37.6.1 diff -C2 -d -r1.37 -r1.37.6.1 *** inst.tex 6 Dec 2001 16:34:53 -0000 1.37 --- inst.tex 18 Oct 2002 16:34:26 -0000 1.37.6.1 *************** *** 484,488 **** including links to the download pages.} ! \seetitle[http://www.cyberus.ca/~g_will/pyExtenDL.shtml] {Creating Python Extensions Using Borland's Free Compiler} {Document describing how to use Borland's free command-line C++ --- 484,488 ---- including links to the download pages.} ! \seetitle[http://www.cyberus.ca/\~{}g_will/pyExtenDL.shtml] {Creating Python Extensions Using Borland's Free Compiler} {Document describing how to use Borland's free command-line C++ From loewis@users.sourceforge.net Fri Oct 18 17:40:39 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:40:39 -0700 Subject: [Python-checkins] python/dist/src/Objects unicodectype.c,2.12,2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21136/Objects Modified Files: unicodectype.c Log Message: Make lower/upper/title work for non-BMP characters. Index: unicodectype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodectype.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** unicodectype.c 18 Oct 2002 16:11:53 -0000 2.12 --- unicodectype.c 18 Oct 2002 16:40:36 -0000 2.13 *************** *** 63,78 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); if (ctype->title) ! ch += ctype->title; else ! ch += ctype->upper; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 63,77 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); + int delta; if (ctype->title) ! delta = ctype->title; else ! delta = ctype->upper; ! if (delta >= 32768) ! delta -= 65536; ! ! return ch + delta; } *************** *** 359,370 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! ! ch += ctype->upper; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 358,365 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! int delta = ctype->upper; ! if (delta >= 32768) ! delta -= 65536; ! return ch + delta; } *************** *** 375,386 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! ! ch += ctype->lower; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 370,377 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! int delta = ctype->lower; ! if (delta >= 32768) ! delta -= 65536; ! return ch + delta; } From nnorwitz@users.sourceforge.net Fri Oct 18 17:45:41 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:45:41 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.25,1.113.4.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23022/Lib/test Modified Files: Tag: release22-maint test_descr.py Log Message: Backport: Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman Don't crash when getting value of a property raises an exception Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.113.4.25 retrieving revision 1.113.4.26 diff -C2 -d -r1.113.4.25 -r1.113.4.26 *** test_descr.py 7 Oct 2002 18:08:26 -0000 1.113.4.25 --- test_descr.py 18 Oct 2002 16:45:39 -0000 1.113.4.26 *************** *** 1684,1687 **** --- 1684,1699 ---- "readonly %r attr on a property" % attr) + class D(object): + __getitem__ = property(lambda s: 1/0) + + d = D() + try: + for i in d: + str(i) + except ZeroDivisionError: + pass + else: + raise TestFailed, "expected ZeroDivisionError from bad property" + def supers(): if verbose: print "Testing super..." From nnorwitz@users.sourceforge.net Fri Oct 18 17:45:41 2002 From: nnorwitz@users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:45:41 -0700 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.27,2.126.4.28 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23022/Objects Modified Files: Tag: release22-maint typeobject.c Log Message: Backport: Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman Don't crash when getting value of a property raises an exception Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126.4.27 retrieving revision 2.126.4.28 diff -C2 -d -r2.126.4.27 -r2.126.4.28 *** typeobject.c 18 Oct 2002 13:52:42 -0000 2.126.4.27 --- typeobject.c 18 Oct 2002 16:45:38 -0000 2.126.4.28 *************** *** 2919,2924 **** if ((f = func->ob_type->tp_descr_get) == NULL) Py_INCREF(func); ! else func = f(func, self, (PyObject *)(self->ob_type)); ival = PyInt_FromLong(i); if (ival != NULL) { --- 2919,2928 ---- if ((f = func->ob_type->tp_descr_get) == NULL) Py_INCREF(func); ! else { func = f(func, self, (PyObject *)(self->ob_type)); + if (func == NULL) { + return NULL; + } + } ival = PyInt_FromLong(i); if (ival != NULL) { From fdrake@users.sourceforge.net Fri Oct 18 17:50:19 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:50:19 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libpoplib.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25065 Modified Files: libpoplib.tex Log Message: Fix reference to the Fetchmail FAQ: - URL was missing an "m" - markup for tilde was wrong - URL was marked as the title - actual title was omitted "make webcheck" didn't catch this; not sure why. Removed some spurious end-of-line whitespace. Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libpoplib.tex 5 Dec 2001 22:37:21 -0000 1.14 --- libpoplib.tex 18 Oct 2002 16:50:17 -0000 1.15 *************** *** 41,48 **** \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle{http://www.tuxedo.org/~esr/fetchail/fetchmail-FAQ.html}{ ! The FAQ for the fetchmail POP/IMAP client collects information ! on POP3 server variations and RFC noncompliance that may be ! useful if you need to write an application based on poplib.} \end{seealso} --- 41,50 ---- \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.tuxedo.org/\~{}esr/fetchmail/fetchmail-FAQ.html] ! {Frequently Asked Questions About Fetchmail} ! {The FAQ for the \program{fetchmail} POP/IMAP client collects ! information on POP3 server variations and RFC noncompliance ! that may be useful if you need to write an application based ! on the POP protocol.} \end{seealso} *************** *** 106,110 **** Flag message number \var{which} for deletion. On most servers deletions are not actually performed until QUIT (the major exception is ! Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect). \end{methoddesc} --- 108,112 ---- Flag message number \var{which} for deletion. On most servers deletions are not actually performed until QUIT (the major exception is ! Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect). \end{methoddesc} *************** *** 124,128 **** \begin{methoddesc}{top}{which, howmuch} Retrieves the message header plus \var{howmuch} lines of the message ! after the header of message number \var{which}. Result is in form \code{(\var{response}, ['line', ...], \var{octets})}. --- 126,130 ---- \begin{methoddesc}{top}{which, howmuch} Retrieves the message header plus \var{howmuch} lines of the message ! after the header of message number \var{which}. Result is in form \code{(\var{response}, ['line', ...], \var{octets})}. From fdrake@users.sourceforge.net Fri Oct 18 17:50:42 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 09:50:42 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libpoplib.tex,1.14,1.14.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25220 Modified Files: Tag: release22-maint libpoplib.tex Log Message: Fix reference to the Fetchmail FAQ: - URL was missing an "m" - markup for tilde was wrong - URL was marked as the title - actual title was omitted "make webcheck" didn't catch this; not sure why. Removed some spurious end-of-line whitespace. Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -C2 -d -r1.14 -r1.14.6.1 *** libpoplib.tex 5 Dec 2001 22:37:21 -0000 1.14 --- libpoplib.tex 18 Oct 2002 16:50:39 -0000 1.14.6.1 *************** *** 41,48 **** \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle{http://www.tuxedo.org/~esr/fetchail/fetchmail-FAQ.html}{ ! The FAQ for the fetchmail POP/IMAP client collects information ! on POP3 server variations and RFC noncompliance that may be ! useful if you need to write an application based on poplib.} \end{seealso} --- 41,50 ---- \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.tuxedo.org/\~{}esr/fetchmail/fetchmail-FAQ.html] ! {Frequently Asked Questions About Fetchmail} ! {The FAQ for the \program{fetchmail} POP/IMAP client collects ! information on POP3 server variations and RFC noncompliance ! that may be useful if you need to write an application based ! on the POP protocol.} \end{seealso} *************** *** 106,110 **** Flag message number \var{which} for deletion. On most servers deletions are not actually performed until QUIT (the major exception is ! Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect). \end{methoddesc} --- 108,112 ---- Flag message number \var{which} for deletion. On most servers deletions are not actually performed until QUIT (the major exception is ! Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect). \end{methoddesc} *************** *** 124,128 **** \begin{methoddesc}{top}{which, howmuch} Retrieves the message header plus \var{howmuch} lines of the message ! after the header of message number \var{which}. Result is in form \code{(\var{response}, ['line', ...], \var{octets})}. --- 126,130 ---- \begin{methoddesc}{top}{which, howmuch} Retrieves the message header plus \var{howmuch} lines of the message ! after the header of message number \var{which}. Result is in form \code{(\var{response}, ['line', ...], \var{octets})}. From loewis@users.sourceforge.net Fri Oct 18 18:34:20 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri, 18 Oct 2002 10:34:20 -0700 Subject: [Python-checkins] python/dist/src/Tools/unicode makeunicodedata.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/unicode In directory usw-pr-cvs1:/tmp/cvs-serv9890/Tools/unicode Modified Files: makeunicodedata.py Log Message: Verify that lower-higher case delta are 16-bit. Index: makeunicodedata.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/unicode/makeunicodedata.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** makeunicodedata.py 18 Oct 2002 16:11:54 -0000 1.13 --- makeunicodedata.py 18 Oct 2002 17:34:18 -0000 1.14 *************** *** 224,236 **** # use delta predictor for upper/lower/title if record[12]: ! upper = (int(record[12], 16) - char) & 0xffff else: upper = 0 if record[13]: ! lower = (int(record[13], 16) - char) & 0xffff else: lower = 0 if record[14]: ! title = (int(record[14], 16) - char) & 0xffff else: title = 0 --- 224,242 ---- # use delta predictor for upper/lower/title if record[12]: ! upper = int(record[12], 16) - char ! assert -32768 <= upper <= 32767 ! upper = upper & 0xffff else: upper = 0 if record[13]: ! lower = int(record[13], 16) - char ! assert -32768 <= lower <= 32767 ! lower = lower & 0xffff else: lower = 0 if record[14]: ! title = int(record[14], 16) - char ! assert -32768 <= lower <= 32767 ! title = title & 0xffff else: title = 0 *************** *** 323,326 **** --- 329,334 ---- # sort on falling frequency + # XXX: different Python versions produce a different order + # for words with equal frequency wordlist.sort(lambda a, b: len(b[1])-len(a[1])) From fdrake@users.sourceforge.net Fri Oct 18 19:16:21 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 11:16:21 -0700 Subject: [Python-checkins] python/dist/src/Doc/mac using.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv24974 Modified Files: using.tex Log Message: Fix markup for tilde in URL. Index: using.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/using.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** using.tex 1 Nov 2001 19:48:01 -0000 1.4 --- using.tex 18 Oct 2002 18:16:19 -0000 1.5 *************** *** 14,18 **** The most recent release version as well as possible newer experimental versions are best found at the MacPython page maintained by Jack ! Jansen: \url{http://www.cwi.nl/~jack/macpython.html}. --- 14,18 ---- The most recent release version as well as possible newer experimental versions are best found at the MacPython page maintained by Jack ! Jansen: \url{http://www.cwi.nl/\textasciitilde jack/macpython.html}. From fdrake@users.sourceforge.net Fri Oct 18 19:16:50 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 18 Oct 2002 11:16:50 -0700 Subject: [Python-checkins] python/dist/src/Doc/mac using.tex,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv25128 Modified Files: Tag: release22-maint using.tex Log Message: Fix markup for tilde in URL. Index: using.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/using.tex,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** using.tex 1 Nov 2001 19:48:01 -0000 1.4 --- using.tex 18 Oct 2002 18:16:47 -0000 1.4.8.1 *************** *** 14,18 **** The most recent release version as well as possible newer experimental versions are best found at the MacPython page maintained by Jack ! Jansen: \url{http://www.cwi.nl/~jack/macpython.html}. --- 14,18 ---- The most recent release version as well as possible newer experimental versions are best found at the MacPython page maintained by Jack ! Jansen: \url{http://www.cwi.nl/\textasciitilde jack/macpython.html}. From gvanrossum@users.sourceforge.net Fri Oct 18 19:20:35 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 11:20:35 -0700 Subject: [Python-checkins] python/dist/src/Demo/threads find.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/threads In directory usw-pr-cvs1:/tmp/cvs-serv26484 Modified Files: find.py Log Message: Note lack of speedup. Remove Irix reference. Remove silly extra '/tmp' arg. Change predicate to look for world-writable non-symlink files. Index: find.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/threads/find.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** find.py 21 Jan 2001 07:06:51 -0000 1.6 --- find.py 18 Oct 2002 18:20:33 -0000 1.7 *************** *** 4,15 **** # It really does do more stats/sec when using multiple threads, # although the improvement is only about 20-30 percent. # I'm too lazy to write a command line parser for the full find(1) # command line syntax, so the predicate it searches for is wired-in, # see function selector() below. (It currently searches for files with ! # group or world write permission.) # Usage: parfind.py [-w nworkers] [directory] ... ! # Default nworkers is 4, maximum appears to be 8 (on Irix 4.0.2) --- 4,17 ---- # It really does do more stats/sec when using multiple threads, # although the improvement is only about 20-30 percent. + # (That was 8 years ago. In 2002, on Linux, I can't measure + # a speedup. :-( ) # I'm too lazy to write a command line parser for the full find(1) # command line syntax, so the predicate it searches for is wired-in, # see function selector() below. (It currently searches for files with ! # world write permission.) # Usage: parfind.py [-w nworkers] [directory] ... ! # Default nworkers is 4 *************** *** 99,103 **** def main(): - sys.argv.append("/tmp") nworkers = 4 opts, args = getopt.getopt(sys.argv[1:], '-w:') --- 101,104 ---- *************** *** 123,128 **** def selector(dir, name, fullname, stat): ! # Look for group or world writable files ! return (stat[ST_MODE] & 0022) != 0 --- 124,129 ---- def selector(dir, name, fullname, stat): ! # Look for world writable files that are not symlinks ! return (stat[ST_MODE] & 0002) != 0 and not S_ISLNK(stat[ST_MODE]) From gvanrossum@users.sourceforge.net Fri Oct 18 19:54:24 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri, 18 Oct 2002 11:54:24 -0700 Subject: [Python-checkins] python/dist/src/Demo/tkinter README,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tkinter In directory usw-pr-cvs1:/tmp/cvs-serv5375 Modified Files: README Log Message: Remove reference to deleted 'www' directory. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tkinter/README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README 23 Oct 1995 14:31:28 -0000 1.5 --- README 18 Oct 2002 18:54:22 -0000 1.6 *************** *** 9,11 **** guido my original example set (fairly random collection) matt Matt Conway's examples, to go with his lifesaver document - www a progressing sequence of www clients using Tk --- 9,10 ---- From goodger@users.sourceforge.net Sat Oct 19 02:33:15 2002 From: goodger@users.sourceforge.net (goodger@users.sourceforge.net) Date: Fri, 18 Oct 2002 18:33:15 -0700 Subject: [Python-checkins] python/nondist/peps pep2html.py,1.45,1.46 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv26783 Modified Files: pep2html.py Log Message: Updated for new ``publish_string()`` convenience function. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** pep2html.py 18 Oct 2002 05:19:08 -0000 1.45 --- pep2html.py 19 Oct 2002 01:33:12 -0000 1.46 *************** *** 42,46 **** REQUIRES = {'python': '2.2', ! 'docutils': '0.2.6'} PROGRAM = sys.argv[0] RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html' --- 42,46 ---- REQUIRES = {'python': '2.2', ! 'docutils': '0.2.7'} PROGRAM = sys.argv[0] RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html' *************** *** 287,307 **** def fix_rst_pep(inpath, input_lines, outfile): from docutils import core, io ! pub = core.Publisher() ! pub.set_reader(reader_name='pep', parser_name='restructuredtext', ! parser=None) ! pub.set_writer(writer_name='pep_html') ! if docutils_settings: ! settings = docutils_settings ! pub.settings = settings ! else: ! settings = pub.get_settings() ! settings._source = inpath ! settings._destination = outfile.name ! pub.source = io.StringInput( ! settings, source=''.join(input_lines), source_path=inpath) ! pub.destination = io.FileOutput( ! settings, destination=outfile, destination_path=outfile.name, ! autoclose=0) ! pub.publish() --- 287,299 ---- def fix_rst_pep(inpath, input_lines, outfile): from docutils import core, io ! output = core.publish_string( ! source=''.join(input_lines), ! source_path=inpath, ! destination_path=outfile.name, ! reader_name='pep', ! parser_name='restructuredtext', ! writer_name='pep_html', ! settings=docutils_settings) ! outfile.write(output) From effbot@users.sourceforge.net Sat Oct 19 21:19:12 2002 From: effbot@users.sourceforge.net (effbot@users.sourceforge.net) Date: Sat, 19 Oct 2002 13:19:12 -0700 Subject: [Python-checkins] python/dist/src/Lib re.py,1.44,1.45 locale.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3994/Lib Modified Files: re.py locale.py Log Message: point people to the Python bug tracker, rather than to a mail account I hardly ever use... Index: re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/re.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** re.py 28 Jul 2002 19:04:07 -0000 1.44 --- re.py 19 Oct 2002 20:19:10 -0000 1.45 *************** *** 1,20 **** """Minimal "re" compatibility wrapper""" - # To help us fix any remaining bugs in the new engine, please - # report what went wrong. You can either use the following web - # page: - # - # http://sourceforge.net/bugs/?group_id=5470 - # - # or send a mail to SRE's author: - # - # Fredrik Lundh - # - # Make sure to include the pattern, the string SRE failed to - # match, and what result you expected. - # - # thanks /F - # - engine = "sre" # Some apps might use this undocumented variable --- 1,4 ---- Index: locale.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/locale.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** locale.py 25 Mar 2002 21:40:36 -0000 1.20 --- locale.py 19 Oct 2002 20:19:10 -0000 1.21 *************** *** 191,195 **** # Author: Marc-Andre Lemburg, mal@lemburg.com ! # Various tweaks by Fredrik Lundh # store away the low-level version of setlocale (it's --- 191,195 ---- # Author: Marc-Andre Lemburg, mal@lemburg.com ! # Various tweaks by Fredrik Lundh # store away the low-level version of setlocale (it's *************** *** 624,630 **** # earlier) to locale strings. # ! # NOTE: this mapping is incomplete. If your language is missing, send ! # a note with the missing language identifier and the suggested locale ! # code to Fredrik Lundh . Thanks /F windows_locale = { --- 624,633 ---- # earlier) to locale strings. # ! # NOTE: this mapping is incomplete. If your language is missing, please ! # submit a bug report to Python bug manager, which you can find via: ! # http://www.python.org/dev/ ! # Make sure you include the missing language identifier and the suggested ! # locale code. ! # windows_locale = { From effbot@users.sourceforge.net Sat Oct 19 21:22:59 2002 From: effbot@users.sourceforge.net (effbot@users.sourceforge.net) Date: Sat, 19 Oct 2002 13:22:59 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex,1.88,1.89 libxmlrpclib.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5018/Doc/lib Modified Files: libre.tex libxmlrpclib.tex Log Message: fixed the mail address in the documentation, too... Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** libre.tex 7 Sep 2002 18:48:14 -0000 1.88 --- libre.tex 19 Oct 2002 20:22:56 -0000 1.89 *************** *** 2,6 **** Regular expression operations} \declaremodule{standard}{re} ! \moduleauthor{Fredrik Lundh}{effbot@telia.com} \sectionauthor{Andrew M. Kuchling}{akuchlin@mems-exchange.org} --- 2,6 ---- Regular expression operations} \declaremodule{standard}{re} ! \moduleauthor{Fredrik Lundh}{fredrik@pythonware.com} \sectionauthor{Andrew M. Kuchling}{akuchlin@mems-exchange.org} Index: libxmlrpclib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmlrpclib.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libxmlrpclib.tex 14 Jun 2002 00:33:02 -0000 1.9 --- libxmlrpclib.tex 19 Oct 2002 20:22:56 -0000 1.10 *************** *** 3,7 **** \declaremodule{standard}{xmlrpclib} \modulesynopsis{XML-RPC client access.} ! \moduleauthor{Fredrik Lundh}{effbot@telia.com} \sectionauthor{Eric S. Raymond}{esr@snark.thyrsus.com} --- 3,7 ---- \declaremodule{standard}{xmlrpclib} \modulesynopsis{XML-RPC client access.} ! \moduleauthor{Fredrik Lundh}{fredrik@pythonware.com} \sectionauthor{Eric S. Raymond}{esr@snark.thyrsus.com} From jackjansen@users.sourceforge.net Sat Oct 19 22:36:58 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sat, 19 Oct 2002 14:36:58 -0700 Subject: [Python-checkins] python/dist/src/Doc/mac libmacos.tex,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv27207 Modified Files: libmacos.tex Log Message: Added a paragraph to explain that SchedParams(0, 0) is usually what you want. Index: libmacos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libmacos.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** libmacos.tex 3 Aug 2001 17:11:33 -0000 1.17 --- libmacos.tex 19 Oct 2002 21:36:56 -0000 1.18 *************** *** 61,64 **** --- 61,67 ---- quarter second and the processor is given up for a quarter second when in the background. + + The most common use case is to call \code{SchedParams(0, 0)} to completely disable + event handling in the interpreter mainloop. \end{funcdesc} From jackjansen@users.sourceforge.net Sat Oct 19 23:02:23 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sat, 19 Oct 2002 15:02:23 -0700 Subject: [Python-checkins] python/dist/src/Python mactoolboxglue.c,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv2543 Modified Files: mactoolboxglue.c Log Message: Made MacOS.Error a class style exception (at last!). Index: mactoolboxglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mactoolboxglue.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mactoolboxglue.c 2 Aug 2002 14:11:23 -0000 1.10 --- mactoolboxglue.c 19 Oct 2002 22:02:21 -0000 1.11 *************** *** 105,109 **** { if (PyMac_OSErrException == NULL) ! PyMac_OSErrException = PyString_FromString("MacOS.Error"); return PyMac_OSErrException; } --- 105,109 ---- { if (PyMac_OSErrException == NULL) ! PyMac_OSErrException = PyErr_NewException("MacOS.Error", NULL, NULL); return PyMac_OSErrException; } From jvr@users.sourceforge.net Sun Oct 20 18:14:31 2002 From: jvr@users.sourceforge.net (jvr@users.sourceforge.net) Date: Sun, 20 Oct 2002 10:14:31 -0700 Subject: [Python-checkins] python/dist/src/Mac/Tools/IDE PythonIDEMain.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv539 Modified Files: PythonIDEMain.py Log Message: cd to users home dir if no current dir has been set. Fixes bug #625734 Index: PythonIDEMain.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PythonIDEMain.py 11 Sep 2002 22:05:59 -0000 1.22 --- PythonIDEMain.py 20 Oct 2002 17:14:28 -0000 1.23 *************** *** 44,47 **** --- 44,52 ---- import PyConsole, PyEdit Splash.wait() + if sys.platform == "darwin": + if sys.argv and sys.argv[0].startswith("-psn"): + home = os.getenv("HOME") + if home: + os.chdir(home) # With -D option (OSX command line only) keep stderr, for debugging the IDE # itself. From rhettinger@users.sourceforge.net Mon Oct 21 04:08:22 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 20 Oct 2002 20:08:22 -0700 Subject: [Python-checkins] python/dist/src/Lib calendar.py,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3372 Modified Files: calendar.py Log Message: Eliminate unused instance variable Index: calendar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/calendar.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** calendar.py 20 Jun 2002 03:38:12 -0000 1.28 --- calendar.py 21 Oct 2002 03:08:20 -0000 1.29 *************** *** 36,43 **** def __getitem__(self, i): ! self.data = [strftime(self.format, (2001, j, 1, 12, 0, 0, 1, 1, 0)) for j in range(1, 13)] ! self.data.insert(0, "") ! return self.data[i] def __len__(self): --- 36,43 ---- def __getitem__(self, i): ! data = [strftime(self.format, (2001, j, 1, 12, 0, 0, 1, 1, 0)) for j in range(1, 13)] ! data.insert(0, "") ! return data[i] def __len__(self): *************** *** 50,56 **** def __getitem__(self, i): # January 1, 2001, was a Monday. ! self.data = [strftime(self.format, (2001, 1, j+1, 12, 0, 0, j, j+1, 0)) for j in range(7)] ! return self.data[i] def __len__(self_): --- 50,56 ---- def __getitem__(self, i): # January 1, 2001, was a Monday. ! data = [strftime(self.format, (2001, 1, j+1, 12, 0, 0, j, j+1, 0)) for j in range(7)] ! return data[i] def __len__(self_): From rhettinger@users.sourceforge.net Mon Oct 21 05:44:13 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun, 20 Oct 2002 21:44:13 -0700 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22848 Modified Files: pydoc.py Log Message: Explicitly use floor division Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** pydoc.py 26 Sep 2002 21:44:57 -0000 1.70 --- pydoc.py 21 Oct 2002 04:44:11 -0000 1.71 *************** *** 100,104 **** """Omit part of a string if needed to make it fit in a maximum length.""" if len(text) > maxlen: ! pre = max(0, (maxlen-3)/2) post = max(0, maxlen-3-pre) return text[:pre] + '...' + text[len(text)-post:] --- 100,104 ---- """Omit part of a string if needed to make it fit in a maximum length.""" if len(text) > maxlen: ! pre = max(0, (maxlen-3)//2) post = max(0, maxlen-3-pre) return text[:pre] + '...' + text[len(text)-post:] From bwarsaw@users.sourceforge.net Mon Oct 21 06:29:55 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sun, 20 Oct 2002 22:29:55 -0700 Subject: [Python-checkins] python/dist/src/Lib/email Charset.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv22916 Modified Files: Charset.py Log Message: body_encode(): Fixed typo reported by Chris Lawrence, closing SF bug #625509. This isn't a huge problem because at the moment there are no built-in charsets for which header_encoding is QP but body_encoding is not. Index: Charset.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Charset.py 14 Oct 2002 15:06:55 -0000 1.10 --- Charset.py 21 Oct 2002 05:29:53 -0000 1.11 *************** *** 349,353 **** if self.body_encoding is BASE64: return email.base64MIME.body_encode(s) ! elif self.header_encoding is QP: return email.quopriMIME.body_encode(s) else: --- 349,353 ---- if self.body_encoding is BASE64: return email.base64MIME.body_encode(s) ! elif self.body_encoding is QP: return email.quopriMIME.body_encode(s) else: From bwarsaw@users.sourceforge.net Mon Oct 21 06:31:10 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sun, 20 Oct 2002 22:31:10 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv23686 Modified Files: test_email.py Log Message: test_body_encoding(): a new test Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_email.py 14 Oct 2002 15:26:17 -0000 1.20 --- test_email.py 21 Oct 2002 05:31:08 -0000 1.21 *************** *** 2093,2096 **** --- 2093,2119 ---- eq(s, c.from_splittable(sp)) + def test_body_encode(self): + eq = self.assertEqual + # Try a charset with QP body encoding + c = Charset('iso-8859-1') + eq('hello w=F6rld', c.body_encode('hello w\xf6rld')) + # Try a charset with Base64 body encoding + c = Charset('utf-8') + eq('aGVsbG8gd29ybGQ=\n', c.body_encode('hello world')) + # Try a charset with None body encoding + c = Charset('us-ascii') + eq('hello world', c.body_encode('hello world')) + # Try the convert argument, where input codec <> output codec + c = Charset('euc-jp') + # With apologies to Tokio Kikuchi ;) + try: + eq('\x1b$B5FCO;~IW\x1b(B', + c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7')) + eq('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', + c.body_encode('\xb5\xc6\xc3\xcf\xbb\xfe\xc9\xd7', False)) + except LookupError: + # We probably don't have the Japanese codecs installed + pass + From bwarsaw@users.sourceforge.net Mon Oct 21 06:44:00 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sun, 20 Oct 2002 22:44:00 -0700 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv29287 Modified Files: test_email.py Log Message: test_body_encoding(): a new test for Charset.body_encode(), especially one that tests the obscure bug reported in SF # 625509. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_email.py 21 Oct 2002 05:31:08 -0000 1.21 --- test_email.py 21 Oct 2002 05:43:58 -0000 1.22 *************** *** 2081,2084 **** --- 2081,2091 ---- # Test the Charset class class TestCharset(unittest.TestCase): + def tearDown(self): + from email import Charset as CharsetModule + try: + del CharsetModule.CHARSETS['fake'] + except KeyError: + pass + def test_idempotent(self): eq = self.assertEqual *************** *** 2115,2118 **** --- 2122,2132 ---- # We probably don't have the Japanese codecs installed pass + # Testing SF bug #625509, which we have to fake, since there are no + # built-in encodings where the header encoding is QP but the body + # encoding is not. + from email import Charset as CharsetModule + CharsetModule.add_charset('fake', CharsetModule.QP, None) + c = Charset('fake') + eq('hello w\xf6rld', c.body_encode('hello w\xf6rld')) From bwarsaw@users.sourceforge.net Mon Oct 21 15:20:40 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 21 Oct 2002 07:20:40 -0700 Subject: [Python-checkins] python/dist/src/Tools/pynche Switchboard.py,2.10,2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv2077 Modified Files: Switchboard.py Log Message: Fix a typo, update (only one) style improvement, whitespace normalization. Index: Switchboard.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/Switchboard.py,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** Switchboard.py 10 Jul 2001 21:48:51 -0000 2.10 --- Switchboard.py 21 Oct 2002 14:20:37 -0000 2.11 *************** *** 8,13 **** - When a Viewer selects a color and wishes to update all other Views, it ! should call update_views() on the Switchboard object. Not that the ! Viewer typically does *not* update itself before calling update_views(), since this would cause it to get updated twice. --- 8,13 ---- - When a Viewer selects a color and wishes to update all other Views, it ! should call update_views() on the Switchboard object. Note that the ! Viewer typically does *not* update itself before calling update_views(), since this would cause it to get updated twice. *************** *** 24,32 **** - colordb_changed() which takes a single argument, an instance of ! ColorDB. This is called whenever the color name database is changed and gives a chance for the Viewers to do something on those events. See ListViewer for details. ! External Viewers are found dynamically. Viewer modules should have names such as FooViewer.py. If such a named module has a module global variable called ADDTOVIEW and this variable is true, the Viewer will be added dynamically to --- 24,32 ---- - colordb_changed() which takes a single argument, an instance of ! ColorDB. This is called whenever the color name database is changed and gives a chance for the Viewers to do something on those events. See ListViewer for details. ! External Viewers are found dynamically. Viewer modules should have names such as FooViewer.py. If such a named module has a module global variable called ADDTOVIEW and this variable is true, the Viewer will be added dynamically to *************** *** 65,69 **** fp = open(initfile) self.__optiondb = marshal.load(fp) ! if type(self.__optiondb) <> DictType: print >> sys.stderr, \ 'Problem reading options from file:', initfile --- 65,69 ---- fp = open(initfile) self.__optiondb = marshal.load(fp) ! if not isinstance(self.__optiondb, DictType): print >> sys.stderr, \ 'Problem reading options from file:', initfile From bwarsaw@users.sourceforge.net Mon Oct 21 15:23:50 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 21 Oct 2002 07:23:50 -0700 Subject: [Python-checkins] python/dist/src/Tools/pynche Main.py,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv4624 Modified Files: Main.py Log Message: Some fixes based on feedback from Hans Petter Langtangen. build(): Fix the logic here for calculating fallbacks if the dbfile isn't parseable. main(): Fix the semantics for -d/--database; this should override any database value found in the .pynche file. Update some comments, and author contact info. Bump to v1.4 Whitespace normalization. Index: Main.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/Main.py,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** Main.py 23 Aug 2001 16:15:02 -0000 2.21 --- Main.py 21 Oct 2002 14:23:48 -0000 2.22 *************** *** 1,10 **** """Pynche -- The PYthon Natural Color and Hue Editor. ! Contact: Barry Warsaw ! Email: bwarsaw@python.org Version: %(__version__)s Pynche is based largely on a similar color editor I wrote years ago for the ! Sunview window system. That editor was called ICE: the Interactive Color Editor. I'd always wanted to port the editor to X but didn't feel like hacking X and C code to do it. Fast forward many years, to where Python + --- 1,10 ---- """Pynche -- The PYthon Natural Color and Hue Editor. ! Contact: %(AUTHNAME)s ! Email: %(AUTHEMAIL)s Version: %(__version__)s Pynche is based largely on a similar color editor I wrote years ago for the ! SunView window system. That editor was called ICE: the Interactive Color Editor. I'd always wanted to port the editor to X but didn't feel like hacking X and C code to do it. Fast forward many years, to where Python + *************** *** 13,19 **** days, too many other systems have the acronym `ICE'. ! This program currently requires Python 1.5 with Tkinter. It has only been ! tested on Solaris 2.6. Feedback is greatly appreciated. Send email to ! bwarsaw@python.org Usage: %(PROGRAM)s [-d file] [-i file] [-X] [-v] [-h] [initialcolor] --- 13,17 ---- days, too many other systems have the acronym `ICE'. ! This program currently requires Python 2.2 with Tkinter. Usage: %(PROGRAM)s [-d file] [-i file] [-X] [-v] [-h] [initialcolor] *************** *** 39,43 **** --version -v ! print the version number --help --- 37,41 ---- --version -v ! print the version number and exit --help *************** *** 49,53 **** """ ! __version__ = '1.3' import sys --- 47,51 ---- """ ! __version__ = '1.4' import sys *************** *** 65,68 **** --- 63,68 ---- PROGRAM = sys.argv[0] + AUTHNAME = 'Barry Warsaw' + AUTHEMAIL = 'barry@python.org' # Default locations of rgb.txt or other textual color database *************** *** 121,143 **** ! def build(master=None, initialcolor=None, initfile=None, ignore=None): # create all output widgets s = Switchboard(not ignore and initfile) ! ! # load the color database ! colordb = None ! try: dbfile = s.optiondb()['DBFILE'] ! colordb = ColorDB.get_colordb(dbfile) ! except (KeyError, IOError): ! # scoot through the files listed above to try to find a usable color ! # database file ! for f in RGB_TXT: ! try: ! colordb = ColorDB.get_colordb(f) ! if colordb: ! break ! except IOError: ! pass if not colordb: usage(1, 'No color database file found, see the -d option.') --- 121,144 ---- ! def build(master=None, initialcolor=None, initfile=None, ignore=None, ! dbfile=None): # create all output widgets s = Switchboard(not ignore and initfile) ! # defer to the command line chosen color database, falling back to the one ! # in the .pynche file. ! if dbfile is None: dbfile = s.optiondb()['DBFILE'] ! # find a parseable color database ! colordb = None ! files = RGB_TXT[:] ! while colordb is None: ! try: ! colordb = ColorDB.get_colordb(dbfile) ! except (KeyError, IOError): ! pass ! if colordb is None: ! if not files: ! break ! dbfile = files.pop(0) if not colordb: usage(1, 'No color database file found, see the -d option.') *************** *** 154,158 **** # get the initial color as components and set the color on all views. if ! # there was no initial color given on the command line, use the one that's # stored in the option database if initialcolor is None: --- 155,159 ---- # get the initial color as components and set the color on all views. if ! # there was no initial color given on the command line, use the one that's # stored in the option database if initialcolor is None: *************** *** 172,178 **** def run(app, s): try: ! app.start() except KeyboardInterrupt: ! pass --- 173,179 ---- def run(app, s): try: ! app.start() except KeyboardInterrupt: ! pass *************** *** 180,189 **** def main(): try: ! opts, args = getopt.getopt( sys.argv[1:], 'hd:i:Xv', ['database=', 'initfile=', 'ignore', 'help', 'version']) except getopt.error, msg: ! usage(1, msg) if len(args) == 0: --- 181,190 ---- def main(): try: ! opts, args = getopt.getopt( sys.argv[1:], 'hd:i:Xv', ['database=', 'initfile=', 'ignore', 'help', 'version']) except getopt.error, msg: ! usage(1, msg) if len(args) == 0: *************** *** 192,213 **** initialcolor = args[0] else: ! usage(1) ! ignore = 0 initfile = os.path.expanduser('~/.pynche') for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) elif opt in ('-v', '--version'): ! print '''\ Pynche -- The PYthon Natural Color and Hue Editor. ! Contact: Barry Warsaw ! Email: bwarsaw@python.org ! Version: %s''' % __version__ sys.exit(0) ! elif opt in ('-d', '--database'): ! RGB_TXT.insert(0, arg) elif opt in ('-X', '--ignore'): ! ignore = 1 elif opt in ('-i', '--initfile'): initfile = arg --- 193,215 ---- initialcolor = args[0] else: ! usage(1) ! ignore = False ! dbfile = None initfile = os.path.expanduser('~/.pynche') for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) elif opt in ('-v', '--version'): ! print """\ Pynche -- The PYthon Natural Color and Hue Editor. ! Contact: %(AUTHNAME)s ! Email: %(AUTHEMAIL)s ! Version: %(__version__)s""" % globals() sys.exit(0) ! elif opt in ('-d', '--database'): ! dbfile = arg elif opt in ('-X', '--ignore'): ! ignore = True elif opt in ('-i', '--initfile'): initfile = arg *************** *** 215,219 **** app, sb = build(initialcolor=initialcolor, initfile=initfile, ! ignore=ignore) run(app, sb) sb.save_views() --- 217,222 ---- app, sb = build(initialcolor=initialcolor, initfile=initfile, ! ignore=ignore, ! dbfile=dbfile) run(app, sb) sb.save_views() From bwarsaw@users.sourceforge.net Mon Oct 21 15:25:26 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 21 Oct 2002 07:25:26 -0700 Subject: [Python-checkins] python/dist/src/Tools/pynche ColorDB.py,2.8,2.9 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv6384 Modified Files: ColorDB.py Log Message: FILETYPES: Newer XFree86 rgb.txt files use the key Xorg instead of XConsortium. Now we can recognize these files! Index: ColorDB.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/ColorDB.py,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** ColorDB.py 10 Jul 2001 21:38:47 -0000 2.8 --- ColorDB.py 21 Oct 2002 14:25:24 -0000 2.9 *************** *** 40,79 **** lineno = 2 self.__name = fp.name ! # Maintain several dictionaries for indexing into the color database. ! # Note that while Tk supports RGB intensities of 4, 8, 12, or 16 bits, ! # for now we only support 8 bit intensities. At least on OpenWindows, ! # all intensities in the /usr/openwin/lib/rgb.txt file are 8-bit ! # ! # key is (red, green, blue) tuple, value is (name, [aliases]) ! self.__byrgb = {} ! # key is name, value is (red, green, blue) ! self.__byname = {} # all unique names (non-aliases). built-on demand self.__allnames = None ! while 1: ! line = fp.readline() ! if not line: ! break ! # get this compiled regular expression from derived class ! mo = self._re.match(line) ! if not mo: print >> sys.stderr, 'Error in', fp.name, ' line', lineno ! lineno += 1 ! continue ! # extract the red, green, blue, and name red, green, blue = self._extractrgb(mo) name = self._extractname(mo) ! keyname = name.lower() ! # BAW: for now the `name' is just the first named color with the ! # rgb values we find. Later, we might want to make the two word ! # version the `name', or the CapitalizedVersion, etc. ! key = (red, green, blue) ! foundname, aliases = self.__byrgb.get(key, (name, [])) ! if foundname <> name and foundname not in aliases: ! aliases.append(name) ! self.__byrgb[key] = (foundname, aliases) ! # add to byname lookup ! self.__byname[keyname] = key ! lineno = lineno + 1 # override in derived classes --- 40,79 ---- lineno = 2 self.__name = fp.name ! # Maintain several dictionaries for indexing into the color database. ! # Note that while Tk supports RGB intensities of 4, 8, 12, or 16 bits, ! # for now we only support 8 bit intensities. At least on OpenWindows, ! # all intensities in the /usr/openwin/lib/rgb.txt file are 8-bit ! # ! # key is (red, green, blue) tuple, value is (name, [aliases]) ! self.__byrgb = {} ! # key is name, value is (red, green, blue) ! self.__byname = {} # all unique names (non-aliases). built-on demand self.__allnames = None ! while 1: ! line = fp.readline() ! if not line: ! break ! # get this compiled regular expression from derived class ! mo = self._re.match(line) ! if not mo: print >> sys.stderr, 'Error in', fp.name, ' line', lineno ! lineno += 1 ! continue ! # extract the red, green, blue, and name red, green, blue = self._extractrgb(mo) name = self._extractname(mo) ! keyname = name.lower() ! # BAW: for now the `name' is just the first named color with the ! # rgb values we find. Later, we might want to make the two word ! # version the `name', or the CapitalizedVersion, etc. ! key = (red, green, blue) ! foundname, aliases = self.__byrgb.get(key, (name, [])) ! if foundname <> name and foundname not in aliases: ! aliases.append(name) ! self.__byrgb[key] = (foundname, aliases) ! # add to byname lookup ! self.__byname[keyname] = key ! lineno = lineno + 1 # override in derived classes *************** *** 89,122 **** def find_byrgb(self, rgbtuple): """Return name for rgbtuple""" ! try: ! return self.__byrgb[rgbtuple] ! except KeyError: ! raise BadColor(rgbtuple) def find_byname(self, name): """Return (red, green, blue) for name""" ! name = name.lower() ! try: ! return self.__byname[name] ! except KeyError: ! raise BadColor(name) def nearest(self, red, green, blue): """Return the name of color nearest (red, green, blue)""" ! # BAW: should we use Voronoi diagrams, Delaunay triangulation, or ! # octree for speeding up the locating of nearest point? Exhaustive ! # search is inefficient, but seems fast enough. ! nearest = -1 ! nearest_name = '' ! for name, aliases in self.__byrgb.values(): ! r, g, b = self.__byname[name.lower()] ! rdelta = red - r ! gdelta = green - g ! bdelta = blue - b ! distance = rdelta * rdelta + gdelta * gdelta + bdelta * bdelta ! if nearest == -1 or distance < nearest: ! nearest = distance ! nearest_name = name ! return nearest_name def unique_names(self): --- 89,122 ---- def find_byrgb(self, rgbtuple): """Return name for rgbtuple""" ! try: ! return self.__byrgb[rgbtuple] ! except KeyError: ! raise BadColor(rgbtuple) def find_byname(self, name): """Return (red, green, blue) for name""" ! name = name.lower() ! try: ! return self.__byname[name] ! except KeyError: ! raise BadColor(name) def nearest(self, red, green, blue): """Return the name of color nearest (red, green, blue)""" ! # BAW: should we use Voronoi diagrams, Delaunay triangulation, or ! # octree for speeding up the locating of nearest point? Exhaustive ! # search is inefficient, but seems fast enough. ! nearest = -1 ! nearest_name = '' ! for name, aliases in self.__byrgb.values(): ! r, g, b = self.__byname[name.lower()] ! rdelta = red - r ! gdelta = green - g ! bdelta = blue - b ! distance = rdelta * rdelta + gdelta * gdelta + bdelta * bdelta ! if nearest == -1 or distance < nearest: ! nearest = distance ! nearest_name = name ! return nearest_name def unique_names(self): *************** *** 138,142 **** raise BadColor((red, green, blue)) return [name] + aliases ! class RGBColorDB(ColorDB): --- 138,142 ---- raise BadColor((red, green, blue)) return [name] + aliases ! class RGBColorDB(ColorDB): *************** *** 173,176 **** --- 173,177 ---- FILETYPES = [ + (re.compile('Xorg'), RGBColorDB), (re.compile('XConsortium'), RGBColorDB), (re.compile('HTML'), HTML40DB), *************** *** 217,225 **** if color[0] <> '#': raise BadColor(color) ! red = color[1:3] ! green = color[3:5] ! blue = color[5:7] rgbtuple = int(red, 16), int(green, 16), int(blue, 16) ! _namedict[color] = rgbtuple return rgbtuple --- 218,226 ---- if color[0] <> '#': raise BadColor(color) ! red = color[1:3] ! green = color[3:5] ! blue = color[5:7] rgbtuple = int(red, 16), int(green, 16), int(blue, 16) ! _namedict[color] = rgbtuple return rgbtuple *************** *** 231,236 **** hexname = _tripdict.get(rgbtuple) if hexname is None: ! hexname = '#%02x%02x%02x' % rgbtuple ! _tripdict[rgbtuple] = hexname return hexname --- 232,237 ---- hexname = _tripdict.get(rgbtuple) if hexname is None: ! hexname = '#%02x%02x%02x' % rgbtuple ! _tripdict[rgbtuple] = hexname return hexname *************** *** 254,259 **** colordb = get_colordb('/usr/openwin/lib/rgb.txt') if not colordb: ! print 'No parseable color database found' ! sys.exit(1) # on my system, this color matches exactly target = 'navy' --- 255,260 ---- colordb = get_colordb('/usr/openwin/lib/rgb.txt') if not colordb: ! print 'No parseable color database found' ! sys.exit(1) # on my system, this color matches exactly target = 'navy' *************** *** 262,268 **** name, aliases = colordb.find_byrgb(rgbtuple) print 'name:', name, 'aliases:', COMMASPACE.join(aliases) ! r, g, b = (1, 1, 128) # nearest to navy ! r, g, b = (145, 238, 144) # nearest to lightgreen ! r, g, b = (255, 251, 250) # snow print 'finding nearest to', target, '...' import time --- 263,269 ---- name, aliases = colordb.find_byrgb(rgbtuple) print 'name:', name, 'aliases:', COMMASPACE.join(aliases) ! r, g, b = (1, 1, 128) # nearest to navy ! r, g, b = (145, 238, 144) # nearest to lightgreen ! r, g, b = (255, 251, 250) # snow print 'finding nearest to', target, '...' import time From bwarsaw@users.sourceforge.net Mon Oct 21 16:58:32 2002 From: bwarsaw@users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon, 21 Oct 2002 08:58:32 -0700 Subject: [Python-checkins] python/dist/src/Misc python-mode.el,4.27,4.28 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv28187 Modified Files: python-mode.el Log Message: (py-parse-state-re): Remove the "if" from the regular expression. This fixes an indentation bug reported by Jeremy when seeing multiple list comprehensions like so: [x for x in seq if blah(x)] # ... [y for y in seq if blah(y)] The reason this broke is because this regexp caused the "find a safe parsing start location higher up in the file" test to erroneously find the if in the listcomp. I think the other keywords in this regexp are fine and good enough. After a weekend of testing, I can't find any adverse effects. Index: python-mode.el =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v retrieving revision 4.27 retrieving revision 4.28 diff -C2 -d -r4.27 -r4.28 *** python-mode.el 28 Sep 2002 18:17:56 -0000 4.27 --- python-mode.el 21 Oct 2002 15:58:29 -0000 4.28 *************** *** 3149,3153 **** (defvar py-parse-state-re (concat ! "^[ \t]*\\(if\\|elif\\|else\\|while\\|def\\|class\\)\\>" "\\|" "^[^ #\t\n]")) --- 3149,3153 ---- (defvar py-parse-state-re (concat ! "^[ \t]*\\(elif\\|else\\|while\\|def\\|class\\)\\>" "\\|" "^[^ #\t\n]")) From jhylton@users.sourceforge.net Mon Oct 21 22:26:23 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:26:23 -0700 Subject: [Python-checkins] python/dist/src/Include compile.h,2.37.2.3,2.37.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv21596/Include Modified Files: Tag: ast-branch compile.h Log Message: Make b_seen and b_return bitfields. Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.37.2.3 retrieving revision 2.37.2.4 diff -C2 -d -r2.37.2.3 -r2.37.2.4 *** compile.h 30 Sep 2002 20:16:33 -0000 2.37.2.3 --- compile.h 21 Oct 2002 21:26:20 -0000 2.37.2.4 *************** *** 47,51 **** int b_next; /* b_seen is used to perform a DFS of basicblocks. */ ! int b_seen; struct instr b_instr[DEFAULT_BLOCK_SIZE]; }; --- 47,53 ---- int b_next; /* b_seen is used to perform a DFS of basicblocks. */ ! int b_seen : 1; ! /* b_return is true if a RETURN_VALUE opcode is inserted. */ ! int b_return : 1; struct instr b_instr[DEFAULT_BLOCK_SIZE]; }; From jhylton@users.sourceforge.net Mon Oct 21 22:26:54 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:26:54 -0700 Subject: [Python-checkins] python/dist/src/Include symtable.h,2.9.18.5,2.9.18.6 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv22269/Include Modified Files: Tag: ast-branch symtable.h Log Message: Add st_top, borrowed ref to module-level ste. Mark several fields as one-bit fields. Index: symtable.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/symtable.h,v retrieving revision 2.9.18.5 retrieving revision 2.9.18.6 diff -C2 -d -r2.9.18.5 -r2.9.18.6 *** symtable.h 30 Aug 2002 20:04:48 -0000 2.9.18.5 --- symtable.h 21 Oct 2002 21:26:52 -0000 2.9.18.6 *************** *** 13,16 **** --- 13,17 ---- const char *st_filename; /* name of file being compiled */ struct _symtable_entry *st_cur; /* current symbol table entry */ + struct _symtable_entry *st_top; /* module entry */ PyObject *st_symbols; /* dictionary of symbol table entries */ PyObject *st_stack; /* stack of namespace info */ *************** *** 30,39 **** PyObject *ste_children; /* list of child ids */ block_ty ste_type; /* module, class, or function */ ! int ste_lineno; /* first line of block */ ! int ste_optimized; /* true if namespace can't be optimized */ ! int ste_nested; /* true if block is nested */ ! int ste_child_free; /* true if a child block has free variables, including free refs to globals */ ! int ste_generator; /* true if namespace is a generator */ int ste_opt_lineno; /* lineno of last exec or import * */ struct symtable *ste_table; --- 31,40 ---- PyObject *ste_children; /* list of child ids */ block_ty ste_type; /* module, class, or function */ ! int ste_optimized : 1; /* true if namespace can't be optimized */ ! int ste_nested : 1; /* true if block is nested */ ! int ste_child_free : 1; /* true if a child block has free variables, including free refs to globals */ ! int ste_generator : 1; /* true if namespace is a generator */ ! int ste_lineno; /* first line of block */ int ste_opt_lineno; /* lineno of last exec or import * */ struct symtable *ste_table; From jhylton@users.sourceforge.net Mon Oct 21 22:28:27 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:28:27 -0700 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.314.2.1,2.314.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv24094/Python Modified Files: Tag: ast-branch ceval.c Log Message: Py_DEBUG defines LLTRACE. So defined(Py_DEBUG) implies defined(LLTRACE). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.314.2.1 retrieving revision 2.314.2.2 diff -C2 -d -r2.314.2.1 -r2.314.2.2 *** ceval.c 9 Jul 2002 13:22:01 -0000 2.314.2.1 --- ceval.c 21 Oct 2002 21:28:25 -0000 2.314.2.2 *************** *** 517,521 **** int lltrace; #endif ! #if defined(Py_DEBUG) || defined(LLTRACE) /* Make it easier to find out where we are with a debugger */ char *filename; --- 517,521 ---- int lltrace; #endif ! #if defined(Py_DEBUG) /* Make it easier to find out where we are with a debugger */ char *filename; *************** *** 630,636 **** #ifdef LLTRACE ! lltrace = PyDict_GetItemString(f->f_globals,"__lltrace__") != NULL; #endif ! #if defined(Py_DEBUG) || defined(LLTRACE) filename = PyString_AsString(co->co_filename); #endif --- 630,636 ---- #ifdef LLTRACE ! lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL; #endif ! #if defined(Py_DEBUG) filename = PyString_AsString(co->co_filename); #endif *************** *** 691,695 **** /* Extract opcode and argument */ ! #if defined(Py_DEBUG) || defined(LLTRACE) f->f_lasti = INSTR_OFFSET(); #endif --- 691,695 ---- /* Extract opcode and argument */ ! #if defined(Py_DEBUG) f->f_lasti = INSTR_OFFSET(); #endif From jhylton@users.sourceforge.net Mon Oct 21 22:31:13 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:31:13 -0700 Subject: [Python-checkins] python/dist/src/Python symtable.c,2.10.8.9,2.10.8.10 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27294/Python Modified Files: Tag: ast-branch symtable.c Log Message: Hook up symbol table analysis code. After analyzing the AST, call symtable_analyze() to determine what variables are free and what variables are globals. The analysis hasn't been tested thoroughly, but it is much simpler than the old symtable analysis code. Add st_top alias for the first ste. The symtable_analyze() function mistakenly passed st_globals, which is a dictionary of symbols not a symbol table entry. (The cast should have been a warning.) Remove two Python-visible attributes of a symtable, because I changed them to bitfields. XXX I'm probably going to remove the Python-level API entirely. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.9 retrieving revision 2.10.8.10 diff -C2 -d -r2.10.8.9 -r2.10.8.10 *** symtable.c 2 Oct 2002 11:50:14 -0000 2.10.8.9 --- symtable.c 21 Oct 2002 21:31:11 -0000 2.10.8.10 *************** *** 97,102 **** {"type", T_INT, OFF(ste_type), READONLY}, {"lineno", T_INT, OFF(ste_lineno), READONLY}, - {"optimized",T_INT, OFF(ste_optimized), READONLY}, - {"nested", T_INT, OFF(ste_nested), READONLY}, {NULL} }; --- 97,100 ---- *************** *** 144,147 **** --- 142,146 ---- }; + static int symtable_analyze(struct symtable *st); static int symtable_enter_block(struct symtable *st, identifier name, block_ty block, void *ast, int lineno); *************** *** 198,201 **** --- 197,201 ---- symtable_enter_block(st, GET_IDENTIFIER(top), ModuleBlock, (void *)mod, 0); + st->st_top = st->st_cur; /* Any other top-level initialization? */ switch (mod->kind) { *************** *** 226,229 **** --- 226,231 ---- } symtable_exit_block(st, (void *)mod); + if (!symtable_analyze(st)) + goto error; return st; error: *************** *** 237,241 **** Py_XDECREF(st->st_symbols); Py_XDECREF(st->st_stack); - Py_XDECREF(st->st_cur); PyMem_Free((void *)st); } --- 239,242 ---- *************** *** 417,421 **** flags |= (i << SCOPE_OFF); u = PyInt_FromLong(flags); ! if (!PyDict_SetItem(symbols, name, u)) { Py_DECREF(u); return 0; --- 418,422 ---- flags |= (i << SCOPE_OFF); u = PyInt_FromLong(flags); ! if (PyDict_SetItem(symbols, name, u) < 0) { Py_DECREF(u); return 0; *************** *** 439,442 **** --- 440,445 ---- goto error; + assert(PySTEntry_Check(ste)); + assert(PyDict_Check(ste->ste_symbols)); while (PyDict_Next(ste->ste_symbols, &pos, &name, &v)) { flags = PyInt_AS_LONG(v); *************** *** 458,466 **** } - /* call analyze_block() on each child */ for (i = 0; i < PyList_GET_SIZE(ste->ste_children); ++i) { ! PyObject *c; ! c = PyDict_GetItem(ste->ste_table->st_symbols, ! PyList_GET_ITEM(ste->ste_children, i)); assert(c && PySTEntry_Check(c)); if (!analyze_block((PySTEntryObject *)c, local, free)) --- 461,466 ---- } for (i = 0; i < PyList_GET_SIZE(ste->ste_children); ++i) { ! PyObject *c = PyList_GET_ITEM(ste->ste_children, i); assert(c && PySTEntry_Check(c)); if (!analyze_block((PySTEntryObject *)c, local, free)) *************** *** 477,485 **** Py_XDECREF(scope); Py_XDECREF(newbound); return success; } int ! PySymtable_Analyze(struct symtable *st) { PyObject *free; --- 477,487 ---- Py_XDECREF(scope); Py_XDECREF(newbound); + if (!success) + assert(PyErr_Occurred()); return success; } int ! symtable_analyze(struct symtable *st) { PyObject *free; *************** *** 489,493 **** if (!free) return 0; ! r = analyze_block((PySTEntryObject *)st->st_global, NULL, free); Py_DECREF(free); return r; --- 491,495 ---- if (!free) return 0; ! r = analyze_block(st->st_top, NULL, free); Py_DECREF(free); return r; *************** *** 521,524 **** --- 523,529 ---- { PySTEntryObject *prev = NULL; + + fprintf(stderr, "enter block %s %d\n", + PyString_AS_STRING(name), lineno); if (st->st_cur) { From jhylton@users.sourceforge.net Mon Oct 21 22:33:34 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:33:34 -0700 Subject: [Python-checkins] python/dist/src/Python newcompile.c,1.1.2.13,1.1.2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv30160/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Several small fixes that get simple function definitions working. Determine the number of locals from the symtable and pass it to PyCode_New(). Add missing breaks in compiler_nameop(). Determine the number of function arguments directly from the AST. Make basic blocks that have a return statement. The flow graph should stop right there. XXX Nothing uses that information yet. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -C2 -d -r1.1.2.13 -r1.1.2.14 *** newcompile.c 2 Oct 2002 11:58:53 -0000 1.1.2.13 --- newcompile.c 21 Oct 2002 21:33:31 -0000 1.1.2.14 *************** *** 376,379 **** --- 376,380 ---- compiler_addop(struct compiler *c, int opcode) { + struct basicblock *b; struct instr *i; int off; *************** *** 381,387 **** if (off < 0) return 0; ! i = &c->u->u_blocks[c->u->u_curblock]->b_instr[off]; i->i_opcode = opcode; i->i_hasarg = 0; return 1; } --- 382,391 ---- if (off < 0) return 0; ! b = c->u->u_blocks[c->u->u_curblock]; ! i = &b->b_instr[off]; i->i_opcode = opcode; i->i_hasarg = 0; + if (opcode == RETURN_VALUE) + b->b_return = 1; return 1; } *************** *** 547,551 **** { PyCodeObject *co; - int ndefs = 0; arguments_ty args = s->v.FunctionDef.args; assert(s->kind == FunctionDef_kind); --- 551,554 ---- *************** *** 558,562 **** if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! c->u->u_argcount = ndefs; VISIT_SEQ(c, stmt, s->v.FunctionDef.body); co = assemble(c); --- 561,565 ---- if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! c->u->u_argcount = asdl_seq_LEN(s->v.FunctionDef.args->args); VISIT_SEQ(c, stmt, s->v.FunctionDef.body); co = assemble(c); *************** *** 567,571 **** /* XXX closure */ ADDOP_O(c, LOAD_CONST, (PyObject *)co, consts); ! ADDOP_I(c, MAKE_FUNCTION, ndefs); if (!compiler_nameop(c, s->v.FunctionDef.name, Store)) return 0; --- 570,574 ---- /* XXX closure */ ADDOP_O(c, LOAD_CONST, (PyObject *)co, consts); ! ADDOP_I(c, MAKE_FUNCTION, c->u->u_argcount); if (!compiler_nameop(c, s->v.FunctionDef.name, Store)) return 0; *************** *** 945,948 **** --- 948,953 ---- optype = OP_GLOBAL; break; + default: + assert(0); } *************** *** 958,961 **** --- 963,967 ---- assert(0); /* impossible */ } + break; case OP_FAST: switch (ctx) { *************** *** 968,971 **** --- 974,978 ---- assert(0); /* impossible */ } + break; case OP_GLOBAL: switch (ctx) { *************** *** 978,981 **** --- 985,989 ---- assert(0); /* impossible */ } + break; case OP_NAME: switch (ctx) { *************** *** 988,991 **** --- 996,1000 ---- assert(0); /* impossible */ } + break; } *************** *** 1371,1374 **** --- 1380,1384 ---- PyObject *name = NULL; PyObject *nil = PyTuple_New(0); + int nlocals; consts = dict_keys_inorder(c->u->u_consts, 0); *************** *** 1385,1389 **** goto error; ! co = PyCode_New(c->u->u_argcount, 0, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, nil, nil, --- 1395,1400 ---- goto error; ! nlocals = PyList_GET_SIZE(c->u->u_ste->ste_varnames); ! co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, nil, nil, From jhylton@users.sourceforge.net Mon Oct 21 22:43:41 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:43:41 -0700 Subject: [Python-checkins] python/dist/src/Python newcompile.c,1.1.2.14,1.1.2.15 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9579 Modified Files: Tag: ast-branch newcompile.c Log Message: Initialize u_nfblocks to 0. Get varnames from compiler unit alias u_varnames. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** newcompile.c 21 Oct 2002 21:33:31 -0000 1.1.2.14 --- newcompile.c 21 Oct 2002 21:43:39 -0000 1.1.2.15 *************** *** 208,214 **** u->u_varnames = u->u_ste->ste_varnames; Py_INCREF(u->u_varnames); - fprintf(stderr, "block %s varnames %s\n", - PyObject_REPR(name), - PyObject_REPR(u->u_varnames)); u->u_nblocks = 0; u->u_blocks = (struct basicblock **)PyObject_Malloc( --- 208,211 ---- *************** *** 216,219 **** --- 213,217 ---- if (!u->u_blocks) return 0; + u->u_nfblocks = 0; memset(u->u_blocks, 0, sizeof(struct basicblock *) * DEFAULT_BLOCKS); u->u_consts = PyDict_New(); *************** *** 1395,1399 **** goto error; ! nlocals = PyList_GET_SIZE(c->u->u_ste->ste_varnames); co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, --- 1393,1397 ---- goto error; ! nlocals = PyList_GET_SIZE(c->u->u_varnames); co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), 0, a->a_bytecode, consts, names, varnames, From jhylton@users.sourceforge.net Mon Oct 21 22:45:47 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 14:45:47 -0700 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.11,1.1.2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11875 Modified Files: Tag: ast-branch ast.c Log Message: Comment out a bunch of debugging prints. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -C2 -d -r1.1.2.11 -r1.1.2.12 *** ast.c 2 Oct 2002 11:49:15 -0000 1.1.2.11 --- ast.c 21 Oct 2002 21:45:45 -0000 1.1.2.12 *************** *** 549,553 **** */ node *ch = CHILD(n, 0); ! fprintf(stderr, "ast_for_atom((%d, %d))\n", TYPE(ch), NCH(ch)); switch (TYPE(ch)) { case NAME: --- 549,553 ---- */ node *ch = CHILD(n, 0); ! /* fprintf(stderr, "ast_for_atom((%d, %d))\n", TYPE(ch), NCH(ch)); */ switch (TYPE(ch)) { case NAME: *************** *** 668,672 **** int i; ! fprintf(stderr, "ast_for_expr(%d, %d)\n", TYPE(n), NCH(n)); loop: switch (TYPE(n)) { --- 668,672 ---- int i; ! /* fprintf(stderr, "ast_for_expr(%d, %d)\n", TYPE(n), NCH(n)); */ loop: switch (TYPE(n)) { *************** *** 859,863 **** */ ! fprintf(stderr, "ast_for_expr_stmt(%d, %d)\n", TYPE(n), NCH(n)); if (NCH(n) == 1) { expr_ty e = ast_for_testlist(CHILD(n, 0)); --- 859,863 ---- */ ! /* fprintf(stderr, "ast_for_expr_stmt(%d, %d)\n", TYPE(n), NCH(n)); */ if (NCH(n) == 1) { expr_ty e = ast_for_testlist(CHILD(n, 0)); *************** *** 921,925 **** expr_ty e; ! fprintf(stderr, "ast_for_exprlist(%d, %d)\n", TYPE(n), context); REQ(n, exprlist); --- 921,925 ---- expr_ty e; ! /* fprintf(stderr, "ast_for_exprlist(%d, %d)\n", TYPE(n), context); */ REQ(n, exprlist); *************** *** 1141,1145 **** node *ch; ! fprintf(stderr, "ast_for_suite(%d) lineno=%d\n", TYPE(n), n->n_lineno); REQ(n, suite); --- 1141,1145 ---- node *ch; ! /* fprintf(stderr, "ast_for_suite(%d) lineno=%d\n", TYPE(n), n->n_lineno); */ REQ(n, suite); *************** *** 1373,1379 **** ast_for_stmt(const node *n) { ! /* _PyObject_DebugMallocStats(); */ ! fprintf(stderr, "ast_for_stmt(%d) lineno=%d\n", ! TYPE(n), n->n_lineno); if (TYPE(n) == stmt) { assert(NCH(n) == 1); --- 1373,1378 ---- ast_for_stmt(const node *n) { ! /* fprintf(stderr, "ast_for_stmt(%d) lineno=%d\n", ! TYPE(n), n->n_lineno); */ if (TYPE(n) == stmt) { assert(NCH(n) == 1); From jhylton@users.sourceforge.net Mon Oct 21 23:36:19 2002 From: jhylton@users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon, 21 Oct 2002 15:36:19 -0700 Subject: [Python-checkins] python/dist/src/Python newcompile.c,1.1.2.15,1.1.2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27827/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Add sane reallocation strategy for u_blocks. Add compiler_unit_check() that looks for bogus u_blocks arrays. Hint: realloc puts 0xfbfbfbfb at the end of the realloc block. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -C2 -d -r1.1.2.15 -r1.1.2.16 *** newcompile.c 21 Oct 2002 21:43:39 -0000 1.1.2.15 --- newcompile.c 21 Oct 2002 22:36:16 -0000 1.1.2.16 *************** *** 36,39 **** --- 36,40 ---- int u_argcount; int u_nblocks; + int u_nalloc; int u_curblock; struct basicblock u_entry; *************** *** 209,212 **** --- 210,214 ---- Py_INCREF(u->u_varnames); u->u_nblocks = 0; + u->u_nalloc = DEFAULT_BLOCKS; u->u_blocks = (struct basicblock **)PyObject_Malloc( sizeof(struct basicblock *) * DEFAULT_BLOCKS); *************** *** 238,249 **** } ! static int ! compiler_exit_scope(struct compiler *c) { ! struct compiler_unit *u = c->u; ! int i, n; ! PyObject *wrapper; ! for (i = 0; i < u->u_nblocks; i++) PyObject_Free((void *)u->u_blocks[i]); if (u->u_blocks) --- 240,249 ---- } ! static void ! compiler_unit_free(struct compiler_unit *u) { ! int i; ! for (i = 0; i < u->u_nblocks; i++) PyObject_Free((void *)u->u_blocks[i]); if (u->u_blocks) *************** *** 253,259 **** Py_XDECREF(u->u_names); Py_XDECREF(u->u_varnames); - PyObject_Free(u); /* Restore c->u to the parent unit. */ n = PyList_GET_SIZE(c->c_stack) - 1; --- 253,279 ---- Py_XDECREF(u->u_names); Py_XDECREF(u->u_varnames); PyObject_Free(u); + } + + static void + compiler_unit_check(struct compiler_unit *u) + { + int i; + assert(u->u_curblock < u->u_nblocks); + assert(u->u_nblocks <= u->u_nalloc); + for (i = 0; i < u->u_nblocks; i++) { + assert(u->u_blocks[i]); + assert(u->u_blocks[i] != 0xcbcbcbcb); + assert(u->u_blocks[i] != 0xfbfbfbfb); + } + } + static int + compiler_exit_scope(struct compiler *c) + { + int n; + PyObject *wrapper; + + compiler_unit_free(c->u); /* Restore c->u to the parent unit. */ n = PyList_GET_SIZE(c->c_stack) - 1; *************** *** 263,266 **** --- 283,287 ---- if (PySequence_DelItem(c->c_stack, n) < 0) return 0; + compiler_unit_check(c->u); } else *************** *** 282,293 **** u = c->u; ! if (u->u_nblocks && u->u_nblocks % DEFAULT_BLOCKS == 0) { ! /* XXX should double */ ! int newsize = u->u_nblocks + DEFAULT_BLOCKS; u->u_blocks = (struct basicblock **)PyObject_Realloc( u->u_blocks, newsize); if (u->u_blocks == NULL) return -1; } b = (struct basicblock *)PyObject_Malloc(sizeof(struct basicblock)); if (b == NULL) --- 303,318 ---- u = c->u; ! if (u->u_nblocks == u->u_nalloc) { ! int newsize = ((u->u_nalloc + u->u_nalloc) ! * sizeof(struct basicblock *)); u->u_blocks = (struct basicblock **)PyObject_Realloc( u->u_blocks, newsize); if (u->u_blocks == NULL) return -1; + memset(u->u_blocks + u->u_nalloc, 0, + sizeof(struct basicblock *) * u->u_nalloc); + u->u_nalloc += u->u_nalloc; } + compiler_unit_check(u); b = (struct basicblock *)PyObject_Malloc(sizeof(struct basicblock)); if (b == NULL) *************** *** 296,299 **** --- 321,325 ---- b->b_ialloc = DEFAULT_BLOCK_SIZE; block = u->u_nblocks++; + assert(u->u_blocks[block] == NULL); u->u_blocks[block] = b; return block; *************** *** 361,366 **** if (ptr == NULL) return -1; ! if (ptr != (void *)b) c->u->u_blocks[block] = (struct basicblock *)ptr; } return b->b_iused++; --- 387,394 ---- if (ptr == NULL) return -1; ! if (ptr != (void *)b) { ! fprintf(stderr, "resize block %d\n", block); c->u->u_blocks[block] = (struct basicblock *)ptr; + } } return b->b_iused++; From rhettinger@users.sourceforge.net Tue Oct 22 06:15:20 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon, 21 Oct 2002 22:15:20 -0700 Subject: [Python-checkins] python/dist/src/Lib calendar.py,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21185 Modified Files: calendar.py Log Message: Patches #626105: Replaces the _center function in the calendar module with the center method for strings. For situations with uneven padding, the behavior is slightly different in that the center method puts the extra space on the right instead of the left. Index: calendar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/calendar.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** calendar.py 21 Oct 2002 03:08:20 -0000 1.29 --- calendar.py 22 Oct 2002 05:15:17 -0000 1.30 *************** *** 123,133 **** return rows - def _center(str, width): - """Center a string in a field.""" - n = width - len(str) - if n <= 0: - return str - return ' '*((n+1)/2) + str + ' '*((n)/2) - def prweek(theweek, width): """Print a single week (no newline).""" --- 123,126 ---- *************** *** 142,146 **** else: s = '%2i' % day # right-align single-digit days ! days.append(_center(s, width)) return ' '.join(days) --- 135,139 ---- else: s = '%2i' % day # right-align single-digit days ! days.append(s.center(width)) return ' '.join(days) *************** *** 153,157 **** days = [] for i in range(_firstweekday, _firstweekday + 7): ! days.append(_center(names[i%7][:width], width)) return ' '.join(days) --- 146,150 ---- days = [] for i in range(_firstweekday, _firstweekday + 7): ! days.append(names[i%7][:width].center(width)) return ' '.join(days) *************** *** 164,168 **** w = max(2, w) l = max(1, l) ! s = (_center(month_name[themonth] + ' ' + `theyear`, 7 * (w + 1) - 1).rstrip() + '\n' * l + weekheader(w).rstrip() + '\n' * l) --- 157,161 ---- w = max(2, w) l = max(1, l) ! s = ((month_name[themonth] + ' ' + `theyear`).center( 7 * (w + 1) - 1).rstrip() + '\n' * l + weekheader(w).rstrip() + '\n' * l) *************** *** 181,186 **** def format3cstring(a, b, c, colwidth=_colwidth, spacing=_spacing): """Returns a string formatted from 3 strings, centered within 3 columns.""" ! return (_center(a, colwidth) + ' ' * spacing + _center(b, colwidth) + ! ' ' * spacing + _center(c, colwidth)) def prcal(year, w=0, l=0, c=_spacing): --- 174,179 ---- def format3cstring(a, b, c, colwidth=_colwidth, spacing=_spacing): """Returns a string formatted from 3 strings, centered within 3 columns.""" ! return (a.center(colwidth) + ' ' * spacing + b.center(colwidth) + ! ' ' * spacing + c.center(colwidth)) def prcal(year, w=0, l=0, c=_spacing): *************** *** 194,198 **** c = max(2, c) colwidth = (w + 1) * 7 - 1 ! s = _center(`year`, colwidth * 3 + c * 2).rstrip() + '\n' * l header = weekheader(w) header = format3cstring(header, header, header, colwidth, c).rstrip() --- 187,191 ---- c = max(2, c) colwidth = (w + 1) * 7 - 1 ! s = `year`.center(colwidth * 3 + c * 2).rstrip() + '\n' * l header = weekheader(w) header = format3cstring(header, header, header, colwidth, c).rstrip() From fdrake@users.sourceforge.net Tue Oct 22 16:06:05 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 08:06:05 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libthread.tex,1.24,1.24.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22207 Modified Files: Tag: release22-maint libthread.tex Log Message: Clarify what versions of Windows are supported, and add Linux specifically. Index: libthread.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthread.tex,v retrieving revision 1.24 retrieving revision 1.24.6.1 diff -C2 -d -r1.24 -r1.24.6.1 *** libthread.tex 28 Nov 2001 07:26:15 -0000 1.24 --- libthread.tex 22 Oct 2002 15:06:01 -0000 1.24.6.1 *************** *** 16,20 **** \index{semaphores, binary} ! The module is optional. It is supported on Windows NT and '95, SGI IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread (a.k.a. ``pthread'') implementation. --- 16,20 ---- \index{semaphores, binary} ! The module is optional. It is supported on Windows, Linux, SGI IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread (a.k.a. ``pthread'') implementation. From fdrake@users.sourceforge.net Tue Oct 22 16:06:53 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 08:06:53 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libthread.tex,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23024 Modified Files: libthread.tex Log Message: Clarify what versions of Windows are supported, and add Linux specifically. Index: libthread.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthread.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** libthread.tex 9 Apr 2002 18:15:00 -0000 1.25 --- libthread.tex 22 Oct 2002 15:06:49 -0000 1.26 *************** *** 16,20 **** \index{semaphores, binary} ! The module is optional. It is supported on Windows NT and '95, SGI IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread (a.k.a. ``pthread'') implementation. --- 16,20 ---- \index{semaphores, binary} ! The module is optional. It is supported on Windows, Linux, SGI IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread (a.k.a. ``pthread'') implementation. From effbot@users.sourceforge.net Tue Oct 22 19:23:02 2002 From: effbot@users.sourceforge.net (effbot@users.sourceforge.net) Date: Tue, 22 Oct 2002 11:23:02 -0700 Subject: [Python-checkins] python/dist/src/Lib xmlrpclib.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4346/Lib Modified Files: xmlrpclib.py Log Message: add support for basic authentication, based on patch #624180 by Phillip J. Eby Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** xmlrpclib.py 30 Jun 2002 03:39:14 -0000 1.20 --- xmlrpclib.py 22 Oct 2002 18:23:00 -0000 1.21 *************** *** 44,47 **** --- 44,48 ---- # 2002-05-15 fl Added error constants (from Andrew Kuchling) # 2002-06-27 fl Merged with Python CVS version + # 2002-10-22 fl Added basic authentication (based on code from Phillip Eby) # # Copyright (c) 1999-2002 by Secret Labs AB. *************** *** 1045,1048 **** --- 1046,1080 ---- ## + # Get authorization info from host parameter + # Host may be a string, or a (host, x509-dict) tuple; if a string, + # it is checked for a "user:pw@host" format, and a "Basic + # Authentication" header is added if appropriate. + # + # @param host Host descriptor (URL or (URL, x509 info) tuple). + # @return A 3-tuple containing (actual host, extra headers, + # x509 info). The header and x509 fields may be None. + + def get_host_info(self, host): + + x509 = {} + if isinstance(host, TupleType): + host, x509 = host + + import urllib + auth, host = urllib.splituser(host) + + if auth: + import base64 + auth = base64.encodestring(auth) + auth = string.join(string.split(auth), "") # get rid of whitespace + extra_headers = [ + ("Authorization", "Basic " + auth) + ] + else: + extra_headers = None + + return host, extra_headers, x509 + + ## # Connect to server. # *************** *** 1053,1056 **** --- 1085,1089 ---- # create a HTTP connection object from a host descriptor import httplib + host, extra_headers, x509 = self.get_host_info(host) return httplib.HTTP(host) *************** *** 1072,1076 **** --- 1105,1115 ---- def send_host(self, connection, host): + host, extra_headers, x509 = self.get_host_info(host) connection.putheader("Host", host) + if extra_headers: + if isinstance(extra_headers, DictType): + extra_headers = extra_headers.items() + for key, value in extra_headers: + connection.putheader(key, value) ## *************** *** 1148,1167 **** # host may be a string, or a (host, x509-dict) tuple import httplib ! if isinstance(host, TupleType): ! host, x509 = host ! else: ! x509 = {} try: HTTPS = httplib.HTTPS except AttributeError: ! raise NotImplementedError,\ ! "your version of httplib doesn't support HTTPS" else: ! return apply(HTTPS, (host, None), x509) ! ! def send_host(self, connection, host): ! if isinstance(host, TupleType): ! host, x509 = host ! connection.putheader("Host", host) ## --- 1187,1199 ---- # host may be a string, or a (host, x509-dict) tuple import httplib ! host, extra_headers, x509 = self.get_host_info(host) try: HTTPS = httplib.HTTPS except AttributeError: ! raise NotImplementedError( ! "your version of httplib doesn't support HTTPS" ! ) else: ! return apply(HTTPS, (host, None), x509 or {}) ## From effbot@users.sourceforge.net Tue Oct 22 19:23:03 2002 From: effbot@users.sourceforge.net (effbot@users.sourceforge.net) Date: Tue, 22 Oct 2002 11:23:03 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libxmlrpclib.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv4346/Doc/lib Modified Files: libxmlrpclib.tex Log Message: add support for basic authentication, based on patch #624180 by Phillip J. Eby Index: libxmlrpclib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmlrpclib.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libxmlrpclib.tex 19 Oct 2002 20:22:56 -0000 1.10 --- libxmlrpclib.tex 22 Oct 2002 18:23:00 -0000 1.11 *************** *** 29,32 **** --- 29,39 ---- fourth argument is a debugging flag. + Both the HTTP and HTTPS transports support the URL syntax extension for + HTTP Basic Authorization: \code{http://user:pass@host:port/path}. The + \code{user:pass} portion will be base64-encoded as an HTTP `Authorization' + header, and sent to the remote server as part of the connection process + when invoking an XML-RPC method. You only need to use this if the + remote server requires a Basic Authentication user and password. + The returned instance is a proxy object with methods that can be used to invoke corresponding RPC calls on the remote server. If the remote From effbot@users.sourceforge.net Tue Oct 22 19:26:31 2002 From: effbot@users.sourceforge.net (effbot@users.sourceforge.net) Date: Tue, 22 Oct 2002 11:26:31 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libxmlrpclib.tex,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8577/Doc/lib Modified Files: libxmlrpclib.tex Log Message: terminology Index: libxmlrpclib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmlrpclib.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libxmlrpclib.tex 22 Oct 2002 18:23:00 -0000 1.11 --- libxmlrpclib.tex 22 Oct 2002 18:26:28 -0000 1.12 *************** *** 30,34 **** Both the HTTP and HTTPS transports support the URL syntax extension for ! HTTP Basic Authorization: \code{http://user:pass@host:port/path}. The \code{user:pass} portion will be base64-encoded as an HTTP `Authorization' header, and sent to the remote server as part of the connection process --- 30,34 ---- Both the HTTP and HTTPS transports support the URL syntax extension for ! HTTP Basic Authentication: \code{http://user:pass@host:port/path}. The \code{user:pass} portion will be base64-encoded as an HTTP `Authorization' header, and sent to the remote server as part of the connection process From gward@users.sourceforge.net Tue Oct 22 19:31:52 2002 From: gward@users.sourceforge.net (gward@users.sourceforge.net) Date: Tue, 22 Oct 2002 11:31:52 -0700 Subject: [Python-checkins] python/dist/src/Lib textwrap.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13895 Modified Files: textwrap.py Log Message: Add comment about inability to handle Unicode strings (hopefully a temporary condition). Index: textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** textwrap.py 13 Oct 2002 19:23:18 -0000 1.17 --- textwrap.py 22 Oct 2002 18:31:50 -0000 1.18 *************** *** 6,9 **** --- 6,12 ---- # Written by Greg Ward + # XXX currently this module does not work very well with Unicode + # strings. See http://www.python.org/sf/622831 for updates. + __revision__ = "$Id$" From fdrake@users.sourceforge.net Tue Oct 22 21:20:24 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 13:20:24 -0700 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv11289 Modified Files: concrete.tex Log Message: Clarified the error cases and Unicode handling of PyString_AsString(), PyString_AsStringAndSize(), and PyString_AS_STRING(). Closes SF bug #606463. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** concrete.tex 20 Jun 2002 22:07:04 -0000 1.17 --- concrete.tex 22 Oct 2002 20:20:20 -0000 1.18 *************** *** 534,548 **** \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string} ! Returns a null-terminated representation of the contents of \var{string}. The pointer refers to the internal buffer of \var{string}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, \var{size})}. ! It must not be deallocated. \end{cfuncdesc} \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string} Macro form of \cfunction{PyString_AsString()} but without error ! checking. \end{cfuncdesc} --- 534,553 ---- \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string} ! Returns a NUL-terminated representation of the contents of \var{string}. The pointer refers to the internal buffer of \var{string}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, \var{size})}. ! It must not be deallocated. If \var{string} is a Unicode object, ! this function computes the default encoding of \var{string} and ! operates on that. If \var{string} is not a string object at all, ! \cfunction{PyString_AsString()} returns \NULL{} and raises ! \exception{TypeError}. \end{cfuncdesc} \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string} Macro form of \cfunction{PyString_AsString()} but without error ! checking. Only string objects are supported; no Unicode objects ! should be passed. \end{cfuncdesc} *************** *** 550,554 **** char **buffer, int *length} ! Returns a null-terminated representation of the contents of the object \var{obj} through the output variables \var{buffer} and \var{length}. --- 555,559 ---- char **buffer, int *length} ! Returns a NUL-terminated representation of the contents of the object \var{obj} through the output variables \var{buffer} and \var{length}. *************** *** 556,567 **** The function accepts both string and Unicode objects as input. For Unicode objects it returns the default encoded version of the ! object. If \var{length} is set to \NULL, the resulting buffer may ! not contain null characters; if it does, the function returns -1 and ! a \exception{TypeError} is raised. The buffer refers to an internal string buffer of \var{obj}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, ! \var{size})}. It must not be deallocated. \end{cfuncdesc} --- 561,576 ---- The function accepts both string and Unicode objects as input. For Unicode objects it returns the default encoded version of the ! object. If \var{length} is \NULL, the resulting buffer may not ! contain NUL characters; if it does, the function returns \code{-1} ! and a \exception{TypeError} is raised. The buffer refers to an internal string buffer of \var{obj}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, ! \var{size})}. It must not be deallocated. If \var{string} is a ! Unicode object, this function computes the default encoding of ! \var{string} and operates on that. If \var{string} is not a string ! object at all, \cfunction{PyString_AsString()} returns \NULL{} and ! raises \exception{TypeError}. \end{cfuncdesc} From fdrake@users.sourceforge.net Tue Oct 22 21:21:08 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 13:21:08 -0700 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.6.6.5,1.6.6.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv12326 Modified Files: Tag: release22-maint concrete.tex Log Message: Clarified the error cases and Unicode handling of PyString_AsString(), PyString_AsStringAndSize(), and PyString_AS_STRING(). Closes SF bug #606463. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.6.6.5 retrieving revision 1.6.6.6 diff -C2 -d -r1.6.6.5 -r1.6.6.6 *** concrete.tex 20 Jun 2002 22:09:12 -0000 1.6.6.5 --- concrete.tex 22 Oct 2002 20:21:06 -0000 1.6.6.6 *************** *** 530,544 **** \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string} ! Returns a null-terminated representation of the contents of \var{string}. The pointer refers to the internal buffer of \var{string}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, \var{size})}. ! It must not be deallocated. \end{cfuncdesc} \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string} Macro form of \cfunction{PyString_AsString()} but without error ! checking. \end{cfuncdesc} --- 530,549 ---- \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string} ! Returns a NUL-terminated representation of the contents of \var{string}. The pointer refers to the internal buffer of \var{string}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, \var{size})}. ! It must not be deallocated. If \var{string} is a Unicode object, ! this function computes the default encoding of \var{string} and ! operates on that. If \var{string} is not a string object at all, ! \cfunction{PyString_AsString()} returns \NULL{} and raises ! \exception{TypeError}. \end{cfuncdesc} \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string} Macro form of \cfunction{PyString_AsString()} but without error ! checking. Only string objects are supported; no Unicode objects ! should be passed. \end{cfuncdesc} *************** *** 546,550 **** char **buffer, int *length} ! Returns a null-terminated representation of the contents of the object \var{obj} through the output variables \var{buffer} and \var{length}. --- 551,555 ---- char **buffer, int *length} ! Returns a NUL-terminated representation of the contents of the object \var{obj} through the output variables \var{buffer} and \var{length}. *************** *** 552,563 **** The function accepts both string and Unicode objects as input. For Unicode objects it returns the default encoded version of the ! object. If \var{length} is set to \NULL, the resulting buffer may ! not contain null characters; if it does, the function returns -1 and ! a \exception{TypeError} is raised. The buffer refers to an internal string buffer of \var{obj}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, ! \var{size})}. It must not be deallocated. \end{cfuncdesc} --- 557,572 ---- The function accepts both string and Unicode objects as input. For Unicode objects it returns the default encoded version of the ! object. If \var{length} is \NULL, the resulting buffer may not ! contain NUL characters; if it does, the function returns \code{-1} ! and a \exception{TypeError} is raised. The buffer refers to an internal string buffer of \var{obj}, not a copy. The data must not be modified in any way, unless the string was just created using \code{PyString_FromStringAndSize(NULL, ! \var{size})}. It must not be deallocated. If \var{string} is a ! Unicode object, this function computes the default encoding of ! \var{string} and operates on that. If \var{string} is not a string ! object at all, \cfunction{PyString_AsString()} returns \NULL{} and ! raises \exception{TypeError}. \end{cfuncdesc} From fdrake@users.sourceforge.net Tue Oct 22 21:31:25 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 13:31:25 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.117,1.118 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21488 Modified Files: libfuncs.tex Log Message: Modify example to use string methods instead of the string module. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** libfuncs.tex 24 Sep 2002 21:08:36 -0000 1.117 --- libfuncs.tex 22 Oct 2002 20:31:22 -0000 1.118 *************** *** 38,42 **** \var{name} is returned. This is done for compatibility with the bytecode generated for the different kinds of import statement; when ! using \samp{import spam.ham.eggs}, the top-level package \code{spam} must be placed in the importing namespace, but when using \samp{from spam.ham import eggs}, the \code{spam.ham} subpackage must be used --- 38,42 ---- \var{name} is returned. This is done for compatibility with the bytecode generated for the different kinds of import statement; when ! using \samp{import spam.ham.eggs}, the top-level package \module{spam} must be placed in the importing namespace, but when using \samp{from spam.ham import eggs}, the \code{spam.ham} subpackage must be used *************** *** 46,54 **** \begin{verbatim} - import string - def my_import(name): mod = __import__(name) ! components = string.split(name, '.') for comp in components[1:]: mod = getattr(mod, comp) --- 46,52 ---- \begin{verbatim} def my_import(name): mod = __import__(name) ! components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp) From fdrake@users.sourceforge.net Tue Oct 22 22:00:49 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:00:49 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.173,1.174 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv11060 Modified Files: tut.tex Log Message: Describe __path__ along with the rest of the package description. Closes SF bug #626554. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** tut.tex 10 Oct 2002 18:24:54 -0000 1.173 --- tut.tex 22 Oct 2002 21:00:44 -0000 1.174 *************** *** 2673,2677 **** is executed. (This also works when \code{__all__} is defined.) ! Note that in general the practicing of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions, --- 2673,2677 ---- is executed. (This also works when \code{__all__} is defined.) ! Note that in general the practice of importing \code{*} from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions, *************** *** 2713,2716 **** --- 2713,2727 ---- %because of its awkwardness; since most packages will have a relative %shallow substructure, this is no big loss.) + + \subsection{Packages in Multiple Directories} + + Packages support one more special attribute, \member{__path__}. This + is initialized to be a list containing the name of the directory + holding the package's \file{__init__.py} before the code in that file + is executed. This variable can be modified; doing so affects future + searches for modules and subpackages contained in the package. + + While this feature is not often needed, it can be used to extend the + set of modules found in a package. From fdrake@users.sourceforge.net Tue Oct 22 22:01:35 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:01:35 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.12,1.156.4.1.2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv11642 Modified Files: Tag: release22-maint tut.tex Log Message: Describe __path__ along with the rest of the package description. Closes SF bug #626554. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.156.4.1.2.12 retrieving revision 1.156.4.1.2.13 diff -C2 -d -r1.156.4.1.2.12 -r1.156.4.1.2.13 *** tut.tex 5 Oct 2002 05:14:19 -0000 1.156.4.1.2.12 --- tut.tex 22 Oct 2002 21:01:33 -0000 1.156.4.1.2.13 *************** *** 2660,2664 **** is executed. (This also works when \code{__all__} is defined.) ! Note that in general the practicing of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions, --- 2660,2664 ---- is executed. (This also works when \code{__all__} is defined.) ! Note that in general the practice of importing \code{*} from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions, *************** *** 2700,2703 **** --- 2700,2714 ---- %because of its awkwardness; since most packages will have a relative %shallow substructure, this is no big loss.) + + \subsection{Packages in Multiple Directories} + + Packages support one more special attribute, \member{__path__}. This + is initialized to be a list containing the name of the directory + holding the package's \file{__init__.py} before the code in that file + is executed. This variable can be modified; doing so affects future + searches for modules and subpackages contained in the package. + + While this feature is not often needed, it can be used to extend the + set of modules found in a package. From fdrake@users.sourceforge.net Tue Oct 22 22:06:28 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:06:28 -0700 Subject: [Python-checkins] python/dist/src/Doc/tools push-docs.sh,1.13.8.2,1.13.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv15021 Modified Files: Tag: release22-maint push-docs.sh Log Message: Work around the fact that "maint" alone is a symlink now. Index: push-docs.sh =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/push-docs.sh,v retrieving revision 1.13.8.2 retrieving revision 1.13.8.3 diff -C2 -d -r1.13.8.2 -r1.13.8.3 *** push-docs.sh 4 Apr 2002 18:05:19 -0000 1.13.8.2 --- push-docs.sh 22 Oct 2002 21:06:24 -0000 1.13.8.3 *************** *** 60,63 **** --- 60,68 ---- fi + if [ "$DOCTYPE" = 'maint' ] ; then + # 'maint' is a symlink + DOCTYPE='maint22' + fi + START="`pwd`" MYDIR="`dirname $0`" From fdrake@users.sourceforge.net Tue Oct 22 22:20:26 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:20:26 -0700 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.235.2.1.2.14,1.235.2.1.2.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv23460 Modified Files: Tag: release22-maint Makefile Log Message: Yes, we have moved past 2.2.2. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.235.2.1.2.14 retrieving revision 1.235.2.1.2.15 diff -C2 -d -r1.235.2.1.2.14 -r1.235.2.1.2.15 *** Makefile 14 Oct 2002 14:33:35 -0000 1.235.2.1.2.14 --- Makefile 22 Oct 2002 21:20:24 -0000 1.235.2.1.2.15 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2.2+ PYTHON= python From fdrake@users.sourceforge.net Tue Oct 22 22:20:27 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:20:27 -0700 Subject: [Python-checkins] python/dist/src/Doc/texinputs boilerplate.tex,1.70.2.1.2.8,1.70.2.1.2.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv23460/texinputs Modified Files: Tag: release22-maint boilerplate.tex Log Message: Yes, we have moved past 2.2.2. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.70.2.1.2.8 retrieving revision 1.70.2.1.2.9 diff -C2 -d -r1.70.2.1.2.8 -r1.70.2.1.2.9 *** boilerplate.tex 14 Oct 2002 14:33:39 -0000 1.70.2.1.2.8 --- boilerplate.tex 22 Oct 2002 21:20:24 -0000 1.70.2.1.2.9 *************** *** 6,11 **** } ! \date{October 14, 2002} % XXX update before release! ! \release{2.2.2} % software release, not documentation \setreleaseinfo{} % empty for final release \setshortversion{2.2} % major.minor only for software --- 6,11 ---- } ! \date{\today} % XXX update before release! ! \release{2.2.2+} % software release, not documentation \setreleaseinfo{} % empty for final release \setshortversion{2.2} % major.minor only for software From fdrake@users.sourceforge.net Tue Oct 22 22:58:11 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:58:11 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib.tex,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8580 Modified Files: liburllib.tex Log Message: Moved description of _urlopener adjacent to the related functions. Added missing import to example code. Added documentation for pathname2url(), url2pathname(). Closes SF bug #623196. Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** liburllib.tex 4 Apr 2002 20:58:02 -0000 1.43 --- liburllib.tex 22 Oct 2002 21:58:06 -0000 1.44 *************** *** 141,144 **** --- 141,168 ---- \end{funcdesc} + \begin{datadesc}{_urlopener} + The public functions \function{urlopen()} and + \function{urlretrieve()} create an instance of the + \class{FancyURLopener} class and use it to perform their requested + actions. To override this functionality, programmers can create a + subclass of \class{URLopener} or \class{FancyURLopener}, then assign + that an instance of that class to the + \code{urllib._urlopener} variable before calling the desired function. + For example, applications may want to specify a different + \mailheader{User-Agent} header than \class{URLopener} defines. This + can be accomplished with the following code: + + \begin{verbatim} + import urllib + + class AppURLopener(urllib.FancyURLopener): + def __init__(self, *args): + self.version = "App/1.7" + urllib.FancyURLopener.__init__(self, *args) + + urllib._urlopener = AppURLopener() + \end{verbatim} + \end{datadesc} + \begin{funcdesc}{urlcleanup}{} Clear the cache that may have been built up by previous calls to *************** *** 189,211 **** \end{funcdesc} ! The public functions \function{urlopen()} and ! \function{urlretrieve()} create an instance of the ! \class{FancyURLopener} class and use it to perform their requested ! actions. To override this functionality, programmers can create a ! subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! that an instance of that class to the ! \code{urllib._urlopener} variable before calling the desired function. ! For example, applications may want to specify a different ! \mailheader{User-Agent} header than \class{URLopener} defines. This ! can be accomplished with the following code: ! ! \begin{verbatim} ! class AppURLopener(urllib.FancyURLopener): ! def __init__(self, *args): ! self.version = "App/1.7" ! urllib.FancyURLopener.__init__(self, *args) ! urllib._urlopener = AppURLopener() ! \end{verbatim} \begin{classdesc}{URLopener}{\optional{proxies\optional{, **x509}}} --- 213,228 ---- \end{funcdesc} ! \begin{funcdesc}{pathname2url}{path} ! Convert the pathname \var{path} from the local syntax for a path to ! the form used in the path component of a URL. This does not produce a ! complete URL. The return value will already be quoted using the ! \function{quote()} function. ! \end{funcdesc} ! \begin{funcdesc}{url2pathname}{path} ! Convert the path component \var{path} from an encoded URL to the local ! syntax for a path. This does not accept a complete URL. This ! function uses \function{unquote()} to decode \var{path}. ! \end{funcdesc} \begin{classdesc}{URLopener}{\optional{proxies\optional{, **x509}}} From fdrake@users.sourceforge.net Tue Oct 22 22:58:42 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue, 22 Oct 2002 14:58:42 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib.tex,1.40,1.40.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8832 Modified Files: Tag: release22-maint liburllib.tex Log Message: Moved description of _urlopener adjacent to the related functions. Added missing import to example code. Added documentation for pathname2url(), url2pathname(). Closes SF bug #623196. Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.40 retrieving revision 1.40.8.1 diff -C2 -d -r1.40 -r1.40.8.1 *** liburllib.tex 20 Oct 2001 04:24:09 -0000 1.40 --- liburllib.tex 22 Oct 2002 21:58:39 -0000 1.40.8.1 *************** *** 114,117 **** --- 114,141 ---- \end{funcdesc} + \begin{datadesc}{_urlopener} + The public functions \function{urlopen()} and + \function{urlretrieve()} create an instance of the + \class{FancyURLopener} class and use it to perform their requested + actions. To override this functionality, programmers can create a + subclass of \class{URLopener} or \class{FancyURLopener}, then assign + that an instance of that class to the + \code{urllib._urlopener} variable before calling the desired function. + For example, applications may want to specify a different + \mailheader{User-Agent} header than \class{URLopener} defines. This + can be accomplished with the following code: + + \begin{verbatim} + import urllib + + class AppURLopener(urllib.FancyURLopener): + def __init__(self, *args): + self.version = "App/1.7" + urllib.FancyURLopener.__init__(self, *args) + + urllib._urlopener = AppURLopener() + \end{verbatim} + \end{datadesc} + \begin{funcdesc}{urlcleanup}{} Clear the cache that may have been built up by previous calls to *************** *** 162,184 **** \end{funcdesc} ! The public functions \function{urlopen()} and ! \function{urlretrieve()} create an instance of the ! \class{FancyURLopener} class and use it to perform their requested ! actions. To override this functionality, programmers can create a ! subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! that an instance of that class to the ! \code{urllib._urlopener} variable before calling the desired function. ! For example, applications may want to specify a different ! \mailheader{User-Agent} header than \class{URLopener} defines. This ! can be accomplished with the following code: ! ! \begin{verbatim} ! class AppURLopener(urllib.FancyURLopener): ! def __init__(self, *args): ! self.version = "App/1.7" ! urllib.FancyURLopener.__init__(self, *args) ! urllib._urlopener = AppURLopener() ! \end{verbatim} \begin{classdesc}{URLopener}{\optional{proxies\optional{, **x509}}} --- 186,201 ---- \end{funcdesc} ! \begin{funcdesc}{pathname2url}{path} ! Convert the pathname \var{path} from the local syntax for a path to ! the form used in the path component of a URL. This does not produce a ! complete URL. The return value will already be quoted using the ! \function{quote()} function. ! \end{funcdesc} ! \begin{funcdesc}{url2pathname}{path} ! Convert the path component \var{path} from an encoded URL to the local ! syntax for a path. This does not accept a complete URL. This ! function uses \function{unquote()} to decode \var{path}. ! \end{funcdesc} \begin{classdesc}{URLopener}{\optional{proxies\optional{, **x509}}} From lemburg@users.sourceforge.net Wed Oct 23 10:02:49 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Wed, 23 Oct 2002 02:02:49 -0700 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c,2.172,2.173 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv2038/Objects Modified Files: unicodeobject.c Log Message: Fix for bug #626172: crash using unicode latin1 single char Python 2.2.3 candidate. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.172 retrieving revision 2.173 diff -C2 -d -r2.172 -r2.173 *** unicodeobject.c 11 Oct 2002 00:43:48 -0000 2.172 --- unicodeobject.c 23 Oct 2002 09:02:46 -0000 2.173 *************** *** 4486,4493 **** } u = (PyUnicodeObject *)PyUnicode_FromObject(container); ! if (u == NULL) { ! Py_DECREF(v); goto onError; - } size = PyUnicode_GET_SIZE(v); --- 4486,4491 ---- } u = (PyUnicodeObject *)PyUnicode_FromObject(container); ! if (u == NULL) goto onError; size = PyUnicode_GET_SIZE(v); From lemburg@users.sourceforge.net Wed Oct 23 10:02:48 2002 From: lemburg@users.sourceforge.net (lemburg@users.sourceforge.net) Date: Wed, 23 Oct 2002 02:02:48 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2038/Lib/test Modified Files: test_unicode.py Log Message: Fix for bug #626172: crash using unicode latin1 single char Python 2.2.3 candidate. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** test_unicode.py 14 Sep 2002 09:19:53 -0000 1.71 --- test_unicode.py 23 Oct 2002 09:02:46 -0000 1.72 *************** *** 435,438 **** --- 435,444 ---- vereq((u'' in u'abc'), True) vereq(('' in u'abc'), True) + try: + u'\xe2' in 'g\xe2teau' + except UnicodeError: + pass + else: + print '*** contains operator does not propagate UnicodeErrors' print 'done.' From fdrake@users.sourceforge.net Wed Oct 23 21:24:49 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 23 Oct 2002 13:24:49 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib markup.tex,1.1,1.1.24.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28074 Modified Files: Tag: release22-maint markup.tex Log Message: Deal with a FAQ: Explain that the "xml" package requires that at least one SAX-compliant XML parser be installed, and why this may not be available by default. Point to the PyXML package as an extended version of the "xml" package that can provide this fuctionality. Note that the docs for the xml.dom and xml.sax packages are the definitiona of the Python bindings for the DOM and SAX interfaces. Index: markup.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/markup.tex,v retrieving revision 1.1 retrieving revision 1.1.24.1 diff -C2 -d -r1.1 -r1.1.24.1 *** markup.tex 5 Jul 2000 02:24:38 -0000 1.1 --- markup.tex 23 Oct 2002 20:24:46 -0000 1.1.24.1 *************** *** 8,10 **** --- 8,32 ---- Extensible Markup Language (XML). + It is important to note that modules in the \module{xml} package + require that there be at least one SAX-compliant XML parser + available. Python includes an interface to the Expat parser as the + \refmodule{xml.parsers.expat} module, but this may not be built by + default on all platforms, since Expat is not always installed, or not + installed in the default location for libraries. If this is the case + for your system, the easiest way to add support for the \module{xml} + package is to install the \ulink{PyXML add-on + package}{http://pyxml.sourceforge.net/}. That package provides an + extended set of XML libraries for Python. + + The documentation for the \module{xml.dom} and \module{xml.sax} + packages are the definition of the Python bindings for the DOM and SAX + interfaces. + \localmoduletable + + \begin{seealso} + \seetitle[http://pyxml.sourceforge.net/] + {Python/XML Libraries} + {Home page for the PyXML package, containing an extension + of \module{xml} package bundled with Python.} + \end{seealso} From fdrake@users.sourceforge.net Wed Oct 23 21:58:34 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 23 Oct 2002 13:58:34 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib markup.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv4636 Modified Files: markup.tex Log Message: Point to the PyXML package as an extended version of the "xml" package that can provide this fuctionality. Note that the docs for the xml.dom and xml.sax packages are the definitiona of the Python bindings for the DOM and SAX interfaces. Index: markup.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/markup.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** markup.tex 5 Jul 2000 02:24:38 -0000 1.1 --- markup.tex 23 Oct 2002 20:58:32 -0000 1.2 *************** *** 8,10 **** --- 8,29 ---- Extensible Markup Language (XML). + It is important to note that modules in the \module{xml} package + require that there be at least one SAX-compliant XML parser available. + Starting with Python 2.3, the Expat parser is included with Python, so + the \refmodule{xml.parsers.expat} module will always be available. + You may still want to be aware of the \ulink{PyXML add-on + package}{http://pyxml.sourceforge.net/}; that package provides an + extended set of XML libraries for Python. + + The documentation for the \module{xml.dom} and \module{xml.sax} + packages are the definition of the Python bindings for the DOM and SAX + interfaces. + \localmoduletable + + \begin{seealso} + \seetitle[http://pyxml.sourceforge.net/] + {Python/XML Libraries} + {Home page for the PyXML package, containing an extension + of \module{xml} package bundled with Python.} + \end{seealso} From fdrake@users.sourceforge.net Thu Oct 24 21:55:10 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 13:55:10 -0700 Subject: [Python-checkins] python/dist/src/Doc/api exceptions.tex,1.3.6.3,1.3.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv7649 Modified Files: Tag: release22-maint exceptions.tex Log Message: Correct the description of PyErr_Restore(). Closes SF bug #577000. Index: exceptions.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/exceptions.tex,v retrieving revision 1.3.6.3 retrieving revision 1.3.6.4 diff -C2 -d -r1.3.6.3 -r1.3.6.4 *** exceptions.tex 25 Sep 2002 02:33:47 -0000 1.3.6.3 --- exceptions.tex 24 Oct 2002 20:55:07 -0000 1.3.6.4 *************** *** 103,108 **** \NULL, the error indicator is cleared. Do not pass a \NULL{} type and non-\NULL{} value or traceback. The exception type should be a ! string or class; if it is a class, the value should be an instance ! of that class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to --- 103,107 ---- \NULL, the error indicator is cleared. Do not pass a \NULL{} type and non-\NULL{} value or traceback. The exception type should be a ! string or class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to *************** *** 111,115 **** function. I warned you.) \note{This function is normally only used by code that needs to save and restore the error indicator ! temporarily.} \end{cfuncdesc} --- 110,115 ---- function. I warned you.) \note{This function is normally only used by code that needs to save and restore the error indicator ! temporarily; use \cfunction{PyErr_Fetch()} to save the current ! exception state.} \end{cfuncdesc} From fdrake@users.sourceforge.net Thu Oct 24 21:54:21 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 13:54:21 -0700 Subject: [Python-checkins] python/dist/src/Doc/api exceptions.tex,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv7058 Modified Files: exceptions.tex Log Message: Correct the description of PyErr_Restore(). Closes SF bug #577000. Index: exceptions.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/exceptions.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** exceptions.tex 25 Sep 2002 02:34:27 -0000 1.11 --- exceptions.tex 24 Oct 2002 20:54:18 -0000 1.12 *************** *** 103,108 **** \NULL, the error indicator is cleared. Do not pass a \NULL{} type and non-\NULL{} value or traceback. The exception type should be a ! string or class; if it is a class, the value should be an instance ! of that class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to --- 103,107 ---- \NULL, the error indicator is cleared. Do not pass a \NULL{} type and non-\NULL{} value or traceback. The exception type should be a ! string or class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to *************** *** 111,115 **** function. I warned you.) \note{This function is normally only used by code that needs to save and restore the error indicator ! temporarily.} \end{cfuncdesc} --- 110,115 ---- function. I warned you.) \note{This function is normally only used by code that needs to save and restore the error indicator ! temporarily; use \cfunction{PyErr_Fetch()} to save the current ! exception state.} \end{cfuncdesc} From jvr@users.sourceforge.net Thu Oct 24 21:03:38 2002 From: jvr@users.sourceforge.net (jvr@users.sourceforge.net) Date: Thu, 24 Oct 2002 13:03:38 -0700 Subject: [Python-checkins] python/dist/src/Mac/Tools/IDE PyEdit.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv1377 Modified Files: PyEdit.py Log Message: 'Replace all' in the find dialog didn't properly update the text view (it used to, though...). Fixed. Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** PyEdit.py 12 Jul 2002 12:06:17 -0000 1.32 --- PyEdit.py 24 Oct 2002 20:03:29 -0000 1.33 *************** *** 1030,1038 **** editor.textchanged() editor.selectionchanged() ! editor.ted.WEUseText(Res.Resource(Text)) ! editor.ted.WECalText() ! editor.SetPort() ! editor.GetWindow().InvalWindowRect(editor._bounds) ! #editor.ted.WEUpdate(self.w.wid.GetWindowPort().visRgn) EasyDialogs.Message("Replaced %d occurrences" % counter) --- 1030,1034 ---- editor.textchanged() editor.selectionchanged() ! editor.set(Text) EasyDialogs.Message("Replaced %d occurrences" % counter) From fdrake@users.sourceforge.net Thu Oct 24 20:58:06 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 12:58:06 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref2.tex,1.34.6.5,1.34.6.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv31044 Modified Files: Tag: release22-maint ref2.tex Log Message: Relocate an index entry so named anchors are not generated in a section head. Closes SF bug #546579. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.34.6.5 retrieving revision 1.34.6.6 diff -C2 -d -r1.34.6.5 -r1.34.6.6 *** ref2.tex 24 Sep 2002 21:01:06 -0000 1.34.6.5 --- ref2.tex 24 Oct 2002 19:58:03 -0000 1.34.6.6 *************** *** 116,121 **** ! \subsection{Blank lines \index{blank line}\label{blank-lines}} A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored (i.e., no NEWLINE token is generated). During --- 116,122 ---- ! \subsection{Blank lines \label{blank-lines}} + \index{blank line} A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored (i.e., no NEWLINE token is generated). During From fdrake@users.sourceforge.net Thu Oct 24 20:36:07 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 12:36:07 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib xmldomminidom.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv13635 Modified Files: xmldomminidom.tex Log Message: Update an example to use the DOM implementation object. Explain that the parse() and parseString() functions use a separate parser, not actually implement a parser. (This is a common question.) Index: xmldomminidom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmldomminidom.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xmldomminidom.tex 30 Jun 2002 15:04:59 -0000 1.6 --- xmldomminidom.tex 24 Oct 2002 19:36:04 -0000 1.7 *************** *** 28,32 **** \end{verbatim} ! The parse function can take either a filename or an open file object. \begin{funcdesc}{parse}{filename_or_file{, parser}} --- 28,33 ---- \end{verbatim} ! The \function{parse()} function can take either a filename or an open ! file object. \begin{funcdesc}{parse}{filename_or_file{, parser}} *************** *** 51,64 **** content of the document. ! You can also create a \class{Document} node merely by instantiating a ! document object. Then you could add child nodes to it to populate the DOM: \begin{verbatim} ! from xml.dom.minidom import Document ! newdoc = Document() ! newel = newdoc.createElement("some_tag") ! newdoc.appendChild(newel) \end{verbatim} --- 52,84 ---- content of the document. ! What the \function{parse()} and \function{parseString()} functions do ! is connect an XML parser with a ``DOM builder'' that can accept parse ! events from any SAX parser and convert them into a DOM tree. The name ! of the functions are perhaps misleading, but are easy to grasp when ! learning the interfaces. The parsing of the document will be ! completed before these functions return; it's simply that these ! functions do not provide a parser implementation themselves. ! ! You can also create a \class{Document} by calling a method on a ``DOM ! Implementation'' object. You can get this object either by calling ! the \function{getDOMImplementation()} function in the ! \refmodule{xml.dom} package or the \module{xml.dom.minidom} module. ! Using the implementation from the \module{xml.dom.minidom} module will ! always return a \class{Document} instance from the minidom ! implementation, while the version from \refmodule{xml.dom} may provide ! an alternate implementation (this is likely if you have the ! \ulink{PyXML package}{http://pyxml.sourceforge.net/} installed). Once ! you have a \class{Document}, you can add child nodes to it to populate the DOM: \begin{verbatim} ! from xml.dom.minidom import getDOMImplementation ! impl = getDOMImplementation() ! ! newdoc = impl.createDocument(None, "some_tag", None) ! top_element = newdoc.documentElement ! text = newdoc.createTextNode('Some textual content.') ! top_element.appendChild(text) \end{verbatim} *************** *** 101,105 **** ! \subsection{DOM objects \label{dom-objects}} The definition of the DOM API for Python is given as part of the --- 121,125 ---- ! \subsection{DOM Objects \label{dom-objects}} The definition of the DOM API for Python is given as part of the From fdrake@users.sourceforge.net Thu Oct 24 20:36:43 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 12:36:43 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib xmldomminidom.tex,1.5,1.5.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv13947 Modified Files: Tag: release22-maint xmldomminidom.tex Log Message: Update an example to use the DOM implementation object. Explain that the parse() and parseString() functions use a separate parser, not actually implement a parser. (This is a common question.) Index: xmldomminidom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmldomminidom.tex,v retrieving revision 1.5 retrieving revision 1.5.8.1 diff -C2 -d -r1.5 -r1.5.8.1 *** xmldomminidom.tex 26 Oct 2001 20:09:49 -0000 1.5 --- xmldomminidom.tex 24 Oct 2002 19:36:41 -0000 1.5.8.1 *************** *** 28,32 **** \end{verbatim} ! The parse function can take either a filename or an open file object. \begin{funcdesc}{parse}{filename_or_file{, parser}} --- 28,33 ---- \end{verbatim} ! The \function{parse()} function can take either a filename or an open ! file object. \begin{funcdesc}{parse}{filename_or_file{, parser}} *************** *** 51,64 **** content of the document. ! You can also create a \class{Document} node merely by instantiating a ! document object. Then you could add child nodes to it to populate the DOM: \begin{verbatim} ! from xml.dom.minidom import Document ! newdoc = Document() ! newel = newdoc.createElement("some_tag") ! newdoc.appendChild(newel) \end{verbatim} --- 52,84 ---- content of the document. ! What the \function{parse()} and \function{parseString()} functions do ! is connect an XML parser with a ``DOM builder'' that can accept parse ! events from any SAX parser and convert them into a DOM tree. The name ! of the functions are perhaps misleading, but are easy to grasp when ! learning the interfaces. The parsing of the document will be ! completed before these functions return; it's simply that these ! functions do not provide a parser implementation themselves. ! ! You can also create a \class{Document} by calling a method on a ``DOM ! Implementation'' object. You can get this object either by calling ! the \function{getDOMImplementation()} function in the ! \refmodule{xml.dom} package or the \module{xml.dom.minidom} module. ! Using the implementation from the \module{xml.dom.minidom} module will ! always return a \class{Document} instance from the minidom ! implementation, while the version from \refmodule{xml.dom} may provide ! an alternate implementation (this is likely if you have the ! \ulink{PyXML package}{http://pyxml.sourceforge.net/} installed). Once ! you have a \class{Document}, you can add child nodes to it to populate the DOM: \begin{verbatim} ! from xml.dom.minidom import getDOMImplementation ! impl = getDOMImplementation() ! ! newdoc = impl.createDocument(None, "some_tag", None) ! top_element = newdoc.documentElement ! text = newdoc.createTextNode('Some textual content.') ! top_element.appendChild(text) \end{verbatim} *************** *** 101,105 **** ! \subsection{DOM objects \label{dom-objects}} The definition of the DOM API for Python is given as part of the --- 121,125 ---- ! \subsection{DOM Objects \label{dom-objects}} The definition of the DOM API for Python is given as part of the From fdrake@users.sourceforge.net Thu Oct 24 20:57:40 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 12:57:40 -0700 Subject: [Python-checkins] python/dist/src/Doc/ref ref2.tex,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv30778 Modified Files: ref2.tex Log Message: Relocate an index entry so named anchors are not generated in a section head. Closes SF bug #546579. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ref2.tex 10 Oct 2002 18:24:54 -0000 1.45 --- ref2.tex 24 Oct 2002 19:57:37 -0000 1.46 *************** *** 150,155 **** ! \subsection{Blank lines \index{blank line}\label{blank-lines}} A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored (i.e., no NEWLINE token is generated). During --- 150,156 ---- ! \subsection{Blank lines \label{blank-lines}} + \index{blank line} A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored (i.e., no NEWLINE token is generated). During From fdrake@users.sourceforge.net Thu Oct 24 17:36:08 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu, 24 Oct 2002 09:36:08 -0700 Subject: [Python-checkins] python/dist/src/Doc/perl l2hinit.perl,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv19413 Modified Files: l2hinit.perl Log Message: Clean up some really minor Perl warnings. Index: l2hinit.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** l2hinit.perl 1 Oct 2002 15:20:19 -0000 1.64 --- l2hinit.perl 24 Oct 2002 16:36:05 -0000 1.65 *************** *** 89,93 **** # processing. # ! my $file = @_[0]; my($jobname, $dir, $ext) = fileparse($file, '\..*'); $dir = L2hos->Make_directory_absolute($dir); --- 89,93 ---- # processing. # ! my $file = $_[0]; my($jobname, $dir, $ext) = fileparse($file, '\..*'); $dir = L2hos->Make_directory_absolute($dir); *************** *** 129,133 **** sub get_my_icon($) { ! my $name = @_[0]; my $text = $my_icon_tags{$name}; if ($my_icon_names{$name}) { --- 129,133 ---- sub get_my_icon($) { ! my $name = $_[0]; my $text = $my_icon_tags{$name}; if ($my_icon_names{$name}) { *************** *** 143,147 **** sub use_my_icon($) { ! my $s = @_[0]; if ($s =~ /\/) { my $r = get_my_icon($1); --- 143,147 ---- sub use_my_icon($) { ! my $s = $_[0]; if ($s =~ /\/) { my $r = get_my_icon($1); *************** *** 277,281 **** sub do_cmd_arabic { # get rid of that nasty ... ! my($ctr, $val, $id, $text) = &read_counter_value(@_[0]); return ($val ? farabic($val) : "0") . $text; } --- 277,281 ---- sub do_cmd_arabic { # get rid of that nasty ... ! my($ctr, $val, $id, $text) = &read_counter_value($_[0]); return ($val ? farabic($val) : "0") . $text; } *************** *** 321,325 **** my $prefix = ''; foreach $key (keys %Modules) { ! $key =~ s/([a-zA-Z0-9._]*)<\/tt>/\1/; my $plat = "$ModulePlatforms{$key}"; $plat = '' --- 321,325 ---- my $prefix = ''; foreach $key (keys %Modules) { ! $key =~ s/([a-zA-Z0-9._]*)<\/tt>/$1/; my $plat = "$ModulePlatforms{$key}"; $plat = '' *************** *** 338,342 **** my $moditem = "$Modules{$key}"; my $plat = ''; ! $key =~ s/([a-zA-Z0-9._]*)<\/tt>/\1/; if ($ModulePlatforms{$key} && !$allthesame) { $plat = (" ($ModulePlatforms{$key}" --- 338,342 ---- my $moditem = "$Modules{$key}"; my $plat = ''; ! $key =~ s/([a-zA-Z0-9._]*)<\/tt>/$1/; if ($ModulePlatforms{$key} && !$allthesame) { $plat = (" ($ModulePlatforms{$key}" *************** *** 504,508 **** my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)" . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; ! s/$rx/\\textohtmlmoduleindex \1 \\textohtmlindex \2/o; # Add a button to the navigation areas: $CUSTOM_BUTTONS .= ('' --- 504,508 ---- my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)" . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; ! s/$rx/\\textohtmlmoduleindex $1 \\textohtmlindex $2/o; # Add a button to the navigation areas: $CUSTOM_BUTTONS .= ('' *************** *** 515,519 **** print "\nadd_bbl_and_idx_dummy_commands ==> adding general index"; my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; ! s/$rx/\\textohtmlindex \1/o; $HAVE_GENERAL_INDEX = 1; } --- 515,519 ---- print "\nadd_bbl_and_idx_dummy_commands ==> adding general index"; my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; ! s/$rx/\\textohtmlindex $1/o; $HAVE_GENERAL_INDEX = 1; } From fdrake@users.sourceforge.net Fri Oct 25 17:56:18 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 09:56:18 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex,1.80.6.14,1.80.6.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26437 Modified Files: Tag: release22-maint libstdtypes.tex Log Message: - The "-" format flag overrides the "0" flag, not the "-" flag. - Documented the alternate forms, which were claimed to be documented but were not. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.80.6.14 retrieving revision 1.80.6.15 diff -C2 -d -r1.80.6.14 -r1.80.6.15 *** libstdtypes.tex 5 Oct 2002 15:41:56 -0000 1.80.6.14 --- libstdtypes.tex 25 Oct 2002 16:56:16 -0000 1.80.6.15 *************** *** 791,795 **** \lineii{0}{The conversion will be zero padded.} \lineii{-}{The converted value is left adjusted (overrides ! \character{-}).} \lineii{{~}}{(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion.} --- 791,795 ---- \lineii{0}{The conversion will be zero padded.} \lineii{-}{The converted value is left adjusted (overrides ! the \character{0} conversion if both are given).} \lineii{{~}}{(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion.} *************** *** 803,835 **** The conversion types are: ! \begin{tableii}{c|l}{character}{Conversion}{Meaning} ! \lineii{d}{Signed integer decimal.} ! \lineii{i}{Signed integer decimal.} ! \lineii{o}{Unsigned octal.} ! \lineii{u}{Unsigned decimal.} ! \lineii{x}{Unsigned hexidecimal (lowercase).} ! \lineii{X}{Unsigned hexidecimal (uppercase).} ! \lineii{e}{Floating point exponential format (lowercase).} ! \lineii{E}{Floating point exponential format (uppercase).} ! \lineii{f}{Floating point decimal format.} ! \lineii{F}{Floating point decimal format.} ! \lineii{g}{Same as \character{e} if exponent is greater than -4 or ! less than precision, \character{f} otherwise.} ! \lineii{G}{Same as \character{E} if exponent is greater than -4 or ! less than precision, \character{F} otherwise.} ! \lineii{c}{Single character (accepts integer or single character ! string).} ! \lineii{r}{String (converts any python object using ! \function{repr()}).} ! \lineii{s}{String (converts any python object using ! \function{str()}).} ! \lineii{\%}{No argument is converted, results in a \character{\%} ! character in the result. (The complete specification is ! \code{\%\%}.)} ! \end{tableii} ! % XXX Examples? ! (The \code{\%r} conversion was added in Python 2.0.) Since Python strings have an explicit length, \code{\%s} conversions --- 803,850 ---- The conversion types are: ! \begin{tableiii}{c|l|c}{character}{Conversion}{Meaning}{Notes} ! \lineiii{d}{Signed integer decimal.}{} ! \lineiii{i}{Signed integer decimal.}{} ! \lineiii{o}{Unsigned octal.}{(1)} ! \lineiii{u}{Unsigned decimal.}{} ! \lineiii{x}{Unsigned hexidecimal (lowercase).}{(2)} ! \lineiii{X}{Unsigned hexidecimal (uppercase).}{(2)} ! \lineiii{e}{Floating point exponential format (lowercase).}{} ! \lineiii{E}{Floating point exponential format (uppercase).}{} ! \lineiii{f}{Floating point decimal format.}{} ! \lineiii{F}{Floating point decimal format.}{} ! \lineiii{g}{Same as \character{e} if exponent is greater than -4 or ! less than precision, \character{f} otherwise.}{} ! \lineiii{G}{Same as \character{E} if exponent is greater than -4 or ! less than precision, \character{F} otherwise.}{} ! \lineiii{c}{Single character (accepts integer or single character ! string).}{} ! \lineiii{r}{String (converts any python object using ! \function{repr()}).}{(3)} ! \lineiii{s}{String (converts any python object using ! \function{str()}).}{} ! \lineiii{\%}{No argument is converted, results in a \character{\%} ! character in the result.}{} ! \end{tableiii} ! \noindent ! Notes: ! \begin{description} ! \item[(1)] ! The alternate form causes a leading zero (\character{0}) to be ! inserted between left-hand padding and the formatting of the ! number if the leading character of the result is not already a ! zero. ! \item[(2)] ! The alternate form causes a leading \code{'0x'} or \code{'0X'} ! (depending on whether the \character{x} or \character{X} format ! was used) to be inserted between left-hand padding and the ! formatting of the number if the leading character of the result is ! not already a zero. ! \item[(3)] ! The \code{\%r} conversion was added in Python 2.0. ! \end{description} ! % XXX Examples? Since Python strings have an explicit length, \code{\%s} conversions From fdrake@users.sourceforge.net Fri Oct 25 17:55:54 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 09:55:54 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex,1.106,1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26217 Modified Files: libstdtypes.tex Log Message: - The "-" format flag overrides the "0" flag, not the "-" flag. - Documented the alternate forms, which were claimed to be documented but were not. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** libstdtypes.tex 24 Sep 2002 15:32:04 -0000 1.106 --- libstdtypes.tex 25 Oct 2002 16:55:51 -0000 1.107 *************** *** 799,803 **** \lineii{0}{The conversion will be zero padded.} \lineii{-}{The converted value is left adjusted (overrides ! \character{-}).} \lineii{{~}}{(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion.} --- 799,803 ---- \lineii{0}{The conversion will be zero padded.} \lineii{-}{The converted value is left adjusted (overrides ! the \character{0} conversion if both are given).} \lineii{{~}}{(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion.} *************** *** 811,843 **** The conversion types are: ! \begin{tableii}{c|l}{character}{Conversion}{Meaning} ! \lineii{d}{Signed integer decimal.} ! \lineii{i}{Signed integer decimal.} ! \lineii{o}{Unsigned octal.} ! \lineii{u}{Unsigned decimal.} ! \lineii{x}{Unsigned hexidecimal (lowercase).} ! \lineii{X}{Unsigned hexidecimal (uppercase).} ! \lineii{e}{Floating point exponential format (lowercase).} ! \lineii{E}{Floating point exponential format (uppercase).} ! \lineii{f}{Floating point decimal format.} ! \lineii{F}{Floating point decimal format.} ! \lineii{g}{Same as \character{e} if exponent is greater than -4 or ! less than precision, \character{f} otherwise.} ! \lineii{G}{Same as \character{E} if exponent is greater than -4 or ! less than precision, \character{F} otherwise.} ! \lineii{c}{Single character (accepts integer or single character ! string).} ! \lineii{r}{String (converts any python object using ! \function{repr()}).} ! \lineii{s}{String (converts any python object using ! \function{str()}).} ! \lineii{\%}{No argument is converted, results in a \character{\%} ! character in the result. (The complete specification is ! \code{\%\%}.)} ! \end{tableii} ! % XXX Examples? ! (The \code{\%r} conversion was added in Python 2.0.) Since Python strings have an explicit length, \code{\%s} conversions --- 811,858 ---- The conversion types are: ! \begin{tableiii}{c|l|c}{character}{Conversion}{Meaning}{Notes} ! \lineiii{d}{Signed integer decimal.}{} ! \lineiii{i}{Signed integer decimal.}{} ! \lineiii{o}{Unsigned octal.}{(1)} ! \lineiii{u}{Unsigned decimal.}{} ! \lineiii{x}{Unsigned hexidecimal (lowercase).}{(2)} ! \lineiii{X}{Unsigned hexidecimal (uppercase).}{(2)} ! \lineiii{e}{Floating point exponential format (lowercase).}{} ! \lineiii{E}{Floating point exponential format (uppercase).}{} ! \lineiii{f}{Floating point decimal format.}{} ! \lineiii{F}{Floating point decimal format.}{} ! \lineiii{g}{Same as \character{e} if exponent is greater than -4 or ! less than precision, \character{f} otherwise.}{} ! \lineiii{G}{Same as \character{E} if exponent is greater than -4 or ! less than precision, \character{F} otherwise.}{} ! \lineiii{c}{Single character (accepts integer or single character ! string).}{} ! \lineiii{r}{String (converts any python object using ! \function{repr()}).}{(3)} ! \lineiii{s}{String (converts any python object using ! \function{str()}).}{} ! \lineiii{\%}{No argument is converted, results in a \character{\%} ! character in the result.}{} ! \end{tableiii} ! \noindent ! Notes: ! \begin{description} ! \item[(1)] ! The alternate form causes a leading zero (\character{0}) to be ! inserted between left-hand padding and the formatting of the ! number if the leading character of the result is not already a ! zero. ! \item[(2)] ! The alternate form causes a leading \code{'0x'} or \code{'0X'} ! (depending on whether the \character{x} or \character{X} format ! was used) to be inserted between left-hand padding and the ! formatting of the number if the leading character of the result is ! not already a zero. ! \item[(3)] ! The \code{\%r} conversion was added in Python 2.0. ! \end{description} ! % XXX Examples? Since Python strings have an explicit length, \code{\%s} conversions From fdrake@users.sourceforge.net Fri Oct 25 19:08:20 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 11:08:20 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv32549 Modified Files: ConfigParser.py Log Message: Re-factor: Use a RawConfigParser base class and make ConfigParser a derived class that adds the ugly string interpolation code. In the process, changed all "__" methods and instance variables to "_". Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** ConfigParser.py 27 Sep 2002 16:21:16 -0000 1.47 --- ConfigParser.py 25 Oct 2002 18:08:18 -0000 1.48 *************** *** 173,191 **** ! class ConfigParser: def __init__(self, defaults=None): ! self.__sections = {} if defaults is None: ! self.__defaults = {} else: ! self.__defaults = defaults def defaults(self): ! return self.__defaults def sections(self): """Return a list of section names, excluding [DEFAULT]""" ! # self.__sections will never have [DEFAULT] in it ! return self.__sections.keys() def add_section(self, section): --- 173,191 ---- ! class RawConfigParser: def __init__(self, defaults=None): ! self._sections = {} if defaults is None: ! self._defaults = {} else: ! self._defaults = defaults def defaults(self): ! return self._defaults def sections(self): """Return a list of section names, excluding [DEFAULT]""" ! # self._sections will never have [DEFAULT] in it ! return self._sections.keys() def add_section(self, section): *************** *** 195,201 **** already exists. """ ! if section in self.__sections: raise DuplicateSectionError(section) ! self.__sections[section] = {} def has_section(self, section): --- 195,201 ---- already exists. """ ! if section in self._sections: raise DuplicateSectionError(section) ! self._sections[section] = {} def has_section(self, section): *************** *** 204,216 **** The DEFAULT section is not acknowledged. """ ! return section in self.__sections def options(self, section): """Return a list of option names for the given section name.""" try: ! opts = self.__sections[section].copy() except KeyError: raise NoSectionError(section) ! opts.update(self.__defaults) if '__name__' in opts: del opts['__name__'] --- 204,216 ---- The DEFAULT section is not acknowledged. """ ! return section in self._sections def options(self, section): """Return a list of option names for the given section name.""" try: ! opts = self._sections[section].copy() except KeyError: raise NoSectionError(section) ! opts.update(self._defaults) if '__name__' in opts: del opts['__name__'] *************** *** 234,238 **** except IOError: continue ! self.__read(fp, filename) fp.close() --- 234,238 ---- except IOError: continue ! self._read(fp, filename) fp.close() *************** *** 251,340 **** except AttributeError: filename = '' ! self.__read(fp, filename) ! ! def get(self, section, option, raw=0, vars=None): ! """Get an option value for a given section. ! ! All % interpolations are expanded in the return values, based on the ! defaults passed into the constructor, unless the optional argument ! `raw' is true. Additional substitutions may be provided using the ! `vars' argument, which must be a dictionary whose contents overrides ! any pre-existing defaults. ! The section DEFAULT is special. ! """ ! d = self.__defaults.copy() ! try: ! d.update(self.__sections[section]) ! except KeyError: if section != DEFAULTSECT: raise NoSectionError(section) ! # Update with the entry specific variables ! if vars is not None: ! d.update(vars) ! option = self.optionxform(option) ! try: ! value = d[option] ! except KeyError: raise NoOptionError(option, section) ! if raw: ! return value ! return self._interpolate(section, option, value, d) ! ! def items(self, section, raw=0, vars=None): ! """Return a list of tuples with (name, value) for each option ! in the section. ! ! All % interpolations are expanded in the return values, based on the ! defaults passed into the constructor, unless the optional argument ! `raw' is true. Additional substitutions may be provided using the ! `vars' argument, which must be a dictionary whose contents overrides ! any pre-existing defaults. ! ! The section DEFAULT is special. ! """ ! d = self.__defaults.copy() try: ! d.update(self.__sections[section]) except KeyError: if section != DEFAULTSECT: raise NoSectionError(section) ! # Update with the entry specific variables ! if vars: ! d.update(vars) ! if raw: ! for option in self.options(section): ! yield (option, d[option]) ! else: ! for option in self.options(section): ! yield (option, ! self._interpolate(section, option, d[option], d)) ! ! def _interpolate(self, section, option, rawval, vars): ! # do the string interpolation ! value = rawval ! depth = MAX_INTERPOLATION_DEPTH ! while depth: # Loop through this until it's done ! depth -= 1 ! if value.find("%(") != -1: ! try: ! value = value % vars ! except KeyError, key: ! raise InterpolationError(key, option, section, rawval) ! else: ! break ! if value.find("%(") != -1: ! raise InterpolationDepthError(option, section, rawval) ! return value ! def __get(self, section, conv, option): return conv(self.get(section, option)) def getint(self, section, option): ! return self.__get(section, int, option) def getfloat(self, section, option): ! return self.__get(section, float, option) _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, --- 251,290 ---- except AttributeError: filename = '' ! self._read(fp, filename) ! def get(self, section, option): ! opt = self.optionxform(option) ! if section not in self._sections: if section != DEFAULTSECT: raise NoSectionError(section) ! if opt in self._defaults: ! return self._defaults[opt] ! else: ! raise NoOptionError(option, section) ! elif opt in self._sections[section]: ! return self._sections[section][opt] ! elif opt in self._defaults: ! return self._defaults[opt] ! else: raise NoOptionError(option, section) ! def items(self, section): try: ! d2 = self._sections[section] except KeyError: if section != DEFAULTSECT: raise NoSectionError(section) ! d = self._defaults.copy() ! d.update(d2) ! return d.items() ! def _get(self, section, conv, option): return conv(self.get(section, option)) def getint(self, section, option): ! return self._get(section, int, option) def getfloat(self, section, option): ! return self._get(section, float, option) _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, *************** *** 354,372 **** if not section or section == DEFAULTSECT: option = self.optionxform(option) ! return option in self.__defaults ! elif section not in self.__sections: return 0 else: option = self.optionxform(option) ! return (option in self.__sections[section] ! or option in self.__defaults) def set(self, section, option, value): """Set an option.""" if not section or section == DEFAULTSECT: ! sectdict = self.__defaults else: try: ! sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) --- 304,322 ---- if not section or section == DEFAULTSECT: option = self.optionxform(option) ! return option in self._defaults ! elif section not in self._sections: return 0 else: option = self.optionxform(option) ! return (option in self._sections[section] ! or option in self._defaults) def set(self, section, option, value): """Set an option.""" if not section or section == DEFAULTSECT: ! sectdict = self._defaults else: try: ! sectdict = self._sections[section] except KeyError: raise NoSectionError(section) *************** *** 375,386 **** def write(self, fp): """Write an .ini-format representation of the configuration state.""" ! if self.__defaults: fp.write("[%s]\n" % DEFAULTSECT) ! for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") ! for section in self.__sections: fp.write("[%s]\n" % section) ! for (key, value) in self.__sections[section].items(): if key != "__name__": fp.write("%s = %s\n" % --- 325,336 ---- def write(self, fp): """Write an .ini-format representation of the configuration state.""" ! if self._defaults: fp.write("[%s]\n" % DEFAULTSECT) ! for (key, value) in self._defaults.items(): fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") ! for section in self._sections: fp.write("[%s]\n" % section) ! for (key, value) in self._sections[section].items(): if key != "__name__": fp.write("%s = %s\n" % *************** *** 391,398 **** """Remove an option.""" if not section or section == DEFAULTSECT: ! sectdict = self.__defaults else: try: ! sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) --- 341,348 ---- """Remove an option.""" if not section or section == DEFAULTSECT: ! sectdict = self._defaults else: try: ! sectdict = self._sections[section] except KeyError: raise NoSectionError(section) *************** *** 405,411 **** def remove_section(self, section): """Remove a file section.""" ! existed = section in self.__sections if existed: ! del self.__sections[section] return existed --- 355,361 ---- def remove_section(self, section): """Remove a file section.""" ! existed = section in self._sections if existed: ! del self._sections[section] return existed *************** *** 427,431 **** ) ! def __read(self, fp, fpname): """Parse a sectioned setup file. --- 377,381 ---- ) ! def _read(self, fp, fpname): """Parse a sectioned setup file. *************** *** 463,473 **** if mo: sectname = mo.group('header') ! if sectname in self.__sections: ! cursect = self.__sections[sectname] elif sectname == DEFAULTSECT: ! cursect = self.__defaults else: cursect = {'__name__': sectname} ! self.__sections[sectname] = cursect # So sections can't start with a continuation line optname = None --- 413,423 ---- if mo: sectname = mo.group('header') ! if sectname in self._sections: ! cursect = self._sections[sectname] elif sectname == DEFAULTSECT: ! cursect = self._defaults else: cursect = {'__name__': sectname} ! self._sections[sectname] = cursect # So sections can't start with a continuation line optname = None *************** *** 503,504 **** --- 453,534 ---- if e: raise e + + + class ConfigParser(RawConfigParser): + + def get(self, section, option, raw=0, vars=None): + """Get an option value for a given section. + + All % interpolations are expanded in the return values, based on the + defaults passed into the constructor, unless the optional argument + `raw' is true. Additional substitutions may be provided using the + `vars' argument, which must be a dictionary whose contents overrides + any pre-existing defaults. + + The section DEFAULT is special. + """ + d = self._defaults.copy() + try: + d.update(self._sections[section]) + except KeyError: + if section != DEFAULTSECT: + raise NoSectionError(section) + # Update with the entry specific variables + if vars is not None: + d.update(vars) + option = self.optionxform(option) + try: + value = d[option] + except KeyError: + raise NoOptionError(option, section) + + if raw: + return value + else: + return self._interpolate(section, option, value, d) + + def items(self, section, raw=0, vars=None): + """Return a list of tuples with (name, value) for each option + in the section. + + All % interpolations are expanded in the return values, based on the + defaults passed into the constructor, unless the optional argument + `raw' is true. Additional substitutions may be provided using the + `vars' argument, which must be a dictionary whose contents overrides + any pre-existing defaults. + + The section DEFAULT is special. + """ + d = self._defaults.copy() + try: + d.update(self._sections[section]) + except KeyError: + if section != DEFAULTSECT: + raise NoSectionError(section) + # Update with the entry specific variables + if vars: + d.update(vars) + if raw: + for option in self.options(section): + yield (option, d[option]) + else: + for option in self.options(section): + yield (option, + self._interpolate(section, option, d[option], d)) + + def _interpolate(self, section, option, rawval, vars): + # do the string interpolation + value = rawval + depth = MAX_INTERPOLATION_DEPTH + while depth: # Loop through this until it's done + depth -= 1 + if value.find("%(") != -1: + try: + value = value % vars + except KeyError, key: + raise InterpolationError(key, option, section, rawval) + else: + break + if value.find("%(") != -1: + raise InterpolationDepthError(option, section, rawval) + return value From fdrake@users.sourceforge.net Fri Oct 25 19:09:26 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 11:09:26 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_cfgparser.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv415 Modified Files: test_cfgparser.py Log Message: Added (very) minimal tests of the RawConfigParser class. Moved the write() test to near the end of the file since it screws up font-lock. ;-( Index: test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_cfgparser.py 27 Sep 2002 16:21:18 -0000 1.14 --- test_cfgparser.py 25 Oct 2002 18:09:24 -0000 1.15 *************** *** 56,75 **** - def write(src): - print "Testing writing of files..." - cf = ConfigParser.ConfigParser() - sio = StringIO.StringIO(src) - cf.readfp(sio) - output = StringIO.StringIO() - cf.write(output) - verify(output, """[DEFAULT] - foo = another very - long line - - [Long Line] - foo = this line is much, much longer than my editor - likes it. - """) - def case_sensitivity(): print "Testing case sensitivity..." --- 56,59 ---- *************** *** 139,142 **** --- 123,140 ---- expect_get_error(cf, ConfigParser.InterpolationDepthError, "Foo", "bar11") + # Now make sure we don't interpolate if we use RawConfigParser: + cf = ConfigParser.RawConfigParser({"getname": "%(__name__)s"}) + sio = StringIO.StringIO(src) + cf.readfp(sio) + verify(cf.get("Foo", "getname") == "%(__name__)s") + verify(cf.get("Foo", "bar") + == "something %(with1)s interpolation (1 step)") + verify(cf.get("Foo", "bar9") + == "something %(with9)s lots of interpolation (9 steps)") + verify(cf.get("Foo", "bar10") + == "something %(with10)s lots of interpolation (10 steps)") + verify(cf.get("Foo", "bar11") + == "something %(with11)s lots of interpolation (11 steps)") + def parse_errors(): *************** *** 211,214 **** --- 209,233 ---- else: raise TestFailed("Failed to catch expected " + exctype.__name__) + + + # The long string literals present in the rest of the file screw up + # font-lock in Emacs/XEmacs, so this stuff needs to stay near the end + # of this file. + + def write(src): + print "Testing writing of files..." + cf = ConfigParser.ConfigParser() + sio = StringIO.StringIO(src) + cf.readfp(sio) + output = StringIO.StringIO() + cf.write(output) + verify(output, """[DEFAULT] + foo = another very + long line + + [Long Line] + foo = this line is much, much longer than my editor + likes it. + """) From fdrake@users.sourceforge.net Fri Oct 25 20:40:52 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 12:40:52 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_cfgparser.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2828 Modified Files: test_cfgparser.py Log Message: Convert to PyUnit. Index: test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_cfgparser.py 25 Oct 2002 18:09:24 -0000 1.15 --- test_cfgparser.py 25 Oct 2002 19:40:49 -0000 1.16 *************** *** 1,303 **** import ConfigParser import StringIO ! from test.test_support import TestFailed, verify ! ! ! def basic(src): ! print "Testing basic accessors..." ! cf = ConfigParser.ConfigParser() ! sio = StringIO.StringIO(src) ! cf.readfp(sio) ! L = cf.sections() ! L.sort() ! verify(L == [r'Commented Bar', ! r'Foo Bar', ! r'Internationalized Stuff', ! r'Long Line', ! r'Section\with$weird%characters[' '\t', ! r'Spaces', ! r'Spacey Bar', ! ], ! "unexpected list of section names") - # The use of spaces in the section names serves as a regression test for - # SourceForge bug #115357. - # http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=115357 - verify(cf.get('Foo Bar', 'foo', raw=1) == 'bar') - verify(cf.get('Spacey Bar', 'foo', raw=1) == 'bar') - verify(cf.get('Commented Bar', 'foo', raw=1) == 'bar') - verify(cf.get('Spaces', 'key with spaces', raw=1) == 'value') - verify(cf.get('Spaces', 'another with spaces', raw=1) == 'splat!') ! verify('__name__' not in cf.options("Foo Bar"), ! '__name__ "option" should not be exposed by the API!') ! # Make sure the right things happen for remove_option(); ! # added to include check for SourceForge bug #123324: ! verify(cf.remove_option('Foo Bar', 'foo'), ! "remove_option() failed to report existance of option") ! verify(not cf.has_option('Foo Bar', 'foo'), ! "remove_option() failed to remove option") ! verify(not cf.remove_option('Foo Bar', 'foo'), ! "remove_option() failed to report non-existance of option" ! " that was removed") ! try: ! cf.remove_option('No Such Section', 'foo') ! except ConfigParser.NoSectionError: ! pass ! else: ! raise TestFailed( ! "remove_option() failed to report non-existance of option" ! " that never existed") ! verify(cf.get('Long Line', 'foo', raw=1) == ! 'this line is much, much longer than my editor\nlikes it.') ! def case_sensitivity(): ! print "Testing case sensitivity..." ! cf = ConfigParser.ConfigParser() ! cf.add_section("A") ! cf.add_section("a") ! L = cf.sections() ! L.sort() ! verify(L == ["A", "a"]) ! cf.set("a", "B", "value") ! verify(cf.options("a") == ["b"]) ! verify(cf.get("a", "b", raw=1) == "value", ! "could not locate option, expecting case-insensitive option names") ! verify(cf.has_option("a", "b")) ! cf.set("A", "A-B", "A-B value") ! for opt in ("a-b", "A-b", "a-B", "A-B"): ! verify(cf.has_option("A", opt), ! "has_option() returned false for option which should exist") ! verify(cf.options("A") == ["a-b"]) ! verify(cf.options("a") == ["b"]) ! cf.remove_option("a", "B") ! verify(cf.options("a") == []) ! # SF bug #432369: ! cf = ConfigParser.ConfigParser() ! sio = StringIO.StringIO("[MySection]\nOption: first line\n\tsecond line\n") ! cf.readfp(sio) ! verify(cf.options("MySection") == ["option"]) ! verify(cf.get("MySection", "Option") == "first line\nsecond line") ! # SF bug #561822: ! cf = ConfigParser.ConfigParser(defaults={"key":"value"}) ! cf.readfp(StringIO.StringIO("[section]\nnekey=nevalue\n")) ! verify(cf.has_option("section", "Key")) ! def boolean(src): ! print "Testing interpretation of boolean Values..." ! cf = ConfigParser.ConfigParser() ! sio = StringIO.StringIO(src) ! cf.readfp(sio) ! for x in range(1, 5): ! verify(cf.getboolean('BOOLTEST', 't%d' % (x)) == 1) ! for x in range(1, 5): ! verify(cf.getboolean('BOOLTEST', 'f%d' % (x)) == 0) ! for x in range(1, 5): ! try: ! cf.getboolean('BOOLTEST', 'e%d' % (x)) ! except ValueError: ! pass ! else: ! raise TestFailed( ! "getboolean() failed to report a non boolean value") ! def interpolation(src): ! print "Testing value interpolation..." ! cf = ConfigParser.ConfigParser({"getname": "%(__name__)s"}) ! sio = StringIO.StringIO(src) ! cf.readfp(sio) ! verify(cf.get("Foo", "getname") == "Foo") ! verify(cf.get("Foo", "bar") == "something with interpolation (1 step)") ! verify(cf.get("Foo", "bar9") ! == "something with lots of interpolation (9 steps)") ! verify(cf.get("Foo", "bar10") ! == "something with lots of interpolation (10 steps)") ! expect_get_error(cf, ConfigParser.InterpolationDepthError, "Foo", "bar11") - # Now make sure we don't interpolate if we use RawConfigParser: - cf = ConfigParser.RawConfigParser({"getname": "%(__name__)s"}) - sio = StringIO.StringIO(src) - cf.readfp(sio) - verify(cf.get("Foo", "getname") == "%(__name__)s") - verify(cf.get("Foo", "bar") - == "something %(with1)s interpolation (1 step)") - verify(cf.get("Foo", "bar9") - == "something %(with9)s lots of interpolation (9 steps)") - verify(cf.get("Foo", "bar10") - == "something %(with10)s lots of interpolation (10 steps)") - verify(cf.get("Foo", "bar11") - == "something %(with11)s lots of interpolation (11 steps)") ! def parse_errors(): ! print "Testing parse errors..." ! expect_parse_error(ConfigParser.ParsingError, ! """[Foo]\n extra-spaces: splat\n""") ! expect_parse_error(ConfigParser.ParsingError, ! """[Foo]\n extra-spaces= splat\n""") ! expect_parse_error(ConfigParser.ParsingError, ! """[Foo]\noption-without-value\n""") ! expect_parse_error(ConfigParser.ParsingError, ! """[Foo]\n:value-without-option-name\n""") ! expect_parse_error(ConfigParser.ParsingError, ! """[Foo]\n=value-without-option-name\n""") ! expect_parse_error(ConfigParser.MissingSectionHeaderError, ! """No Section!\n""") ! def query_errors(): ! print "Testing query interface..." ! cf = ConfigParser.ConfigParser() ! verify(cf.sections() == [], ! "new ConfigParser should have no defined sections") ! verify(not cf.has_section("Foo"), ! "new ConfigParser should have no acknowledged sections") ! try: ! cf.options("Foo") ! except ConfigParser.NoSectionError, e: ! pass ! else: ! raise TestFailed( ! "Failed to catch expected NoSectionError from options()") ! try: ! cf.set("foo", "bar", "value") ! except ConfigParser.NoSectionError, e: ! pass ! else: ! raise TestFailed("Failed to catch expected NoSectionError from set()") ! expect_get_error(cf, ConfigParser.NoSectionError, "foo", "bar") ! cf.add_section("foo") ! expect_get_error(cf, ConfigParser.NoOptionError, "foo", "bar") ! def weird_errors(): ! print "Testing miscellaneous error conditions..." ! cf = ConfigParser.ConfigParser() ! cf.add_section("Foo") ! try: cf.add_section("Foo") ! except ConfigParser.DuplicateSectionError, e: ! pass ! else: ! raise TestFailed("Failed to catch expected DuplicateSectionError") ! def expect_get_error(cf, exctype, section, option, raw=0): ! try: ! cf.get(section, option, raw=raw) ! except exctype, e: ! pass ! else: ! raise TestFailed("Failed to catch expected " + exctype.__name__) ! def expect_parse_error(exctype, src): ! cf = ConfigParser.ConfigParser() ! sio = StringIO.StringIO(src) ! try: ! cf.readfp(sio) ! except exctype, e: ! pass ! else: ! raise TestFailed("Failed to catch expected " + exctype.__name__) - # The long string literals present in the rest of the file screw up - # font-lock in Emacs/XEmacs, so this stuff needs to stay near the end - # of this file. ! def write(src): ! print "Testing writing of files..." ! cf = ConfigParser.ConfigParser() ! sio = StringIO.StringIO(src) ! cf.readfp(sio) ! output = StringIO.StringIO() ! cf.write(output) ! verify(output, """[DEFAULT] ! foo = another very ! long line ! [Long Line] ! foo = this line is much, much longer than my editor ! likes it. ! """) ! basic(r""" ! [Foo Bar] ! foo=bar ! [Spacey Bar] ! foo = bar ! [Commented Bar] ! foo: bar ; comment ! [Long Line] ! foo: this line is much, much longer than my editor ! likes it. ! [Section\with$weird%characters[""" '\t' r"""] ! [Internationalized Stuff] ! foo[bg]: Bulgarian ! foo=Default ! foo[en]=English ! foo[de]=Deutsch ! [Spaces] ! key with spaces : value ! another with spaces = splat! ! """) ! write("""[Long Line] ! foo: this line is much, much longer than my editor ! likes it. ! [DEFAULT] ! foo: another very ! long line""") ! case_sensitivity() ! boolean(r""" ! [BOOLTEST] ! T1=1 ! T2=TRUE ! T3=True ! T4=oN ! T5=yes ! F1=0 ! F2=FALSE ! F3=False ! F4=oFF ! F5=nO ! E1=2 ! E2=foo ! E3=-1 ! E4=0.1 ! E5=FALSE AND MORE ! """) ! interpolation(r""" ! [Foo] ! bar=something %(with1)s interpolation (1 step) ! bar9=something %(with9)s lots of interpolation (9 steps) ! bar10=something %(with10)s lots of interpolation (10 steps) ! bar11=something %(with11)s lots of interpolation (11 steps) ! with11=%(with10)s ! with10=%(with9)s ! with9=%(with8)s ! with8=%(with7)s ! with7=%(with6)s ! with6=%(with5)s ! with5=%(with4)s ! with4=%(with3)s ! with3=%(with2)s ! with2=%(with1)s ! with1=with ! [Mutual Recursion] ! foo=%(bar)s ! bar=%(foo)s ! """) ! parse_errors() ! query_errors() ! weird_errors() --- 1,273 ---- import ConfigParser import StringIO + import unittest ! from test import test_support ! class TestCaseBase(unittest.TestCase): ! def newconfig(self, defaults=None): ! if defaults is None: ! self.cf = self.config_class() ! else: ! self.cf = self.config_class(defaults) ! return self.cf ! def fromstring(self, string, defaults=None): ! cf = self.newconfig(defaults) ! sio = StringIO.StringIO(string) ! cf.readfp(sio) ! return cf ! def test_basic(self): ! cf = self.fromstring( ! "[Foo Bar]\n" ! "foo=bar\n" ! "[Spacey Bar]\n" ! "foo = bar\n" ! "[Commented Bar]\n" ! "foo: bar ; comment\n" ! "[Long Line]\n" ! "foo: this line is much, much longer than my editor\n" ! " likes it.\n" ! "[Section\\with$weird%characters[\t]\n" ! "[Internationalized Stuff]\n" ! "foo[bg]: Bulgarian\n" ! "foo=Default\n" ! "foo[en]=English\n" ! "foo[de]=Deutsch\n" ! "[Spaces]\n" ! "key with spaces : value\n" ! "another with spaces = splat!\n" ! ) ! L = cf.sections() ! L.sort() ! eq = self.assertEqual ! eq(L, [r'Commented Bar', ! r'Foo Bar', ! r'Internationalized Stuff', ! r'Long Line', ! r'Section\with$weird%characters[' '\t', ! r'Spaces', ! r'Spacey Bar', ! ]) + # The use of spaces in the section names serves as a + # regression test for SourceForge bug #583248: + # http://www.python.org/sf/583248 + eq(cf.get('Foo Bar', 'foo'), 'bar') + eq(cf.get('Spacey Bar', 'foo'), 'bar') + eq(cf.get('Commented Bar', 'foo'), 'bar') + eq(cf.get('Spaces', 'key with spaces'), 'value') + eq(cf.get('Spaces', 'another with spaces'), 'splat!') ! self.failIf('__name__' in cf.options("Foo Bar"), ! '__name__ "option" should not be exposed by the API!') ! # Make sure the right things happen for remove_option(); ! # added to include check for SourceForge bug #123324: ! self.failUnless(cf.remove_option('Foo Bar', 'foo'), ! "remove_option() failed to report existance of option") ! self.failIf(cf.has_option('Foo Bar', 'foo'), ! "remove_option() failed to remove option") ! self.failIf(cf.remove_option('Foo Bar', 'foo'), ! "remove_option() failed to report non-existance of option" ! " that was removed") ! self.assertRaises(ConfigParser.NoSectionError, ! cf.remove_option, 'No Such Section', 'foo') + eq(cf.get('Long Line', 'foo'), + 'this line is much, much longer than my editor\nlikes it.') ! def test_case_sensitivity(self): ! cf = self.newconfig() ! cf.add_section("A") ! cf.add_section("a") ! L = cf.sections() ! L.sort() ! eq = self.assertEqual ! eq(L, ["A", "a"]) ! cf.set("a", "B", "value") ! eq(cf.options("a"), ["b"]) ! eq(cf.get("a", "b"), "value", ! "could not locate option, expecting case-insensitive option names") ! self.failUnless(cf.has_option("a", "b")) ! cf.set("A", "A-B", "A-B value") ! for opt in ("a-b", "A-b", "a-B", "A-B"): ! self.failUnless( ! cf.has_option("A", opt), ! "has_option() returned false for option which should exist") ! eq(cf.options("A"), ["a-b"]) ! eq(cf.options("a"), ["b"]) ! cf.remove_option("a", "B") ! eq(cf.options("a"), []) + # SF bug #432369: + cf = self.fromstring( + "[MySection]\nOption: first line\n\tsecond line\n") + eq(cf.options("MySection"), ["option"]) + eq(cf.get("MySection", "Option"), "first line\nsecond line") ! # SF bug #561822: ! cf = self.fromstring("[section]\nnekey=nevalue\n", ! defaults={"key":"value"}) ! self.failUnless(cf.has_option("section", "Key")) + def test_parse_errors(self): + self.newconfig() + self.parse_error(ConfigParser.ParsingError, + "[Foo]\n extra-spaces: splat\n") + self.parse_error(ConfigParser.ParsingError, + "[Foo]\n extra-spaces= splat\n") + self.parse_error(ConfigParser.ParsingError, + "[Foo]\noption-without-value\n") + self.parse_error(ConfigParser.ParsingError, + "[Foo]\n:value-without-option-name\n") + self.parse_error(ConfigParser.ParsingError, + "[Foo]\n=value-without-option-name\n") + self.parse_error(ConfigParser.MissingSectionHeaderError, + "No Section!\n") ! def parse_error(self, exc, src): ! sio = StringIO.StringIO(src) ! self.assertRaises(exc, self.cf.readfp, sio) + def test_query_errors(self): + cf = self.newconfig() + self.assertEqual(cf.sections(), [], + "new ConfigParser should have no defined sections") + self.failIf(cf.has_section("Foo"), + "new ConfigParser should have no acknowledged sections") + self.assertRaises(ConfigParser.NoSectionError, + cf.options, "Foo") + self.assertRaises(ConfigParser.NoSectionError, + cf.set, "foo", "bar", "value") + self.get_error(ConfigParser.NoSectionError, "foo", "bar") + cf.add_section("foo") + self.get_error(ConfigParser.NoOptionError, "foo", "bar") ! def get_error(self, exc, section, option): ! self.assertRaises(exc, self.cf.get, section, option) + def test_boolean(self): + cf = self.fromstring( + "[BOOLTEST]\n" + "T1=1\n" + "T2=TRUE\n" + "T3=True\n" + "T4=oN\n" + "T5=yes\n" + "F1=0\n" + "F2=FALSE\n" + "F3=False\n" + "F4=oFF\n" + "F5=nO\n" + "E1=2\n" + "E2=foo\n" + "E3=-1\n" + "E4=0.1\n" + "E5=FALSE AND MORE" + ) + for x in range(1, 5): + self.failUnless(cf.getboolean('BOOLTEST', 't%d' % x)) + self.failIf(cf.getboolean('BOOLTEST', 'f%d' % x)) + self.assertRaises(ValueError, + cf.getboolean, 'BOOLTEST', 'e%d' % x) ! def test_weird_errors(self): ! cf = self.newconfig() cf.add_section("Foo") ! self.assertRaises(ConfigParser.DuplicateSectionError, ! cf.add_section, "Foo") + def test_write(self): + cf = self.fromstring( + "[Long Line]\n" + "foo: this line is much, much longer than my editor\n" + " likes it.\n" + "[DEFAULT]\n" + "foo: another very\n" + " long line" + ) + output = StringIO.StringIO() + cf.write(output) + self.assertEqual( + output.getvalue(), + "[DEFAULT]\n" + "foo = another very\n" + "\tlong line\n" + "\n" + "[Long Line]\n" + "foo = this line is much, much longer than my editor\n" + "\tlikes it.\n" + "\n" + ) ! # shared by subclasses ! def get_interpolation_config(self): ! return self.fromstring( ! "[Foo]\n" ! "bar=something %(with1)s interpolation (1 step)\n" ! "bar9=something %(with9)s lots of interpolation (9 steps)\n" ! "bar10=something %(with10)s lots of interpolation (10 steps)\n" ! "bar11=something %(with11)s lots of interpolation (11 steps)\n" ! "with11=%(with10)s\n" ! "with10=%(with9)s\n" ! "with9=%(with8)s\n" ! "with8=%(with7)s\n" ! "with7=%(with6)s\n" ! "with6=%(with5)s\n" ! "with5=%(with4)s\n" ! "with4=%(with3)s\n" ! "with3=%(with2)s\n" ! "with2=%(with1)s\n" ! "with1=with\n" ! "\n" ! "[Mutual Recursion]\n" ! "foo=%(bar)s\n" ! "bar=%(foo)s\n", ! defaults={"getname": "%(__name__)s"}) ! class ConfigParserTestCase(TestCaseBase): ! config_class = ConfigParser.ConfigParser + def test_interpolation(self): + cf = self.get_interpolation_config() + eq = self.assertEqual + eq(cf.get("Foo", "getname"), "Foo") + eq(cf.get("Foo", "bar"), "something with interpolation (1 step)") + eq(cf.get("Foo", "bar9"), + "something with lots of interpolation (9 steps)") + eq(cf.get("Foo", "bar10"), + "something with lots of interpolation (10 steps)") + self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11") ! class RawConfigParserTestCase(TestCaseBase): ! config_class = ConfigParser.RawConfigParser ! def test_interpolation(self): ! cf = self.get_interpolation_config() ! eq = self.assertEqual ! eq(cf.get("Foo", "getname"), "%(__name__)s") ! eq(cf.get("Foo", "bar"), ! "something %(with1)s interpolation (1 step)") ! eq(cf.get("Foo", "bar9"), ! "something %(with9)s lots of interpolation (9 steps)") ! eq(cf.get("Foo", "bar10"), ! "something %(with10)s lots of interpolation (10 steps)") ! eq(cf.get("Foo", "bar11"), ! "something %(with11)s lots of interpolation (11 steps)") ! def test_main(): ! suite = unittest.TestSuite() ! suite.addTests([unittest.makeSuite(ConfigParserTestCase), ! unittest.makeSuite(RawConfigParserTestCase)]) ! test_support.run_suite(suite) ! if __name__ == "__main__": ! test_main() From fdrake@users.sourceforge.net Fri Oct 25 20:41:28 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 12:41:28 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_cfgparser,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv3014/Lib/test/output Removed Files: test_cfgparser Log Message: Remove useless output file. --- test_cfgparser DELETED --- From jackjansen@users.sourceforge.net Fri Oct 25 21:06:41 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:06:41 -0700 Subject: [Python-checkins] python/dist/src/Mac/Lib aetools.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10785 Modified Files: aetools.py Log Message: Under Jaguar it seems that 'errn' return value keyword parameters don't (or don't always?) show up with missed(). I think this is a bug in Jaguar, but as it is a potential dangerous problem (the OSA event has failed, but the Python code isn't told about this and happily continues) this is a quick workaround. Bugfix candidate, I'll add it to 2.2.2 as a last second fix. Index: aetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetools.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** aetools.py 7 Aug 2002 14:48:59 -0000 1.4 --- aetools.py 25 Oct 2002 20:06:29 -0000 1.5 *************** *** 66,69 **** --- 66,77 ---- parameters['----'] = unpack(dirobj, formodulename) del dirobj + # Workaround for what I feel is a bug in OSX 10.2: 'errn' won't show up in missed... + try: + dirobj = ae.AEGetParamDesc('errn', '****') + except AE.Error: + pass + else: + parameters['errn'] = unpack(dirobj, formodulename) + del dirobj while 1: key = missed(ae) From fdrake@users.sourceforge.net Fri Oct 25 21:21:02 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:21:02 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18331 Modified Files: libcfgparser.tex Log Message: Update to reflect the refactoring into the RawConfigParser and ConfigParser classes. Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** libcfgparser.tex 27 Sep 2002 15:49:56 -0000 1.23 --- libcfgparser.tex 25 Oct 2002 20:20:58 -0000 1.24 *************** *** 23,27 **** The optional values can contain format strings which refer to other values in the same section, or values in a special ! \code{DEFAULT} section. Additional defaults can be provided upon initialization and retrieval. Lines beginning with \character{\#} or \character{;} are ignored and may be used to provide comments. --- 23,27 ---- The optional values can contain format strings which refer to other values in the same section, or values in a special ! \code{DEFAULT} section. Additional defaults can be provided on initialization and retrieval. Lines beginning with \character{\#} or \character{;} are ignored and may be used to provide comments. *************** *** 30,33 **** --- 30,34 ---- \begin{verbatim} + [My Section] foodir: %(dir)s/whatever dir=frob *************** *** 43,50 **** others. \begin{classdesc}{ConfigParser}{\optional{defaults}} ! Return a new instance of the \class{ConfigParser} class. When ! \var{defaults} is given, it is initialized into the dictionary of ! intrinsic defaults. The keys must be strings, and the values must be appropriate for the \samp{\%()s} string interpolation. Note that \var{__name__} is an intrinsic default; its value is the section name, --- 44,58 ---- others. + \begin{classdesc}{RawConfigParser}{\optional{defaults}} + The basic configuration object. When \var{defaults} is given, it is + initialized into the dictionary of intrinsic defaults. This class + does not support the magical interpolation behavior. + \versionadded{2.3} + \end{classdesc} + \begin{classdesc}{ConfigParser}{\optional{defaults}} ! Derived class of \class{RawConfigParser} that implements the magical ! interpolation feature and adds optional arguments the \method{get()} ! and \method{items()} methods. The values in \var{defaults} must be appropriate for the \samp{\%()s} string interpolation. Note that \var{__name__} is an intrinsic default; its value is the section name, *************** *** 87,92 **** \begin{datadesc}{MAX_INTERPOLATION_DEPTH} The maximum depth for recursive interpolation for \method{get()} when ! the \var{raw} parameter is false. Setting this does not change the ! allowed recursion depth. \end{datadesc} --- 95,100 ---- \begin{datadesc}{MAX_INTERPOLATION_DEPTH} The maximum depth for recursive interpolation for \method{get()} when ! the \var{raw} parameter is false. This is relevant only for the ! \class{ConfigParser} class. \end{datadesc} *************** *** 99,105 **** ! \subsection{ConfigParser Objects \label{ConfigParser-objects}} ! \class{ConfigParser} instances have the following methods: \begin{methoddesc}{defaults}{} --- 107,113 ---- ! \subsection{RawConfigParser Objects \label{RawConfigParser-objects}} ! \class{RawConfigParser} instances have the following methods: \begin{methoddesc}{defaults}{} *************** *** 163,171 **** \end{methoddesc} ! \begin{methoddesc}{get}{section, option\optional{, raw\optional{, vars}}} ! Get an \var{option} value for the provided \var{section}. All the ! \character{\%} interpolations are expanded in the return values, based on ! the defaults passed into the constructor, as well as the options ! \var{vars} provided, unless the \var{raw} argument is true. \end{methoddesc} --- 171,176 ---- \end{methoddesc} ! \begin{methoddesc}{get}{section, option} ! Get an \var{option} value for the named \var{section}. \end{methoddesc} *************** *** 190,198 **** \end{methoddesc} ! \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} ! Create a generator which will return a tuple \code{(name, value)} for ! each option in the given \var{section}. Optional arguments have the ! same meaning as for the \code{get()} method. ! \versionadded{2.3} \end{methoddesc} --- 195,201 ---- \end{methoddesc} ! \begin{methoddesc}{items}{section} ! Return a list of \code{(\var{name}, \var{value})} pairs for each ! option in the given \var{section}. \end{methoddesc} *************** *** 231,233 **** --- 234,256 ---- behavior. Setting this to \function{str()}, for example, would make option names case sensitive. + \end{methoddesc} + + + \subsection{ConfigParser Objects \label{ConfigParser-objects}} + + The \class{ConfigParser} class extends some methods of the + \class{RawConfigParser} interface, adding some optional arguments. + + \begin{methoddesc}{get}{section, option\optional{, raw\optional{, vars}}} + Get an \var{option} value for the named \var{section}. All the + \character{\%} interpolations are expanded in the return values, based + on the defaults passed into the constructor, as well as the options + \var{vars} provided, unless the \var{raw} argument is true. + \end{methoddesc} + + \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} + Create a generator which will return a tuple \code{(name, value)} for + each option in the given \var{section}. Optional arguments have the + same meaning as for the \code{get()} method. + \versionadded{2.3} \end{methoddesc} From jackjansen@users.sourceforge.net Fri Oct 25 21:36:58 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:36:58 -0700 Subject: [Python-checkins] python/dist/src/Mac/Lib aetools.py,1.2.14.1,1.2.14.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24473 Modified Files: Tag: release22-maint aetools.py Log Message: Backport of 1.5: Under Jaguar it seems that 'errn' return value keyword parameters don't (or don't always?) show up with missed(). I think this is a bug in Jaguar, but as it is a potential dangerous problem (the OSA event has failed, but the Python code isn't told about this and happily continues) this is a quick workaround. Index: aetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetools.py,v retrieving revision 1.2.14.1 retrieving revision 1.2.14.2 diff -C2 -d -r1.2.14.1 -r1.2.14.2 *** aetools.py 24 Feb 2002 22:48:51 -0000 1.2.14.1 --- aetools.py 25 Oct 2002 20:36:53 -0000 1.2.14.2 *************** *** 66,69 **** --- 66,77 ---- parameters['----'] = unpack(dirobj) del dirobj + # Workaround for what I feel is a bug in OSX 10.2: 'errn' won't show up in missed... + try: + dirobj = ae.AEGetParamDesc('errn', '****') + except AE.Error: + pass + else: + parameters['errn'] = unpack(dirobj, formodulename) + del dirobj while 1: key = missed(ae) From fdrake@users.sourceforge.net Fri Oct 25 21:41:32 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:41:32 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26702 Modified Files: ConfigParser.py Log Message: According to the docs, __name__ is not exposed via the API except indirectly via %(__name__)s. Not sure why, but maintain the documented behavior for the new items() method. Be a little more efficient about how we compute the list of options in the ConfigParser.items() method. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ConfigParser.py 25 Oct 2002 18:08:18 -0000 1.48 --- ConfigParser.py 25 Oct 2002 20:41:30 -0000 1.49 *************** *** 275,280 **** --- 275,283 ---- if section != DEFAULTSECT: raise NoSectionError(section) + d2 = {} d = self._defaults.copy() d.update(d2) + if "__name__" in d: + del d["__name__"] return d.items() *************** *** 509,517 **** if vars: d.update(vars) if raw: ! for option in self.options(section): yield (option, d[option]) else: ! for option in self.options(section): yield (option, self._interpolate(section, option, d[option], d)) --- 512,523 ---- if vars: d.update(vars) + options = d.keys() + if "__name__" in options: + options.remove("__name__") if raw: ! for option in options: yield (option, d[option]) else: ! for option in options: yield (option, self._interpolate(section, option, d[option], d)) From fdrake@users.sourceforge.net Fri Oct 25 21:42:46 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:42:46 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_cfgparser.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27205 Modified Files: test_cfgparser.py Log Message: Add tests for both raw and non-raw versions of the items() methods. Index: test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_cfgparser.py 25 Oct 2002 19:40:49 -0000 1.16 --- test_cfgparser.py 25 Oct 2002 20:42:44 -0000 1.17 *************** *** 231,234 **** --- 231,246 ---- defaults={"getname": "%(__name__)s"}) + def check_items_config(self, expected): + cf = self.fromstring( + "[section]\n" + "name = value\n" + "key: |%(name)s| \n" + "getdefault: |%(default)s|\n" + "getname: |%(__name__)s|", + defaults={"default": ""}) + L = list(cf.items("section")) + L.sort() + self.assertEqual(L, expected) + class ConfigParserTestCase(TestCaseBase): *************** *** 246,249 **** --- 258,268 ---- self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11") + def test_items(self): + self.check_items_config([('default', ''), + ('getdefault', '||'), + ('getname', '|section|'), + ('key', '|value|'), + ('name', 'value')]) + class RawConfigParserTestCase(TestCaseBase): *************** *** 262,265 **** --- 281,291 ---- eq(cf.get("Foo", "bar11"), "something %(with11)s lots of interpolation (11 steps)") + + def test_items(self): + self.check_items_config([('default', ''), + ('getdefault', '|%(default)s|'), + ('getname', '|%(__name__)s|'), + ('key', '|%(name)s|'), + ('name', 'value')]) From jackjansen@users.sourceforge.net Fri Oct 25 21:37:45 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri, 25 Oct 2002 13:37:45 -0700 Subject: [Python-checkins] python/dist/src/Mac/Tools/IDE PyEdit.py,1.26.6.1,1.26.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv24942 Modified Files: Tag: release22-maint PyEdit.py Log Message: Backport of 1.25: 'Replace all' in the find dialog didn't properly update the text view (it used to, though...). Fixed. Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.26.6.1 retrieving revision 1.26.6.2 diff -C2 -d -r1.26.6.1 -r1.26.6.2 *** PyEdit.py 24 Feb 2002 23:17:23 -0000 1.26.6.1 --- PyEdit.py 25 Oct 2002 20:37:43 -0000 1.26.6.2 *************** *** 961,969 **** editor.textchanged() editor.selectionchanged() ! editor.ted.WEUseText(Res.Resource(Text)) ! editor.ted.WECalText() ! editor.SetPort() ! editor.GetWindow().InvalWindowRect(editor._bounds) ! #editor.ted.WEUpdate(self.w.wid.GetWindowPort().visRgn) EasyDialogs.Message("Replaced %d occurrences" % counter) --- 961,965 ---- editor.textchanged() editor.selectionchanged() ! editor.set(Text) EasyDialogs.Message("Replaced %d occurrences" % counter) From fdrake@users.sourceforge.net Fri Oct 25 22:52:03 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 14:52:03 -0700 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25460/Lib Modified Files: ConfigParser.py Log Message: Implement a safer and more predictable interpolation approach. Closes SF bug #511737. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ConfigParser.py 25 Oct 2002 20:41:30 -0000 1.49 --- ConfigParser.py 25 Oct 2002 21:52:00 -0000 1.50 *************** *** 539,540 **** --- 539,588 ---- raise InterpolationDepthError(option, section, rawval) return value + + + class SafeConfigParser(ConfigParser): + + def _interpolate(self, section, option, rawval, vars): + # do the string interpolation + L = [] + self._interpolate_some(option, L, rawval, section, vars, 1) + return ''.join(L) + + _interpvar_match = re.compile(r"%\(([^)]+)\)s").match + + def _interpolate_some(self, option, accum, rest, section, map, depth): + if depth > MAX_INTERPOLATION_DEPTH: + raise InterpolationDepthError(option, section, rest) + while rest: + p = rest.find("%") + if p < 0: + accum.append(rest) + return + if p > 0: + accum.append(rest[:p]) + rest = rest[p:] + # p is no longer used + c = rest[1:2] + if c == "%": + accum.append("%") + rest = rest[2:] + elif c == "(": + m = self._interpvar_match(rest) + if m is None: + raise InterpolationSyntaxError( + "bad interpolation variable syntax at: %r" % rest) + var = m.group(1) + rest = rest[m.end():] + try: + v = map[var] + except KeyError: + raise InterpolationError( + "no value found for %r" % var) + if "%" in v: + self._interpolate_some(option, accum, v, + section, map, depth + 1) + else: + accum.append(v) + else: + raise InterpolationSyntaxError( + "'%' must be followed by '%' or '('") From fdrake@users.sourceforge.net Fri Oct 25 22:52:03 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 14:52:03 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_cfgparser.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv25460/Lib/test Modified Files: test_cfgparser.py Log Message: Implement a safer and more predictable interpolation approach. Closes SF bug #511737. Index: test_cfgparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cfgparser.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_cfgparser.py 25 Oct 2002 20:42:44 -0000 1.17 --- test_cfgparser.py 25 Oct 2002 21:52:00 -0000 1.18 *************** *** 290,297 **** def test_main(): suite = unittest.TestSuite() suite.addTests([unittest.makeSuite(ConfigParserTestCase), ! unittest.makeSuite(RawConfigParserTestCase)]) test_support.run_suite(suite) --- 290,312 ---- + class SafeConfigParserTestCase(ConfigParserTestCase): + config_class = ConfigParser.SafeConfigParser + + def test_safe_interpolation(self): + # See http://www.python.org/sf/511737 + cf = self.fromstring("[section]\n" + "option1=xxx\n" + "option2=%(option1)s/xxx\n" + "ok=%(option1)s/%%s\n" + "not_ok=%(option2)s/%%s") + self.assertEqual(cf.get("section", "ok"), "xxx/%s") + self.assertEqual(cf.get("section", "not_ok"), "xxx/xxx/%s") + + def test_main(): suite = unittest.TestSuite() suite.addTests([unittest.makeSuite(ConfigParserTestCase), ! unittest.makeSuite(RawConfigParserTestCase), ! unittest.makeSuite(SafeConfigParserTestCase)]) test_support.run_suite(suite) From fdrake@users.sourceforge.net Fri Oct 25 22:52:02 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri, 25 Oct 2002 14:52:02 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25460/Doc/lib Modified Files: libcfgparser.tex Log Message: Implement a safer and more predictable interpolation approach. Closes SF bug #511737. Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** libcfgparser.tex 25 Oct 2002 20:20:58 -0000 1.24 --- libcfgparser.tex 25 Oct 2002 21:52:00 -0000 1.25 *************** *** 60,63 **** --- 60,73 ---- \end{classdesc} + \begin{classdesc}{SafeConfigParser}{\optional{defaults}} + Derived class of \class{ConfigParser} that implements a more-sane + variant of the magical interpolation feature. This implementation is + more predictable as well. + % XXX Need to explain what's safer/more predictable about it. + New applications should prefer this version if they don't need to be + compatible with older versions of Python. + \versionadded{2.3} + \end{classdesc} + \begin{excdesc}{NoSectionError} Exception raised when a specified section is not found. From rhettinger@users.sourceforge.net Sat Oct 26 04:14:00 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 25 Oct 2002 20:14:00 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.174,1.175 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv11786 Modified Files: tut.tex Log Message: Clarify packages in tutorial. Closes SF bug #616211. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** tut.tex 22 Oct 2002 21:00:44 -0000 1.174 --- tut.tex 26 Oct 2002 03:13:57 -0000 1.175 *************** *** 2557,2560 **** --- 2557,2563 ---- \end{verbatim} + When importing the package, Python searchs through the directories + on \code{sys.path} looking for the package subdirectory. + The \file{__init__.py} files are required to make Python treat the directories as containing packages; this is done to prevent From rhettinger@users.sourceforge.net Sat Oct 26 04:15:06 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 25 Oct 2002 20:15:06 -0700 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.13,1.156.4.1.2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv12329 Modified Files: Tag: release22-maint tut.tex Log Message: Clarify packages in tutorial. Closes SF bug #616211. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.156.4.1.2.13 retrieving revision 1.156.4.1.2.14 diff -C2 -d -r1.156.4.1.2.13 -r1.156.4.1.2.14 *** tut.tex 22 Oct 2002 21:01:33 -0000 1.156.4.1.2.13 --- tut.tex 26 Oct 2002 03:15:03 -0000 1.156.4.1.2.14 *************** *** 2544,2547 **** --- 2544,2551 ---- \end{verbatim} + When importing the package, Python searchs through the directories + on \code{sys.path} looking for a subdirectory containing the + top-level package. + The \file{__init__.py} files are required to make Python treat the directories as containing packages; this is done to prevent From loewis@users.sourceforge.net Sat Oct 26 14:33:02 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 06:33:02 -0700 Subject: [Python-checkins] python/dist/src configure,1.347,1.348 configure.in,1.358,1.359 pyconfig.h.in,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv8826 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #628898: Define _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.347 retrieving revision 1.348 diff -C2 -d -r1.347 -r1.348 *** configure 16 Oct 2002 20:28:22 -0000 1.347 --- configure 26 Oct 2002 13:32:58 -0000 1.348 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.357 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.358 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. *************** *** 902,906 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 902,906 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *************** *** 1243,1246 **** --- 1243,1261 ---- + # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires definition + # of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else several APIs + # are not declared. Since this is also needed in some cases for HP-UX, + # we define it globally. + + cat >>confdefs.h <<\_ACEOF + #define _XOPEN_SOURCE_EXTENDED 1 + _ACEOF + + + cat >>confdefs.h <<\_ACEOF + #define _POSIX_C_SOURCE 199506L + _ACEOF + + # Arguments passed to configure. *************** *** 17161,17165 **** # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` --- 17176,17180 ---- # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ! ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.358 retrieving revision 1.359 diff -C2 -d -r1.358 -r1.359 *** configure.in 16 Oct 2002 20:28:24 -0000 1.358 --- configure.in 26 Oct 2002 13:33:00 -0000 1.359 *************** *** 34,37 **** --- 34,44 ---- AC_DEFINE(_XOPEN_SOURCE, 500) + # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires definition + # of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else several APIs + # are not declared. Since this is also needed in some cases for HP-UX, + # we define it globally. + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Define to activate Unix95-and-earlier features) + AC_DEFINE(_POSIX_C_SOURCE, 199506L, Define to activate features from IEEE Stds 1003.{123}-1995) + # Arguments passed to configure. AC_SUBST(CONFIG_ARGS) Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** pyconfig.h.in 16 Oct 2002 20:28:24 -0000 1.55 --- pyconfig.h.in 26 Oct 2002 13:33:00 -0000 1.56 *************** *** 786,789 **** --- 786,792 ---- #undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.{123}-1995 */ + #undef _POSIX_C_SOURCE + /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE *************** *** 799,802 **** --- 802,808 ---- # define _XOPEN_SOURCE 500 #endif + + /* Define to activate Unix95-and-earlier features */ + #undef _XOPEN_SOURCE_EXTENDED /* Define to 1 if type `char' is unsigned and you are not using gcc. */ From loewis@users.sourceforge.net Sat Oct 26 14:36:15 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 06:36:15 -0700 Subject: [Python-checkins] python/dist/src/Modules _cursesmodule.c,2.67,2.68 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv9741/Modules Modified Files: _cursesmodule.c Log Message: Remove duplicate definitions of _XOPEN_SOURCE_EXTENDED. Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** _cursesmodule.c 30 Sep 2002 16:19:48 -0000 2.67 --- _cursesmodule.c 26 Oct 2002 13:36:13 -0000 2.68 *************** *** 104,113 **** #ifdef __osf__ - #define _XOPEN_SOURCE_EXTENDED /* Define macro for OSF/1 */ #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ #endif #ifdef __hpux - #define _XOPEN_SOURCE_EXTENDED #define STRICT_SYSV_CURSES #endif --- 104,111 ---- From loewis@users.sourceforge.net Sat Oct 26 14:47:46 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 06:47:46 -0700 Subject: [Python-checkins] python/dist/src configure,1.348,1.349 configure.in,1.359,1.360 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv12551 Modified Files: configure configure.in Log Message: Patch #623771: Properly use autoconf 2.5x macros. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.348 retrieving revision 1.349 diff -C2 -d -r1.348 -r1.349 *** configure 26 Oct 2002 13:32:58 -0000 1.348 --- configure 26 Oct 2002 13:47:43 -0000 1.349 *************** *** 1,6 **** #! /bin/sh ! # From configure.in Revision: 1.358 . # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 --- 1,6 ---- #! /bin/sh ! # From configure.in Revision: 1.359 . # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.53 for python 2.3. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 *************** *** 254,262 **** # Identity of this package. ! PACKAGE_NAME= ! PACKAGE_TARNAME= ! PACKAGE_VERSION= ! PACKAGE_STRING= ! PACKAGE_BUGREPORT= ac_unique_file="Include/object.h" --- 254,262 ---- # Identity of this package. ! PACKAGE_NAME='python' ! PACKAGE_TARNAME='python' ! PACKAGE_VERSION='2.3' ! PACKAGE_STRING='python 2.3' ! PACKAGE_BUGREPORT='' ac_unique_file="Include/object.h" *************** *** 762,766 **** # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF ! \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... --- 762,766 ---- # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF ! \`configure' configures python 2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... *************** *** 818,822 **** if test -n "$ac_init_help"; then ! cat <<\_ACEOF --- 818,824 ---- if test -n "$ac_init_help"; then ! case $ac_init_help in ! short | recursive ) echo "Configuration of python 2.3:";; ! esac cat <<\_ACEOF *************** *** 928,931 **** --- 930,935 ---- if $ac_init_version; then cat <<\_ACEOF + python configure 2.3 + generated by GNU Autoconf 2.53 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 *************** *** 941,945 **** running configure, to aid debugging if configure makes a mistake. ! It was created by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was --- 945,949 ---- running configure, to aid debugging if configure makes a mistake. ! It was created by python $as_me 2.3, which was generated by GNU Autoconf 2.53. Invocation command line was *************** *** 1211,1214 **** --- 1215,1227 ---- + + + + + + + + + ac_config_headers="$ac_config_headers pyconfig.h" *************** *** 1219,1223 **** - # Set VERSION so we only need to edit in one place (i.e., here) VERSION=2.3 --- 1232,1235 ---- *************** *** 9875,9879 **** fi; ! # Determine if signalmodule should be used. --- 9887,9891 ---- fi; ! # Determine isignalmodule should be used. *************** *** 16440,16443 **** --- 16452,16456 ---- # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure *************** *** 16765,16769 **** cat >&5 <<_CSEOF ! This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was --- 16778,16782 ---- cat >&5 <<_CSEOF ! This file was extended by python $as_me 2.3, which was generated by GNU Autoconf 2.53. Invocation command line was *************** *** 16824,16828 **** cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ! config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" --- 16837,16841 ---- cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ! python config.status 2.3 configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.359 retrieving revision 1.360 diff -C2 -d -r1.359 -r1.360 *** configure.in 26 Oct 2002 13:33:00 -0000 1.359 --- configure.in 26 Oct 2002 13:47:44 -0000 1.360 *************** *** 1,6 **** dnl Process this file with autoconf 2.0 or later to make a configure script. AC_REVISION($Revision$) AC_PREREQ(2.53) ! AC_INIT(Include/object.h) AC_CONFIG_HEADER(pyconfig.h) --- 1,11 ---- dnl Process this file with autoconf 2.0 or later to make a configure script. + + # Set VERSION so we only need to edit in one place (i.e., here) + m4_define(PYTHON_VERSION, 2.3) + AC_REVISION($Revision$) AC_PREREQ(2.53) ! AC_INIT(python, PYTHON_VERSION) ! AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) *************** *** 14,20 **** ]) - # Set VERSION so we only need to edit in one place (i.e., here) AC_SUBST(VERSION) ! VERSION=2.3 AC_SUBST(SOVERSION) --- 19,24 ---- ]) AC_SUBST(VERSION) ! VERSION=PYTHON_VERSION AC_SUBST(SOVERSION) *************** *** 2398,2402 **** # generate output files ! AC_OUTPUT(Makefile.pre Modules/Setup.config) echo "creating Setup" --- 2402,2407 ---- # generate output files ! AC_CONFIG_FILES(Makefile.pre Modules/Setup.config) ! AC_OUTPUT echo "creating Setup" From loewis@users.sourceforge.net Sat Oct 26 15:39:12 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:39:12 -0700 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.265,2.266 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv26440/Python Modified Files: bltinmodule.c Log Message: Patch #512981: Update readline input stream on sys.stdin/out change. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.265 retrieving revision 2.266 diff -C2 -d -r2.265 -r2.266 *** bltinmodule.c 27 Aug 2002 16:58:00 -0000 2.265 --- bltinmodule.c 26 Oct 2002 14:39:10 -0000 2.266 *************** *** 1312,1317 **** return NULL; } ! if (PyFile_AsFile(fin) == stdin && PyFile_AsFile(fout) == stdout && ! isatty(fileno(stdin)) && isatty(fileno(stdout))) { PyObject *po; char *prompt; --- 1312,1318 ---- return NULL; } ! if (PyFile_Check (fin) && PyFile_Check (fout) ! && isatty(fileno(PyFile_AsFile(fin))) ! && isatty(fileno(PyFile_AsFile(fout)))) { PyObject *po; char *prompt; *************** *** 1330,1334 **** prompt = ""; } ! s = PyOS_Readline(prompt); Py_XDECREF(po); if (s == NULL) { --- 1331,1336 ---- prompt = ""; } ! s = PyOS_Readline(PyFile_AsFile (fin), PyFile_AsFile (fout), ! prompt); Py_XDECREF(po); if (s == NULL) { From loewis@users.sourceforge.net Sat Oct 26 15:39:12 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:39:12 -0700 Subject: [Python-checkins] python/dist/src/Parser myreadline.c,2.27,2.28 tokenizer.c,2.67,2.68 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv26440/Parser Modified Files: myreadline.c tokenizer.c Log Message: Patch #512981: Update readline input stream on sys.stdin/out change. Index: myreadline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/myreadline.c,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** myreadline.c 14 Jul 2002 23:12:29 -0000 2.27 --- myreadline.c 26 Oct 2002 14:39:09 -0000 2.28 *************** *** 88,92 **** char * ! PyOS_StdioReadline(char *prompt) { size_t n; --- 88,92 ---- char * ! PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { size_t n; *************** *** 95,99 **** if ((p = PyMem_MALLOC(n)) == NULL) return NULL; ! fflush(stdout); #ifndef RISCOS if (prompt) --- 95,99 ---- if ((p = PyMem_MALLOC(n)) == NULL) return NULL; ! fflush(sys_stdout); #ifndef RISCOS if (prompt) *************** *** 108,112 **** #endif fflush(stderr); ! switch (my_fgets(p, (int)n, stdin)) { case 0: /* Normal case */ break; --- 108,112 ---- #endif fflush(stderr); ! switch (my_fgets(p, (int)n, sys_stdin)) { case 0: /* Normal case */ break; *************** *** 136,140 **** PyErr_SetString(PyExc_OverflowError, "input line too long"); } ! if (my_fgets(p+n, (int)incr, stdin) != 0) break; n += strlen(p+n); --- 136,140 ---- PyErr_SetString(PyExc_OverflowError, "input line too long"); } ! if (my_fgets(p+n, (int)incr, sys_stdin) != 0) break; n += strlen(p+n); *************** *** 149,153 **** Note: Python expects in return a buffer allocated with PyMem_Malloc. */ ! char *(*PyOS_ReadlineFunctionPointer)(char *); --- 149,153 ---- Note: Python expects in return a buffer allocated with PyMem_Malloc. */ ! char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); *************** *** 155,166 **** char * ! PyOS_Readline(char *prompt) { char *rv; if (PyOS_ReadlineFunctionPointer == NULL) { ! PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; } Py_BEGIN_ALLOW_THREADS ! rv = (*PyOS_ReadlineFunctionPointer)(prompt); Py_END_ALLOW_THREADS return rv; --- 155,178 ---- char * ! PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { char *rv; + if (PyOS_ReadlineFunctionPointer == NULL) { ! PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; } + Py_BEGIN_ALLOW_THREADS ! ! /* This is needed to handle the unlikely case that the ! * interpreter is in interactive mode *and* stdin/out are not ! * a tty. This can happen, for example if python is run like ! * this: python -i < test1.py ! */ ! if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) ! rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); ! else ! rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, ! prompt); Py_END_ALLOW_THREADS return rv; Index: tokenizer.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** tokenizer.c 3 Sep 2002 15:39:58 -0000 2.67 --- tokenizer.c 26 Oct 2002 14:39:09 -0000 2.68 *************** *** 19,23 **** #endif /* PGEN */ ! extern char *PyOS_Readline(char *); /* Return malloc'ed string including trailing \n; empty malloc'ed string for EOF; --- 19,23 ---- #endif /* PGEN */ ! extern char *PyOS_Readline(FILE *, FILE *, char *); /* Return malloc'ed string including trailing \n; empty malloc'ed string for EOF; *************** *** 672,676 **** } if (tok->prompt != NULL) { ! char *new = PyOS_Readline(tok->prompt); if (tok->nextprompt != NULL) tok->prompt = tok->nextprompt; --- 672,676 ---- } if (tok->prompt != NULL) { ! char *new = PyOS_Readline(stdin, stdout, tok->prompt); if (tok->nextprompt != NULL) tok->prompt = tok->nextprompt; From loewis@users.sourceforge.net Sat Oct 26 15:39:11 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:39:11 -0700 Subject: [Python-checkins] python/dist/src/Modules readline.c,2.53,2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26440/Modules Modified Files: readline.c Log Message: Patch #512981: Update readline input stream on sys.stdin/out change. Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** readline.c 9 Oct 2002 21:27:33 -0000 2.53 --- readline.c 26 Oct 2002 14:39:09 -0000 2.54 *************** *** 33,37 **** /* Pointers needed from outside (but not declared in a header file). */ extern DL_IMPORT(int) (*PyOS_InputHook)(void); ! extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *); --- 33,37 ---- /* Pointers needed from outside (but not declared in a header file). */ extern DL_IMPORT(int) (*PyOS_InputHook)(void); ! extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *,char *); *************** *** 607,616 **** static char * ! call_readline(char *prompt) { size_t n; char *p, *q; PyOS_sighandler_t old_inthandler; ! old_inthandler = PyOS_setsig(SIGINT, onintr); if (setjmp(jbuf)) { --- 607,616 ---- static char * ! call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { size_t n; char *p, *q; PyOS_sighandler_t old_inthandler; ! old_inthandler = PyOS_setsig(SIGINT, onintr); if (setjmp(jbuf)) { *************** *** 623,626 **** --- 623,633 ---- } rl_event_hook = PyOS_InputHook; + + if (sys_stdin != rl_instream || sys_stdout != rl_outstream) { + rl_instream = sys_stdin; + rl_outstream = sys_stdout; + rl_prep_terminal (1); + } + p = readline(prompt); PyOS_setsig(SIGINT, old_inthandler); *************** *** 677,683 **** m = Py_InitModule4("readline", readline_methods, doc_module, (PyObject *)NULL, PYTHON_API_VERSION); ! if (isatty(fileno(stdin))) { ! PyOS_ReadlineFunctionPointer = call_readline; ! setup_readline(); ! } } --- 684,689 ---- m = Py_InitModule4("readline", readline_methods, doc_module, (PyObject *)NULL, PYTHON_API_VERSION); ! ! PyOS_ReadlineFunctionPointer = call_readline; ! setup_readline(); } From loewis@users.sourceforge.net Sat Oct 26 15:39:11 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:39:11 -0700 Subject: [Python-checkins] python/dist/src/Include pythonrun.h,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv26440/Include Modified Files: pythonrun.h Log Message: Patch #512981: Update readline input stream on sys.stdin/out change. Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** pythonrun.h 12 Aug 2002 13:06:35 -0000 2.54 --- pythonrun.h 26 Oct 2002 14:39:09 -0000 2.55 *************** *** 114,120 **** /* Stuff with no proper home (yet) */ ! PyAPI_FUNC(char *) PyOS_Readline(char *); PyAPI_DATA(int) (*PyOS_InputHook)(void); ! PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(char *); /* Stack size, in "pointers" (so we get extra safety margins --- 114,120 ---- /* Stuff with no proper home (yet) */ ! PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *); PyAPI_DATA(int) (*PyOS_InputHook)(void); ! PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); /* Stack size, in "pointers" (so we get extra safety margins From loewis@users.sourceforge.net Sat Oct 26 15:42:04 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:42:04 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.502,1.503 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv27222/Misc Modified Files: NEWS Log Message: Document patch #512981. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.502 retrieving revision 1.503 diff -C2 -d -r1.502 -r1.503 *** NEWS 16 Oct 2002 18:28:36 -0000 1.502 --- NEWS 26 Oct 2002 14:42:02 -0000 1.503 *************** *** 293,296 **** --- 293,299 ---- ----------------- + - readline now dynamically adjusts its input/output stream if + sys.stdin/stdout changes. + - The _tkinter module (and hence Tkinter) has dropped support for Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are From loewis@users.sourceforge.net Sat Oct 26 15:43:09 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:43:09 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.211,1.212 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv27471/Misc Modified Files: ACKS Log Message: Add Daniel Stutzbach, for #512981. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** ACKS 17 Oct 2002 22:15:32 -0000 1.211 --- ACKS 26 Oct 2002 14:43:07 -0000 1.212 *************** *** 504,507 **** --- 504,508 ---- Peter Stoehr Ken Stox + Daniel Stutzbach William Tanksley Christian Tanzer From loewis@users.sourceforge.net Sat Oct 26 15:50:47 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:50:47 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib xmlsaxutils.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv29237/Doc/lib Modified Files: xmlsaxutils.tex Log Message: Patch #613256: Add nescape method to xml.sax.saxutils. Index: xmlsaxutils.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxutils.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xmlsaxutils.tex 10 Aug 2001 22:14:17 -0000 1.3 --- xmlsaxutils.tex 26 Oct 2002 14:50:45 -0000 1.4 *************** *** 23,26 **** --- 23,37 ---- \end{funcdesc} + \begin{funcdesc}{unescape}{data\optional{, entities}} + Unescape \character{\&}, \character{\<}, and \character{\>} + in a string of data. + + You can unescape other strings of data by passing a dictionary as the + optional \var{entities} parameter. The keys and values must all be + strings; each key will be replaced with its corresponding value. + + \versionadded{2.3} + \end{funcdesc} + \begin{funcdesc}{quoteattr}{data\optional{, entities}} Similar to \function{escape()}, but also prepares \var{data} to be From loewis@users.sourceforge.net Sat Oct 26 15:50:47 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:50:47 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_sax.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv29237/Lib/test Modified Files: test_sax.py Log Message: Patch #613256: Add nescape method to xml.sax.saxutils. Index: test_sax.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sax.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_sax.py 12 Sep 2002 17:02:01 -0000 1.22 --- test_sax.py 26 Oct 2002 14:50:45 -0000 1.23 *************** *** 9,13 **** # don't try to test this module if we cannot create a parser raise ImportError("no XML parsers available") ! from xml.sax.saxutils import XMLGenerator, escape, quoteattr, XMLFilterBase from xml.sax.expatreader import create_parser from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl --- 9,14 ---- # don't try to test this module if we cannot create a parser raise ImportError("no XML parsers available") ! from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \ ! XMLFilterBase from xml.sax.expatreader import create_parser from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl *************** *** 70,73 **** --- 71,85 ---- def test_escape_extra(): return escape("Hei på deg", {"å" : "å"}) == "Hei på deg" + + # ===== unescape + + def test_unescape_basic(): + return unescape("Donald Duck & Co") == "Donald Duck & Co" + + def test_unescape_all(): + return unescape("<Donald Duck & Co>") == "" + + def test_unescape_extra(): + return unescape("Hei på deg", {"å" : "å"}) == "Hei på deg" # ===== quoteattr From loewis@users.sourceforge.net Sat Oct 26 15:50:47 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:50:47 -0700 Subject: [Python-checkins] python/dist/src/Lib/test/output test_sax,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv29237/Lib/test/output Modified Files: test_sax Log Message: Patch #613256: Add nescape method to xml.sax.saxutils. Index: test_sax =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_sax,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_sax 7 Aug 2001 19:17:06 -0000 1.10 --- test_sax 26 Oct 2002 14:50:45 -0000 1.11 *************** *** 30,33 **** --- 30,36 ---- Passed test_single_double_quoteattr Passed test_single_quoteattr + Passed test_unescape_all + Passed test_unescape_basic + Passed test_unescape_extra Passed test_xmlgen_attr_escape Passed test_xmlgen_basic *************** *** 37,39 **** Passed test_xmlgen_ns Passed test_xmlgen_pi ! 37 tests, 0 failures --- 40,42 ---- Passed test_xmlgen_ns Passed test_xmlgen_pi ! 40 tests, 0 failures From loewis@users.sourceforge.net Sat Oct 26 15:50:47 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:50:47 -0700 Subject: [Python-checkins] python/dist/src/Lib/xml/sax saxutils.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv29237/Lib/xml/sax Modified Files: saxutils.py Log Message: Patch #613256: Add nescape method to xml.sax.saxutils. Index: saxutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** saxutils.py 7 Aug 2001 19:14:46 -0000 1.16 --- saxutils.py 26 Oct 2002 14:50:45 -0000 1.17 *************** *** 13,30 **** _StringTypes = [types.StringType] def escape(data, entities={}): """Escape &, <, and > in a string of data. ! You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. """ data = data.replace("&", "&") ! data = data.replace("<", "<") ! data = data.replace(">", ">") ! for chars, entity in entities.items(): ! data = data.replace(chars, entity) ! return data def quoteattr(data, entities={}): --- 13,50 ---- _StringTypes = [types.StringType] + def __dict_replace(s, d): + """Replace substrings of a string using a dictionary.""" + for key, value in d.items(): + s = s.replace(key, value) + return s def escape(data, entities={}): """Escape &, <, and > in a string of data. ! You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. """ + + # must do ampersand first data = data.replace("&", "&") ! data = __dict_replace(data, {"<" : "<", ! ">" : ">", ! }) ! return __dict_replace(data, entities) ! ! def unescape(data, entities={}): ! """Unescape &, <, and > in a string of data. ! ! You can unescape other strings of data by passing a dictionary as ! the optional entities parameter. The keys and values must all be ! strings; each key will be replaced with its corresponding value. ! """ ! data = __dict_replace(data, {"<" : "<", ! ">" : ">", ! }) ! # must do ampersand last ! data = data.replace("&", "&") ! return __dict_replace(data, entities) def quoteattr(data, entities={}): From loewis@users.sourceforge.net Sat Oct 26 15:50:48 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 07:50:48 -0700 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.212,1.213 NEWS,1.503,1.504 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv29237/Misc Modified Files: ACKS NEWS Log Message: Patch #613256: Add nescape method to xml.sax.saxutils. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** ACKS 26 Oct 2002 14:43:07 -0000 1.212 --- ACKS 26 Oct 2002 14:50:45 -0000 1.213 *************** *** 57,60 **** --- 57,61 ---- Finn Bock Paul Boddie + Matthew Boedicker David Bolen Jurjen Bos Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.503 retrieving revision 1.504 diff -C2 -d -r1.503 -r1.504 *** NEWS 26 Oct 2002 14:42:02 -0000 1.503 --- NEWS 26 Oct 2002 14:50:45 -0000 1.504 *************** *** 353,356 **** --- 353,359 ---- ------- + - xml.sax.saxutils.unescape has been added, to replace entity references + with their entity value. + - Queue.Queue.{put,get} now support an optional timeout argument. From loewis@users.sourceforge.net Sat Oct 26 16:01:56 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat, 26 Oct 2002 08:01:56 -0700 Subject: [Python-checkins] python/dist/src/Objects obmalloc.c,2.48,2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv32430 Modified Files: obmalloc.c Log Message: Patch #627105: Document that SYSTEM_PAGE_SIZE really should not be larger than the system page size. Index: obmalloc.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/obmalloc.c,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** obmalloc.c 12 Sep 2002 14:43:40 -0000 2.48 --- obmalloc.c 26 Oct 2002 15:01:53 -0000 2.49 *************** *** 140,144 **** * things simpler, we assume that it is 4K, which is OK for most systems. * It is probably better if this is the native page size, but it doesn't ! * have to be. */ #define SYSTEM_PAGE_SIZE (4 * 1024) --- 140,147 ---- * things simpler, we assume that it is 4K, which is OK for most systems. * It is probably better if this is the native page size, but it doesn't ! * have to be. In theory, if SYSTEM_PAGE_SIZE is larger than the native page ! * size, then `POOL_ADDR(p)->arenaindex' could rarely cause a segmentation ! * violation fault. 4K is apparently OK for all the platforms that python ! * currently targets. */ #define SYSTEM_PAGE_SIZE (4 * 1024) From montanaro@users.sourceforge.net Sun Oct 27 01:59:24 2002 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat, 26 Oct 2002 18:59:24 -0700 Subject: [Python-checkins] python/dist/src/Parser pgenmain.c,2.27,2.28 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv27793 Modified Files: pgenmain.c Log Message: Change PyOS_Readline declaration to match the recent change to myreadline.c (see Patch 512981). I changed stdin to sys_stdin in the body of the function, but did not change stderr to sys_stdout, though I suspect that may be the correct course. I don't know the code involved well enough to judge. Index: pgenmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/pgenmain.c,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** pgenmain.c 9 Jul 2002 02:57:01 -0000 2.27 --- pgenmain.c 27 Oct 2002 01:59:21 -0000 2.28 *************** *** 166,170 **** char * ! PyOS_Readline(char *prompt) { size_t n = 1000; --- 166,170 ---- char * ! PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { size_t n = 1000; *************** *** 174,178 **** return NULL; fprintf(stderr, "%s", prompt); ! q = fgets(p, n, stdin); if (q == NULL) { *p = '\0'; --- 174,178 ---- return NULL; fprintf(stderr, "%s", prompt); ! q = fgets(p, n, sys_stdin); if (q == NULL) { *p = '\0'; From gvanrossum@users.sourceforge.net Sun Oct 27 22:48:58 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 27 Oct 2002 14:48:58 -0800 Subject: [Python-checkins] python/dist/src/Tools ss1.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools In directory usw-pr-cvs1:/tmp/cvs-serv13061 Added Files: ss1.py Log Message: Beginnings of a spreadsheet I used as an example on Linux Lunacy II. --- NEW FILE: ss1.py --- """SS1 -- a spreadsheet.""" import os import re import sys import cgi import rexec from xml.parsers import expat LEFT, CENTER, RIGHT = "LEFT", "CENTER", "RIGHT" def ljust(x, n): return x.ljust(n) def center(x, n): return x.center(n) def rjust(x, n): return x.rjust(n) align2action = {LEFT: ljust, CENTER: center, RIGHT: rjust} align2xml = {LEFT: "left", CENTER: "center", RIGHT: "right"} xml2align = {"left": LEFT, "center": CENTER, "right": RIGHT} align2anchor = {LEFT: "w", CENTER: "center", RIGHT: "e"} def sum(seq): total = 0 for x in seq: if x is not None: total += x return total class Sheet: def __init__(self): self.cells = {} # {(x, y): cell, ...} self.rexec = rexec.RExec() m = self.rexec.add_module('__main__') m.cell = self.cellvalue m.cells = self.multicellvalue m.sum = sum def cellvalue(self, x, y): cell = self.getcell(x, y) if hasattr(cell, 'recalc'): return cell.recalc(self.rexec) else: return cell def multicellvalue(self, x1, y1, x2, y2): if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 seq = [] for y in range(y1, y2+1): for x in range(x1, x2+1): seq.append(self.cellvalue(x, y)) return seq def getcell(self, x, y): return self.cells.get((x, y)) def setcell(self, x, y, cell): assert x > 0 and y > 0 assert isinstance(cell, BaseCell) self.cells[x, y] = cell def clearcell(self, x, y): try: del self.cells[x, y] except KeyError: pass def clearcells(self, x1, y1, x2, y2): for xy in self.selectcells(x1, y1, x2, y2): del self.cells[xy] def clearrows(self, y1, y2): self.clearcells(0, y1, sys.maxint, y2) def clearcolumns(self, x1, x2): self.clearcells(x1, 0, x2, sys.maxint) def selectcells(self, x1, y1, x2, y2): if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 return [(x, y) for x, y in self.cells if x1 <= x <= x2 and y1 <= y <= y2] def movecells(self, x1, y1, x2, y2, dx, dy): if dx == 0 and dy == 0: return if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 assert x1+dx > 0 and y1+dy > 0 new = {} for x, y in self.cells: cell = self.cells[x, y] if hasattr(cell, 'renumber'): cell = cell.renumber(x1, y1, x2, y2, dx, dy) if x1 <= x <= x2 and y1 <= y <= y2: x += dx y += dy new[x, y] = cell self.cells = new def insertrows(self, y, n): assert n > 0 self.movecells(0, y, sys.maxint, sys.maxint, 0, n) def deleterows(self, y1, y2): if y1 > y2: y1, y2 = y2, y1 self.clearrows(y1, y2) self.movecells(0, y2+1, sys.maxint, sys.maxint, 0, y1-y2-1) def insertcolumns(self, x, n): assert n > 0 self.movecells(x, 0, sys.maxint, sys.maxint, n, 0) def deletecolumns(self, x1, x2): if x1 > x2: x1, x2 = x2, x1 self.clearcells(x1, x2) self.movecells(x2+1, 0, sys.maxint, sys.maxint, x1-x2-1, 0) def getsize(self): maxx = maxy = 0 for x, y in self.cells: maxx = max(maxx, x) maxy = max(maxy, y) return maxx, maxy def reset(self): for cell in self.cells.itervalues(): if hasattr(cell, 'reset'): cell.reset() def recalc(self): self.reset() for cell in self.cells.itervalues(): if hasattr(cell, 'recalc'): cell.recalc(self.rexec) def display(self): maxx, maxy = self.getsize() width, height = maxx+1, maxy+1 colwidth = [1] * width full = {} # Add column heading labels in row 0 for x in range(1, width): full[x, 0] = text, alignment = colnum2name(x), RIGHT colwidth[x] = max(colwidth[x], len(text)) # Add row labels in column 0 for y in range(1, height): full[0, y] = text, alignment = str(y), RIGHT colwidth[0] = max(colwidth[0], len(text)) # Add sheet cells in columns with x>0 and y>0 for (x, y), cell in self.cells.iteritems(): if x <= 0 or y <= 0: continue if hasattr(cell, 'recalc'): cell.recalc(self.rexec) if hasattr(cell, 'format'): text, alignment = cell.format() assert isinstance(text, str) assert alignment in (LEFT, CENTER, RIGHT) else: text = str(cell) if isinstance(cell, str): alignment = LEFT else: alignment = RIGHT full[x, y] = (text, alignment) colwidth[x] = max(colwidth[x], len(text)) # Calculate the horizontal separator line (dashes and dots) sep = "" for x in range(width): if sep: sep += "+" sep += "-"*colwidth[x] # Now print The full grid for y in range(height): line = "" for x in range(width): text, alignment = full.get((x, y)) or ("", LEFT) text = align2action[alignment](text, colwidth[x]) if line: line += '|' line += text print line if y == 0: print sep def xml(self): out = [''] for (x, y), cell in self.cells.iteritems(): if hasattr(cell, 'xml'): cellxml = cell.xml() else: cellxml = '%s' % cgi.escape(cell) out.append('\n %s\n' % (y, x, cellxml)) out.append('') return '\n'.join(out) def save(self, filename): text = self.xml() f = open(filename, "w") f.write(text) if text and not text.endswith('\n'): f.write('\n') f.close() def load(self, filename): f = open(filename, 'r') SheetParser(self).parsefile(f) f.close() class SheetParser: def __init__(self, sheet): self.sheet = sheet def parsefile(self, f): parser = expat.ParserCreate() parser.StartElementHandler = self.startelement parser.EndElementHandler = self.endelement parser.CharacterDataHandler = self.data parser.ParseFile(f) def startelement(self, tag, attrs): method = getattr(self, 'start_'+tag, None) if method: for key, value in attrs.iteritems(): attrs[key] = str(value) # XXX Convert Unicode to 8-bit method(attrs) self.texts = [] def data(self, text): text = str(text) # XXX Convert Unicode to 8-bit self.texts.append(text) def endelement(self, tag): method = getattr(self, 'end_'+tag, None) if method: method("".join(self.texts)) def start_cell(self, attrs): self.y = int(attrs.get("row")) self.x = int(attrs.get("col")) def start_value(self, attrs): self.fmt = attrs.get('format') self.alignment = xml2align.get(attrs.get('align')) start_formula = start_value def end_int(self, text): try: self.value = int(text) except: self.value = None def end_long(self, text): try: self.value = long(text) except: self.value = None def end_double(self, text): try: self.value = float(text) except: self.value = None def end_complex(self, text): try: self.value = complex(text) except: self.value = None def end_string(self, text): try: self.value = text except: self.value = None def end_value(self, text): if isinstance(self.value, BaseCell): self.cell = self.value elif isinstance(self.value, str): self.cell = StringCell(self.value, self.fmt or "%s", self.alignment or LEFT) else: self.cell = NumericCell(self.value, self.fmt or "%s", self.alignment or RIGHT) def end_formula(self, text): self.cell = FormulaCell(text, self.fmt or "%s", self.alignment or RIGHT) def end_cell(self, text): self.sheet.setcell(self.x, self.y, self.cell) class BaseCell: __init__ = None # Must provide """Abstract base class for sheet cells. Subclasses may but needn't provide the following APIs: cell.reset() -- prepare for recalculation cell.recalc(rexec) -> value -- recalculate formula cell.format() -> (value, alignment) -- return formatted value cell.xml() -> string -- return XML """ class NumericCell(BaseCell): def __init__(self, value, fmt="%s", alignment=RIGHT): assert isinstance(value, (int, long, float, complex)) assert alignment in (LEFT, CENTER, RIGHT) self.value = value self.fmt = fmt self.alignment = alignment def recalc(self, rexec): return self.value def format(self): try: text = self.fmt % self.value except: text = str(self.value) return text, self.alignment def xml(self): method = getattr(self, '_xml_' + type(self.value).__name__) return '%s' % ( align2xml[self.alignment], self.fmt, method()) def _xml_int(self): if -2**31 <= self.value < 2**31: return '%s' % self.value else: return self._xml_long() def _xml_long(self): return '%s' % self.value def _xml_float(self): return '%s' % repr(self.value) def _xml_complex(self): return '%s' % repr(self.value) class StringCell(BaseCell): def __init__(self, text, fmt="%s", alignment=LEFT): assert isinstance(text, (str, unicode)) assert alignment in (LEFT, CENTER, RIGHT) self.text = text self.fmt = fmt self.alignment = alignment def recalc(self, rexec): return self.text def format(self): return self.text, self.alignment def xml(self): s = '%s' return s % ( align2xml[self.alignment], self.fmt, cgi.escape(self.text)) class FormulaCell(BaseCell): def __init__(self, formula, fmt="%s", alignment=RIGHT): assert alignment in (LEFT, CENTER, RIGHT) self.formula = formula self.translated = translate(self.formula) self.fmt = fmt self.alignment = alignment self.reset() def reset(self): self.value = None def recalc(self, rexec): if self.value is None: try: self.value = rexec.r_eval(self.translated) except: exc = sys.exc_info()[0] if hasattr(exc, "__name__"): self.value = exc.__name__ else: self.value = str(exc) return self.value def format(self): try: text = self.fmt % self.value except: text = str(self.value) return text, self.alignment def xml(self): return '%s' % ( align2xml[self.alignment], self.fmt, self.formula) def renumber(self, x1, y1, x2, y2, dx, dy): out = [] for part in re.split('(\w+)', self.formula): m = re.match('^([A-Z]+)([1-9][0-9]*)$', part) if m is not None: sx, sy = m.groups() x = colname2num(sx) y = int(sy) if x1 <= x <= x2 and y1 <= y <= y2: part = cellname(x+dx, y+dy) out.append(part) return FormulaCell("".join(out), self.fmt, self.alignment) def translate(formula): """Translate a formula containing fancy cell names to valid Python code. Examples: B4 -> cell(2, 4) B4:Z100 -> cells(2, 4, 26, 100) """ out = [] for part in re.split(r"(\w+(?::\w+)?)", formula): m = re.match(r"^([A-Z]+)([1-9][0-9]*)(?::([A-Z]+)([1-9][0-9]*))?$", part) if m is None: out.append(part) else: x1, y1, x2, y2 = m.groups() x1 = colname2num(x1) if x2 is None: s = "cell(%s, %s)" % (x1, y1) else: x2 = colname2num(x2) s = "cells(%s, %s, %s, %s)" % (x1, y1, x2, y2) out.append(s) return "".join(out) def cellname(x, y): "Translate a cell coordinate to a fancy cell name (e.g. (1, 1)->'A1')." assert x > 0 # Column 0 has an empty name, so can't use that return colnum2name(x) + str(y) def colname2num(s): "Translate a column name to number (e.g. 'A'->1, 'Z'->26, 'AA'->27)." s = s.upper() n = 0 for c in s: assert 'A' <= c <= 'Z' n = n*26 + ord(c) - ord('A') + 1 return n def colnum2name(n): "Translate a column number to name (e.g. 1->'A', etc.)." assert n > 0 s = "" while n: n, m = divmod(n-1, 26) s = chr(m+ord('A')) + s return s import Tkinter as Tk class SheetGUI: """Beginnings of a GUI for a spreadsheet. TO DO: - clear multiple cells - Select rows or columns - Insert, clear, remove rows or columns - Show new contents while typing - Scroll bars - Grow grid when window is grown - Proper menus - Undo, redo - Cut, copy and paste - Formatting and alignment """ def __init__(self, filename="sheet1.xml", rows=10, columns=5): """Constructor. Load the sheet from the filename argument. Set up the Tk widget tree. """ # Create and load the sheet self.filename = filename self.sheet = Sheet() if os.path.isfile(filename): self.sheet.load(filename) # Calculate the needed grid size maxx, maxy = self.sheet.getsize() rows = max(rows, maxy) columns = max(columns, maxx) # Create the widgets self.root = Tk.Tk() self.root.wm_title("Spreadsheet: %s" % self.filename) self.beacon = Tk.Label(self.root, text="A1", font=('helvetica', 16, 'bold')) self.entry = Tk.Entry(self.root) self.savebutton = Tk.Button(self.root, text="Save", command=self.save) self.cellgrid = Tk.Frame(self.root) # Configure the widget lay-out self.cellgrid.pack(side="bottom", expand=1, fill="both") self.beacon.pack(side="left") self.savebutton.pack(side="right") self.entry.pack(side="left", expand=1, fill="x") # Bind some events self.entry.bind("", self.return_event) self.entry.bind("", self.shift_return_event) self.entry.bind("", self.tab_event) self.entry.bind("", self.shift_tab_event) # Now create the cell grid self.makegrid(rows, columns) # Select the top-left cell self.currentxy = None self.cornerxy = None self.setcurrent(1, 1) # Copy the sheet cells to the GUI cells self.sync() def makegrid(self, rows, columns): """Helper to create the grid of GUI cells. The edge (x==0 or y==0) is filled with labels; the rest is real cells. """ self.gridcells = {} # Create the top row of labels for x in range(1, columns+1): self.cellgrid.grid_columnconfigure(x, minsize=64) cell = Tk.Label(self.cellgrid, text=colnum2name(x), relief='raised') cell.grid_configure(column=x, row=0, sticky='WE') self.gridcells[x, 0] = cell # Create the leftmost column of labels for y in range(1, rows+1): cell = Tk.Label(self.cellgrid, text=str(y), relief='raised') cell.grid_configure(column=0, row=y, sticky='WE') self.gridcells[0, y] = cell # Create the real cells for x in range(1, columns+1): for y in range(1, rows+1): cell = Tk.Label(self.cellgrid, relief='sunken', bg='white', fg='black') cell.grid_configure(column=x, row=y, sticky='NWSE') self.gridcells[x, y] = cell def helper(event, self=self, x=x, y=y): self.setcurrent(x, y) cell.bind("", helper) def shelper(event, self=self, x=x, y=y): self.setcorner(x, y) cell.bind("", shelper) def save(self): self.sheet.save(self.filename) def setcurrent(self, x, y): "Make (x, y) the current cell." if self.currentxy is not None: self.change_cell() self.clearfocus() name = cellname(x, y) cell = self.sheet.getcell(x, y) if cell is None: text = "" elif isinstance(cell, FormulaCell): text = '=' + cell.formula else: text, alignment = cell.format() self.beacon['text'] = name self.entry.delete(0, 'end') self.entry.insert(0, text) self.entry.selection_range(0, 'end') self.entry.focus_set() self.currentxy = x, y self.cornerxy = None gridcell = self.gridcells.get(self.currentxy) if gridcell is not None: gridcell['bg'] = 'lightBlue' def setcorner(self, x, y): if self.currentxy is None or self.currentxy == (x, y): self.setcurrent(x, y) return self.clearfocus() self.cornerxy = x, y x1, y1 = self.currentxy x2, y2 = self.cornerxy or self.currentxy if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 for x in range(x1, x2+1): for y in range(y1, y2+1): gridcell = self.gridcells.get((x, y)) if gridcell is not None: gridcell['bg'] = 'lightBlue' name1 = cellname(*self.currentxy) name2 = cellname(*self.cornerxy) self.beacon['text'] = "%s:%s" % (name1, name2) def clearfocus(self): if self.currentxy is not None: x1, y1 = self.currentxy x2, y2 = self.cornerxy or self.currentxy if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 for x in range(x1, x2+1): for y in range(y1, y2+1): gridcell = self.gridcells.get((x, y)) if gridcell is not None: gridcell['bg'] = 'white' def return_event(self, event): "Callback for the Return key." self.change_cell() x, y = self.currentxy self.setcurrent(x, y+1) return "break" def shift_return_event(self, event): "Callback for the Return key with Shift modifier." self.change_cell() x, y = self.currentxy self.setcurrent(x, max(1, y-1)) return "break" def tab_event(self, event): "Callback for the Tab key." self.change_cell() x, y = self.currentxy self.setcurrent(x+1, y) return "break" def shift_tab_event(self, event): "Callback for the Tab key with Shift modifier." self.change_cell() x, y = self.currentxy self.setcurrent(max(1, x-1), y) return "break" def change_cell(self): "Set the current cell from the entry widget." x, y = self.currentxy text = self.entry.get() cell = None if text.startswith('='): cell = FormulaCell(text[1:]) else: for cls in int, long, float, complex: try: value = cls(text) except: continue else: cell = NumericCell(value) break if cell is None and text: cell = StringCell(text) if cell is None: self.sheet.clearcell(x, y) else: self.sheet.setcell(x, y, cell) self.sync() def sync(self): "Fill the GUI cells from the sheet cells." self.sheet.recalc() for (x, y), gridcell in self.gridcells.iteritems(): if x == 0 or y == 0: continue cell = self.sheet.getcell(x, y) if cell is None: gridcell['text'] = "" else: if hasattr(cell, 'format'): text, alignment = cell.format() else: text, alignment = str(cell), LEFT gridcell['text'] = text gridcell['anchor'] = align2anchor[alignment] def test_basic(): "Basic non-gui self-test." import os a = Sheet() for x in range(1, 11): for y in range(1, 11): if x == 1: cell = NumericCell(y) elif y == 1: cell = NumericCell(x) else: c1 = cellname(x, 1) c2 = cellname(1, y) formula = "%s*%s" % (c1, c2) cell = FormulaCell(formula) a.setcell(x, y, cell) ## if os.path.isfile("sheet1.xml"): ## print "Loading from sheet1.xml" ## a.load("sheet1.xml") a.display() a.save("sheet1.xml") def test_gui(): "GUI test." g = SheetGUI() g.root.mainloop() if __name__ == '__main__': #test_basic() test_gui() From gvanrossum@users.sourceforge.net Mon Oct 28 01:06:39 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 27 Oct 2002 17:06:39 -0800 Subject: [Python-checkins] python/dist/src/Demo/tkinter/guido ss1.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tkinter/guido In directory usw-pr-cvs1:/tmp/cvs-serv16725 Added Files: ss1.py Log Message: Spreadsheet demo that I used in the advanced talk at Linux Lunacy II. --- NEW FILE: ss1.py --- """SS1 -- a spreadsheet.""" import os import re import sys import cgi import rexec from xml.parsers import expat LEFT, CENTER, RIGHT = "LEFT", "CENTER", "RIGHT" def ljust(x, n): return x.ljust(n) def center(x, n): return x.center(n) def rjust(x, n): return x.rjust(n) align2action = {LEFT: ljust, CENTER: center, RIGHT: rjust} align2xml = {LEFT: "left", CENTER: "center", RIGHT: "right"} xml2align = {"left": LEFT, "center": CENTER, "right": RIGHT} align2anchor = {LEFT: "w", CENTER: "center", RIGHT: "e"} def sum(seq): total = 0 for x in seq: if x is not None: total += x return total class Sheet: def __init__(self): self.cells = {} # {(x, y): cell, ...} self.rexec = rexec.RExec() m = self.rexec.add_module('__main__') m.cell = self.cellvalue m.cells = self.multicellvalue m.sum = sum def cellvalue(self, x, y): cell = self.getcell(x, y) if hasattr(cell, 'recalc'): return cell.recalc(self.rexec) else: return cell def multicellvalue(self, x1, y1, x2, y2): if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 seq = [] for y in range(y1, y2+1): for x in range(x1, x2+1): seq.append(self.cellvalue(x, y)) return seq def getcell(self, x, y): return self.cells.get((x, y)) def setcell(self, x, y, cell): assert x > 0 and y > 0 assert isinstance(cell, BaseCell) self.cells[x, y] = cell def clearcell(self, x, y): try: del self.cells[x, y] except KeyError: pass def clearcells(self, x1, y1, x2, y2): for xy in self.selectcells(x1, y1, x2, y2): del self.cells[xy] def clearrows(self, y1, y2): self.clearcells(0, y1, sys.maxint, y2) def clearcolumns(self, x1, x2): self.clearcells(x1, 0, x2, sys.maxint) def selectcells(self, x1, y1, x2, y2): if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 return [(x, y) for x, y in self.cells if x1 <= x <= x2 and y1 <= y <= y2] def movecells(self, x1, y1, x2, y2, dx, dy): if dx == 0 and dy == 0: return if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 assert x1+dx > 0 and y1+dy > 0 new = {} for x, y in self.cells: cell = self.cells[x, y] if hasattr(cell, 'renumber'): cell = cell.renumber(x1, y1, x2, y2, dx, dy) if x1 <= x <= x2 and y1 <= y <= y2: x += dx y += dy new[x, y] = cell self.cells = new def insertrows(self, y, n): assert n > 0 self.movecells(0, y, sys.maxint, sys.maxint, 0, n) def deleterows(self, y1, y2): if y1 > y2: y1, y2 = y2, y1 self.clearrows(y1, y2) self.movecells(0, y2+1, sys.maxint, sys.maxint, 0, y1-y2-1) def insertcolumns(self, x, n): assert n > 0 self.movecells(x, 0, sys.maxint, sys.maxint, n, 0) def deletecolumns(self, x1, x2): if x1 > x2: x1, x2 = x2, x1 self.clearcells(x1, x2) self.movecells(x2+1, 0, sys.maxint, sys.maxint, x1-x2-1, 0) def getsize(self): maxx = maxy = 0 for x, y in self.cells: maxx = max(maxx, x) maxy = max(maxy, y) return maxx, maxy def reset(self): for cell in self.cells.itervalues(): if hasattr(cell, 'reset'): cell.reset() def recalc(self): self.reset() for cell in self.cells.itervalues(): if hasattr(cell, 'recalc'): cell.recalc(self.rexec) def display(self): maxx, maxy = self.getsize() width, height = maxx+1, maxy+1 colwidth = [1] * width full = {} # Add column heading labels in row 0 for x in range(1, width): full[x, 0] = text, alignment = colnum2name(x), RIGHT colwidth[x] = max(colwidth[x], len(text)) # Add row labels in column 0 for y in range(1, height): full[0, y] = text, alignment = str(y), RIGHT colwidth[0] = max(colwidth[0], len(text)) # Add sheet cells in columns with x>0 and y>0 for (x, y), cell in self.cells.iteritems(): if x <= 0 or y <= 0: continue if hasattr(cell, 'recalc'): cell.recalc(self.rexec) if hasattr(cell, 'format'): text, alignment = cell.format() assert isinstance(text, str) assert alignment in (LEFT, CENTER, RIGHT) else: text = str(cell) if isinstance(cell, str): alignment = LEFT else: alignment = RIGHT full[x, y] = (text, alignment) colwidth[x] = max(colwidth[x], len(text)) # Calculate the horizontal separator line (dashes and dots) sep = "" for x in range(width): if sep: sep += "+" sep += "-"*colwidth[x] # Now print The full grid for y in range(height): line = "" for x in range(width): text, alignment = full.get((x, y)) or ("", LEFT) text = align2action[alignment](text, colwidth[x]) if line: line += '|' line += text print line if y == 0: print sep def xml(self): out = [''] for (x, y), cell in self.cells.iteritems(): if hasattr(cell, 'xml'): cellxml = cell.xml() else: cellxml = '%s' % cgi.escape(cell) out.append('\n %s\n' % (y, x, cellxml)) out.append('') return '\n'.join(out) def save(self, filename): text = self.xml() f = open(filename, "w") f.write(text) if text and not text.endswith('\n'): f.write('\n') f.close() def load(self, filename): f = open(filename, 'r') SheetParser(self).parsefile(f) f.close() class SheetParser: def __init__(self, sheet): self.sheet = sheet def parsefile(self, f): parser = expat.ParserCreate() parser.StartElementHandler = self.startelement parser.EndElementHandler = self.endelement parser.CharacterDataHandler = self.data parser.ParseFile(f) def startelement(self, tag, attrs): method = getattr(self, 'start_'+tag, None) if method: for key, value in attrs.iteritems(): attrs[key] = str(value) # XXX Convert Unicode to 8-bit method(attrs) self.texts = [] def data(self, text): text = str(text) # XXX Convert Unicode to 8-bit self.texts.append(text) def endelement(self, tag): method = getattr(self, 'end_'+tag, None) if method: method("".join(self.texts)) def start_cell(self, attrs): self.y = int(attrs.get("row")) self.x = int(attrs.get("col")) def start_value(self, attrs): self.fmt = attrs.get('format') self.alignment = xml2align.get(attrs.get('align')) start_formula = start_value def end_int(self, text): try: self.value = int(text) except: self.value = None def end_long(self, text): try: self.value = long(text) except: self.value = None def end_double(self, text): try: self.value = float(text) except: self.value = None def end_complex(self, text): try: self.value = complex(text) except: self.value = None def end_string(self, text): try: self.value = text except: self.value = None def end_value(self, text): if isinstance(self.value, BaseCell): self.cell = self.value elif isinstance(self.value, str): self.cell = StringCell(self.value, self.fmt or "%s", self.alignment or LEFT) else: self.cell = NumericCell(self.value, self.fmt or "%s", self.alignment or RIGHT) def end_formula(self, text): self.cell = FormulaCell(text, self.fmt or "%s", self.alignment or RIGHT) def end_cell(self, text): self.sheet.setcell(self.x, self.y, self.cell) class BaseCell: __init__ = None # Must provide """Abstract base class for sheet cells. Subclasses may but needn't provide the following APIs: cell.reset() -- prepare for recalculation cell.recalc(rexec) -> value -- recalculate formula cell.format() -> (value, alignment) -- return formatted value cell.xml() -> string -- return XML """ class NumericCell(BaseCell): def __init__(self, value, fmt="%s", alignment=RIGHT): assert isinstance(value, (int, long, float, complex)) assert alignment in (LEFT, CENTER, RIGHT) self.value = value self.fmt = fmt self.alignment = alignment def recalc(self, rexec): return self.value def format(self): try: text = self.fmt % self.value except: text = str(self.value) return text, self.alignment def xml(self): method = getattr(self, '_xml_' + type(self.value).__name__) return '%s' % ( align2xml[self.alignment], self.fmt, method()) def _xml_int(self): if -2**31 <= self.value < 2**31: return '%s' % self.value else: return self._xml_long() def _xml_long(self): return '%s' % self.value def _xml_float(self): return '%s' % repr(self.value) def _xml_complex(self): return '%s' % repr(self.value) class StringCell(BaseCell): def __init__(self, text, fmt="%s", alignment=LEFT): assert isinstance(text, (str, unicode)) assert alignment in (LEFT, CENTER, RIGHT) self.text = text self.fmt = fmt self.alignment = alignment def recalc(self, rexec): return self.text def format(self): return self.text, self.alignment def xml(self): s = '%s' return s % ( align2xml[self.alignment], self.fmt, cgi.escape(self.text)) class FormulaCell(BaseCell): def __init__(self, formula, fmt="%s", alignment=RIGHT): assert alignment in (LEFT, CENTER, RIGHT) self.formula = formula self.translated = translate(self.formula) self.fmt = fmt self.alignment = alignment self.reset() def reset(self): self.value = None def recalc(self, rexec): if self.value is None: try: self.value = rexec.r_eval(self.translated) except: exc = sys.exc_info()[0] if hasattr(exc, "__name__"): self.value = exc.__name__ else: self.value = str(exc) return self.value def format(self): try: text = self.fmt % self.value except: text = str(self.value) return text, self.alignment def xml(self): return '%s' % ( align2xml[self.alignment], self.fmt, self.formula) def renumber(self, x1, y1, x2, y2, dx, dy): out = [] for part in re.split('(\w+)', self.formula): m = re.match('^([A-Z]+)([1-9][0-9]*)$', part) if m is not None: sx, sy = m.groups() x = colname2num(sx) y = int(sy) if x1 <= x <= x2 and y1 <= y <= y2: part = cellname(x+dx, y+dy) out.append(part) return FormulaCell("".join(out), self.fmt, self.alignment) def translate(formula): """Translate a formula containing fancy cell names to valid Python code. Examples: B4 -> cell(2, 4) B4:Z100 -> cells(2, 4, 26, 100) """ out = [] for part in re.split(r"(\w+(?::\w+)?)", formula): m = re.match(r"^([A-Z]+)([1-9][0-9]*)(?::([A-Z]+)([1-9][0-9]*))?$", part) if m is None: out.append(part) else: x1, y1, x2, y2 = m.groups() x1 = colname2num(x1) if x2 is None: s = "cell(%s, %s)" % (x1, y1) else: x2 = colname2num(x2) s = "cells(%s, %s, %s, %s)" % (x1, y1, x2, y2) out.append(s) return "".join(out) def cellname(x, y): "Translate a cell coordinate to a fancy cell name (e.g. (1, 1)->'A1')." assert x > 0 # Column 0 has an empty name, so can't use that return colnum2name(x) + str(y) def colname2num(s): "Translate a column name to number (e.g. 'A'->1, 'Z'->26, 'AA'->27)." s = s.upper() n = 0 for c in s: assert 'A' <= c <= 'Z' n = n*26 + ord(c) - ord('A') + 1 return n def colnum2name(n): "Translate a column number to name (e.g. 1->'A', etc.)." assert n > 0 s = "" while n: n, m = divmod(n-1, 26) s = chr(m+ord('A')) + s return s import Tkinter as Tk class SheetGUI: """Beginnings of a GUI for a spreadsheet. TO DO: - clear multiple cells - Select rows or columns - Insert, clear, remove rows or columns - Show new contents while typing - Scroll bars - Grow grid when window is grown - Proper menus - Undo, redo - Cut, copy and paste - Formatting and alignment """ def __init__(self, filename="sheet1.xml", rows=10, columns=5): """Constructor. Load the sheet from the filename argument. Set up the Tk widget tree. """ # Create and load the sheet self.filename = filename self.sheet = Sheet() if os.path.isfile(filename): self.sheet.load(filename) # Calculate the needed grid size maxx, maxy = self.sheet.getsize() rows = max(rows, maxy) columns = max(columns, maxx) # Create the widgets self.root = Tk.Tk() self.root.wm_title("Spreadsheet: %s" % self.filename) self.beacon = Tk.Label(self.root, text="A1", font=('helvetica', 16, 'bold')) self.entry = Tk.Entry(self.root) self.savebutton = Tk.Button(self.root, text="Save", command=self.save) self.cellgrid = Tk.Frame(self.root) # Configure the widget lay-out self.cellgrid.pack(side="bottom", expand=1, fill="both") self.beacon.pack(side="left") self.savebutton.pack(side="right") self.entry.pack(side="left", expand=1, fill="x") # Bind some events self.entry.bind("", self.return_event) self.entry.bind("", self.shift_return_event) self.entry.bind("", self.tab_event) self.entry.bind("", self.shift_tab_event) # Now create the cell grid self.makegrid(rows, columns) # Select the top-left cell self.currentxy = None self.cornerxy = None self.setcurrent(1, 1) # Copy the sheet cells to the GUI cells self.sync() def makegrid(self, rows, columns): """Helper to create the grid of GUI cells. The edge (x==0 or y==0) is filled with labels; the rest is real cells. """ self.gridcells = {} # Create the top row of labels for x in range(1, columns+1): self.cellgrid.grid_columnconfigure(x, minsize=64) cell = Tk.Label(self.cellgrid, text=colnum2name(x), relief='raised') cell.grid_configure(column=x, row=0, sticky='WE') self.gridcells[x, 0] = cell # Create the leftmost column of labels for y in range(1, rows+1): cell = Tk.Label(self.cellgrid, text=str(y), relief='raised') cell.grid_configure(column=0, row=y, sticky='WE') self.gridcells[0, y] = cell # Create the real cells for x in range(1, columns+1): for y in range(1, rows+1): cell = Tk.Label(self.cellgrid, relief='sunken', bg='white', fg='black') cell.grid_configure(column=x, row=y, sticky='NWSE') self.gridcells[x, y] = cell def helper(event, self=self, x=x, y=y): self.setcurrent(x, y) cell.bind("", helper) def shelper(event, self=self, x=x, y=y): self.setcorner(x, y) cell.bind("", shelper) def save(self): self.sheet.save(self.filename) def setcurrent(self, x, y): "Make (x, y) the current cell." if self.currentxy is not None: self.change_cell() self.clearfocus() name = cellname(x, y) cell = self.sheet.getcell(x, y) if cell is None: text = "" elif isinstance(cell, FormulaCell): text = '=' + cell.formula else: text, alignment = cell.format() self.beacon['text'] = name self.entry.delete(0, 'end') self.entry.insert(0, text) self.entry.selection_range(0, 'end') self.entry.focus_set() self.currentxy = x, y self.cornerxy = None gridcell = self.gridcells.get(self.currentxy) if gridcell is not None: gridcell['bg'] = 'lightBlue' def setcorner(self, x, y): if self.currentxy is None or self.currentxy == (x, y): self.setcurrent(x, y) return self.clearfocus() self.cornerxy = x, y x1, y1 = self.currentxy x2, y2 = self.cornerxy or self.currentxy if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 for x in range(x1, x2+1): for y in range(y1, y2+1): gridcell = self.gridcells.get((x, y)) if gridcell is not None: gridcell['bg'] = 'lightBlue' name1 = cellname(*self.currentxy) name2 = cellname(*self.cornerxy) self.beacon['text'] = "%s:%s" % (name1, name2) def clearfocus(self): if self.currentxy is not None: x1, y1 = self.currentxy x2, y2 = self.cornerxy or self.currentxy if x1 > x2: x1, x2 = x2, x1 if y1 > y2: y1, y2 = y2, y1 for x in range(x1, x2+1): for y in range(y1, y2+1): gridcell = self.gridcells.get((x, y)) if gridcell is not None: gridcell['bg'] = 'white' def return_event(self, event): "Callback for the Return key." self.change_cell() x, y = self.currentxy self.setcurrent(x, y+1) return "break" def shift_return_event(self, event): "Callback for the Return key with Shift modifier." self.change_cell() x, y = self.currentxy self.setcurrent(x, max(1, y-1)) return "break" def tab_event(self, event): "Callback for the Tab key." self.change_cell() x, y = self.currentxy self.setcurrent(x+1, y) return "break" def shift_tab_event(self, event): "Callback for the Tab key with Shift modifier." self.change_cell() x, y = self.currentxy self.setcurrent(max(1, x-1), y) return "break" def change_cell(self): "Set the current cell from the entry widget." x, y = self.currentxy text = self.entry.get() cell = None if text.startswith('='): cell = FormulaCell(text[1:]) else: for cls in int, long, float, complex: try: value = cls(text) except: continue else: cell = NumericCell(value) break if cell is None and text: cell = StringCell(text) if cell is None: self.sheet.clearcell(x, y) else: self.sheet.setcell(x, y, cell) self.sync() def sync(self): "Fill the GUI cells from the sheet cells." self.sheet.recalc() for (x, y), gridcell in self.gridcells.iteritems(): if x == 0 or y == 0: continue cell = self.sheet.getcell(x, y) if cell is None: gridcell['text'] = "" else: if hasattr(cell, 'format'): text, alignment = cell.format() else: text, alignment = str(cell), LEFT gridcell['text'] = text gridcell['anchor'] = align2anchor[alignment] def test_basic(): "Basic non-gui self-test." import os a = Sheet() for x in range(1, 11): for y in range(1, 11): if x == 1: cell = NumericCell(y) elif y == 1: cell = NumericCell(x) else: c1 = cellname(x, 1) c2 = cellname(1, y) formula = "%s*%s" % (c1, c2) cell = FormulaCell(formula) a.setcell(x, y, cell) ## if os.path.isfile("sheet1.xml"): ## print "Loading from sheet1.xml" ## a.load("sheet1.xml") a.display() a.save("sheet1.xml") def test_gui(): "GUI test." g = SheetGUI() g.root.mainloop() if __name__ == '__main__': #test_basic() test_gui() From gvanrossum@users.sourceforge.net Mon Oct 28 01:07:04 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Sun, 27 Oct 2002 17:07:04 -0800 Subject: [Python-checkins] python/dist/src/Tools ss1.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Tools In directory usw-pr-cvs1:/tmp/cvs-serv16985 Removed Files: ss1.py Log Message: Oops, committed this in the wrong place. --- ss1.py DELETED --- From fdrake@users.sourceforge.net Mon Oct 28 17:29:05 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 09:29:05 -0800 Subject: [Python-checkins] python/dist/src/Lib/xml/sax saxutils.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv20493 Modified Files: saxutils.py Log Message: Avoid calling __dict_replace() if we don't need to -- the call is much more expensive than just doing to work needed, and these things seem to always turn into a bottleneck eventually. Index: saxutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** saxutils.py 26 Oct 2002 14:50:45 -0000 1.17 --- saxutils.py 28 Oct 2002 17:29:01 -0000 1.18 *************** *** 29,36 **** # must do ampersand first data = data.replace("&", "&") ! data = __dict_replace(data, {"<" : "<", ! ">" : ">", ! }) ! return __dict_replace(data, entities) def unescape(data, entities={}): --- 29,37 ---- # must do ampersand first data = data.replace("&", "&") ! data = data.replace(">", ">") ! data = data.replace("<", "<") ! if entities: ! data = __dict_replace(data, entities) ! return data def unescape(data, entities={}): *************** *** 41,50 **** strings; each key will be replaced with its corresponding value. """ ! data = __dict_replace(data, {"<" : "<", ! ">" : ">", ! }) # must do ampersand last data = data.replace("&", "&") ! return __dict_replace(data, entities) def quoteattr(data, entities={}): --- 42,52 ---- strings; each key will be replaced with its corresponding value. """ ! data = data.replace("<", "<") ! data = data.replace(">", ">") # must do ampersand last data = data.replace("&", "&") ! if entities: ! data = __dict_replace(data, entities) ! return data def quoteattr(data, entities={}): From fdrake@users.sourceforge.net Mon Oct 28 17:47:02 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 09:47:02 -0800 Subject: [Python-checkins] python/dist/src/Lib/xml/sax saxutils.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv29586/xml/sax Modified Files: saxutils.py Log Message: Really do replacement of & last to avoid bad interactions between & replacement and replacements based on the entities parameter. Index: saxutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** saxutils.py 28 Oct 2002 17:29:01 -0000 1.18 --- saxutils.py 28 Oct 2002 17:46:59 -0000 1.19 *************** *** 44,51 **** data = data.replace("<", "<") data = data.replace(">", ">") - # must do ampersand last - data = data.replace("&", "&") if entities: data = __dict_replace(data, entities) return data --- 44,51 ---- data = data.replace("<", "<") data = data.replace(">", ">") if entities: data = __dict_replace(data, entities) + # must do ampersand last + data = data.replace("&", "&") return data From fdrake@users.sourceforge.net Mon Oct 28 17:58:50 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 09:58:50 -0800 Subject: [Python-checkins] python/dist/src/Lib/test test_sax.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3554/test Modified Files: test_sax.py Log Message: Add a test of interaction between & and extra replacements. Remove extra noise from the output when there are no errors, and say more in the exception when there are errors. Index: test_sax.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sax.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_sax.py 26 Oct 2002 14:50:45 -0000 1.23 --- test_sax.py 28 Oct 2002 17:58:48 -0000 1.24 *************** *** 20,34 **** tests = 0 ! fails = 0 def confirm(outcome, name): ! global tests, fails tests = tests + 1 if outcome: ! print "Passed", name else: ! print "Failed", name ! fails = fails + 1 def test_make_parser2(): --- 20,34 ---- tests = 0 ! failures = [] def confirm(outcome, name): ! global tests tests = tests + 1 if outcome: ! if verbose: ! print "Failed", name else: ! failures.append(name) def test_make_parser2(): *************** *** 83,86 **** --- 83,89 ---- return unescape("Hei på deg", {"å" : "å"}) == "Hei på deg" + def test_unescape_amp_extra(): + return unescape("&foo;", {"&foo;": "splat"}) == "&foo;" + # ===== quoteattr *************** *** 651,655 **** confirm(value(), name) ! print "%d tests, %d failures" % (tests, fails) ! if fails != 0: ! raise TestFailed, "%d of %d tests failed" % (fails, tests) --- 654,660 ---- confirm(value(), name) ! if verbose: ! print "%d tests, %d failures" % (tests, len(failures)) ! if failures: ! raise TestFailed("%d of %d tests failed: %s" ! % (len(failures), tests, ", ".join(failures))) From fdrake@users.sourceforge.net Mon Oct 28 17:59:26 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 09:59:26 -0800 Subject: [Python-checkins] python/dist/src/Lib/test/output test_sax,1.11,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv3936/test/output Removed Files: test_sax Log Message: Remove unnecessary output file. --- test_sax DELETED --- From fdrake@users.sourceforge.net Mon Oct 28 18:09:44 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 10:09:44 -0800 Subject: [Python-checkins] python/dist/src/Lib/xml/sax saxutils.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv9548 Modified Files: saxutils.py Log Message: Minor simplification. Index: saxutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** saxutils.py 28 Oct 2002 17:46:59 -0000 1.19 --- saxutils.py 28 Oct 2002 18:09:41 -0000 1.20 *************** *** 47,52 **** data = __dict_replace(data, entities) # must do ampersand last ! data = data.replace("&", "&") ! return data def quoteattr(data, entities={}): --- 47,51 ---- data = __dict_replace(data, entities) # must do ampersand last ! return data.replace("&", "&") def quoteattr(data, entities={}): From fdrake@users.sourceforge.net Mon Oct 28 19:28:27 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 11:28:27 -0800 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.175,1.176 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv20278 Modified Files: tut.tex Log Message: Chapter titles that get split over multiple lines in the typeset formats can't have whitespace after the last non-blank character (bug in LaTeX?); fix up a couple of instances of this. Update an email address. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** tut.tex 26 Oct 2002 03:13:57 -0000 1.175 --- tut.tex 28 Oct 2002 19:28:22 -0000 1.176 *************** *** 4185,4190 **** \appendix ! \chapter{Interactive Input Editing and History Substitution ! \label{interacting}} Some versions of the Python interpreter support editing of the current --- 4185,4189 ---- \appendix ! \chapter{Interactive Input Editing and History Substitution\label{interacting}} Some versions of the Python interpreter support editing of the current *************** *** 4348,4354 **** ! \chapter{Floating Point Arithmetic: Issues and Limitations ! \label{fp-issues}} ! \sectionauthor{Tim Peters}{tim.one@home.com} Floating-point numbers are represented in computer hardware as --- 4347,4352 ---- ! \chapter{Floating Point Arithmetic: Issues and Limitations\label{fp-issues}} ! \sectionauthor{Tim Peters}{tim_one@email.msn.com} Floating-point numbers are represented in computer hardware as From fdrake@users.sourceforge.net Mon Oct 28 19:30:57 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon, 28 Oct 2002 11:30:57 -0800 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.14,1.156.4.1.2.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv21634 Modified Files: Tag: release22-maint tut.tex Log Message: Chapter titles that get split over multiple lines in the typeset formats can't have whitespace after the last non-blank character (bug in LaTeX?); fix up a couple of instances of this. Update an email address. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.156.4.1.2.14 retrieving revision 1.156.4.1.2.15 diff -C2 -d -r1.156.4.1.2.14 -r1.156.4.1.2.15 *** tut.tex 26 Oct 2002 03:15:03 -0000 1.156.4.1.2.14 --- tut.tex 28 Oct 2002 19:30:45 -0000 1.156.4.1.2.15 *************** *** 4173,4178 **** \appendix ! \chapter{Interactive Input Editing and History Substitution ! \label{interacting}} Some versions of the Python interpreter support editing of the current --- 4173,4177 ---- \appendix ! \chapter{Interactive Input Editing and History Substitution\label{interacting}} Some versions of the Python interpreter support editing of the current *************** *** 4336,4342 **** ! \chapter{Floating Point Arithmetic: Issues and Limitations ! \label{fp-issues}} ! \sectionauthor{Tim Peters}{tim.one@home.com} Floating-point numbers are represented in computer hardware as --- 4335,4340 ---- ! \chapter{Floating Point Arithmetic: Issues and Limitations\label{fp-issues}} ! \sectionauthor{Tim Peters}{tim_one@email.msn.com} Floating-point numbers are represented in computer hardware as From loewis@users.sourceforge.net Tue Oct 29 10:07:46 2002 From: loewis@users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue, 29 Oct 2002 02:07:46 -0800 Subject: [Python-checkins] python/dist/src configure,1.349,1.350 configure.in,1.360,1.361 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv12384 Modified Files: configure configure.in Log Message: Patch #629426: Eliminate more autoconf warnings. Use AC_HELP_STRING. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.349 retrieving revision 1.350 diff -C2 -d -r1.349 -r1.350 *** configure 26 Oct 2002 13:47:43 -0000 1.349 --- configure 29 Oct 2002 10:07:39 -0000 1.350 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.359 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for python 2.3. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.360 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for python 2.3. *************** *** 826,858 **** --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --enable-framework=INSTALLDIR Build (MacOSX|Darwin) framework ! --enable-shared disable/enable building shared python library ! --enable-toolbox-glue disable/enable MacOSX glue code for extensions ! --enable-ipv6 Enable ipv6 (with ipv4) support ! --disable-ipv6 Disable ipv6 support ! --enable-unicode=ucs2,ucs4 Enable Unicode strings (default is yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ! --without-gcc never use gcc ! --with-cxx= enable C++ support ! --with-suffix=.exe set executable suffix ! --with-pydebug build with Py_DEBUG defined ! --with-libs='lib1 ...' link against additional libs ! --with-signal-module disable/enable signal module ! --with-dec-threads use DEC Alpha/OSF1 thread-safe libraries ! --with(out)-threads=DIRECTORY disable/enable thread support ! --with(out)-thread=DIRECTORY deprecated; use --with(out)-threads ! --with-pth use GNU pth threading libraries ! --with(out)-universal-newlines disable/enable foreign newlines ! --with(out)-doc-strings disable/enable documentation strings ! --with(out)-pymalloc disable/enable specialized mallocs ! --with-wctype-functions use wctype.h functions ! --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking ! --with-dl-dld=DL_DIR,DLD_DIR GNU dynamic linking ! --with-fpectl enable SIGFPE catching ! --with-libm=STRING math library ! --with-libc=STRING C library Some influential environment variables: --- 826,863 ---- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --enable-framework[=INSTALLDIR] ! Build (MacOSX|Darwin) framework ! --enable-shared disable/enable building shared python library ! --enable-toolbox-glue disable/enable MacOSX glue code for extensions ! --enable-ipv6 Enable ipv6 (with ipv4) support ! --disable-ipv6 Disable ipv6 support ! --enable-unicode[=ucs[24]] ! Enable Unicode strings (default is yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ! --without-gcc never use gcc ! --with-cxx= enable C++ support ! --with-suffix=.exe set executable suffix ! --with-pydebug build with Py_DEBUG defined ! --with-libs='lib1 ...' link against additional libs ! --with-signal-module disable/enable signal module ! --with-dec-threads use DEC Alpha/OSF1 thread-safe libraries ! --with(out)-threads[=DIRECTORY] ! disable/enable thread support ! --with(out)-thread[=DIRECTORY] ! deprecated; use --with(out)-threads ! --with-pth use GNU pth threading libraries ! --with(out)-universal-newlines ! disable/enable foreign newlines ! --with(out)-doc-strings disable/enable documentation strings ! --with(out)-pymalloc disable/enable specialized mallocs ! --with-wctype-functions use wctype.h functions ! --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking ! --with-dl-dld=DL_DIR GNU dynamic linking ! --with-fpectl enable SIGFPE catching ! --with-libm=STRING math library ! --with-libc=STRING C library Some influential environment variables: *************** *** 1274,1278 **** CONFIG_ARGS="$ac_configure_args" - # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then --- 1279,1282 ---- *************** *** 1314,1318 **** ##AC_ARG_WITH(dyld, ! ##[ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) ## # Set name for machine-dependent library files --- 1318,1323 ---- ##AC_ARG_WITH(dyld, ! ## AC_HELP_STRING(--with-dyld, ! ## Use (OpenStep|Rhapsody) dynamic linker)) ## # Set name for machine-dependent library files *************** *** 9887,9891 **** fi; ! # Determine isignalmodule should be used. --- 9892,9896 ---- fi; ! # Determine if signalmodule should be used. *************** *** 9959,9964 **** if test "${with_thread+set}" = set; then withval="$with_thread" ! ! with_threads=$with_thread fi; --- 9964,9968 ---- if test "${with_thread+set}" = set; then withval="$with_thread" ! with_threads=$with_thread fi; *************** *** 10274,10281 **** if test "${with_pth+set}" = set; then withval="$with_pth" ! ! echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 ! cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF --- 10278,10284 ---- if test "${with_pth+set}" = set; then withval="$with_pth" ! echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 ! cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF *************** *** 10286,10294 **** _ACEOF ! LIBS="-lpth $LIBS" ! THREADOBJ="Python/thread.o" else ! ! echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 --- 10289,10296 ---- _ACEOF ! LIBS="-lpth $LIBS" ! THREADOBJ="Python/thread.o" else ! echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 *************** *** 11744,11750 **** if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" ! else { { echo "$as_me:$LINENO: error: proper usage is --with-dl-dld=DL_DIRECTORY" >&5 ! echo "$as_me: error: proper usage is --with-dl-dld=DL_DIRECTORY" >&2;} ! { (exit DLD_DIRECTORY); exit DLD_DIRECTORY; }; } fi DLINCLDIR=${dldir} --- 11746,11752 ---- if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" ! else { { echo "$as_me:$LINENO: error: proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY" >&5 ! echo "$as_me: error: proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY" >&2;} ! { (exit 1); exit 1; }; } fi DLINCLDIR=${dldir} Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.360 retrieving revision 1.361 diff -C2 -d -r1.360 -r1.361 *** configure.in 26 Oct 2002 13:47:44 -0000 1.360 --- configure.in 29 Oct 2002 10:07:43 -0000 1.361 *************** *** 49,55 **** CONFIG_ARGS="$ac_configure_args" ! AC_ARG_ENABLE(framework, ! [ --enable-framework[=INSTALLDIR] Build (MacOSX|Darwin) framework],[ case $enableval in yes) --- 49,56 ---- CONFIG_ARGS="$ac_configure_args" ! dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output AC_ARG_ENABLE(framework, ! AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework), ! [ case $enableval in yes) *************** *** 84,88 **** ##AC_ARG_WITH(dyld, ! ##[ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) ## # Set name for machine-dependent library files --- 85,90 ---- ##AC_ARG_WITH(dyld, ! ## AC_HELP_STRING(--with-dyld, ! ## Use (OpenStep|Rhapsody) dynamic linker)) ## # Set name for machine-dependent library files *************** *** 132,136 **** # checks for alternative programs AC_MSG_CHECKING(for --without-gcc) ! AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [ case $withval in no) CC=cc --- 134,140 ---- # checks for alternative programs AC_MSG_CHECKING(for --without-gcc) ! AC_ARG_WITH(gcc, ! AC_HELP_STRING(--without-gcc,never use gcc), ! [ case $withval in no) CC=cc *************** *** 158,162 **** ;; *) ! AC_ERROR(Unknown BeOS platform \"$BE_HOST_CPU\") ;; esac --- 162,166 ---- ;; *) ! AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"]) ;; esac *************** *** 175,179 **** MAINOBJ=python.o AC_MSG_CHECKING(for --with-cxx=) ! AC_ARG_WITH(cxx, [ --with-cxx= enable C++ support],[ check_cxx=no case $withval in --- 179,185 ---- MAINOBJ=python.o AC_MSG_CHECKING(for --with-cxx=) ! AC_ARG_WITH(cxx, ! AC_HELP_STRING(--with-cxx=, enable C++ support), ! [ check_cxx=no case $withval in *************** *** 191,195 **** if test "$with_cxx" = "yes" then ! AC_ERROR(must supply a compiler when using --with-cxx) fi --- 197,201 ---- if test "$with_cxx" = "yes" then ! AC_MSG_ERROR([must supply a compiler when using --with-cxx]) fi *************** *** 222,227 **** if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then ! AC_ERROR(cached CC is different -- throw away $cache_file ! (it is also a good idea to do 'make clean' before compiling)) fi --- 228,233 ---- if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then ! AC_MSG_ERROR([cached CC is different -- throw away $cache_file ! (it is also a good idea to do 'make clean' before compiling)]) fi *************** *** 234,238 **** AC_EXEEXT AC_MSG_CHECKING(for --with-suffix) ! AC_ARG_WITH(suffix, [ --with-suffix=.exe set executable suffix],[ case $withval in no) EXEEXT=;; --- 240,246 ---- AC_EXEEXT AC_MSG_CHECKING(for --with-suffix) ! AC_ARG_WITH(suffix, ! AC_HELP_STRING(--with-suffix=.exe, set executable suffix), ! [ case $withval in no) EXEEXT=;; *************** *** 349,353 **** AC_MSG_CHECKING(for --enable-shared) AC_ARG_ENABLE(shared, ! [ --enable-shared disable/enable building shared python library]) if test -z "$enable_shared" --- 357,361 ---- AC_MSG_CHECKING(for --enable-shared) AC_ARG_ENABLE(shared, ! AC_HELP_STRING(--enable-shared, disable/enable building shared python library)) if test -z "$enable_shared" *************** *** 457,461 **** AC_MSG_CHECKING(for --with-pydebug) AC_ARG_WITH(pydebug, ! [ --with-pydebug build with Py_DEBUG defined], [ if test "$withval" != no then --- 465,470 ---- AC_MSG_CHECKING(for --with-pydebug) AC_ARG_WITH(pydebug, ! AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined), ! [ if test "$withval" != no then *************** *** 831,835 **** AC_MSG_CHECKING(for --enable-toolbox-glue) AC_ARG_ENABLE(toolbox-glue, ! [ --enable-toolbox-glue disable/enable MacOSX glue code for extensions]) if test -z "$enable_toolbox_glue" --- 840,844 ---- AC_MSG_CHECKING(for --enable-toolbox-glue) AC_ARG_ENABLE(toolbox-glue, ! AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions)) if test -z "$enable_toolbox_glue" *************** *** 1140,1147 **** AC_MSG_CHECKING(for --with-libs) AC_ARG_WITH(libs, ! [ --with-libs='lib1 ...' link against additional libs], [ AC_MSG_RESULT($withval) LIBS="$withval $LIBS" ! ], AC_MSG_RESULT(no)) # Determine if signalmodule should be used. --- 1149,1158 ---- AC_MSG_CHECKING(for --with-libs) AC_ARG_WITH(libs, ! AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs), ! [ AC_MSG_RESULT($withval) LIBS="$withval $LIBS" ! ], ! [AC_MSG_RESULT(no)]) # Determine if signalmodule should be used. *************** *** 1150,1154 **** AC_MSG_CHECKING(for --with-signal-module) AC_ARG_WITH(signal-module, ! [ --with-signal-module disable/enable signal module]) if test -z "$with_signal_module" --- 1161,1165 ---- AC_MSG_CHECKING(for --with-signal-module) AC_ARG_WITH(signal-module, ! AC_HELP_STRING(--with-signal-module, disable/enable signal module)) if test -z "$with_signal_module" *************** *** 1172,1176 **** AC_SUBST(LDLAST) AC_ARG_WITH(dec-threads, ! [ --with-dec-threads use DEC Alpha/OSF1 thread-safe libraries], [ AC_MSG_RESULT($withval) LDLAST=-threads --- 1183,1188 ---- AC_SUBST(LDLAST) AC_ARG_WITH(dec-threads, ! AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries), ! [ AC_MSG_RESULT($withval) LDLAST=-threads *************** *** 1178,1182 **** with_thread="$withval"; fi], ! AC_MSG_RESULT(no)) # Templates for things AC_DEFINEd more than once. --- 1190,1194 ---- with_thread="$withval"; fi], ! [AC_MSG_RESULT(no)]) # Templates for things AC_DEFINEd more than once. *************** *** 1189,1199 **** AC_MSG_CHECKING(for --with-threads) AC_ARG_WITH(threads, ! [ --with(out)-threads[=DIRECTORY] disable/enable thread support]) # --with-thread is deprecated, but check for it anyway AC_ARG_WITH(thread, ! [ --with(out)-thread[=DIRECTORY] deprecated; use --with(out)-threads],[ ! with_threads=$with_thread]) if test -z "$with_threads" --- 1201,1213 ---- AC_MSG_CHECKING(for --with-threads) + dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output AC_ARG_WITH(threads, ! AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support)) # --with-thread is deprecated, but check for it anyway + dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output AC_ARG_WITH(thread, ! AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads), ! [with_threads=$with_thread]) if test -z "$with_threads" *************** *** 1251,1262 **** THREADOBJ="Python/thread.o"],[ AC_MSG_CHECKING(for --with-pth) ! AC_ARG_WITH(pth, ! [ --with-pth use GNU pth threading libraries], [ ! AC_MSG_RESULT($withval) ! AC_DEFINE(WITH_THREAD) ! AC_DEFINE(HAVE_PTH, 1, [Define if you have GNU PTH threads.]) ! LIBS="-lpth $LIBS" ! THREADOBJ="Python/thread.o"],[ ! AC_MSG_RESULT(no) # Just looking for pthread_create in libpthread is not enough: --- 1265,1277 ---- THREADOBJ="Python/thread.o"],[ AC_MSG_CHECKING(for --with-pth) ! AC_ARG_WITH([pth], ! AC_HELP_STRING(--with-pth, use GNU pth threading libraries), ! [AC_MSG_RESULT($withval) ! AC_DEFINE([WITH_THREAD]) ! AC_DEFINE([HAVE_PTH], 1, ! [Define if you have GNU PTH threads.]) ! LIBS="-lpth $LIBS" ! THREADOBJ="Python/thread.o"], ! [AC_MSG_RESULT(no) # Just looking for pthread_create in libpthread is not enough: *************** *** 1375,1380 **** AC_MSG_CHECKING([if --enable-ipv6 is specified]) AC_ARG_ENABLE(ipv6, ! [ --enable-ipv6 Enable ipv6 (with ipv4) support ! --disable-ipv6 Disable ipv6 support], [ case "$enableval" in no) --- 1390,1395 ---- AC_MSG_CHECKING([if --enable-ipv6 is specified]) AC_ARG_ENABLE(ipv6, ! [ --enable-ipv6 Enable ipv6 (with ipv4) support ! --disable-ipv6 Disable ipv6 support], [ case "$enableval" in no) *************** *** 1541,1545 **** AC_MSG_CHECKING(for --with-universal-newlines) AC_ARG_WITH(universal-newlines, ! [ --with(out)-universal-newlines disable/enable foreign newlines]) if test -z "$with_universal_newlines" --- 1556,1560 ---- AC_MSG_CHECKING(for --with-universal-newlines) AC_ARG_WITH(universal-newlines, ! AC_HELP_STRING(--with(out)-universal-newlines, disable/enable foreign newlines)) if test -z "$with_universal_newlines" *************** *** 1556,1560 **** AC_MSG_CHECKING(for --with-doc-strings) AC_ARG_WITH(doc-strings, ! [ --with(out)-doc-strings disable/enable documentation strings]) if test -z "$with_doc_strings" --- 1571,1575 ---- AC_MSG_CHECKING(for --with-doc-strings) AC_ARG_WITH(doc-strings, ! AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings)) if test -z "$with_doc_strings" *************** *** 1571,1575 **** AC_MSG_CHECKING(for --with-pymalloc) AC_ARG_WITH(pymalloc, ! [ --with(out)-pymalloc disable/enable specialized mallocs]) if test -z "$with_pymalloc" --- 1586,1590 ---- AC_MSG_CHECKING(for --with-pymalloc) AC_ARG_WITH(pymalloc, ! AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs)) if test -z "$with_pymalloc" *************** *** 1586,1590 **** AC_MSG_CHECKING(for --with-wctype-functions) AC_ARG_WITH(wctype-functions, ! [ --with-wctype-functions use wctype.h functions], [ if test "$withval" != no then --- 1601,1606 ---- AC_MSG_CHECKING(for --with-wctype-functions) AC_ARG_WITH(wctype-functions, ! AC_HELP_STRING(--with-wctype-functions, use wctype.h functions), ! [ if test "$withval" != no then *************** *** 1603,1607 **** AC_MSG_CHECKING(for --with-sgi-dl) AC_ARG_WITH(sgi-dl, ! [ --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking], [ AC_MSG_RESULT($withval) AC_DEFINE(WITH_SGI_DL, 1, --- 1619,1624 ---- AC_MSG_CHECKING(for --with-sgi-dl) AC_ARG_WITH(sgi-dl, ! AC_HELP_STRING(--with-sgi-dl=DIRECTORY, IRIX 4 dynamic linking), ! [ AC_MSG_RESULT($withval) AC_DEFINE(WITH_SGI_DL, 1, *************** *** 1615,1619 **** if test ! -z "$dldir" -a -d "$dldir" then LDFLAGS="$LDFLAGS -L$dldir" ! else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) fi DLINCLDIR=${dldir} --- 1632,1636 ---- if test ! -z "$dldir" -a -d "$dldir" then LDFLAGS="$LDFLAGS -L$dldir" ! else AC_MSG_ERROR([proper usage is --with-sgi-dl=DIRECTORY]) fi DLINCLDIR=${dldir} *************** *** 1621,1625 **** AC_MSG_CHECKING(for --with-dl-dld) ! AC_ARG_WITH(dl-dld, [ --with-dl-dld=DL_DIR,DLD_DIR GNU dynamic linking], [ AC_MSG_RESULT($withval) AC_DEFINE(WITH_DL_DLD, 1, --- 1638,1644 ---- AC_MSG_CHECKING(for --with-dl-dld) ! AC_ARG_WITH(dl-dld, ! AC_HELP_STRING(--with-dl-dld=DL_DIR, GNU dynamic linking), ! [ AC_MSG_RESULT($withval) AC_DEFINE(WITH_DL_DLD, 1, *************** *** 1638,1642 **** if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" ! else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) fi DLINCLDIR=${dldir} --- 1657,1661 ---- if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" ! else AC_MSG_ERROR([proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY]) fi DLINCLDIR=${dldir} *************** *** 2094,2098 **** AC_MSG_CHECKING(for --with-fpectl) AC_ARG_WITH(fpectl, ! [ --with-fpectl enable SIGFPE catching], [ if test "$withval" != no then --- 2113,2118 ---- AC_MSG_CHECKING(for --with-fpectl) AC_ARG_WITH(fpectl, ! AC_HELP_STRING(--with-fpectl, enable SIGFPE catching), ! [ if test "$withval" != no then *************** *** 2112,2116 **** esac AC_MSG_CHECKING(for --with-libm=STRING) ! AC_ARG_WITH(libm, [ --with-libm=STRING math library], [ if test "$withval" = no then LIBM= --- 2132,2138 ---- esac AC_MSG_CHECKING(for --with-libm=STRING) ! AC_ARG_WITH(libm, ! AC_HELP_STRING(--with-libm=STRING, math library), ! [ if test "$withval" = no then LIBM= *************** *** 2118,2130 **** elif test "$withval" != yes then LIBM=$withval ! AC_MSG_RESULT(set LIBM=\"$withval\") ! else AC_ERROR(proper usage is --with-libm=STRING) fi], ! [AC_MSG_RESULT(default LIBM=\"$LIBM\")]) # check for --with-libc=... AC_SUBST(LIBC) AC_MSG_CHECKING(for --with-libc=STRING) ! AC_ARG_WITH(libc, [ --with-libc=STRING C library], [ if test "$withval" = no then LIBC= --- 2140,2154 ---- elif test "$withval" != yes then LIBM=$withval ! AC_MSG_RESULT(set LIBM="$withval") ! else AC_MSG_ERROR([proper usage is --with-libm=STRING]) fi], ! [AC_MSG_RESULT(default LIBM="$LIBM")]) # check for --with-libc=... AC_SUBST(LIBC) AC_MSG_CHECKING(for --with-libc=STRING) ! AC_ARG_WITH(libc, ! AC_HELP_STRING(--with-libc=STRING, C library), ! [ if test "$withval" = no then LIBC= *************** *** 2132,2139 **** elif test "$withval" != yes then LIBC=$withval ! AC_MSG_RESULT(set LIBC=\"$withval\") ! else AC_ERROR(proper usage is --with-libc=STRING) fi], ! [AC_MSG_RESULT(default LIBC=\"$LIBC\")]) # check for hypot() in math library --- 2156,2163 ---- elif test "$withval" != yes then LIBC=$withval ! AC_MSG_RESULT(set LIBC="$withval") ! else AC_MSG_ERROR([proper usage is --with-libc=STRING]) fi], ! [AC_MSG_RESULT(default LIBC="$LIBC")]) # check for hypot() in math library *************** *** 2188,2193 **** AC_MSG_CHECKING(what type to use for unicode) AC_ARG_ENABLE(unicode, ! [ --enable-unicode[=ucs2,ucs4] Enable Unicode strings (default is yes)],,enable_unicode=yes) if test $enable_unicode = yes --- 2212,2220 ---- AC_MSG_CHECKING(what type to use for unicode) + dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output AC_ARG_ENABLE(unicode, ! AC_HELP_STRING(--enable-unicode@<:@=ucs@<:@24@:>@@:>@, Enable Unicode strings (default is yes)), ! [], ! [enable_unicode=yes]) if test $enable_unicode = yes From gvanrossum@users.sourceforge.net Tue Oct 29 18:36:45 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Tue, 29 Oct 2002 10:36:45 -0800 Subject: [Python-checkins] python/dist/src/Objects classobject.c,2.163,2.164 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11087 Modified Files: classobject.c Log Message: Since properties are supported here, is possible that instance_getattr2() raises an exception. Fix all code that made this assumption. Backport candidate. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.163 retrieving revision 2.164 diff -C2 -d -r2.163 -r2.164 *** classobject.c 18 Oct 2002 14:15:33 -0000 2.163 --- classobject.c 29 Oct 2002 18:36:40 -0000 2.164 *************** *** 550,553 **** --- 550,557 ---- init = instance_getattr2(inst, initstr); if (init == NULL) { + if (PyErr_Occurred()) { + Py_DECREF(inst); + return NULL; + } if ((arg != NULL && (!PyTuple_Check(arg) || PyTuple_Size(arg) != 0)) *************** *** 695,699 **** } v = instance_getattr2(inst, name); ! if (v == NULL) { PyErr_Format(PyExc_AttributeError, "%.50s instance has no attribute '%.400s'", --- 699,703 ---- } v = instance_getattr2(inst, name); ! if (v == NULL && !PyErr_Occurred()) { PyErr_Format(PyExc_AttributeError, "%.50s instance has no attribute '%.400s'", *************** *** 1810,1832 **** instance_getattr2 directly because it will not set an exception on failure. */ ! if (((PyInstanceObject *)v)->in_class->cl_getattr == NULL) { method = instance_getattr2((PyInstanceObject *)v, name_op[op]); ! if (method == NULL) { ! assert(!PyErr_Occurred()); ! res = Py_NotImplemented; ! Py_INCREF(res); ! return res; ! } ! } else { method = PyObject_GetAttr(v, name_op[op]); ! if (method == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL; PyErr_Clear(); - res = Py_NotImplemented; - Py_INCREF(res); - return res; } } --- 1814,1831 ---- instance_getattr2 directly because it will not set an exception on failure. */ ! if (((PyInstanceObject *)v)->in_class->cl_getattr == NULL) method = instance_getattr2((PyInstanceObject *)v, name_op[op]); ! else method = PyObject_GetAttr(v, name_op[op]); ! if (method == NULL) { ! if (PyErr_Occurred()) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL; PyErr_Clear(); } + res = Py_NotImplemented; + Py_INCREF(res); + return res; } From gvanrossum@users.sourceforge.net Tue Oct 29 19:08:32 2002 From: gvanrossum@users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Tue, 29 Oct 2002 11:08:32 -0800 Subject: [Python-checkins] python/dist/src/Lib/test test_class.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23989 Modified Files: test_class.py Log Message: Added test for this fix to classobject.c: Since properties are supported here, is possible that instance_getattr2() raises an exception. Fix all code that made this assumption. Backport candidate. Index: test_class.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_class.py 30 Jul 2002 23:26:01 -0000 1.9 --- test_class.py 29 Oct 2002 19:08:29 -0000 1.10 *************** *** 289,290 **** --- 289,317 ---- else: raise TestFailed, "how could this not have overflowed the stack?" + + + # Tests for exceptions raised in instance_getattr2(). + + def booh(self): + raise AttributeError, "booh" + + class A: + a = property(booh) + try: + A().a # Raised AttributeError: A instance has no attribute 'a' + except AttributeError, x: + if str(x) is not "booh": + print "attribute error for A().a got masked:", str(x) + + class E: + __eq__ = property(booh) + E() == E() # In debug mode, caused a C-level assert() to fail + + class I: + __init__ = property(booh) + try: + I() # In debug mode, printed XXX undetected error and raises AttributeError + except AttributeError, x: + pass + else: + print "attribute error for I.__init__ got masked" From jackjansen@users.sourceforge.net Tue Oct 29 21:59:22 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 13:59:22 -0800 Subject: [Python-checkins] python/dist/src/Mac/Lib macostools.py,1.12.14.2,1.12.14.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4109/Python 2.2/Mac/Lib Modified Files: Tag: release22-maint macostools.py Log Message: Fixed silly typo in previous fix. Needs to be ported forward. Index: macostools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macostools.py,v retrieving revision 1.12.14.2 retrieving revision 1.12.14.3 diff -C2 -d -r1.12.14.2 -r1.12.14.3 *** macostools.py 12 Mar 2002 15:05:11 -0000 1.12.14.2 --- macostools.py 29 Oct 2002 21:59:20 -0000 1.12.14.3 *************** *** 70,74 **** if now == moddate: now = now + 1 ! dir_fss.SetDates(crdate, now, bkdate) def touched_ae(dst): --- 70,77 ---- if now == moddate: now = now + 1 ! try: ! dir_fss.SetDates(crdate, now, bkdate) ! except macfs.error: ! pass def touched_ae(dst): From jackjansen@users.sourceforge.net Tue Oct 29 22:00:09 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:00:09 -0800 Subject: [Python-checkins] python/dist/src/Mac/Lib aetools.py,1.2.14.2,1.2.14.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4520/Python 2.2/Mac/Lib Modified Files: Tag: release22-maint aetools.py Log Message: The previous patch needed a little massaging for 2.2. Index: aetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetools.py,v retrieving revision 1.2.14.2 retrieving revision 1.2.14.3 diff -C2 -d -r1.2.14.2 -r1.2.14.3 *** aetools.py 25 Oct 2002 20:36:53 -0000 1.2.14.2 --- aetools.py 29 Oct 2002 22:00:06 -0000 1.2.14.3 *************** *** 72,76 **** pass else: ! parameters['errn'] = unpack(dirobj, formodulename) del dirobj while 1: --- 72,76 ---- pass else: ! parameters['errn'] = unpack(dirobj) del dirobj while 1: From jackjansen@users.sourceforge.net Tue Oct 29 22:01:09 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:01:09 -0800 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py,1.17.2.4,1.17.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory usw-pr-cvs1:/tmp/cvs-serv4929/Python 2.2/Lib/email/test Modified Files: Tag: release22-maint test_email.py Log Message: Stop-gap to forestall test_email failing in MacPython: disable the line-ending test. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17.2.4 retrieving revision 1.17.2.5 diff -C2 -d -r1.17.2.4 -r1.17.2.5 *** test_email.py 14 Oct 2002 17:26:03 -0000 1.17.2.4 --- test_email.py 29 Oct 2002 22:01:06 -0000 1.17.2.5 *************** *** 1840,1843 **** --- 1840,1846 ---- def test_crlf_separation(self): + if sys.platform == 'mac': + # Skipped in MacPython 2.2.X due to line-end problems + return eq = self.assertEqual fp = openfile('msg_26.txt') From jackjansen@users.sourceforge.net Tue Oct 29 22:03:40 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:03:40 -0800 Subject: [Python-checkins] python/dist/src/Mac/Python macgetargv.c,1.26,1.26.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv6333/Python 2.2/Mac/Python Modified Files: Tag: release22-maint macgetargv.c Log Message: Added a few printfs in case of unexpected situations during application startup. Index: macgetargv.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macgetargv.c,v retrieving revision 1.26 retrieving revision 1.26.12.1 diff -C2 -d -r1.26 -r1.26.12.1 *** macgetargv.c 10 Sep 2001 22:00:39 -0000 1.26 --- macgetargv.c 29 Oct 2002 22:03:37 -0000 1.26.12.1 *************** *** 98,105 **** info.processName = NULL; info.processAppSpec = &PyMac_ApplicationFSSpec; ! if ( err=GetProcessInformation(¤tPSN, &info)) return err; ! if ( err=PyMac_GetFullPathname(&PyMac_ApplicationFSSpec, PyMac_ApplicationPath, PATHNAMELEN) ) return err; applocation_inited = 1; return 0; --- 98,109 ---- info.processName = NULL; info.processAppSpec = &PyMac_ApplicationFSSpec; ! if ( err=GetProcessInformation(¤tPSN, &info)) { ! fprintf(stderr, "GetProcessInformation failed: error %d\n", err); return err; ! } ! if ( err=PyMac_GetFullPathname(&PyMac_ApplicationFSSpec, PyMac_ApplicationPath, PATHNAMELEN) ) { ! fprintf(stderr, "PyMac_GetFullPathname failed for application: error %d\n", err); return err; + } applocation_inited = 1; return 0; *************** *** 142,147 **** { #pragma unused (reply, refCon) ! #if 0 ! /* Test by Jack: would removing this facilitate debugging? */ got_one = 1; #endif --- 146,153 ---- { #pragma unused (reply, refCon) ! #if 1 ! /* Removing this facilitate debugging: you can start Python under CW and ! * then double-click a file to run it. ! */ got_one = 1; #endif *************** *** 233,241 **** SystemTask(); #endif ! ok = GetNextEvent(everyEvent, &event); if (ok && event.what == kHighLevelEvent) { AEProcessAppleEvent(&event); } } } --- 239,248 ---- SystemTask(); #endif ! ok = WaitNextEvent(everyEvent, &event, 1, NULL); if (ok && event.what == kHighLevelEvent) { AEProcessAppleEvent(&event); } } + if (!got_one) fprintf(stderr, "Warning: no OAPP or ODOC AppleEvent received\n"); } From jackjansen@users.sourceforge.net Tue Oct 29 22:03:48 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:03:48 -0800 Subject: [Python-checkins] python/dist/src/Mac/Python macmain.c,1.72.8.1,1.72.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv6386/Python 2.2/Mac/Python Modified Files: Tag: release22-maint macmain.c Log Message: Added a few printfs in case of unexpected situations during application startup. Index: macmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macmain.c,v retrieving revision 1.72.8.1 retrieving revision 1.72.8.2 diff -C2 -d -r1.72.8.1 -r1.72.8.2 *** macmain.c 24 Feb 2002 23:07:04 -0000 1.72.8.1 --- macmain.c 29 Oct 2002 22:03:45 -0000 1.72.8.2 *************** *** 337,340 **** --- 337,342 ---- if ( p ) *p = 0; chdir(app_wd); + } else { + fprintf(stderr, "Warning: No argv[0], cannot chdir to pythonhome\n"); } #endif From jackjansen@users.sourceforge.net Tue Oct 29 22:05:50 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:05:50 -0800 Subject: [Python-checkins] python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,1.6.4.2.2.4,1.6.4.2.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv6700/Python 2.2/Mac/Distributions/(vise) Modified Files: Tag: release22-maint Python 2.2.vct Log Message: Files used for MacPython 2.2.2 distribution. Index: Python 2.2.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Attic/Python 2.2.vct,v retrieving revision 1.6.4.2.2.4 retrieving revision 1.6.4.2.2.5 diff -C2 -d -r1.6.4.2.2.4 -r1.6.4.2.2.5 Binary files /tmp/cvs4D28De and /tmp/cvs1lp03v differ From jackjansen@users.sourceforge.net Tue Oct 29 22:06:10 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:06:10 -0800 Subject: [Python-checkins] python/dist/src/Mac/Build PythonInterpreter.mcp,1.18.4.1,1.18.4.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv7180/Python 2.2/Mac/Build Modified Files: Tag: release22-maint PythonInterpreter.mcp Log Message: Files used for MacPython 2.2.2 distribution. Index: PythonInterpreter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonInterpreter.mcp,v retrieving revision 1.18.4.1 retrieving revision 1.18.4.2 diff -C2 -d -r1.18.4.1 -r1.18.4.2 Binary files /tmp/cvsai7hSh and /tmp/cvs8aDXEq differ From jackjansen@users.sourceforge.net Tue Oct 29 22:06:15 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:06:15 -0800 Subject: [Python-checkins] python/dist/src/Mac Relnotes,1.28.4.2.2.3,1.28.4.2.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv7403/Python 2.2/Mac Modified Files: Tag: release22-maint Relnotes Log Message: Files used for MacPython 2.2.2 distribution. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.28.4.2.2.3 retrieving revision 1.28.4.2.2.4 diff -C2 -d -r1.28.4.2.2.3 -r1.28.4.2.2.4 *** Relnotes 26 Mar 2002 13:47:16 -0000 1.28.4.2.2.3 --- Relnotes 29 Oct 2002 22:06:13 -0000 1.28.4.2.2.4 *************** *** 1,60 **** ! Changes in 2.2.1 since 2.2 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. These notes are meant primarily for MacPython ! but some of the information may be relevant to using Mac-specific features under ! Mac OS X unix Python (a.k.a. MachoPython) too. ! ! - This release should work on multiprocessor OSX machines. ! - The problem with incomplete read()s on sockets has been fixed. ! - NavServices is now weaklinked, so this release should work on a virgin Mac OS 8.1. ! - test_longexp took days to finish on OSX. It now fails with a message so the ! other tests continue. ! - The IDE looks better under OSX after redesign of some windows. ! - The IDE class browser and object browser now work under OSX. ! - The IDE browser now has some understanding of the 2.2 object model. ! - IDE readline() output is echoed to the output window. ! - IDE output is flushed to the screen more often under OSX. ! - IDE doesn't have a second quit menu under OSX anymore. ! - IDE scrollbars now have live feedback. ! - IDE now does copy/paste under OSX. ! - IDE: minimal support for floating windows. ! - The IDE now sort-of works under MachoPython. ! - macostools.mkalias() can now handle folders. ! - macresource module fixed to work under MachoPython. ! - macfs.FSRef objects now have an as_pathname method. ! - The ic module returned bogus values for creator/type. Fixed. ! - Most toolbox modules now weaklink against InterfaceLib (or CarbonLib) so ! they can be imported even if not all functionality is available. Calling a ! method missing on your system will raise an exception. ! - Carbon.App: support for various missing methods added. ! - Carbon.CarbonEvt: various method signatures fixed. ! - Carbon.CF: Unicode support added. ! - Carbon.CG: did not import. Fixed. ! - Carbon.CG: various missing methods added. ! - Carbon.Ctl: ControlActionProcs weren't supported. Fixed. ! - Carbon.Drag: exceptions in callback routines are now printed. ! - Carbon.Fm: QDTextBounds was missing. Added. ! - Carbon.Menu: support for optional MenuObjs was added. ! - Carbon.Mlte: unicode support added. ! - Carbon.Scrap: fixed to work under Carbon by finally implementing the ! Carbon Scrap Manager interface. ! - Carbon.Snd: SndRecord and SndRecordToFile were missing. Added. ! - Applescript suites had a problem with the required events being in either Standard ! or Required. Fixed by introducing a new common base suite for them. ! - Applescript example rewritten. ! - Applescript can now handle Unicode parameters. ! - An Applescript suite with a start() event no longer causes problems. ! - Exceptions in AE callback routines are now printed. ! - waste: updated to current version, thereby getting it to work under MachoPython. ! - gensuitemodule: better handling of verbs that are Python keywords. ! - gensuitemodule: enum values are now identify()d. ! - MachoPython: Python.app build process fixed. ! - MachoPython: Python.app can now be called from the command line. ! - MachoPython: MacOS error exceptions now include the textual error in ! stead of only the numeric error code. ! - Embedding: don't call PyMac_OutputSeen if we have a custom console. Known problems -------------- --- 1,13 ---- ! Changes in 2.2.2 since 2.2.1 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. + - The installer is now based on VISE 8.0, and should work fine on MacOSX. + - A problem with Python randomly refusing to run on OSX, presenting only + a window with <> in the title, has been solved. + - A Jaguar problem with AppleEvent errors being ignored has been fixed. + Known problems -------------- From jackjansen@users.sourceforge.net Tue Oct 29 22:06:20 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:06:20 -0800 Subject: [Python-checkins] python/dist/src/Mac/Include macbuildno.h,1.22.4.2.2.2,1.22.4.2.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv7459/Python 2.2/Mac/Include Modified Files: Tag: release22-maint macbuildno.h Log Message: Files used for MacPython 2.2.2 distribution. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.22.4.2.2.2 retrieving revision 1.22.4.2.2.3 diff -C2 -d -r1.22.4.2.2.2 -r1.22.4.2.2.3 *** macbuildno.h 7 Apr 2002 21:59:38 -0000 1.22.4.2.2.2 --- macbuildno.h 29 Oct 2002 22:06:18 -0000 1.22.4.2.2.3 *************** *** 1 **** ! #define BUILD 133 --- 1 ---- ! #define BUILD 138 From jackjansen@users.sourceforge.net Tue Oct 29 22:06:26 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:06:26 -0800 Subject: [Python-checkins] python/dist/src/Mac ReadMe,1.38.4.2.2.3,1.38.4.2.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv7515/Python 2.2/Mac Modified Files: Tag: release22-maint ReadMe Log Message: Files used for MacPython 2.2.2 distribution. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.38.4.2.2.3 retrieving revision 1.38.4.2.2.4 diff -C2 -d -r1.38.4.2.2.3 -r1.38.4.2.2.4 *** ReadMe 7 Apr 2002 21:59:32 -0000 1.38.4.2.2.3 --- ReadMe 29 Oct 2002 22:06:23 -0000 1.38.4.2.2.4 *************** *** 1,3 **** ! How to install Python 2.2.1 on your Macintosh --------------------------------------------- --- 1,3 ---- ! How to install Python 2.2.2 on your Macintosh --------------------------------------------- *************** *** 6,10 **** use the Carbon version or not. For Mac OS X users: this version of Python does not run from the command line, it is a pure "Mac only" app. Use the standard ! unix Python from the commandline, the two Pythons will be merged in the future. You should definitely read the Relnotes file too, and the section below about --- 6,11 ---- use the Carbon version or not. For Mac OS X users: this version of Python does not run from the command line, it is a pure "Mac only" app. Use the standard ! unix Python from the commandline, the two Pythons will be merged in the future, see ! the note on "What is in a name" below. You should definitely read the Relnotes file too, and the section below about *************** *** 34,38 **** install what you want. ! If you want 68k support you will have get MacPython 1.5.2. What to install --- 35,39 ---- install what you want. ! If you want 68k support you will have to get MacPython 1.5.2. What to install *************** *** 43,47 **** manipulation package (allows you to read, write and display images and do lots of operations on them). ! For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet. This is the reason Classic MacPython is also installed on MacOSX: it allows you to run Tkinter applications, albeit in the Classic box. --- 44,48 ---- manipulation package (allows you to read, write and display images and do lots of operations on them). ! For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon. This is the reason Classic MacPython is also installed on MacOSX: it allows you to run Tkinter applications, albeit in the Classic box. *************** *** 84,95 **** frozen modules. This should not be a problem in normal use. ! test_time will fail because MacPython accepts bogus values for ! mktime(), this will be fixed later (it is not a very serious problem). ! ! test_email will fail during summer (no kidding:-). Actually, it will fail ! when DST is active, because the date parsing test is GMT-centric ! and does not handle the Macintosh's localtime very well. ! ! Three tests will fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). --- 85,89 ---- frozen modules. This should not be a problem in normal use. ! Three tests may fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). *************** *** 113,116 **** --- 107,138 ---- ways. + What is in a name? + ------------------ + + A lot, actually:-) Especially if you are looking for "a Python for a Macintosh" + and assume that MacPython will fit that bill. Traditionally, MacPython was the + only solution, but with the appearance of MacOSX there are more possibilities. + MacPython 2.2.X is meant primarily for "old MacOS", but as unix-Python 2.2.X + misses a lot of the mac-specific functionality for some applications it is + still the best choice on MacOSX as well. For unix-related tasks you are better + off with unix-Python 2.2.X, and as of OSX 10.2 Apple ships a Python (version 2.2) + standard. + + Another possibility on OSX is to use a framework-based build of unix-Python 2.2.X, + which does include most of the mac goodies. This python is colloquially known + as MachoPython, and you will need it to run Tkinter programs natively, or use + wxWindows. See the MacPython homepage for details. + + The current expectation is that by the time 2.3 comes out (early 2003) MacOSX + will be so well established that we will use the name "MacPython 2.3" to refer + to the OSX-only framework build of unix-Python, which by then will include all + the mac goodies. The OS9 version will probably be called something like + MacOS9Python 2.3. + + The distinction between these versions and there names is especially important + if you join the discussions on the MacPython mailing list, and it is a good idea + to clearly state your Python and MacOS version when asking for advice or submitting + bug reports. + OSX Multiple users note ----------------------- *************** *** 127,133 **** not having a preference file: the symptom is failing to import all sorts of standard modules. If you remove your per-user Python preference files ! (in ~/Library/Preferences) and then run PythonIntpreter once everything should be fine. Uninstalling ------------ --- 149,162 ---- not having a preference file: the symptom is failing to import all sorts of standard modules. If you remove your per-user Python preference files ! (in ~/Library/Preferences) and then run PythonInterpreter once everything should be fine. + MacOS 8.1 note + -------------- + + The distribution is fully functional as far back as MacOS 8.1, with one exception: + the IDE as installed is not compatible with 8.1. There is a separate path for running + the IDE on 8.1 available at http://www.cwi.nl/~jack/macpython.html . + Uninstalling ------------ *************** *** 183,189 **** are lost and you have to set them again. ! After you are satisfied that 2.2.1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2.1". The ConfigurePython... applets will try to detect incompatible --- 212,218 ---- are lost and you have to set them again. ! After you are satisfied that 2.2.2 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2.2". The ConfigurePython... applets will try to detect incompatible *************** *** 236,240 **** . However, a better way to discuss MacPython is to join the mailing list, which is explicitly meant for ! this purpose. --- 265,270 ---- . However, a better way to discuss MacPython is to join the mailing list, which is explicitly meant for ! this purpose. And please remember what's said in the note on "what's in ! a name" above. From jackjansen@users.sourceforge.net Tue Oct 29 22:06:31 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:06:31 -0800 Subject: [Python-checkins] python/dist/src/Mac _checkversion.py,1.11.6.1.2.1,1.11.6.1.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv7562/Python 2.2/Mac Modified Files: Tag: release22-maint _checkversion.py Log Message: Files used for MacPython 2.2.2 distribution. Index: _checkversion.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/_checkversion.py,v retrieving revision 1.11.6.1.2.1 retrieving revision 1.11.6.1.2.2 diff -C2 -d -r1.11.6.1.2.1 -r1.11.6.1.2.2 *** _checkversion.py 19 Mar 2002 10:59:38 -0000 1.11.6.1.2.1 --- _checkversion.py 29 Oct 2002 22:06:28 -0000 1.11.6.1.2.2 *************** *** 6,10 **** _PACKAGE="MacPython" ! _VERSION="2.2.1" _URL="http://www.cwi.nl/~jack/macpythonversion.txt" --- 6,10 ---- _PACKAGE="MacPython" ! _VERSION="2.2.2" _URL="http://www.cwi.nl/~jack/macpythonversion.txt" From jackjansen@users.sourceforge.net Tue Oct 29 22:48:46 2002 From: jackjansen@users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Tue, 29 Oct 2002 14:48:46 -0800 Subject: [Python-checkins] python/dist/src/Mac/Lib macostools.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22980 Modified Files: macostools.py Log Message: Forward port of 1.12.14.3 (which has an incorrect log message): if SetDates() in touched() returns an error ignore it: the user may not have permission to change the parent folder. This is a non-serious problem, the only function of touched() is to speed up the finder seeing the change. Index: macostools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macostools.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** macostools.py 5 Aug 2002 21:53:57 -0000 1.16 --- macostools.py 29 Oct 2002 22:48:43 -0000 1.17 *************** *** 72,76 **** if now == moddate: now = now + 1 ! dir_fss.SetDates(crdate, now, bkdate) def touched_ae(dst): --- 72,79 ---- if now == moddate: now = now + 1 ! try: ! dir_fss.SetDates(crdate, now, bkdate) ! except macfs.error: ! pass def touched_ae(dst): From rhettinger@users.sourceforge.net Wed Oct 30 05:17:24 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 21:17:24 -0800 Subject: [Python-checkins] python/dist/src/Lib keyword.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10809 Modified Files: keyword.py Log Message: Patrick K. O'Brien notices that kwlist was missing from __all__. Added because it is part of the documented interface. Index: keyword.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/keyword.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** keyword.py 19 Jun 2001 00:26:25 -0000 1.11 --- keyword.py 30 Oct 2002 05:17:22 -0000 1.12 *************** *** 11,15 **** """ ! __all__ = ["iskeyword"] kwlist = [ --- 11,15 ---- """ ! __all__ = ["iskeyword", "kwlist"] kwlist = [ From tim_one@users.sourceforge.net Wed Oct 30 05:21:02 2002 From: tim_one@users.sourceforge.net (tim_one@users.sourceforge.net) Date: Tue, 29 Oct 2002 21:21:02 -0800 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11356/Lib Modified Files: pydoc.py Log Message: SF bug 630824: pydoc Helper keywords missing 'yield' Wow, what a brittle subsystem! Fixed, maybe, provided Fred doesn't shuffle the docs around. Bugfix candidate. Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** pydoc.py 21 Oct 2002 04:44:11 -0000 1.71 --- pydoc.py 30 Oct 2002 05:21:00 -0000 1.72 *************** *** 1407,1410 **** --- 1407,1411 ---- 'try': ('ref/try', 'EXCEPTIONS'), 'while': ('ref/while', 'break continue if TRUTHVALUE'), + 'yield': ('ref/yield', ''), } From rhettinger@users.sourceforge.net Wed Oct 30 05:26:49 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 21:26:49 -0800 Subject: [Python-checkins] python/dist/src/Lib keyword.py,1.11,1.11.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12527 Modified Files: Tag: release22-maint keyword.py Log Message: Patrick K. O'Brien noticed that kwlist was missing from __all__. Added because it is part of the documented interface. Index: keyword.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/keyword.py,v retrieving revision 1.11 retrieving revision 1.11.16.1 diff -C2 -d -r1.11 -r1.11.16.1 *** keyword.py 19 Jun 2001 00:26:25 -0000 1.11 --- keyword.py 30 Oct 2002 05:26:45 -0000 1.11.16.1 *************** *** 11,15 **** """ ! __all__ = ["iskeyword"] kwlist = [ --- 11,15 ---- """ ! __all__ = ["iskeyword", "kwlist"] kwlist = [ From rhettinger@users.sourceforge.net Wed Oct 30 05:44:53 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 21:44:53 -0800 Subject: [Python-checkins] python/dist/src/Lib shutil.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17566 Modified Files: shutil.py Log Message: Added new move() function to __all__. Index: shutil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/shutil.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** shutil.py 7 Oct 2002 13:23:24 -0000 1.24 --- shutil.py 30 Oct 2002 05:44:50 -0000 1.25 *************** *** 11,15 **** __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", ! "copytree","rmtree","Error"] class Error(exceptions.EnvironmentError): --- 11,15 ---- __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", ! "copytree","move","rmtree","Error"] class Error(exceptions.EnvironmentError): From rhettinger@users.sourceforge.net Wed Oct 30 06:15:55 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 22:15:55 -0800 Subject: [Python-checkins] python/dist/src/Lib heapq.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25445 Modified Files: heapq.py Log Message: Added __all__. Index: heapq.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** heapq.py 11 Aug 2002 18:28:09 -0000 1.15 --- heapq.py 30 Oct 2002 06:15:53 -0000 1.16 *************** *** 127,130 **** --- 127,132 ---- """ + __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace'] + def heappush(heap, item): """Push item onto heap, maintaining the heap invariant.""" From rhettinger@users.sourceforge.net Wed Oct 30 06:10:01 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 22:10:01 -0800 Subject: [Python-checkins] python/dist/src/Lib difflib.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23963 Modified Files: difflib.py Log Message: Added missing names to __all__. Index: difflib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** difflib.py 1 Jun 2002 14:18:45 -0000 1.10 --- difflib.py 30 Oct 2002 06:09:58 -0000 1.11 *************** *** 21,25 **** __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher', ! 'Differ'] class SequenceMatcher: --- 21,25 ---- __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher', ! 'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK'] class SequenceMatcher: From rhettinger@users.sourceforge.net Wed Oct 30 06:20:41 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 22:20:41 -0800 Subject: [Python-checkins] python/dist/src/Lib imaplib.py,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26579 Modified Files: imaplib.py Log Message: Added missing class to __all__. Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** imaplib.py 16 Jul 2002 21:35:23 -0000 1.55 --- imaplib.py 30 Oct 2002 06:20:37 -0000 1.56 *************** *** 23,27 **** import binascii, re, socket, time, random, sys ! __all__ = ["IMAP4", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate"] --- 23,27 ---- import binascii, re, socket, time, random, sys ! __all__ = ["IMAP4", "IMAP4_SSL", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate"] From rhettinger@users.sourceforge.net Wed Oct 30 06:33:35 2002 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue, 29 Oct 2002 22:33:35 -0800 Subject: [Python-checkins] python/dist/src/Lib difflib.py,1.6,1.6.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv29734 Modified Files: Tag: release22-maint difflib.py Log Message: Added missing names to __all__. Index: difflib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -C2 -d -r1.6 -r1.6.10.1 *** difflib.py 4 Oct 2001 05:36:56 -0000 1.6 --- difflib.py 30 Oct 2002 06:33:33 -0000 1.6.10.1 *************** *** 23,27 **** __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher', ! 'Differ'] class SequenceMatcher: --- 23,27 ---- __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher', ! 'Differ', 'IS_CHARACTER_JUNK', 'IS_LINE_JUNK'] class SequenceMatcher: From fdrake@acm.org Wed Oct 30 15:31:33 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Wed, 30 Oct 2002 10:31:33 -0500 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.71,1.72 In-Reply-To: References: Message-ID: <15807.64341.707735.793775@grendel.zope.com> tim_one@users.sourceforge.net writes: > SF bug 630824: pydoc Helper keywords missing 'yield' > Wow, what a brittle subsystem! Fixed, maybe, provided Fred doesn't > shuffle the docs around. See http://www.python.org/sf/628258 -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@users.sourceforge.net Wed Oct 30 16:54:14 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 30 Oct 2002 08:54:14 -0800 Subject: [Python-checkins] python/dist/src/Doc/html/icons pyfav.gif,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html/icons In directory usw-pr-cvs1:/tmp/cvs-serv24503/html/icons Added Files: pyfav.gif Log Message: Added "favicon" image. --- NEW FILE: pyfav.gif --- (This appears to be a binary file; contents omitted.) From fdrake@users.sourceforge.net Wed Oct 30 16:54:56 2002 From: fdrake@users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed, 30 Oct 2002 08:54:56 -0800 Subject: [Python-checkins] python/dist/src/Doc/html index.html.in,1.16,1.17 about.html,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory usw-pr-cvs1:/tmp/cvs-serv25031/html Modified Files: index.html.in about.html Log Message: Make use of the new "favicon" image. Index: index.html.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/index.html.in,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.html.in 1 Apr 2002 18:49:45 -0000 1.16 --- index.html.in 30 Oct 2002 16:54:53 -0000 1.17 *************** *** 6,9 **** --- 6,10 ---- content="Top-level index to the standard documentation for Python @RELEASE@."> +

Content Format
ZIPGZipBZip2