Skip to content

Commit dcf97b9

Browse files
committed
Merged revisions 64434-64435,64440-64443,64445,64447-64448,64450,64452,64455,64461,64464,64466,64468 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r64434 | andrew.kuchling | 2008-06-20 18:13:58 -0500 (Fri, 20 Jun 2008) | 1 line Remove request for e-mail; it's unlikely these classes will be saved ........ r64435 | andrew.kuchling | 2008-06-20 18:14:32 -0500 (Fri, 20 Jun 2008) | 1 line Grammar fixes ........ r64440 | andrew.kuchling | 2008-06-21 08:29:12 -0500 (Sat, 21 Jun 2008) | 1 line Docstring typo ........ r64441 | andrew.kuchling | 2008-06-21 08:47:20 -0500 (Sat, 21 Jun 2008) | 1 line Use repr() for bad input strings; this makes the empty string or binary characters more visible ........ r64442 | andrew.kuchling | 2008-06-21 08:48:38 -0500 (Sat, 21 Jun 2008) | 1 line Docstring correction ........ r64443 | georg.brandl | 2008-06-21 09:26:19 -0500 (Sat, 21 Jun 2008) | 2 lines Documentation fix. ........ r64445 | facundo.batista | 2008-06-21 12:30:06 -0500 (Sat, 21 Jun 2008) | 3 lines Reviewed and updated the documentation. Fixes #3017. ........ r64447 | facundo.batista | 2008-06-21 13:58:04 -0500 (Sat, 21 Jun 2008) | 6 lines Now a from submitted via POST that also has a query string will contain both FieldStorage and MiniFieldStorage items. Fixes #1817. ........ r64448 | facundo.batista | 2008-06-21 14:48:19 -0500 (Sat, 21 Jun 2008) | 5 lines In the deprecated functions I added an alert to review specially a section of the subprocess documentation that helps with the replacing of those functionss. ........ r64450 | georg.brandl | 2008-06-22 04:05:29 -0500 (Sun, 22 Jun 2008) | 2 lines Turn section references into proper cross-references. ........ r64452 | facundo.batista | 2008-06-22 08:36:20 -0500 (Sun, 22 Jun 2008) | 5 lines Issue #2722. Now the char buffer to support the path string has not fixed length, it mallocs memory if needed. As a result, we don't have a maximum for the getcwd() method. ........ r64455 | facundo.batista | 2008-06-22 10:27:10 -0500 (Sun, 22 Jun 2008) | 4 lines Issue 3164. Small fix to don't repeat a comparation without necessity. ........ r64461 | georg.brandl | 2008-06-22 13:11:52 -0500 (Sun, 22 Jun 2008) | 2 lines #3085: Fix syntax error. ........ r64464 | georg.brandl | 2008-06-22 13:31:54 -0500 (Sun, 22 Jun 2008) | 2 lines Expand docstrings of sqlite3 functions. ........ r64466 | georg.brandl | 2008-06-22 14:07:59 -0500 (Sun, 22 Jun 2008) | 2 lines Write out "phi" consistently. ........ r64468 | facundo.batista | 2008-06-22 14:35:24 -0500 (Sun, 22 Jun 2008) | 4 lines Just returning nothing instead of rising TestSkipped, because it makes the test fail in the trunk.loewis-sun buildbot. ........
1 parent f9c98b4 commit dcf97b9

File tree

16 files changed

+249
-56
lines changed

16 files changed

+249
-56
lines changed

Doc/library/ast.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,5 @@ and classes for traversing abstract syntax trees:
253253
debugging purposes. The returned string will show the names and the values
254254
for fields. This makes the code impossible to evaluate, so if evaluation is
255255
wanted *annotate_fields* must be set to False. Attributes such as line
256-
numbers and column offsets are dumped by default. If this is wanted,
256+
numbers and column offsets are not dumped by default. If this is wanted,
257257
*include_attributes* can be set to ``True``.

Doc/library/cgi.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ data part of type :mimetype:`application/x-www-form-urlencoded`), the items will
162162
actually be instances of the class :class:`MiniFieldStorage`. In this case, the
163163
:attr:`list`, :attr:`file`, and :attr:`filename` attributes are always ``None``.
164164

165+
A form submitted via POST that also has a query string will contain both
166+
:class:`FieldStorage` and :class:`MiniFieldStorage` items.
165167

166168
Higher Level Interface
167169
----------------------

Doc/library/cmath.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Definition::
4040

4141
In engineering the polar coordinate system is popular for complex numbers. In
4242
polar coordinates a complex number is defined by the radius *r* and the phase
43-
angle *φ*. The radius *r* is the absolute value of the complex, which can be
43+
angle *phi*. The radius *r* is the absolute value of the complex, which can be
4444
viewed as distance from (0, 0). The radius *r* is always 0 or a positive float.
45-
The phase angle *φ* is the counter clockwise angle from the positive x axis,
45+
The phase angle *phi* is the counter clockwise angle from the positive x axis,
4646
e.g. *1* has the angle *0*, *1j* has the angle *π/2* and *-1* the angle **.
4747

4848
.. note::
@@ -53,12 +53,12 @@ e.g. *1* has the angle *0*, *1j* has the angle *π/2* and *-1* the angle *-π*.
5353

5454
Definition::
5555

56-
z = r * exp(1j * φ)
57-
z = r * cis(φ)
56+
z = r * exp(1j * phi)
57+
z = r * cis(phi)
5858

5959
r := abs(z) := sqrt(real(z)**2 + imag(z)**2)
6060
phi := phase(z) := atan2(imag(z), real(z))
61-
cis(φ) := cos(φ) + 1j * sin(φ)
61+
cis(phi) := cos(phi) + 1j * sin(phi)
6262

6363

6464
.. function:: phase(x)

Doc/library/decimal.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Decimal objects
418418

419419
.. method:: conjugate()
420420

421-
Just returns itself, this method is only to comply with the Decimal
421+
Just returns self, this method is only to comply with the Decimal
422422
Specification.
423423

424424
.. method:: copy_abs()
@@ -1192,9 +1192,10 @@ In addition to the three supplied contexts, new contexts can be created with the
11921192
The sign of the result, if non-zero, is the same as that of the original
11931193
dividend.
11941194

1195+
11951196
.. method:: remainder_near(x, y)
11961197

1197-
Returns `x - y * n`, where *n* is the integer nearest the exact value
1198+
Returns `x - y * n`, where *n* is the integer nearest the exact value
11981199
of `x / y` (if the result is `0` then its sign will be the sign of *x*).
11991200

12001201

Doc/library/os.rst

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -337,21 +337,6 @@ These functions create new file objects. (See also :func:`open`.)
337337
does on most platforms).
338338

339339

340-
.. function:: popen(command[, mode[, bufsize]])
341-
342-
Open a pipe to or from *command*. The return value is an open file object
343-
connected to the pipe, which can be read or written depending on whether *mode*
344-
is ``'r'`` (default) or ``'w'``. The *bufsize* argument has the same meaning as
345-
the corresponding argument to the built-in :func:`open` function. The exit
346-
status of the command (encoded in the format specified for :func:`wait`) is
347-
available as the return value of the :meth:`close` method of the file object,
348-
except that when the exit status is zero (termination without errors), ``None``
349-
is returned. Availability: Macintosh, Unix, Windows.
350-
351-
.. deprecated:: 2.6
352-
This function is obsolete. Use the :mod:`subprocess` module.
353-
354-
355340
.. _os-fd-ops:
356341

357342
File Descriptor Operations
@@ -1449,7 +1434,8 @@ written in Python, such as a mail server's external command delivery program.
14491434

14501435
(Note that the :mod:`subprocess` module provides more powerful facilities for
14511436
spawning new processes and retrieving their results; using that module is
1452-
preferable to using these functions.)
1437+
preferable to using these functions. Check specially the *Replacing Older
1438+
Functions with the subprocess Module* section in that documentation page.)
14531439

14541440
If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new
14551441
process; if *mode* is :const:`P_WAIT`, returns the process's exit code if it
@@ -1571,7 +1557,8 @@ written in Python, such as a mail server's external command delivery program.
15711557

15721558
The :mod:`subprocess` module provides more powerful facilities for spawning new
15731559
processes and retrieving their results; using that module is preferable to using
1574-
this function.
1560+
this function. Use the :mod:`subprocess` module. Check especially the
1561+
:ref:`subprocess-replacements` section.
15751562

15761563

15771564
.. function:: times()

Doc/library/stdtypes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,11 @@ the particular object.
21452145
the system default encoding for converting strings.
21462146

21472147

2148+
.. attribute:: file.errors
2149+
2150+
The Unicode error handler used along with the encoding.
2151+
2152+
21482153
.. attribute:: file.mode
21492154

21502155
The I/O mode for the file. If the file was created using the :func:`open`

Doc/library/subprocess.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ The following attributes are also available:
289289
``N`` (Unix only).
290290

291291

292+
.. _subprocess-replacements:
293+
292294
Replacing Older Functions with the subprocess Module
293295
----------------------------------------------------
294296

@@ -386,13 +388,13 @@ Replacing os.popen\*
386388

387389
::
388390

389-
pipe = os.popen(cmd, mode='r', bufsize)
391+
pipe = os.popen(cmd, 'r', bufsize)
390392
==>
391393
pipe = Popen(cmd, shell=True, bufsize=bufsize, stdout=PIPE).stdout
392394

393395
::
394396

395-
pipe = os.popen(cmd, mode='w', bufsize)
397+
pipe = os.popen(cmd, 'w', bufsize)
396398
==>
397399
pipe = Popen(cmd, shell=True, bufsize=bufsize, stdin=PIPE).stdin
398400

Lib/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def dump(node, annotate_fields=True, include_attributes=False):
7373
debugging purposes. The returned string will show the names and the values
7474
for fields. This makes the code impossible to evaluate, so if evaluation is
7575
wanted *annotate_fields* must be set to False. Attributes such as line
76-
numbers and column offsets are dumped by default. If this is wanted,
76+
numbers and column offsets are not dumped by default. If this is wanted,
7777
*include_attributes* can be set to True.
7878
"""
7979
def _format(node):

Lib/cgi.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ def __init__(self, fp=None, headers=None, outerboundary="",
449449
self.strict_parsing = strict_parsing
450450
if 'REQUEST_METHOD' in environ:
451451
method = environ['REQUEST_METHOD'].upper()
452+
self.qs_on_post = None
452453
if method == 'GET' or method == 'HEAD':
453454
if 'QUERY_STRING' in environ:
454455
qs = environ['QUERY_STRING']
@@ -467,6 +468,8 @@ def __init__(self, fp=None, headers=None, outerboundary="",
467468
headers['content-type'] = "application/x-www-form-urlencoded"
468469
if 'CONTENT_TYPE' in environ:
469470
headers['content-type'] = environ['CONTENT_TYPE']
471+
if 'QUERY_STRING' in environ:
472+
self.qs_on_post = environ['QUERY_STRING']
470473
if 'CONTENT_LENGTH' in environ:
471474
headers['content-length'] = environ['CONTENT_LENGTH']
472475
self.fp = fp or sys.stdin
@@ -618,6 +621,8 @@ def __nonzero__(self):
618621
def read_urlencoded(self):
619622
"""Internal: read data in query string format."""
620623
qs = self.fp.read(self.length)
624+
if self.qs_on_post:
625+
qs += '&' + self.qs_on_post
621626
self.list = list = []
622627
for key, value in parse_qsl(qs, self.keep_blank_values,
623628
self.strict_parsing):
@@ -632,6 +637,12 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
632637
if not valid_boundary(ib):
633638
raise ValueError('Invalid boundary in multipart form: %r' % (ib,))
634639
self.list = []
640+
if self.qs_on_post:
641+
for key, value in parse_qsl(self.qs_on_post, self.keep_blank_values,
642+
self.strict_parsing):
643+
self.list.append(MiniFieldStorage(key, value))
644+
FieldStorageClass = None
645+
635646
klass = self.FieldStorageClass or self.__class__
636647
parser = email.parser.FeedParser()
637648
# Create bogus content-type header for proper multipart parsing

Lib/fractions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __new__(cls, numerator=0, denominator=1):
6868
input = numerator
6969
m = _RATIONAL_FORMAT.match(input)
7070
if m is None:
71-
raise ValueError('Invalid literal for Fraction: ' + input)
71+
raise ValueError('Invalid literal for Fraction: %r' % input)
7272
numerator = m.group('num')
7373
decimal = m.group('decimal')
7474
if decimal:

0 commit comments

Comments
 (0)