Mercurial > hg
annotate mercurial/templates/rss/changelogentry.tmpl @ 45095:8e04607023e5
procutil: ensure that procutil.std{out,err}.write() writes all bytes
Python 3 offers different kind of streams and it’s not guaranteed for all of
them that calling write() writes all bytes.
When Python is started in unbuffered mode, sys.std{out,err}.buffer are
instances of io.FileIO, whose write() can write less bytes for
platform-specific reasons (e.g. Linux has a 0x7ffff000 bytes maximum and could
write less if interrupted by a signal; when writing to Windows consoles, it’s
limited to 32767 bytes to avoid the "not enough space" error). This can lead to
silent loss of data, both when using sys.std{out,err}.buffer (which may in fact
not be a buffered stream) and when using the text streams sys.std{out,err}
(I’ve created a CPython bug report for that:
https://bugs.python.org/issue41221).
Python may fix the problem at some point. For now, we implement our own wrapper
for procutil.std{out,err} that calls the raw stream’s write() method until all
bytes have been written. We don’t use sys.std{out,err} for larger writes, so I
think it’s not worth the effort to patch them.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Fri, 10 Jul 2020 12:27:58 +0200 |
parents | 849b8e84487e |
children |
rev | line source |
---|---|
599 | 1 <item> |
21118
e1a3898a8bb8
hgweb: adding branch names from inbranch template to rss feed
Aaron Jensen <ajensen@webmd.net>
parents:
21057
diff
changeset
|
2 <title>{inbranch%"{if(name, '[{name|escape}] ')}"}{branches%"{if(name, '[{name|escape}] ')}"}{desc|strip|firstline|strip|escape}</title> |
18526
9409aeaafdc1
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents:
9999
diff
changeset
|
3 <guid isPermaLink="true">{urlbase}{url|urlescape}rev/{node|short}</guid> |
29436
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
4 <link>{urlbase}{url|urlescape}rev/{node|short}</link> |
21057
19ee4923a2b6
hgweb: adding branch, tags, bookmarks, user, and file list to rss feed entries
Aaron Jensen <ajensen@webmd.net>
parents:
18526
diff
changeset
|
5 <description> |
29436
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
6 <![CDATA[ |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
7 <table> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
8 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
9 <th style="text-align:left;">changeset</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
10 <td>{node|short}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
11 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
12 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
13 <th style="text-align:left;">branch</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
14 <td>{inbranch%"{name|escape}"}{branches%"{name|escape}"}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
15 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
16 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
17 <th style="text-align:left;">bookmark</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
18 <td>{bookmarks%"{name|escape}"}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
19 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
20 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
21 <th style="text-align:left;">tag</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
22 <td>{tags%"{name|escape}"}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
23 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
24 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
25 <th style="text-align:left;vertical-align:top;">user</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
26 <td>{author|obfuscate}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
27 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
28 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
29 <th style="text-align:left;vertical-align:top;">description</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
30 <td>{desc|strip|escape|websub|addbreaks|nonempty}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
31 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
32 <tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
33 <th style="text-align:left;vertical-align:top;">files</th> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
34 <td>{files}</td> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
35 </tr> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
36 </table> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
37 ]]> |
849b8e84487e
hgweb: reindent rss/changelogentry.tmpl
Anton Shestakov <av6@dwimlabs.net>
parents:
21486
diff
changeset
|
38 </description> |
8428
5ccca71775e1
atom/rss: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8235
diff
changeset
|
39 <author>{author|obfuscate}</author> |
5ccca71775e1
atom/rss: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8235
diff
changeset
|
40 <pubDate>{date|rfc822date}</pubDate> |
599 | 41 </item> |