| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Mukhamedzhanova.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There were no tests for the encoders module. encode_base64 worked
because it is the default and so got tested implicitly elsewhere, and
we use encode_7or8bit internally, so that worked, too. I previously
fixed encode_noop, so this fix means that everythign in the encoders
module now works, hopefully correctly. Also added an explicit test
for encode_base64.
|
| |
| |
| |
| |
| |
| |
| | |
The new _has_surrogates code was suggested by Serhiy Storchaka. See
the issue for timings, but it is far faster than any other alternative,
and also removes the load time that we previously incurred from compiling
the complex regex this replaces.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |\ |
|
| | |
| | |
| | |
| | | |
Initial patch contributed by Edmond Burnett.
|
|\ \ \
| |/ /
| | |
| | | |
as reported by Serhiy Storchaka and Matthew Barnett.
|
| | |
| | |
| | |
| | | |
as reported by Serhiy Storchaka and Matthew Barnett.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously the parts of the message retained whatever linesep they had on
read, which means if the messages weren't read in univeral newline mode, the
line endings could well be inconsistent. In general sending it via smtplib
would result in them getting fixed, but it is better to generate them
correctly to begin with. Also, the new send_message method of smtplib does
not do the fixup, so that method is producing rfc-invalid output without this
fix.
|
| |\ \
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously the parts of the message retained whatever linesep they had on
read, which means if the messages weren't read in univeral newline mode, the
line endings could well be inconsistent. In general sending it via smtplib
would result in them getting fixed, but it is better to generate them
correctly to begin with. Also, the new send_message method of smtplib does
not do the fixup, so that method is producing rfc-invalid output without this
fix.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously the parts of the message retained whatever linesep they had on
read, which means if the messages weren't read in univeral newline mode, the
line endings could well be inconsistent. In general sending it via smtplib
would result in them getting fixed, but it is better to generate them
correctly to begin with. Also, the new send_message method of smtplib does
not do the fixup, so that method is producing rfc-invalid output without this
fix.
|
| | |
| | |
| | |
| | |
| | | |
Original patch submitted by QNX, modified for clarity by me (mostly comments).
QNX reports a 30% speed up in average email parsing time.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
|\ \ \
| |/ /
| | |
| | | |
Patch by Serhiy Storchaka.
|
| |\ \
| | |/
| | |
| | | |
Patch by Serhiy Storchaka.
|
| | |
| | |
| | |
| | | |
Patch by Serhiy Storchaka.
|
|/ / |
|
| |
| |
| |
| | |
return None if unable to parse the argument.
|
|\ \
| |/
| |
| | |
Fix by Colin Su. Test by me, based on a test written by Petri Lehtinen.
|
| |
| |
| |
| | |
Fix by Colin Su. Test by me, based on a test written by Petri Lehtinen.
|
| | |
|
| |
| |
| |
| |
| | |
It was correct in the original patch and I foobared it
when I restructured part of the code.
|
| |
| |
| |
| |
| |
| |
| | |
The new code correctly handles historic changes in UTC offsets.
A test for this should follow.
Original patch by Alexander Belopolsky.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This code passes all the same tests that the existing RFC mime header
parser passes, plus a bunch of additional ones.
There are a couple of commented out tests where there are issues with the
folding. The folding doesn't normally get invoked for headers parsed from
source, and the cases are marginal anyway (headers with invalid binary data)
so I'm not worried about them, but will fix them after the beta.
There are things that can be done to make this API even more convenient, but I
think this is a solid foundation worth having. And the parser is a full RFC
parser, so it handles cases that the current parser doesn't. (There are also
probably cases where it fails when the current parser doesn't, but I haven't
found them yet ;)
Oh, yeah, and there are some really ugly bits in the parser for handling some
'postel' cases that are unfortunately common.
I hope/plan to to eventually refactor a lot of the code in the parser which
should reduce the line count...but there is no escaping the fact that the
error recovery is welter of special cases.
|
|\ \
| |/
| |
| | |
mktime() when timezone offest is supplied.
|
| |
| |
| |
| | |
mktime() when timezone offest is supplied.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The behavior of MessageDefect is legacy behavior. The chances anyone is
actually using the undocumented 'line' attribute is low, but it costs
little to retain backward compatibility. Although one of the costs is
having to restore normal exception behavior in HeaderDefect. On the
other hand, I'll probably add some specialized behavior there later.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a behavior change: before this leading and trailing spaces were
stripped from ASCII parts, now they are preserved. Without this fix we didn't
parse the examples in the RFC correctly, so I think breaking backward
compatibility here is justified.
Patch by Ralf Schlatterbeck.
|
| |
| |
| |
| |
| | |
Thanks to Nick Coghlan for pointing out that I'd forgotten about class
decorators.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This feature was supposed to be part of the initial email6 checkin, but it got
lost in my big refactoring.
In this patch I'm not providing an easy way to turn off the errors, but they
only happen when a header is added programmatically, and it is almost never
the right thing to do to allow the duplicate to be added. An application that
needs to add duplicates of unique headers can create a policy subclass to
allow it.
|