Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
92843e3c
Kaydet (Commit)
92843e3c
authored
Tem 03, 2011
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge heads
üst
774f83cd
37d72b71
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
288 additions
and
86 deletions
+288
-86
smtplib.rst
Doc/library/smtplib.rst
+19
-8
sqlite3.rst
Doc/library/sqlite3.rst
+38
-37
3.3.rst
Doc/whatsnew/3.3.rst
+1
-1
process.py
Lib/concurrent/futures/process.py
+27
-15
test_file_loader.py
Lib/importlib/test/source/test_file_loader.py
+1
-1
smtplib.py
Lib/smtplib.py
+39
-13
test_concurrent_futures.py
Lib/test/test_concurrent_futures.py
+7
-0
test_csv.py
Lib/test/test_csv.py
+4
-4
test_marshal.py
Lib/test/test_marshal.py
+24
-0
test_shutil.py
Lib/test/test_shutil.py
+5
-5
test_smtplib.py
Lib/test/test_smtplib.py
+110
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+6
-0
marshal.c
Python/marshal.c
+0
-0
msi.py
Tools/msi/msi.py
+6
-1
No files found.
Doc/library/smtplib.rst
Dosyayı görüntüle @
92843e3c
...
...
@@ -348,21 +348,32 @@ An :class:`SMTP` instance has the following methods:
.. versionchanged:: 3.2 *msg* may be a byte string.
.. method:: SMTP.send_message(msg, from_addr=None, to_addrs=None, mail_options=[], rcpt_options=[])
.. method:: SMTP.send_message(msg, from_addr=None, to_addrs=None, \
mail_options=[], rcpt_options=[])
This is a convenience method for calling :meth:`sendmail` with the message
represented by an :class:`email.message.Message` object. The arguments have
the same meaning as for :meth:`sendmail`, except that *msg* is a ``Message``
object.
If *from_addr* is ``None``, ``send_message`` sets its value to the value of
the :mailheader:`From` header from *msg*. If *to_addrs* is ``None``,
``send_message`` combines the values (if any) of the :mailheader:`To`,
:mailheader:`CC`, and :mailheader:`Bcc` fields from *msg*. Regardless of
the values of *from_addr* and *to_addrs*, ``send_message`` deletes any Bcc
field from *msg*. It then serializes *msg* using
If *from_addr* is ``None`` or *to_addrs* is ``None``, ``send_message`` fills
those arguments with addresses extracted from the headers of *msg* as
specified in :rfc:`2822`\: *from_addr* is set to the :mailheader:`Sender`
field if it is present, and otherwise to the :mailheader:`From` field.
*to_adresses* combines the values (if any) of the :mailheader:`To`,
:mailheader:`Cc`, and :mailheader:`Bcc` fields from *msg*. If exactly one
set of :mailheader:`Resent-*` headers appear in the message, the regular
headers are ignored and the :mailheader:`Resent-*` headers are used instead.
If the message contains more than one set of :mailheader:`Resent-*` headers,
a :exc:`ValueError` is raised, since there is no way to unambiguously detect
the most recent set of :mailheader:`Resent-` headers.
``send_message`` serializes *msg* using
:class:`~email.generator.BytesGenerator` with ``\r\n`` as the *linesep*, and
calls :meth:`sendmail` to transmit the resulting message.
calls :meth:`sendmail` to transmit the resulting message. Regardless of the
values of *from_addr* and *to_addrs*, ``send_message`` does not transmit any
:mailheader:`Bcc` or :mailheader:`Resent-Bcc` headers that may appear
in *msg*.
.. versionadded:: 3.2
...
...
Doc/library/sqlite3.rst
Dosyayı görüntüle @
92843e3c
...
...
@@ -615,43 +615,43 @@ Row Objects
Let's assume we initialize a table as in the example given above::
conn = sqlite3.connect(":memory:")
c = conn.cursor()
c.execute('''create table stocks
(date text, trans text, symbol text,
qty real, price real)''')
c.execute("""insert into stocks
values ('2006-01-05','BUY','RHAT',100,35.14)""")
conn.commit()
c.close()
conn = sqlite3.connect(":memory:")
c = conn.cursor()
c.execute('''create table stocks
(date text, trans text, symbol text,
qty real, price real)''')
c.execute("""insert into stocks
values ('2006-01-05','BUY','RHAT',100,35.14)""")
conn.commit()
c.close()
Now we plug :class:`Row` in::
>>> conn.row_factory = sqlite3.Row
>>> c = conn.cursor()
>>> c.execute('select * from stocks')
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
>>> r = c.fetchone()
>>> type(r)
<class 'sqlite3.Row'>
>>> tuple(r)
('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)
>>> len(r)
5
>>> r[2]
'RHAT'
>>> r.keys()
['date', 'trans', 'symbol', 'qty', 'price']
>>> r['qty']
100.0
>>> for member in r:
... print(member)
...
2006-01-05
BUY
RHAT
100.0
35.14
>>> conn.row_factory = sqlite3.Row
>>> c = conn.cursor()
>>> c.execute('select * from stocks')
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
>>> r = c.fetchone()
>>> type(r)
<class 'sqlite3.Row'>
>>> tuple(r)
('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)
>>> len(r)
5
>>> r[2]
'RHAT'
>>> r.keys()
['date', 'trans', 'symbol', 'qty', 'price']
>>> r['qty']
100.0
>>> for member in r:
... print(member)
...
2006-01-05
BUY
RHAT
100.0
35.14
.. _sqlite3-types:
...
...
@@ -902,6 +902,7 @@ only makes sense to call from a different thread.
.. rubric:: Footnotes
.. [#f1] The sqlite3 module is not built with loadable extension support by
default, because some platforms (notably Mac OS X) have SQLite libraries which
are compiled without this feature. To get loadable extension support, you must
pass --enable-loadable-sqlite-extensions to configure.
default, because some platforms (notably Mac OS X) have SQLite
libraries which are compiled without this feature. To get loadable
extension support, you must pass --enable-loadable-sqlite-extensions to
configure.
Doc/whatsnew/3.3.rst
Dosyayı görüntüle @
92843e3c
...
...
@@ -206,7 +206,7 @@ handle NAT with non-secure FTP without opening fixed ports.
shutil
------
The :mod:`shutil` module has a new :func:`~shutil.disk_usage` providing total,
The :mod:`shutil` module has a new :func:`~shutil.disk_usage`
function
providing total,
used and free disk space statistics.
(Contributed by Giampaolo Rodolà in :issue:`12442`)
...
...
Lib/concurrent/futures/process.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -50,7 +50,7 @@ import os
from
concurrent.futures
import
_base
import
queue
import
multiprocessing
from
multiprocessing.queues
import
SimpleQueue
,
SentinelReady
from
multiprocessing.queues
import
SimpleQueue
,
SentinelReady
,
Full
import
threading
import
weakref
...
...
@@ -195,15 +195,18 @@ def _queue_management_worker(executor_reference,
result_queue: A multiprocessing.Queue of _ResultItems generated by the
process workers.
"""
executor
=
None
def
shutting_down
():
return
_shutdown
or
executor
is
None
or
executor
.
_shutdown_thread
def
shutdown_worker
():
# This is an upper bound
nb_children_alive
=
sum
(
p
.
is_alive
()
for
p
in
processes
.
values
())
for
i
in
range
(
0
,
nb_children_alive
):
call_queue
.
put
(
None
)
call_queue
.
put
_nowait
(
None
)
# If .join() is not called on the created processes then
# some multiprocessing.Queue methods may deadlock on Mac OS
# X.
# some multiprocessing.Queue methods may deadlock on Mac OS X.
for
p
in
processes
.
values
():
p
.
join
()
...
...
@@ -222,7 +225,7 @@ def _queue_management_worker(executor_reference,
if
executor
is
not
None
:
executor
.
_broken
=
True
executor
.
_shutdown_thread
=
True
del
executor
executor
=
None
# All futures in flight must be marked failed
for
work_id
,
work_item
in
pending_work_items
.
items
():
work_item
.
future
.
set_exception
(
...
...
@@ -242,7 +245,11 @@ def _queue_management_worker(executor_reference,
if
isinstance
(
result_item
,
int
):
# Clean shutdown of a worker using its PID
# (avoids marking the executor broken)
assert
shutting_down
()
del
processes
[
result_item
]
if
not
processes
:
shutdown_worker
()
return
elif
result_item
is
not
None
:
work_item
=
pending_work_items
.
pop
(
result_item
.
work_id
,
None
)
# work_item can be None if another process terminated (see above)
...
...
@@ -257,16 +264,21 @@ def _queue_management_worker(executor_reference,
# - The interpreter is shutting down OR
# - The executor that owns this worker has been collected OR
# - The executor that owns this worker has been shutdown.
if
_shutdown
or
executor
is
None
or
executor
.
_shutdown_thread
:
# Since no new work items can be added, it is safe to shutdown
# this thread if there are no pending work items.
if
not
pending_work_items
:
shutdown_worker
()
return
else
:
# Start shutting down by telling a process it can exit.
call_queue
.
put
(
None
)
del
executor
if
shutting_down
():
try
:
# Since no new work items can be added, it is safe to shutdown
# this thread if there are no pending work items.
if
not
pending_work_items
:
shutdown_worker
()
return
else
:
# Start shutting down by telling a process it can exit.
call_queue
.
put_nowait
(
None
)
except
Full
:
# This is not a problem: we will eventually be woken up (in
# result_queue.get()) and be able to send a sentinel again.
pass
executor
=
None
_system_limits_checked
=
False
_system_limited
=
None
...
...
Lib/importlib/test/source/test_file_loader.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -214,7 +214,7 @@ class BadBytecodeTest(unittest.TestCase):
lambda
bc
:
bc
[:
8
]
+
b
'<test>'
,
del_source
=
del_source
)
file_path
=
mapping
[
'_temp'
]
if
not
del_source
else
bytecode_path
with
self
.
assertRaises
(
Value
Error
):
with
self
.
assertRaises
(
EOF
Error
):
self
.
import_
(
file_path
,
'_temp'
)
def
_test_bad_magic
(
self
,
test
,
*
,
del_source
=
False
):
...
...
Lib/smtplib.py
100755 → 100644
Dosyayı görüntüle @
92843e3c
...
...
@@ -49,6 +49,7 @@ import email.message
import
email.generator
import
base64
import
hmac
import
copy
from
email.base64mime
import
body_encode
as
encode_base64
from
sys
import
stderr
...
...
@@ -676,7 +677,7 @@ class SMTP:
msg may be a string containing characters in the ASCII range, or a byte
string. A string is encoded to bytes using the ascii codec, and lone
\
r
and
\n
characters are converted to
\r
\n
characters.
\
\
r and
\\
n characters are converted to
\\
r
\
\
n characters.
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first. If the server does ESMTP, message size
...
...
@@ -759,24 +760,49 @@ class SMTP:
"""Converts message to a bytestring and passes it to sendmail.
The arguments are as for sendmail, except that msg is an
email.message.Message object. If from_addr is None, the from_addr is
taken from the 'From' header of the Message. If to_addrs is None, its
value is composed from the addresses listed in the 'To', 'CC', and
'Bcc' fields. Regardless of the values of from_addr and to_addr, any
Bcc field in the Message object is deleted. The Message object is then
serialized using email.generator.BytesGenerator and sendmail is called
to transmit the message.
email.message.Message object. If from_addr is None or to_addrs is
None, these arguments are taken from the headers of the Message as
described in RFC 2822 (a ValueError is raised if there is more than
one set of 'Resent-' headers). Regardless of the values of from_addr and
to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
resent) of the Message object won't be transmitted. The Message
object is then serialized using email.generator.BytesGenerator and
sendmail is called to transmit the message.
"""
# 'Resent-Date' is a mandatory field if the Message is resent (RFC 2822
# Section 3.6.6). In such a case, we use the 'Resent-*' fields. However,
# if there is more than one 'Resent-' block there's no way to
# unambiguously determine which one is the most recent in all cases,
# so rather than guess we raise a ValueError in that case.
#
# TODO implement heuristics to guess the correct Resent-* block with an
# option allowing the user to enable the heuristics. (It should be
# possible to guess correctly almost all of the time.)
resent
=
msg
.
get_all
(
'Resent-Date'
)
if
resent
is
None
:
header_prefix
=
''
elif
len
(
resent
)
==
1
:
header_prefix
=
'Resent-'
else
:
raise
ValueError
(
"message has more than one 'Resent-' header block"
)
if
from_addr
is
None
:
from_addr
=
msg
[
'From'
]
# Prefer the sender field per RFC 2822:3.6.2.
from_addr
=
(
msg
[
header_prefix
+
'Sender'
]
if
(
header_prefix
+
'Sender'
)
in
msg
else
msg
[
header_prefix
+
'From'
])
if
to_addrs
is
None
:
addr_fields
=
[
f
for
f
in
(
msg
[
'To'
],
msg
[
'Bcc'
],
msg
[
'CC'
])
if
f
is
not
None
]
addr_fields
=
[
f
for
f
in
(
msg
[
header_prefix
+
'To'
],
msg
[
header_prefix
+
'Bcc'
],
msg
[
header_prefix
+
'Cc'
])
if
f
is
not
None
]
to_addrs
=
[
a
[
1
]
for
a
in
email
.
utils
.
getaddresses
(
addr_fields
)]
del
msg
[
'Bcc'
]
# Make a local copy so we can delete the bcc headers.
msg_copy
=
copy
.
copy
(
msg
)
del
msg_copy
[
'Bcc'
]
del
msg_copy
[
'Resent-Bcc'
]
with
io
.
BytesIO
()
as
bytesmsg
:
g
=
email
.
generator
.
BytesGenerator
(
bytesmsg
)
g
.
flatten
(
msg
,
linesep
=
'
\r\n
'
)
g
.
flatten
(
msg
_copy
,
linesep
=
'
\r\n
'
)
flatmsg
=
bytesmsg
.
getvalue
()
return
self
.
sendmail
(
from_addr
,
to_addrs
,
flatmsg
,
mail_options
,
rcpt_options
)
...
...
Lib/test/test_concurrent_futures.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -367,6 +367,13 @@ class ExecutorTest(unittest.TestCase):
self
.
assertEqual
([
None
,
None
],
results
)
def
test_shutdown_race_issue12456
(
self
):
# Issue #12456: race condition at shutdown where trying to post a
# sentinel in the call queue blocks (the queue is full while processes
# have exited).
self
.
executor
.
map
(
str
,
[
2
]
*
(
self
.
worker_count
+
1
))
self
.
executor
.
shutdown
()
class
ThreadPoolExecutorTest
(
ThreadPoolMixin
,
ExecutorTest
):
def
test_map_submits_without_iteration
(
self
):
...
...
Lib/test/test_csv.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -459,20 +459,20 @@ class TestDialectExcel(TestCsvBase):
'5'
,
'6'
]])
def
test_quoted_quote
(
self
):
self
.
readerAssertEqual
(
'1,2,3,"""I see,"" said the
blind
man","as he picked up his hammer and saw"'
,
self
.
readerAssertEqual
(
'1,2,3,"""I see,"" said the
happy
man","as he picked up his hammer and saw"'
,
[[
'1'
,
'2'
,
'3'
,
'"I see," said the
blind
man'
,
'"I see," said the
happy
man'
,
'as he picked up his hammer and saw'
]])
def
test_quoted_nl
(
self
):
input
=
'''
\
1,2,3,"""I see,""
said the
blind
man","as he picked up his
said the
happy
man","as he picked up his
hammer and saw"
9,8,7,6'''
self
.
readerAssertEqual
(
input
,
[[
'1'
,
'2'
,
'3'
,
'"I see,"
\n
said the
blind
man'
,
'"I see,"
\n
said the
happy
man'
,
'as he picked up his
\n
hammer and saw'
],
[
'9'
,
'8'
,
'7'
,
'6'
]])
...
...
Lib/test/test_marshal.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -228,6 +228,30 @@ class BugsTestCase(unittest.TestCase):
invalid_string
=
b
'l
\x02\x00\x00\x00\x00\x00\x00\x00
'
self
.
assertRaises
(
ValueError
,
marshal
.
loads
,
invalid_string
)
def
test_multiple_dumps_and_loads
(
self
):
# Issue 12291: marshal.load() should be callable multiple times
# with interleaved data written by non-marshal code
# Adapted from a patch by Engelbert Gruber.
data
=
(
1
,
'abc'
,
b
'def'
,
1.0
,
(
2
,
'a'
,
[
'b'
,
b
'c'
]))
for
interleaved
in
(
b
''
,
b
'0123'
):
ilen
=
len
(
interleaved
)
positions
=
[]
try
:
with
open
(
support
.
TESTFN
,
'wb'
)
as
f
:
for
d
in
data
:
marshal
.
dump
(
d
,
f
)
if
ilen
:
f
.
write
(
interleaved
)
positions
.
append
(
f
.
tell
())
with
open
(
support
.
TESTFN
,
'rb'
)
as
f
:
for
i
,
d
in
enumerate
(
data
):
self
.
assertEqual
(
d
,
marshal
.
load
(
f
))
if
ilen
:
f
.
read
(
ilen
)
self
.
assertEqual
(
positions
[
i
],
f
.
tell
())
finally
:
support
.
unlink
(
support
.
TESTFN
)
def
test_main
():
support
.
run_unittest
(
IntTestCase
,
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -732,11 +732,11 @@ class TestShutil(unittest.TestCase):
"disk_usage not available on this platform"
)
def
test_disk_usage
(
self
):
usage
=
shutil
.
disk_usage
(
os
.
getcwd
())
self
.
assert
True
(
usage
.
total
>
0
)
self
.
assert
True
(
usage
.
used
>
0
)
self
.
assert
True
(
usage
.
free
>=
0
)
self
.
assert
True
(
usage
.
total
>=
usage
.
used
)
self
.
assert
True
(
usage
.
total
>
usage
.
free
)
self
.
assert
Greater
(
usage
.
total
,
0
)
self
.
assert
Greater
(
usage
.
used
,
0
)
self
.
assert
GreaterEqual
(
usage
.
free
,
0
)
self
.
assert
GreaterEqual
(
usage
.
total
,
usage
.
used
)
self
.
assert
Greater
(
usage
.
total
,
usage
.
free
)
class
TestMove
(
unittest
.
TestCase
):
...
...
Lib/test/test_smtplib.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -320,13 +320,16 @@ class DebuggingServerTests(unittest.TestCase):
# XXX (see comment in testSend)
time
.
sleep
(
0.01
)
smtp
.
quit
()
# make sure the Bcc header is still in the message.
self
.
assertEqual
(
m
[
'Bcc'
],
'John Root <root@localhost>, "Dinsdale" '
'<warped@silly.walks.com>'
)
self
.
client_evt
.
set
()
self
.
serv_evt
.
wait
()
self
.
output
.
flush
()
# Add the X-Peer header that DebuggingServer adds
m
[
'X-Peer'
]
=
socket
.
gethostbyname
(
'localhost'
)
# The Bcc header
is deleted before serialization
.
# The Bcc header
should not be transmitted
.
del
m
[
'Bcc'
]
mexpect
=
'
%
s
%
s
\n
%
s'
%
(
MSG_BEGIN
,
m
.
as_string
(),
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
...
...
@@ -365,6 +368,112 @@ class DebuggingServerTests(unittest.TestCase):
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
to_addr
)
def
testSendMessageWithSpecifiedAddresses
(
self
):
# Make sure addresses specified in call override those in message.
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
m
[
'From'
]
=
'foo@bar.com'
m
[
'To'
]
=
'John, Dinsdale'
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
smtp
.
send_message
(
m
,
from_addr
=
'joe@example.com'
,
to_addrs
=
'foo@example.net'
)
# XXX (see comment in testSend)
time
.
sleep
(
0.01
)
smtp
.
quit
()
self
.
client_evt
.
set
()
self
.
serv_evt
.
wait
()
self
.
output
.
flush
()
# Add the X-Peer header that DebuggingServer adds
m
[
'X-Peer'
]
=
socket
.
gethostbyname
(
'localhost'
)
mexpect
=
'
%
s
%
s
\n
%
s'
%
(
MSG_BEGIN
,
m
.
as_string
(),
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
debugout
=
smtpd
.
DEBUGSTREAM
.
getvalue
()
sender
=
re
.
compile
(
"^sender: joe@example.com$"
,
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
sender
)
for
addr
in
(
'John'
,
'Dinsdale'
):
to_addr
=
re
.
compile
(
r"^recips: .*'{}'.*$"
.
format
(
addr
),
re
.
MULTILINE
)
self
.
assertNotRegex
(
debugout
,
to_addr
)
recip
=
re
.
compile
(
r"^recips: .*'foo@example.net'.*$"
,
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
recip
)
def
testSendMessageWithMultipleFrom
(
self
):
# Sender overrides To
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
m
[
'From'
]
=
'Bernard, Bianca'
m
[
'Sender'
]
=
'the_rescuers@Rescue-Aid-Society.com'
m
[
'To'
]
=
'John, Dinsdale'
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
smtp
.
send_message
(
m
)
# XXX (see comment in testSend)
time
.
sleep
(
0.01
)
smtp
.
quit
()
self
.
client_evt
.
set
()
self
.
serv_evt
.
wait
()
self
.
output
.
flush
()
# Add the X-Peer header that DebuggingServer adds
m
[
'X-Peer'
]
=
socket
.
gethostbyname
(
'localhost'
)
mexpect
=
'
%
s
%
s
\n
%
s'
%
(
MSG_BEGIN
,
m
.
as_string
(),
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
debugout
=
smtpd
.
DEBUGSTREAM
.
getvalue
()
sender
=
re
.
compile
(
"^sender: the_rescuers@Rescue-Aid-Society.com$"
,
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
sender
)
for
addr
in
(
'John'
,
'Dinsdale'
):
to_addr
=
re
.
compile
(
r"^recips: .*'{}'.*$"
.
format
(
addr
),
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
to_addr
)
def
testSendMessageResent
(
self
):
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
m
[
'From'
]
=
'foo@bar.com'
m
[
'To'
]
=
'John'
m
[
'CC'
]
=
'Sally, Fred'
m
[
'Bcc'
]
=
'John Root <root@localhost>, "Dinsdale" <warped@silly.walks.com>'
m
[
'Resent-Date'
]
=
'Thu, 1 Jan 1970 17:42:00 +0000'
m
[
'Resent-From'
]
=
'holy@grail.net'
m
[
'Resent-To'
]
=
'Martha <my_mom@great.cooker.com>, Jeff'
m
[
'Resent-Bcc'
]
=
'doe@losthope.net'
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
smtp
.
send_message
(
m
)
# XXX (see comment in testSend)
time
.
sleep
(
0.01
)
smtp
.
quit
()
self
.
client_evt
.
set
()
self
.
serv_evt
.
wait
()
self
.
output
.
flush
()
# The Resent-Bcc headers are deleted before serialization.
del
m
[
'Bcc'
]
del
m
[
'Resent-Bcc'
]
# Add the X-Peer header that DebuggingServer adds
m
[
'X-Peer'
]
=
socket
.
gethostbyname
(
'localhost'
)
mexpect
=
'
%
s
%
s
\n
%
s'
%
(
MSG_BEGIN
,
m
.
as_string
(),
MSG_END
)
self
.
assertEqual
(
self
.
output
.
getvalue
(),
mexpect
)
debugout
=
smtpd
.
DEBUGSTREAM
.
getvalue
()
sender
=
re
.
compile
(
"^sender: holy@grail.net$"
,
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
sender
)
for
addr
in
(
'my_mom@great.cooker.com'
,
'Jeff'
,
'doe@losthope.net'
):
to_addr
=
re
.
compile
(
r"^recips: .*'{}'.*$"
.
format
(
addr
),
re
.
MULTILINE
)
self
.
assertRegex
(
debugout
,
to_addr
)
def
testSendMessageMultipleResentRaises
(
self
):
m
=
email
.
mime
.
text
.
MIMEText
(
'A test message'
)
m
[
'From'
]
=
'foo@bar.com'
m
[
'To'
]
=
'John'
m
[
'CC'
]
=
'Sally, Fred'
m
[
'Bcc'
]
=
'John Root <root@localhost>, "Dinsdale" <warped@silly.walks.com>'
m
[
'Resent-Date'
]
=
'Thu, 1 Jan 1970 17:42:00 +0000'
m
[
'Resent-From'
]
=
'holy@grail.net'
m
[
'Resent-To'
]
=
'Martha <my_mom@great.cooker.com>, Jeff'
m
[
'Resent-Bcc'
]
=
'doe@losthope.net'
m
[
'Resent-Date'
]
=
'Thu, 2 Jan 1970 17:42:00 +0000'
m
[
'Resent-To'
]
=
'holy@grail.net'
m
[
'Resent-From'
]
=
'Martha <my_mom@great.cooker.com>, Jeff'
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
3
)
with
self
.
assertRaises
(
ValueError
):
smtp
.
send_message
(
m
)
smtp
.
close
()
class
NonConnectingTests
(
unittest
.
TestCase
):
...
...
Misc/ACKS
Dosyayı görüntüle @
92843e3c
...
...
@@ -278,6 +278,7 @@ Ben Escoto
Andy Eskilsson
André Espaze
Stefan Esser
Nicolas Estibals
Stephen D Evans
Carey Evans
Tim Everett
...
...
Misc/NEWS
Dosyayı görüntüle @
92843e3c
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #12291: You can now load multiple marshalled objects from a stream,
with other data interleaved between marshalled objects.
- Issue #12356: When required positional or keyword-only arguments are not
given, produce a informative error message which includes the name(s) of the
missing arguments.
...
...
@@ -200,6 +203,9 @@ Core and Builtins
Library
-------
- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
conformance to the RFCs: correctly handle Sender and Resent- headers.
- Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
the garbage collector while the Heap lock is held.
...
...
Python/marshal.c
Dosyayı görüntüle @
92843e3c
This diff is collapsed.
Click to expand it.
Tools/msi/msi.py
Dosyayı görüntüle @
92843e3c
...
...
@@ -119,6 +119,7 @@ pythondll_uuid = {
"30"
:
"{6953bc3b-6768-4291-8410-7914ce6e2ca8}"
,
"31"
:
"{4afcba0b-13e4-47c3-bebe-477428b46913}"
,
"32"
:
"{3ff95315-1096-4d31-bd86-601d5438ad5e}"
,
"33"
:
"{f7581ca4-d368-4eea-8f82-d48c64c4f047}"
,
}
[
major
+
minor
]
# Compute the name that Sphinx gives to the docfile
...
...
@@ -1010,6 +1011,8 @@ def add_files(db):
lib
.
remove_pyc
()
# package READMEs if present
lib
.
glob
(
"README"
)
if
dir
==
'Lib'
:
lib
.
add_file
(
"sysconfig.cfg"
)
if
dir
==
'test'
and
parent
.
physical
==
'Lib'
:
lib
.
add_file
(
"185test.db"
)
lib
.
add_file
(
"audiotest.au"
)
...
...
@@ -1045,7 +1048,7 @@ def add_files(db):
if
dir
==
"Icons"
:
lib
.
glob
(
"*.gif"
)
lib
.
add_file
(
"idle.icns"
)
if
dir
==
"command"
and
parent
.
physical
==
"distutils"
:
if
dir
==
"command"
and
parent
.
physical
in
(
"distutils"
,
"packaging"
)
:
lib
.
glob
(
"wininst*.exe"
)
lib
.
add_file
(
"command_template"
)
if
dir
==
"lib2to3"
:
...
...
@@ -1156,6 +1159,8 @@ def add_files(db):
lib
.
add_file
(
"README.txt"
,
src
=
"README"
)
if
f
==
'Scripts'
:
lib
.
add_file
(
"2to3.py"
,
src
=
"2to3"
)
lib
.
add_file
(
"pydoc3.py"
,
src
=
"pydoc3"
)
lib
.
add_file
(
"pysetup3.py"
,
src
=
"pysetup3"
)
if
have_tcl
:
lib
.
start_component
(
"pydocgui.pyw"
,
tcltk
,
keyfile
=
"pydocgui.pyw"
)
lib
.
add_file
(
"pydocgui.pyw"
)
...
...
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