Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1c47222a
Commit
1c47222a
authored
Sep 20, 2012
by
Christian Heimes
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
5cb31c92
fe6e7e6b
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
64 additions
and
38 deletions
+64
-38
Doc/c-api/import.rst
Doc/c-api/import.rst
+1
-1
Doc/faq/windows.rst
Doc/faq/windows.rst
+5
-5
Doc/library/doctest.rst
Doc/library/doctest.rst
+1
-1
Doc/library/pyexpat.rst
Doc/library/pyexpat.rst
+1
-1
Doc/library/smtpd.rst
Doc/library/smtpd.rst
+7
-6
Doc/library/timeit.rst
Doc/library/timeit.rst
+10
-10
Doc/tools/sphinxext/susp-ignored.csv
Doc/tools/sphinxext/susp-ignored.csv
+1
-2
Doc/whatsnew/3.3.rst
Doc/whatsnew/3.3.rst
+5
-4
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+12
-0
Lib/xml/etree/ElementTree.py
Lib/xml/etree/ElementTree.py
+1
-1
Misc/NEWS
Misc/NEWS
+6
-0
Modules/_io/_iomodule.c
Modules/_io/_iomodule.c
+1
-1
Modules/_io/iobase.c
Modules/_io/iobase.c
+1
-1
Modules/_io/textio.c
Modules/_io/textio.c
+1
-1
Modules/posixmodule.c
Modules/posixmodule.c
+8
-1
Objects/typeobject.c
Objects/typeobject.c
+3
-3
No files found.
Doc/c-api/import.rst
View file @
1c47222a
...
...
@@ -76,7 +76,7 @@ Importing Modules
UTF-8 encoded string instead of a Unicode object.
.. versionchanged:: 3.3
Negative values for *
*level*
* are no longer accepted.
Negative values for *
level
* are no longer accepted.
.. c:function:: PyObject* PyImport_Import(PyObject *name)
...
...
Doc/faq/windows.rst
View file @
1c47222a
...
...
@@ -464,13 +464,13 @@ to console subprocesses which are designed to handle those signals. See
Why does os.path.isdir() fail on NT shared directories?
-------------------------------------------------------
The solution appears to be always append the "\\" on the end of shared
drives.
In order to work correctly, :func:`os.path.isdir` requires a ``"\\"`` at the
end of the shared drive::
>>> import os
>>> os.path.isdir(
'\\\\rorschach\\public')
>>> os.path.isdir('\\\\rorschach\\public')
0
>>> os.path.isdir(
'\\\\rorschach\\public\\')
>>> os.path.isdir('\\\\rorschach\\public\\')
1
It helps to think of share points as being like drive letters. Example::
...
...
@@ -480,7 +480,7 @@ It helps to think of share points as being like drive letters. Example::
k:\media is a directory
k:\media\ is not a directory
The same rules apply if you substitute
"k:" with "\\conky\foo"
::
The same rules apply if you substitute
``"k:"`` with ``"\\conky\foo"``
::
\\conky\foo is not a directory
\\conky\foo\ is a directory
...
...
Doc/library/doctest.rst
View file @
1c47222a
...
...
@@ -338,7 +338,7 @@ The fine print:
Backslashes in a raw docstring: m\n
Otherwise, the backslash will be interpreted as part of the string. For example,
the
"\\"
above would be interpreted as a newline character. Alternatively, you
the
``\n``
above would be interpreted as a newline character. Alternatively, you
can double each backslash in the doctest version (and not use a raw string)::
>>> def f(x):
...
...
Doc/library/pyexpat.rst
View file @
1c47222a
...
...
@@ -402,7 +402,7 @@ otherwise stated.
.. method:: xmlparser.CommentHandler(data)
Called for comments. *data* is the text of the comment, excluding the leading
'``<!-``\ ``-``' and trailing '``-``\ ``->``'
.
``'<!-``\ ``-'`` and trailing ``'-``\ ``->'``
.
.. method:: xmlparser.StartCdataSectionHandler()
...
...
Doc/library/smtpd.rst
View file @
1c47222a
...
...
@@ -111,12 +111,13 @@ SMTPChannel Objects
.. attribute:: addr
Holds the address of the client, the second value returned by
socket.accept()
:func:`socket.accept <socket.socket.accept>`
.. attribute:: received_lines
Holds a list of the line strings (decoded using UTF-8) received from
the client. The lines have their "\\r\\n" line ending translated to "\\n".
the client. The lines have their ``"\r\n"`` line ending translated to
``"\n"``.
.. attribute:: smtp_state
...
...
@@ -141,12 +142,12 @@ SMTPChannel Objects
.. attribute:: received_data
Holds a string containing all of the data sent by the client during the
DATA state, up to but not including the terminating
"\r\n.\r\n"
.
DATA state, up to but not including the terminating
``"\r\n.\r\n"``
.
.. attribute:: fqdn
Holds the fully-qualified domain name of the server as returned by
``socket.getfqdn()`
`.
:func:`socket.getfqdn
`.
.. attribute:: peer
...
...
@@ -170,14 +171,14 @@ SMTPChannel Objects
MAIL Accepts the "MAIL FROM:" syntax and stores the supplied address as
:attr:`mailfrom`. In extended command mode, accepts the
:rfc:`1870` SIZE attribute and responds appropriately based on the
value of
``data_size_limit``
.
value of
*data_size_limit*
.
RCPT Accepts the "RCPT TO:" syntax and stores the supplied addresses in
the :attr:`rcpttos` list.
RSET Resets the :attr:`mailfrom`, :attr:`rcpttos`, and
:attr:`received_data`, but not the greeting.
DATA Sets the internal state to :attr:`DATA` and stores remaining lines
from the client in :attr:`received_data` until the terminator
"\r\n.\r\n"
is received.
``"\r\n.\r\n"``
is received.
HELP Returns minimal information on command syntax
VRFY Returns code 252 (the server doesn't know if the address is valid)
EXPN Reports that the command is not implemented.
...
...
Doc/library/timeit.rst
View file @
1c47222a
...
...
@@ -31,13 +31,13 @@ The module defines the following public class:
may also contain multiple statements separated by ``;`` or newlines, as long as
they don't contain multi-line string literals.
To measure the execution time of the first statement, use the :meth:`timeit`
method. The :meth:`repeat` method is a convenience to call :meth:`timeit`
To measure the execution time of the first statement, use the :meth:`
Timer.
timeit`
method. The :meth:`repeat` method is a convenience to call :meth:`
.
timeit`
multiple times and return a list of results.
The *stmt* and *setup* parameters can also take objects that are callable
without arguments. This will embed calls to them in a timer function that
will then be executed by :meth:`timeit`. Note that the timing overhead is a
will then be executed by :meth:`
.
timeit`. Note that the timing overhead is a
little larger in this case because of the extra function calls.
...
...
@@ -60,12 +60,12 @@ The module defines the following public class:
.. method:: Timer.repeat(repeat=3, number=1000000)
Call :meth:`timeit` a few times.
Call :meth:`
.
timeit` a few times.
This is a convenience function that calls the :meth:`timeit` repeatedly,
This is a convenience function that calls the :meth:`
.
timeit` repeatedly,
returning a list of results. The first argument specifies how many times to
call :meth:`timeit`. The second argument specifies the *number* argument for
:
func:`
timeit`.
call :meth:`
.
timeit`. The second argument specifies the *number* argument for
:
meth:`.
timeit`.
.. note::
...
...
@@ -89,7 +89,7 @@ The module defines the following public class:
.. note::
By default, :meth:`timeit` temporarily turns off :term:`garbage collection`
By default, :meth:`
.
timeit` temporarily turns off :term:`garbage collection`
during the timing. The advantage of this approach is that it makes
independent timings more comparable. This disadvantage is that GC may be
an important component of the performance of the function being measured.
...
...
@@ -117,7 +117,7 @@ The module also defines three convenience functions:
.. function:: timeit(stmt='pass', setup='pass', timer=<default timer>, number=1000000)
Create a :class:`Timer` instance with the given statement, setup code and timer
function and run its :meth:`timeit` method with *number* executions.
function and run its :meth:`
.
timeit` method with *number* executions.
Command Line Interface
...
...
@@ -243,7 +243,7 @@ attributes. ::
3.15 usec/pass
To give the :mod:`timeit` module access to functions you define, you can pass a
``setup``
parameter which contains an import statement::
*setup*
parameter which contains an import statement::
def test():
"""Stupid test function"""
...
...
Doc/tools/sphinxext/susp-ignored.csv
View file @
1c47222a
...
...
@@ -124,9 +124,8 @@ library/functions,,:step,a[start:stop:step]
library/functions,,:stop,"a[start:stop, i]"
library/functions,,:stop,a[start:stop:step]
library/hotshot,,:lineno,"ncalls tottime percall cumtime percall filename:lineno(function)"
library/http.client,
52
,:port,host:port
library/http.client,,:port,host:port
library/http.cookies,,`,!#$%&'*+-.^_`|~:
library/httplib,,:port,host:port
library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS"
library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS"
library/inspect,,:int,">>> def foo(a, *, b:int, **kwargs):"
...
...
Doc/whatsnew/3.3.rst
View file @
1c47222a
...
...
@@ -69,6 +69,7 @@ New library modules:
* :mod:`faulthandler` (helps debugging low-level crashes)
* :mod:`ipaddress` (high-level objects representing IP addresses and masks)
* :mod:`lzma` (compress data using the XZ / LZMA algorithm)
* :mod:`unittest.mock` (replace parts of your system under test with mock objects)
* :mod:`venv` (Python :ref:`virtual environments <pep-405>`, as in the
popular ``virtualenv`` package)
...
...
@@ -923,7 +924,7 @@ New Modules
faulthandler
------------
This new debug module contains functions to dump Python tracebacks explicitly,
This new debug module
:mod:`faulthandler`
contains functions to dump Python tracebacks explicitly,
on a fault (a crash like a segmentation fault), after a timeout, or on a user
signal. Call :func:`faulthandler.enable` to install fault handlers for the
:const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS`, and
...
...
@@ -1927,7 +1928,7 @@ Porting Python code
updated
to
use
the
full
name
of
the
module
instead
of
just
the
tail
of
the
name
.
*
The
*
*
index
*
*
argument
to
:
func
:`
__import__
`
now
defaults
to
0
instead
of
-
1
*
The
*
index
*
argument
to
:
func
:`
__import__
`
now
defaults
to
0
instead
of
-
1
and
no
longer
support
negative
values
.
It
was
an
oversight
when
:
pep
:`
328
`
was
implemented
that
the
default
value
remained
-
1.
If
you
need
to
continue
to
perform
a
relative
import
followed
by
an
absolute
import
,
then
perform
the
...
...
@@ -1995,9 +1996,9 @@ Porting C code
* :c:func:`PyImport_GetMagicNumber` now returns -1 upon failure.
* As a negative value for the *
*level*
* argument to :func:`__import__` is no
* As a negative value for the *
level
* argument to :func:`__import__` is no
longer valid, the same now holds for :c:func:`PyImport_ImportModuleLevel`.
This also means that the value of *
*level*
* used by
This also means that the value of *
level
* used by
:c:func:`PyImport_ImportModuleEx` is now 0 instead of -1.
...
...
Lib/test/test_xml_etree.py
View file @
1c47222a
...
...
@@ -1809,6 +1809,18 @@ class ElementTreeTest(unittest.TestCase):
mye
=
MyElement
(
'joe'
)
self
.
assertEqual
(
mye
.
newmethod
(),
'joe'
)
def
test_html_empty_elems_serialization
(
self
):
# issue 15970
# from http://www.w3.org/TR/html401/index/elements.html
for
element
in
[
'AREA'
,
'BASE'
,
'BASEFONT'
,
'BR'
,
'COL'
,
'FRAME'
,
'HR'
,
'IMG'
,
'INPUT'
,
'ISINDEX'
,
'LINK'
,
'META'
,
'PARAM'
]:
for
elem
in
[
element
,
element
.
lower
()]:
expected
=
'<%s>'
%
elem
serialized
=
serialize
(
ET
.
XML
(
'<%s />'
%
elem
),
method
=
'html'
)
self
.
assertEqual
(
serialized
,
expected
)
serialized
=
serialize
(
ET
.
XML
(
'<%s></%s>'
%
(
elem
,
elem
)),
method
=
'html'
)
self
.
assertEqual
(
serialized
,
expected
)
class
ElementIterTest
(
unittest
.
TestCase
):
def
_ilist
(
self
,
elem
,
tag
=
None
):
...
...
Lib/xml/etree/ElementTree.py
View file @
1c47222a
...
...
@@ -995,7 +995,7 @@ def _serialize_xml(write, elem, qnames, namespaces):
write
(
_escape_cdata
(
elem
.
tail
))
HTML_EMPTY
=
(
"area"
,
"base"
,
"basefont"
,
"br"
,
"col"
,
"frame"
,
"hr"
,
"img"
,
"input"
,
"isindex"
,
"link"
,
"meta"
"param"
)
"img"
,
"input"
,
"isindex"
,
"link"
,
"meta"
,
"param"
)
try
:
HTML_EMPTY
=
set
(
HTML_EMPTY
)
...
...
Misc/NEWS
View file @
1c47222a
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.1
Core and Builtins
-----------------
- Issue #15965: Explicitly cast AT_FDCWD as (int). Required on Solaris 10
(which defines AT_FDCWD as 0xffd19553), harmless on other platforms.
- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
- Issue #15895: Fix FILE pointer leak in one error branch of
...
...
@@ -29,6 +32,9 @@ Core and Builtins
Library
-------
- Issue #15970: xml.etree.ElementTree now serializes correctly the empty HTML
elements '
meta
' and '
param
'.
- Issue #15842: the SocketIO.{readable,writable,seekable} methods now
raise ValueError when the file-like object is closed. Patch by Alessandro
Moura.
...
...
Modules/_io/_iomodule.c
View file @
1c47222a
...
...
@@ -185,7 +185,7 @@ PyDoc_STRVAR(open_doc,
"
\n
"
"* On output, if newline is None, any '
\\
n' characters written are
\n
"
" translated to the system default line separator, os.linesep. If
\n
"
" newline is '' or '
\n
', no translation takes place. If newline is any
\n
"
" newline is '' or '
\
\
n', no translation takes place. If newline is any
\n
"
" of the other legal values, any '
\\
n' characters written are translated
\n
"
" to the given string.
\n
"
"
\n
"
...
...
Modules/_io/iobase.c
View file @
1c47222a
...
...
@@ -442,7 +442,7 @@ PyDoc_STRVAR(iobase_readline_doc,
"
\n
"
"If limit is specified, at most limit bytes will be read.
\n
"
"
\n
"
"The line terminator is always b'
\n
' for binary files; for text
\n
"
"The line terminator is always b'
\
\
n' for binary files; for text
\n
"
"files, the newlines argument to open can be used to select the line
\n
"
"terminator(s) recognized.
\n
"
);
...
...
Modules/_io/textio.c
View file @
1c47222a
...
...
@@ -648,7 +648,7 @@ PyDoc_STRVAR(textiowrapper_doc,
"
\n
"
"* On output, if newline is None, any '
\\
n' characters written are
\n
"
" translated to the system default line separator, os.linesep. If
\n
"
" newline is '' or '
\n
', no translation takes place. If newline is any
\n
"
" newline is '' or '
\
\
n', no translation takes place. If newline is any
\n
"
" of the other legal values, any '
\\
n' characters written are translated
\n
"
" to the given string.
\n
"
"
\n
"
...
...
Modules/posixmodule.c
View file @
1c47222a
...
...
@@ -414,7 +414,14 @@ win32_warn_bytes_api()
#ifdef AT_FDCWD
#define DEFAULT_DIR_FD AT_FDCWD
/*
* Why the (int) cast? Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
* without the int cast, the value gets interpreted as uint (4291925331),
* which doesn't play nicely with all the initializer lines in this file that
* look like this:
* int dir_fd = DEFAULT_DIR_FD;
*/
#define DEFAULT_DIR_FD (int)AT_FDCWD
#else
#define DEFAULT_DIR_FD (-100)
#endif
...
...
Objects/typeobject.c
View file @
1c47222a
...
...
@@ -5992,7 +5992,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
descr
=
_PyType_Lookup
(
type
,
p
->
name_strobj
);
if
(
descr
==
NULL
)
{
if
(
ptr
==
(
void
**
)
&
type
->
tp_iternext
)
{
specific
=
_PyObject_NextNotImplemented
;
specific
=
(
void
*
)
_PyObject_NextNotImplemented
;
}
continue
;
}
...
...
@@ -6039,7 +6039,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
/* We specifically allow __hash__ to be set to None
to prevent inheritance of the default
implementation from object.__hash__ */
specific
=
PyObject_HashNotImplemented
;
specific
=
(
void
*
)
PyObject_HashNotImplemented
;
}
else
{
use_generic
=
1
;
...
...
@@ -6254,7 +6254,7 @@ add_operators(PyTypeObject *type)
continue
;
if
(
PyDict_GetItem
(
dict
,
p
->
name_strobj
))
continue
;
if
(
*
ptr
==
PyObject_HashNotImplemented
)
{
if
(
*
ptr
==
(
void
*
)
PyObject_HashNotImplemented
)
{
/* Classes may prevent the inheritance of the tp_hash
slot by storing PyObject_HashNotImplemented in it. Make it
visible as a None value for the __hash__ attribute. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment