<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[15285] CalendarServer/trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/15285">15285</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2015-11-04 11:06:32 -0800 (Wed, 04 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update all the python and C packages to current versions and fix any issues introduced by that.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkbin_buildsh">CalendarServer/trunk/bin/_build.sh</a></li>
<li><a href="#CalendarServertrunkcalendarserveraccesslogpy">CalendarServer/trunk/calendarserver/accesslog.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverpushutilpy">CalendarServer/trunk/calendarserver/push/util.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertapcaldavpy">CalendarServer/trunk/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertapprofilingpy">CalendarServer/trunk/calendarserver/tap/profiling.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertaptesttest_utilpy">CalendarServer/trunk/calendarserver/tap/test/test_util.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertaputilpy">CalendarServer/trunk/calendarserver/tap/util.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolscalverify_diffpy">CalendarServer/trunk/calendarserver/tools/calverify_diff.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsconfigpy">CalendarServer/trunk/calendarserver/tools/config.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsdkimtoolpy">CalendarServer/trunk/calendarserver/tools/dkimtool.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsexportpy">CalendarServer/trunk/calendarserver/tools/export.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsicalsplitpy">CalendarServer/trunk/calendarserver/tools/icalsplit.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsimporterpy">CalendarServer/trunk/calendarserver/tools/importer.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsmanagetimezonespy">CalendarServer/trunk/calendarserver/tools/managetimezones.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsmigrate_verifypy">CalendarServer/trunk/calendarserver/tools/migrate_verify.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsobliteratepy">CalendarServer/trunk/calendarserver/tools/obliterate.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolstesttest_gatewaypy">CalendarServer/trunk/calendarserver/tools/test/test_gateway.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolstesttest_principalspy">CalendarServer/trunk/calendarserver/tools/test/test_principals.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebcalresourcepy">CalendarServer/trunk/calendarserver/webcal/resource.py</a></li>
<li><a href="#CalendarServertrunkcontribperformanceloadtesticalpy">CalendarServer/trunk/contrib/performance/loadtest/ical.py</a></li>
<li><a href="#CalendarServertrunkcontribperformanceloadtestpopulationpy">CalendarServer/trunk/contrib/performance/loadtest/population.py</a></li>
<li><a href="#CalendarServertrunkcontribperformanceloadtestprofilespy">CalendarServer/trunk/contrib/performance/loadtest/profiles.py</a></li>
<li><a href="#CalendarServertrunkcontribperformanceloadtesttest_icalpy">CalendarServer/trunk/contrib/performance/loadtest/test_ical.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestshttpTestspy">CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py</a></li>
<li><a href="#CalendarServertrunkcontribtoolsanonymous_logpy">CalendarServer/trunk/contrib/tools/anonymous_log.py</a></li>
<li><a href="#CalendarServertrunkcontribtoolsharpoonpy">CalendarServer/trunk/contrib/tools/harpoon.py</a></li>
<li><a href="#CalendarServertrunkcontribtoolspg_stats_analysispy">CalendarServer/trunk/contrib/tools/pg_stats_analysis.py</a></li>
<li><a href="#CalendarServertrunkcontribtoolsprotocolanalysispy">CalendarServer/trunk/contrib/tools/protocolanalysis.py</a></li>
<li><a href="#CalendarServertrunkrequirementscstxt">CalendarServer/trunk/requirements-cs.txt</a></li>
<li><a href="#CalendarServertrunkrequirementstwisteddefaulttxt">CalendarServer/trunk/requirements-twisted-default.txt</a></li>
<li><a href="#CalendarServertrunkrequirementstwistedosxtxt">CalendarServer/trunk/requirements-twisted-osx.txt</a></li>
<li><a href="#CalendarServertrunksetuppy">CalendarServer/trunk/setup.py</a></li>
<li><a href="#CalendarServertrunksupport_cache_deps">CalendarServer/trunk/support/_cache_deps</a></li>
<li><a href="#CalendarServertrunktwistedcaldavaccountingpy">CalendarServer/trunk/twistedcaldav/accounting.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdatabasepy">CalendarServer/trunk/twistedcaldav/database.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorytesttest_proxyprincipaldbpy">CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavlocalizationpy">CalendarServer/trunk/twistedcaldav/localization.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavnotificationspy">CalendarServer/trunk/twistedcaldav/notifications.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavsqlpy">CalendarServer/trunk/twistedcaldav/sql.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstorebridgepy">CalendarServer/trunk/twistedcaldav/storebridge.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_calendarquerypy">CalendarServer/trunk/twistedcaldav/test/test_calendarquery.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_configpy">CalendarServer/trunk/twistedcaldav/test/test_config.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_databasepy">CalendarServer/trunk/twistedcaldav/test/test_database.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_multigetpy">CalendarServer/trunk/twistedcaldav/test/test_multiget.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_sqlpy">CalendarServer/trunk/twistedcaldav/test/test_sql.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_timezonespy">CalendarServer/trunk/twistedcaldav/test/test_timezones.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_upgradepy">CalendarServer/trunk/twistedcaldav/test/test_upgrade.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_xmlutilpy">CalendarServer/trunk/twistedcaldav/test/test_xmlutil.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtimezonespy">CalendarServer/trunk/twistedcaldav/timezones.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtimezonestdservicepy">CalendarServer/trunk/twistedcaldav/timezonestdservice.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavupgradepy">CalendarServer/trunk/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServertrunktxdavbasedatastorefilepy">CalendarServer/trunk/txdav/base/datastore/file.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreindex_filepy">CalendarServer/trunk/txdav/caldav/datastore/index_file.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimipmailgatewaypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/mailgateway.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_mailgatewaypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_outboundpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduledkimpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduletesttest_dkimpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_dkim.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduletesttest_remoteserverspy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_remoteservers.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoresqlpy">CalendarServer/trunk/txdav/caldav/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoretestcommonpy">CalendarServer/trunk/txdav/caldav/datastore/test/common.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoretesttest_attachmentspy">CalendarServer/trunk/txdav/caldav/datastore/test/test_attachments.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoretesttest_filepy">CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoretesttest_index_filepy">CalendarServer/trunk/txdav/caldav/datastore/test/test_index_file.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastorefilepy">CalendarServer/trunk/txdav/carddav/datastore/file.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastoreindex_filepy">CalendarServer/trunk/txdav/carddav/datastore/index_file.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastoresqlpy">CalendarServer/trunk/txdav/carddav/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastoretestcommonpy">CalendarServer/trunk/txdav/carddav/datastore/test/common.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastoretesttest_index_filepy">CalendarServer/trunk/txdav/carddav/datastore/test/test_index_file.py</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastorefilepy">CalendarServer/trunk/txdav/common/datastore/file.py</a></li>
<li><a href="#CalendarServertrunktxdavwhodirectorypy">CalendarServer/trunk/txdav/who/directory.py</a></li>
<li><a href="#CalendarServertrunktxdavxmlbasepy">CalendarServer/trunk/txdav/xml/base.py</a></li>
<li><a href="#CalendarServertrunktxdavxmlparser_saxpy">CalendarServer/trunk/txdav/xml/parser_sax.py</a></li>
<li><a href="#CalendarServertrunktxdavxmlrfc2518py">CalendarServer/trunk/txdav/xml/rfc2518.py</a></li>
<li><a href="#CalendarServertrunktxweb2authdigestpy">CalendarServer/trunk/txweb2/auth/digest.py</a></li>
<li><a href="#CalendarServertrunktxweb2davfileoppy">CalendarServer/trunk/txweb2/dav/fileop.py</a></li>
<li><a href="#CalendarServertrunktxweb2davmethodpropfindpy">CalendarServer/trunk/txweb2/dav/method/propfind.py</a></li>
<li><a href="#CalendarServertrunktxweb2davtesttest_xattrpropspy">CalendarServer/trunk/txweb2/dav/test/test_xattrprops.py</a></li>
<li><a href="#CalendarServertrunktxweb2davutilpy">CalendarServer/trunk/txweb2/dav/util.py</a></li>
<li><a href="#CalendarServertrunktxweb2davxattrpropspy">CalendarServer/trunk/txweb2/dav/xattrprops.py</a></li>
<li><a href="#CalendarServertrunktxweb2staticpy">CalendarServer/trunk/txweb2/static.py</a></li>
<li><a href="#CalendarServertrunktxweb2testtest_httpauthpy">CalendarServer/trunk/txweb2/test/test_httpauth.py</a></li>
<li><a href="#CalendarServertrunktxweb2testtest_streampy">CalendarServer/trunk/txweb2/test/test_stream.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertesttest_accesslogpy">CalendarServer/trunk/calendarserver/test/test_accesslog.py</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#CalendarServertrunk">CalendarServer/trunk/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunk"></a>
<div class="propset"><h4>Property changes: CalendarServer/trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pod2pod-migration:14338-14520
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who:12819-12860
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-2:12861-12898
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-3:12899-12913
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-4:12914-13157
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-5:13158-13163
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua:13309-13327
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua-1:13328-13330
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes:13648-13656
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes-2:13657
</span><span class="cx">/CalendarServer/branches/users/sagen/request-socket:14748-14767
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan:14185-14269
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-2:14270-14324
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-3:14325-14450
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-4:14451-14471
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-5:14471-14555
</span><span class="cx">/CalendarServer/branches/users/wsanchez/psycopg2cffi:14427-14439
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx"> + /CalDAVTester/trunk:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pod2pod-migration:14338-14520
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/cdaboo/update-packages:15273-15284
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who:12819-12860
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-2:12861-12898
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-3:12899-12913
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-4:12914-13157
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-5:13158-13163
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua:13309-13327
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua-1:13328-13330
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes:13648-13656
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes-2:13657
</span><span class="cx">/CalendarServer/branches/users/sagen/request-socket:14748-14767
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan:14185-14269
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-2:14270-14324
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-3:14325-14450
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-4:14451-14471
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-5:14471-14555
</span><span class="cx">/CalendarServer/branches/users/wsanchez/psycopg2cffi:14427-14439
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><a id="CalendarServertrunkbin_buildsh"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/bin/_build.sh (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/_build.sh        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/bin/_build.sh        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -499,13 +499,13 @@
</span><span class="cx"> if [ "${ssl_version}" -ge "${min_ssl_version}" ]; then
</span><span class="cx"> using_system "OpenSSL";
</span><span class="cx"> else
</span><del>- local v="0.9.8zf";
</del><ins>+ local v="0.9.8zg";
</ins><span class="cx"> local n="openssl";
</span><span class="cx"> local p="${n}-${v}";
</span><span class="cx">
</span><span class="cx"> # use 'config' instead of 'configure'; 'make' instead of 'jmake'.
</span><span class="cx"> # also pass 'shared' to config to build shared libs.
</span><del>- c_dependency -c "config" -m "c69a4a679233f7df189e1ad6659511ec" \
</del><ins>+ c_dependency -c "config" -s "a73005583ba8d5edc3bdcc1f99a1e33ee0ed41f8" \
</ins><span class="cx"> -p "make depend" -b "make" \
</span><span class="cx"> "openssl" "${p}" \
</span><span class="cx"> "http://www.openssl.org/source/${p}.tar.gz" "shared";
</span><span class="lines">@@ -587,13 +587,14 @@
</span><span class="cx"> "http://github.com/downloads/libevent/libevent/${p}.tar.gz" \
</span><span class="cx"> ${configure_openssl};
</span><span class="cx">
</span><del>- local v="1.4.20";
</del><ins>+ local v="1.4.24";
</ins><span class="cx"> local n="memcached";
</span><span class="cx"> local p="${n}-${v}";
</span><span class="cx">
</span><del>- c_dependency -m "92f702bcb28d7bec8fdf9418360fc062" \
</del><ins>+ c_dependency -s "32a798a37ef782da10a09d74aa1e5be91f2861db" \
</ins><span class="cx"> "memcached" "${p}" \
</span><del>- "http://www.memcached.org/files/${p}.tar.gz";
</del><ins>+ "http://www.memcached.org/files/${p}.tar.gz" \
+ "--disable-docs";
</ins><span class="cx"> fi;
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -725,9 +726,9 @@
</span><span class="cx"> mkdir -p "${py_ve_tools}/junk";
</span><span class="cx">
</span><span class="cx"> for pkg in \
</span><del>- setuptools-17.0 \
- pip-7.0.3 \
- virtualenv-13.0.3 \
</del><ins>+ setuptools-18.5 \
+ pip-7.1.2 \
+ virtualenv-13.1.2 \
</ins><span class="cx"> ; do
</span><span class="cx"> local name="${pkg%-*}";
</span><span class="cx"> local version="${pkg#*-}";
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserveraccesslogpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/accesslog.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/accesslog.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/accesslog.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -588,7 +588,7 @@
</span><span class="cx">
</span><span class="cx"> def __init__(self):
</span><span class="cx"> self.items = {
</span><del>- "cpu count" : psutil.NUM_CPUS if psutil is not None else -1,
</del><ins>+ "cpu count" : psutil.cpu_count() if psutil is not None else -1,
</ins><span class="cx"> "cpu use" : 0.0,
</span><span class="cx"> "memory used" : 0,
</span><span class="cx"> "memory percent": 0.0,
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverpushutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/push/util.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/push/util.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/push/util.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx">
</span><span class="cx"> @return: C{str} topic, or empty string if value is not found
</span><span class="cx"> """
</span><del>- certData = open(certPath).read()
</del><ins>+ with open(certPath) as f:
+ certData = f.read()
</ins><span class="cx"> return getAPNTopicFromX509(crypto.load_certificate(crypto.FILETYPE_PEM, certData))
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/caldav.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/caldav.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -768,7 +768,7 @@
</span><span class="cx"> else:
</span><span class="cx"> logID = ""
</span><span class="cx">
</span><del>- if config.ProcessType is not "Utility":
</del><ins>+ if config.ProcessType != "Utility":
</ins><span class="cx"> execName = ""
</span><span class="cx">
</span><span class="cx"> setproctitle(
</span><span class="lines">@@ -1248,7 +1248,7 @@
</span><span class="cx"> "-p", str(pool.Port),
</span><span class="cx"> "-l", pool.BindAddress,
</span><span class="cx"> ])
</span><del>- if config.Memcached.MaxMemory is not 0:
</del><ins>+ if config.Memcached.MaxMemory != 0:
</ins><span class="cx"> memcachedArgv.extend(
</span><span class="cx"> ["-m", str(config.Memcached.MaxMemory)]
</span><span class="cx"> )
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertapprofilingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/profiling.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/profiling.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tap/profiling.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -39,12 +39,11 @@
</span><span class="cx"> if self.saveStats:
</span><span class="cx"> p.dump_stats(self.profileOutput)
</span><span class="cx"> else:
</span><del>- stream = open(self.profileOutput, 'w')
- s = pstats.Stats(p, stream=stream)
- s.strip_dirs()
- s.sort_stats(-1)
- s.print_stats()
- stream.close()
</del><ins>+ with open(self.profileOutput, 'w') as stream:
+ s = pstats.Stats(p, stream=stream)
+ s.strip_dirs()
+ s.sort_stats(-1)
+ s.print_stats()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> AppProfiler.profilers["cprofile-cpu"] = CProfileCPURunner
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertaptesttest_utilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/test/test_util.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/test/test_util.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tap/test/test_util.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -14,17 +14,19 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx">
</span><del>-from calendarserver.tap.util import (
- MemoryLimitService, Stepper, verifyTLSCertificate
-)
-from twistedcaldav.util import computeProcessCount
-from twistedcaldav.test.util import TestCase
</del><ins>+from calendarserver.tap.util import MemoryLimitService, Stepper, verifyTLSCertificate, memoryForPID
+
+from twisted.internet.defer import succeed, inlineCallbacks
</ins><span class="cx"> from twisted.internet.task import Clock
</span><del>-from twisted.internet.defer import succeed, inlineCallbacks
</del><span class="cx"> from twisted.python.filepath import FilePath
</span><ins>+
</ins><span class="cx"> from twistedcaldav.config import ConfigDict
</span><ins>+from twistedcaldav.test.util import TestCase
+from twistedcaldav.util import computeProcessCount
</ins><span class="cx">
</span><ins>+import os
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> class ProcessCountTestCase(TestCase):
</span><span class="cx">
</span><span class="cx"> def test_count(self):
</span><span class="lines">@@ -132,7 +134,16 @@
</span><span class="cx"> self.assertEquals(processMonitor.history, ['process #1', 'process #2', 'process #3'])
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def test_memoryForPID(self):
+ """
+ Test that L{memoryForPID} returns a valid result.
+ """
</ins><span class="cx">
</span><ins>+ memory = memoryForPID(os.getpid())
+ self.assertNotEqual(memory, 0)
+
+
+
</ins><span class="cx"> #
</span><span class="cx"> # Tests for Stepper
</span><span class="cx"> #
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertaputilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/util.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/util.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tap/util.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -937,7 +937,7 @@
</span><span class="cx"> @return: Memory used by process in bytes
</span><span class="cx"> @rtype: C{int}
</span><span class="cx"> """
</span><del>- memoryInfo = psutil.Process(pid).get_memory_info()
</del><ins>+ memoryInfo = psutil.Process(pid).memory_info()
</ins><span class="cx"> return memoryInfo.rss if residentOnly else memoryInfo.vms
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1524,8 +1524,7 @@
</span><span class="cx"> config.SSLPassPhraseDialog and
</span><span class="cx"> os.path.isfile(config.SSLPassPhraseDialog)
</span><span class="cx"> ):
</span><del>- sslPrivKey = open(config.SSLPrivateKey)
- try:
</del><ins>+ with open(config.SSLPrivateKey) as sslPrivKey:
</ins><span class="cx"> keyType = None
</span><span class="cx"> for line in sslPrivKey.readlines():
</span><span class="cx"> if "-----BEGIN RSA PRIVATE KEY-----" in line:
</span><span class="lines">@@ -1534,8 +1533,6 @@
</span><span class="cx"> elif "-----BEGIN DSA PRIVATE KEY-----" in line:
</span><span class="cx"> keyType = "DSA"
</span><span class="cx"> break
</span><del>- finally:
- sslPrivKey.close()
</del><span class="cx">
</span><span class="cx"> if keyType is None:
</span><span class="cx"> log.error(
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertesttest_accesslogpyfromrev15284CalendarServerbranchesuserscdabooupdatepackagescalendarservertesttest_accesslogpy"></a>
<div class="copfile"><h4>Copied: CalendarServer/trunk/calendarserver/test/test_accesslog.py (from rev 15284, CalendarServer/branches/users/cdaboo/update-packages/calendarserver/test/test_accesslog.py) (0 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/test/test_accesslog.py         (rev 0)
+++ CalendarServer/trunk/calendarserver/test/test_accesslog.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+##
+# Copyright (c) 2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+from twisted.trial.unittest import TestCase
+from calendarserver.accesslog import SystemMonitor
+
+class AccessLog(TestCase):
+ """
+ Tests for L{calendarserver.accesslog}.
+ """
+
+ def test_systemMonitor(self):
+ """
+ L{SystemMonitor} generates the correct data.
+ """
+
+ monitor = SystemMonitor()
+ self.assertNotEqual(monitor.items["cpu count"], 0)
+ self.assertEqual(monitor.items["cpu use"], 0.0)
+
+ monitor.update()
+ self.assertNotEqual(monitor.items["cpu count"], 0)
+
+ monitor.stop()
+ self.assertNotEqual(monitor.items["cpu count"], 0)
</ins></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolscalverify_diffpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/calverify_diff.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/calverify_diff.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/calverify_diff.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -24,7 +24,8 @@
</span><span class="cx">
</span><span class="cx"> def analyze(fname):
</span><span class="cx">
</span><del>- lines = open(os.path.expanduser(fname)).read().splitlines()
</del><ins>+ with open(os.path.expanduser(fname)) as f:
+ lines = f.read().splitlines()
</ins><span class="cx"> total = len(lines)
</span><span class="cx"> ctr = 0
</span><span class="cx"> results = {
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/config.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/config.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/config.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -538,9 +538,8 @@
</span><span class="cx"> @type pidFilename: C{str}
</span><span class="cx"> """
</span><span class="cx"> if os.path.exists(pidFilename):
</span><del>- pidFile = open(pidFilename, "r")
- pid = pidFile.read().strip()
- pidFile.close()
</del><ins>+ with open(pidFilename, "r") as pidFile:
+ pid = pidFile.read().strip()
</ins><span class="cx"> try:
</span><span class="cx"> pid = int(pid)
</span><span class="cx"> except ValueError:
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsdkimtoolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/dkimtool.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/dkimtool.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/dkimtool.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -40,14 +40,16 @@
</span><span class="cx"> output = key.exportKey()
</span><span class="cx"> lineBreak = False
</span><span class="cx"> if options["key"]:
</span><del>- open(options["key"], "w").write(output)
</del><ins>+ with open(options["key"], "w") as f:
+ f.write(output)
</ins><span class="cx"> else:
</span><span class="cx"> print(output)
</span><span class="cx"> lineBreak = True
</span><span class="cx">
</span><span class="cx"> output = key.publickey().exportKey()
</span><span class="cx"> if options["pub-key"]:
</span><del>- open(options["pub-key"], "w").write(output)
</del><ins>+ with open(options["pub-key"], "w") as f:
+ f.write(output)
</ins><span class="cx"> else:
</span><span class="cx"> if lineBreak:
</span><span class="cx"> print
</span><span class="lines">@@ -70,7 +72,8 @@
</span><span class="cx"> log.publisher.levels.setLogLevelForNamespace("txdav.caldav.datastore.scheduling.ischedule.dkim", LogLevel.debug)
</span><span class="cx">
</span><span class="cx"> # Parse the HTTP file
</span><del>- request = open(options["request"]).read()
</del><ins>+ with open(options["request"]) as f:
+ request = f.read()
</ins><span class="cx"> method, uri, headers, stream = _parseRequest(request)
</span><span class="cx">
</span><span class="cx"> # Setup signing headers
</span><span class="lines">@@ -113,7 +116,8 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def _doVerify(options):
</span><span class="cx"> # Parse the HTTP file
</span><del>- verify = open(os.path.expanduser(options["verify"])).read()
</del><ins>+ with open(os.path.expanduser(options["verify"])) as f:
+ verify = f.read()
</ins><span class="cx"> _method, _uri, headers, body = _parseRequest(verify)
</span><span class="cx">
</span><span class="cx"> # Check for local public key
</span><span class="lines">@@ -185,7 +189,9 @@
</span><span class="cx"> """
</span><span class="cx"> Do the key lookup using the actual lookup method.
</span><span class="cx"> """
</span><del>- return RSA.importKey(open(self.pubkeyfile).read())
</del><ins>+ with open(self.pubkeyfile) as f:
+ data = f.read()
+ return RSA.importKey(data)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsexportpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/export.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/export.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/export.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -346,9 +346,8 @@
</span><span class="cx"> comp.addComponent(sub)
</span><span class="cx">
</span><span class="cx"> filename = os.path.join(dirname, "{}_{}.ics".format(homeUID, calendar.name()))
</span><del>- fileobj = open(filename, 'wb')
- fileobj.write(comp.getTextWithTimezones(True))
- fileobj.close()
</del><ins>+ with open(filename, 'wb') as fileobj:
+ fileobj.write(comp.getTextWithTimezones(True))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsicalsplitpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/icalsplit.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/icalsplit.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/icalsplit.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -29,11 +29,8 @@
</span><span class="cx"> converting a monolithic iCalendar object into a set of objects
</span><span class="cx"> that comply with CalDAV's requirements on resources.
</span><span class="cx"> """
</span><del>- inputFile = open(inputFileName)
- try:
</del><ins>+ with open(inputFileName) as inputFile:
</ins><span class="cx"> calendar = iComponent.fromStream(inputFile)
</span><del>- finally:
- inputFile.close()
</del><span class="cx">
</span><span class="cx"> assert calendar.name() == "VCALENDAR"
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsimporterpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/importer.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/importer.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/importer.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -362,9 +362,8 @@
</span><span class="cx"> for filename in os.listdir(dirname):
</span><span class="cx"> fullpath = os.path.join(dirname, filename)
</span><span class="cx"> print("Importing {}".format(fullpath))
</span><del>- fileobj = open(fullpath, 'r')
- component = Component.allFromStream(fileobj)
- fileobj.close()
</del><ins>+ with open(fullpath, 'r') as fileobj:
+ component = Component.allFromStream(fileobj)
</ins><span class="cx"> yield importCollectionComponent(self.store, component)
</span><span class="cx">
</span><span class="cx"> else:
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsmanagetimezonespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/managetimezones.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/managetimezones.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/managetimezones.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -85,7 +85,8 @@
</span><span class="cx">
</span><span class="cx"> # Get the version from the Makefile
</span><span class="cx"> try:
</span><del>- makefile = open(os.path.join(zonedir, "Makefile")).read()
</del><ins>+ with open(os.path.join(zonedir, "Makefile")) as f:
+ makefile = f.read()
</ins><span class="cx"> lines = makefile.splitlines()
</span><span class="cx"> for line in lines:
</span><span class="cx"> if line.startswith("VERSION="):
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsmigrate_verifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/migrate_verify.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -161,36 +161,36 @@
</span><span class="cx">
</span><span class="cx"> self.output.write("-- Reading data file: %s\n" % (self.options["data"]))
</span><span class="cx">
</span><del>- datafile = open(os.path.expanduser(self.options["data"]))
- total = 0
- invalidGUIDs = set()
- for line in datafile:
- line = line.strip()
- total += 1
- segments = line.split("/")
- while segments and segments[0] != "__uids__":
- segments.pop(0)
- if segments and len(segments) >= 6:
- guid = segments[3]
- calendar = segments[4]
- resource = segments[5]
</del><ins>+ with open(os.path.expanduser(self.options["data"])) as datafile:
+ total = 0
+ invalidGUIDs = set()
+ for line in datafile:
+ line = line.strip()
+ total += 1
+ segments = line.split("/")
+ while segments and segments[0] != "__uids__":
+ segments.pop(0)
+ if segments and len(segments) >= 6:
+ guid = segments[3]
+ calendar = segments[4]
+ resource = segments[5]
</ins><span class="cx">
</span><del>- if calendar == "inbox":
- self.ignoreInbox += 1
- invalidGUIDs.add(guid)
- elif calendar == "dropbox":
- self.ignoreDropbox += 1
- invalidGUIDs.add(guid)
- elif len(segments) > 6:
</del><ins>+ if calendar == "inbox":
+ self.ignoreInbox += 1
+ invalidGUIDs.add(guid)
+ elif calendar == "dropbox":
+ self.ignoreDropbox += 1
+ invalidGUIDs.add(guid)
+ elif len(segments) > 6:
+ self.badPaths.append(line)
+ invalidGUIDs.add(guid)
+ else:
+ self.pathsByGUID.setdefault(guid, {}).setdefault(calendar, set()).add(resource)
+ self.validPaths += 1
+ else:
+ if segments and len(segments) >= 4:
+ invalidGUIDs.add(segments[3])
</ins><span class="cx"> self.badPaths.append(line)
</span><del>- invalidGUIDs.add(guid)
- else:
- self.pathsByGUID.setdefault(guid, {}).setdefault(calendar, set()).add(resource)
- self.validPaths += 1
- else:
- if segments and len(segments) >= 4:
- invalidGUIDs.add(segments[3])
- self.badPaths.append(line)
</del><span class="cx">
</span><span class="cx"> # Remove any invalid GUIDs that actuall were valid
</span><span class="cx"> invalidGUIDs = [pguid for pguid in invalidGUIDs if pguid not in self.pathsByGUID]
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsobliteratepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/obliterate.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/obliterate.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/obliterate.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -271,7 +271,8 @@
</span><span class="cx"> self.output.write("%s is not a valid file\n" % (self.options["data"],))
</span><span class="cx"> raise ConfigError
</span><span class="cx">
</span><del>- uuids = open(self.options["data"]).read().split()
</del><ins>+ with open(self.options["data"]) as f:
+ uuids = f.read().split()
</ins><span class="cx"> else:
</span><span class="cx"> self.output.write("One of --data or --uuid must be specified\n")
</span><span class="cx"> raise ConfigError
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolstesttest_gatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/test/test_gateway.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/test/test_gateway.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/test/test_gateway.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -69,9 +69,8 @@
</span><span class="cx">
</span><span class="cx"> testRoot = os.path.join(os.path.dirname(__file__), "gateway")
</span><span class="cx"> templateName = os.path.join(testRoot, "caldavd.plist")
</span><del>- templateFile = open(templateName)
- template = templateFile.read()
- templateFile.close()
</del><ins>+ with open(templateName) as templateFile:
+ template = templateFile.read()
</ins><span class="cx">
</span><span class="cx"> databaseRoot = os.path.abspath("_spawned_scripts_db" + str(os.getpid()))
</span><span class="cx"> newConfig = template % {
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolstesttest_principalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/test/test_principals.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/test/test_principals.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/tools/test/test_principals.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -37,9 +37,8 @@
</span><span class="cx">
</span><span class="cx"> testRoot = os.path.join(os.path.dirname(__file__), "principals")
</span><span class="cx"> templateName = os.path.join(testRoot, "caldavd.plist")
</span><del>- templateFile = open(templateName)
- template = templateFile.read()
- templateFile.close()
</del><ins>+ with open(templateName) as templateFile:
+ template = templateFile.read()
</ins><span class="cx">
</span><span class="cx"> databaseRoot = os.path.abspath("_spawned_scripts_db" + str(os.getpid()))
</span><span class="cx"> newConfig = template % {
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebcalresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webcal/resource.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webcal/resource.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/calendarserver/webcal/resource.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -131,11 +131,8 @@
</span><span class="cx"> # If we don't have a cached template, load it up.
</span><span class="cx"> #
</span><span class="cx"> if not hasattr(self, cacheAttr):
</span><del>- templateFile = open(templateFileName)
- try:
</del><ins>+ with open(templateFileName) as templateFile:
</ins><span class="cx"> htmlContent = templateFile.read()
</span><del>- finally:
- templateFile.close()
</del><span class="cx">
</span><span class="cx"> if debug:
</span><span class="cx"> # Don't cache
</span><span class="lines">@@ -201,6 +198,19 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> try:
</span><ins>+ from osx.utils import CFTimeZoneRef
+
+ def lookupSystemTimezone():
+ try:
+ return CFTimeZoneRef.defaultTimeZoneName()
+ except:
+ return ""
+
+except ImportError:
+ def lookupSystemTimezone():
+ return ""
+
+try:
</ins><span class="cx"> from Foundation import NSTimeZone
</span><span class="cx">
</span><span class="cx"> def lookupSystemTimezone():
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformanceloadtesticalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/loadtest/ical.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/performance/loadtest/ical.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/performance/loadtest/ical.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -167,9 +167,8 @@
</span><span class="cx"> """
</span><span class="cx"> path = self.serializePath()
</span><span class="cx"> if path and os.path.exists(path):
</span><del>- f = open(path)
- comp = Component.fromString(f.read())
- f.close()
</del><ins>+ with open(path) as f:
+ comp = Component.fromString(f.read())
</ins><span class="cx"> return comp
</span><span class="cx"> else:
</span><span class="cx"> return None
</span><span class="lines">@@ -185,9 +184,8 @@
</span><span class="cx"> if component is None:
</span><span class="cx"> os.remove(path)
</span><span class="cx"> else:
</span><del>- f = open(path, "w")
- f.write(str(component))
- f.close()
</del><ins>+ with open(path, "w") as f:
+ f.write(str(component))
</ins><span class="cx"> self.uid = component.resourceUID() if component is not None else None
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1332,7 +1330,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Write JSON data
</span><del>- json.dump(data, open(os.path.join(path, "index.json"), "w"), indent=2)
</del><ins>+ with open(os.path.join(path, "index.json"), "w") as f:
+ json.dump(data, f, indent=2)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def deserialize(self):
</span><span class="lines">@@ -1349,7 +1348,8 @@
</span><span class="cx">
</span><span class="cx"> # Parse JSON data for calendars
</span><span class="cx"> try:
</span><del>- data = json.load(open(os.path.join(path, "index.json")))
</del><ins>+ with open(os.path.join(path, "index.json")) as f:
+ data = json.load(f)
</ins><span class="cx"> except IOError:
</span><span class="cx"> return
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformanceloadtestpopulationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/loadtest/population.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/performance/loadtest/population.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/performance/loadtest/population.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -407,7 +407,8 @@
</span><span class="cx">
</span><span class="cx"> # Load parameters from config
</span><span class="cx"> if "thresholdsPath" in params:
</span><del>- jsondata = json.load(open(params["thresholdsPath"]))
</del><ins>+ with open(params["thresholdsPath"]) as f:
+ jsondata = json.load(f)
</ins><span class="cx"> elif "thresholds" in params:
</span><span class="cx"> jsondata = params["thresholds"]
</span><span class="cx"> else:
</span><span class="lines">@@ -423,7 +424,8 @@
</span><span class="cx"> self._fields.extend(self._fields_extend)
</span><span class="cx">
</span><span class="cx"> if "benchmarksPath" in params:
</span><del>- self.benchmarks = json.load(open(params["benchmarksPath"]))
</del><ins>+ with open(params["benchmarksPath"]) as f:
+ self.benchmarks = json.load(f)
</ins><span class="cx"> else:
</span><span class="cx"> self.benchmarks = {}
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformanceloadtestprofilespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/loadtest/profiles.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/performance/loadtest/profiles.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/performance/loadtest/profiles.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -915,7 +915,8 @@
</span><span class="cx">
</span><span class="cx"> # Load parameters from config
</span><span class="cx"> if "thresholdsPath" in params:
</span><del>- jsondata = json.load(open(params["thresholdsPath"]))
</del><ins>+ with open(params["thresholdsPath"]) as f:
+ jsondata = json.load(f)
</ins><span class="cx"> elif "thresholds" in params:
</span><span class="cx"> jsondata = params["thresholds"]
</span><span class="cx"> else:
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformanceloadtesttest_icalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/loadtest/test_ical.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/performance/loadtest/test_ical.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/performance/loadtest/test_ical.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -1540,7 +1540,9 @@
</span><span class="cx"> self.assertTrue(os.path.exists(indexPath))
</span><span class="cx"> def _normDict(d):
</span><span class="cx"> return dict([(k, sorted(v, key=lambda x: x["changeToken" if k == "calendars" else "url"]) if v else None,) for k, v in d.items()])
</span><del>- self.assertEqual(_normDict(json.loads(open(indexPath).read())), _normDict(json.loads("""{
</del><ins>+ with open(indexPath) as f:
+ jdata = f.read()
+ self.assertEqual(_normDict(json.loads(jdata)), _normDict(json.loads("""{
</ins><span class="cx"> "calendars": [
</span><span class="cx"> {
</span><span class="cx"> "changeToken": "123",
</span><span class="lines">@@ -1597,11 +1599,15 @@
</span><span class="cx">
</span><span class="cx"> event1Path = os.path.join(clientPath, "calendar", "1.ics")
</span><span class="cx"> self.assertTrue(os.path.exists(event1Path))
</span><del>- self.assertEqual(open(event1Path).read(), cal1)
</del><ins>+ with open(event1Path) as f:
+ data = f.read()
+ self.assertEqual(data, cal1)
</ins><span class="cx">
</span><span class="cx"> event2Path = os.path.join(clientPath, "inbox", "i1.ics")
</span><span class="cx"> self.assertTrue(os.path.exists(event2Path))
</span><del>- self.assertEqual(open(event2Path).read(), cal2)
</del><ins>+ with open(event2Path) as f:
+ data = f.read()
+ self.assertEqual(data, cal2)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_deserialization(self):
</span><span class="lines">@@ -1642,7 +1648,8 @@
</span><span class="cx"> clientPath = os.path.join(self.client.serializePath, "user91-OS_X_10.6")
</span><span class="cx"> os.mkdir(clientPath)
</span><span class="cx"> indexPath = os.path.join(clientPath, "index.json")
</span><del>- open(indexPath, "w").write("""{
</del><ins>+ with open(indexPath, "w") as f:
+ f.write("""{
</ins><span class="cx"> "calendars": [
</span><span class="cx"> {
</span><span class="cx"> "changeToken": "321",
</span><span class="lines">@@ -1699,10 +1706,12 @@
</span><span class="cx">
</span><span class="cx"> os.mkdir(os.path.join(clientPath, "calendar"))
</span><span class="cx"> event1Path = os.path.join(clientPath, "calendar", "2.ics")
</span><del>- open(event1Path, "w").write(cal1)
</del><ins>+ with open(event1Path, "w") as f:
+ f.write(cal1)
</ins><span class="cx"> os.mkdir(os.path.join(clientPath, "inbox"))
</span><span class="cx"> event1Path = os.path.join(clientPath, "inbox", "i2.ics")
</span><del>- open(event1Path, "w").write(cal2)
</del><ins>+ with open(event1Path, "w") as f:
+ f.write(cal2)
</ins><span class="cx">
</span><span class="cx"> self.client.deserialize()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestshttpTestspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -67,7 +67,8 @@
</span><span class="cx"> """
</span><span class="cx"> Clear the server's SQL log file.
</span><span class="cx"> """
</span><del>- open(self.logFilePath, "w").write("")
</del><ins>+ with open(self.logFilePath, "w") as f:
+ f.write("")
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def doRequest(self):
</span><span class="lines">@@ -91,7 +92,8 @@
</span><span class="cx"> return float(line[pos + 2:])
</span><span class="cx">
</span><span class="cx"> # Need to skip over stats that are unlabeled
</span><del>- data = open(self.logFilePath).read()
</del><ins>+ with open(self.logFilePath) as f:
+ data = f.read()
</ins><span class="cx"> lines = data.splitlines()
</span><span class="cx"> offset = 0
</span><span class="cx"> while True:
</span></span></pre></div>
<a id="CalendarServertrunkcontribtoolsanonymous_logpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/tools/anonymous_log.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/tools/anonymous_log.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/tools/anonymous_log.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -55,7 +55,10 @@
</span><span class="cx"> print("Exception: %s for %s" % (e, line,))
</span><span class="cx"> raise
</span><span class="cx">
</span><ins>+ finally:
+ f.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def anonymizeLine(self, line):
</span><span class="cx">
</span><span class="cx"> startPos = line.find("- ")
</span></span></pre></div>
<a id="CalendarServertrunkcontribtoolsharpoonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/tools/harpoon.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/tools/harpoon.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/tools/harpoon.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -41,12 +41,14 @@
</span><span class="cx">
</span><span class="cx"> pidDir = os.path.join(PROCDIR, pidString)
</span><span class="cx"> statsFile = os.path.join(pidDir, "stat")
</span><del>- statLine = open(statsFile).read()
</del><ins>+ with open(statsFile) as f:
+ statLine = f.read()
</ins><span class="cx"> stats = statLine.split()
</span><span class="cx"> vsize = int(stats[22])
</span><span class="cx"> cmdFile = os.path.join(pidDir, "cmdline")
</span><span class="cx"> if os.path.exists(cmdFile):
</span><del>- cmdLine = open(cmdFile).read().split('\x00')
</del><ins>+ with open(cmdFile) as f:
+ cmdLine = f.read().split('\x00')
</ins><span class="cx"> if cmdLine[0].startswith(PYTHON):
</span><span class="cx"> for arg in cmdLine[1:]:
</span><span class="cx"> if arg.startswith(CMDARG):
</span></span></pre></div>
<a id="CalendarServertrunkcontribtoolspg_stats_analysispy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/tools/pg_stats_analysis.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/tools/pg_stats_analysis.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/tools/pg_stats_analysis.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -160,6 +160,8 @@
</span><span class="cx"> if line.startswith("---"):
</span><span class="cx"> break
</span><span class="cx">
</span><ins>+ f.close()
+
</ins><span class="cx"> entries = []
</span><span class="cx"> for line in f:
</span><span class="cx"> bits = line.split("|")
</span></span></pre></div>
<a id="CalendarServertrunkcontribtoolsprotocolanalysispy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/tools/protocolanalysis.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/tools/protocolanalysis.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/contrib/tools/protocolanalysis.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -439,6 +439,9 @@
</span><span class="cx"> print("Failed to process line:\n%s" % (line,))
</span><span class="cx"> raise
</span><span class="cx">
</span><ins>+ finally:
+ f.close()
+
</ins><span class="cx"> # Average various items
</span><span class="cx"> self.averagedHourlyByMethodTime.clear()
</span><span class="cx"> for method, hours in self.hourlyByMethodTime.iteritems():
</span></span></pre></div>
<a id="CalendarServertrunkrequirementscstxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/requirements-cs.txt (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-cs.txt        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/requirements-cs.txt        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -4,20 +4,20 @@
</span><span class="cx">
</span><span class="cx"> --editable . # calendarserver
</span><span class="cx">
</span><del>- zope.interface==4.1.2
-         setuptools==17.0
</del><ins>+ zope.interface==4.1.3
+         setuptools==18.5
</ins><span class="cx">
</span><del>- --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@15263#egg=twextpy
- cffi==1.1.0
- pycparser==2.13
</del><ins>+ --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@15283#egg=twextpy
+ cffi==1.3.0
+ pycparser==2.14
</ins><span class="cx"> #twisted
</span><span class="cx">
</span><span class="cx"> # [LDAP] extra
</span><del>- python-ldap==2.4.19
</del><ins>+ python-ldap==2.4.22
</ins><span class="cx"> #setuptools
</span><span class="cx">
</span><span class="cx"> # [DAL] extra
</span><del>- sqlparse==0.1.14 # Compat issue in 0.1.15; fix before updating
</del><ins>+ sqlparse==0.1.18
</ins><span class="cx">
</span><span class="cx"> # [OpenDirectory] extra
</span><span class="cx"> #pyobjc-framework-OpenDirectory # Use system module
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> --editable svn+http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk@15140#egg=kerberos
</span><span class="cx">
</span><span class="cx"> --editable svn+http://svn.calendarserver.org/repository/calendarserver/PyCalendar/trunk@15020#egg=pycalendar
</span><del>- python-dateutil==1.5 # Note: v2.0+ is for Python 3
- pytz==2015.4
</del><ins>+ python-dateutil==2.4.2
+ pytz==2015.7
</ins><span class="cx">
</span><del>- psutil==2.2.1
- setproctitle==1.1.8
</del><ins>+ psutil==3.2.2
+ setproctitle==1.1.9
</ins><span class="cx"> # xattr==0.7.5 # Only needed for upgrades from ancient versions. Added in _cache_deps.
</span><span class="cx"> #cffi
</span></span></pre></div>
<a id="CalendarServertrunkrequirementstwisteddefaulttxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/requirements-twisted-default.txt (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-twisted-default.txt        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/requirements-twisted-default.txt        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -12,13 +12,13 @@
</span><span class="cx"> #pyOpenSSL
</span><span class="cx"> service_identity==14.0.0
</span><span class="cx"> characteristic==14.3.0
</span><del>- pyasn1==0.1.7
- pyasn1-modules==0.0.5
</del><ins>+ pyasn1==0.1.9
+ pyasn1-modules==0.0.8
</ins><span class="cx"> #pyOpenSSL
</span><span class="cx"> pycrypto==2.6.1
</span><span class="cx">
</span><del>- pyOpenSSL==0.14
- cryptography==0.9
</del><ins>+ pyOpenSSL==0.15.1
+ cryptography==1.1
</ins><span class="cx">         idna
</span><span class="cx"> #pyasn1
</span><span class="cx"> #cffi
</span><span class="lines">@@ -26,4 +26,4 @@
</span><span class="cx"> ipaddress
</span><span class="cx"> #setuptools==17.0
</span><span class="cx"> #six
</span><del>- six==1.9.0
</del><ins>+ six==1.10.0
</ins></span></pre></div>
<a id="CalendarServertrunkrequirementstwistedosxtxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/requirements-twisted-osx.txt (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-twisted-osx.txt        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/requirements-twisted-osx.txt        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -2,13 +2,13 @@
</span><span class="cx"> # Twisted dependency for OS X systems (uses pySecureTransport).
</span><span class="cx"> ##
</span><span class="cx">
</span><del>-Twisted==15.2.1
</del><ins>+Twisted==15.4.0
</ins><span class="cx"> #zope.interface
</span><span class="cx"> pycrypto==2.6.1
</span><span class="cx">
</span><span class="cx"> --editable svn+http://svn.calendarserver.org/repository/calendarserver/OSXFrameworks/trunk@15238#egg=osxframeworks
</span><del>- #cffi==1.1.0
- # pycparser==2.13
</del><ins>+ #cffi==1.3.0
+ # pycparser==2.14
</ins><span class="cx">
</span><span class="cx"> --editable svn+http://svn.calendarserver.org/repository/calendarserver/PySecureTransport/trunk@15229#egg=pysecuretransport
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunksetuppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/setup.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/setup.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/setup.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx"> install_requirements = [
</span><span class="cx"> # Core frameworks
</span><span class="cx"> "zope.interface",
</span><del>- "Twisted>=15.2.1",
</del><ins>+ "Twisted>=15.4.0",
</ins><span class="cx"> "twextpy",
</span><span class="cx">
</span><span class="cx"> # Security frameworks
</span><span class="lines">@@ -332,7 +332,7 @@
</span><span class="cx"> # Data store
</span><span class="cx"> "xattr",
</span><span class="cx"> "twextpy[DAL]",
</span><del>- "sqlparse>=0.1.11",
</del><ins>+ "sqlparse",
</ins><span class="cx">
</span><span class="cx"> # Calendar
</span><span class="cx"> "python-dateutil",
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx"> ])
</span><span class="cx"> else:
</span><span class="cx"> install_requirements.extend([
</span><del>- "pyOpenSSL>=0.14", # also for Twisted
</del><ins>+ "pyOpenSSL>=0.15.1", # also for Twisted
</ins><span class="cx"> "service_identity", # for Twisted
</span><span class="cx"> ])
</span><span class="cx">
</span><span class="lines">@@ -500,9 +500,8 @@
</span><span class="cx"> else:
</span><span class="cx"> script.append(line)
</span><span class="cx">
</span><del>- newScript = open(scriptPath, "w")
- newScript.write("\n".join(script))
- newScript.close()
</del><ins>+ with open(scriptPath, "w") as newScript:
+ newScript.write("\n".join(script))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> #
</span></span></pre></div>
<a id="CalendarServertrunksupport_cache_deps"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/support/_cache_deps (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/_cache_deps        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/support/_cache_deps        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> mkdir -p "${wd}/.develop/tools";
</span><span class="cx">
</span><span class="cx"> for pkg in \
</span><del>- setuptools-17.0 \
- pip-7.0.3 \
- virtualenv-13.0.3 \
</del><ins>+ setuptools-18.5 \
+ pip-7.1.2 \
+ virtualenv-13.1.2 \
</ins><span class="cx"> ; do
</span><span class="cx"> name="${pkg%-*}";
</span><span class="cx"> version="${pkg#*-}";
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavaccountingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/accounting.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/accounting.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/accounting.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -134,11 +134,8 @@
</span><span class="cx"> #
</span><span class="cx"> # Now write out the data to the log file
</span><span class="cx"> #
</span><del>- logFile = open(os.path.join(logRoot, logFilename), "a")
- try:
</del><ins>+ with open(os.path.join(logRoot, logFilename), "a") as logFile:
</ins><span class="cx"> logFile.write(data)
</span><del>- finally:
- logFile.close()
</del><span class="cx">
</span><span class="cx"> return logFilename
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdatabasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/database.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/database.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/database.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> ]
</span><span class="cx">
</span><span class="cx"> import thread
</span><ins>+import threading
</ins><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> from txdav.base.datastore.subpostgres import postgres
</span><span class="lines">@@ -41,28 +42,43 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-class ConnectionClosingThreadPool(ThreadPool):
</del><ins>+class ConnectionCloseThread(threading.Thread):
</ins><span class="cx"> """
</span><del>- A ThreadPool that closes connections for each worker thread
</del><ins>+ An L{Thread} that closes its DB connection when it has finished running.
</ins><span class="cx"> """
</span><span class="cx">
</span><del>- def _worker(self):
- log.debug("Starting ADBAPI thread: %s" % (thread.get_ident(),))
- ThreadPool._worker(self)
- self._closeConnection()
</del><ins>+ def __init__(self, group=None, target=None, name=None,
+ args=(), kwargs=None, verbose=None):
</ins><span class="cx">
</span><ins>+ if target is not None:
+ self._realTarget = target
+ target = self.targetWithConnectionClose
+ super(ConnectionCloseThread, self).__init__(group=group, target=target, name=name, args=args, kwargs=kwargs, verbose=verbose)
</ins><span class="cx">
</span><del>- def _closeConnection(self):
</del><span class="cx">
</span><del>- tid = thread.get_ident()
- log.debug("Closing ADBAPI thread: %s" % (tid,))
</del><ins>+ def targetWithConnectionClose(self, *args, **kwargs):
+ self._realTarget(*args, **kwargs)
+ if hasattr(self, "_db_close"):
+ self._db_close()
</ins><span class="cx">
</span><del>- conn = self.pool.connections.get(tid)
- self.pool._close(conn)
- del self.pool.connections[tid]
</del><span class="cx">
</span><span class="cx">
</span><ins>+class ConnectionClosingThreadPool(ThreadPool):
+ """
+ A L{ThreadPool} that closes connections for each worker thread when stopped.
+ """
</ins><span class="cx">
</span><ins>+ threadFactory = ConnectionCloseThread
+
+ def stop(self):
+ for tid, conn in self.pool.connections.items():
+ for thread in self.threads:
+ if thread.ident == tid:
+ thread._db_close = lambda : self.pool.disconnect(conn)
+ ThreadPool.stop(self)
+
+
+
</ins><span class="cx"> class AbstractADBAPIDatabase(object):
</span><span class="cx"> """
</span><span class="cx"> A generic SQL database.
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorytesttest_proxyprincipaldbpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -89,7 +89,9 @@
</span><span class="cx"> self.assertEqual(membersA, set(("B", "C", "D",)))
</span><span class="cx"> self.assertEqual(membershipsB, set(("A",)))
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_normalDBNonAscii(self):
</span><span class="cx">
</span><span class="lines">@@ -105,7 +107,9 @@
</span><span class="cx"> self.assertEqual(membersA, set(("B", "C", "D",)))
</span><span class="cx"> self.assertEqual(membershipsB, set((principalID,)))
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_DBIndexed(self):
</span><span class="cx">
</span><span class="lines">@@ -114,7 +118,9 @@
</span><span class="cx"> db = ProxySqliteDB(db_path)
</span><span class="cx"> self.assertEqual(set([row[1] for row in (yield db.query("PRAGMA index_list(GROUPS)"))]), set(("GROUPNAMES", "MEMBERS")))
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_OldDB(self):
</span><span class="cx">
</span><span class="lines">@@ -123,7 +129,9 @@
</span><span class="cx"> db = self.old_ProxyDB(db_path)
</span><span class="cx"> self.assertEqual(set([row[1] for row in (yield db.query("PRAGMA index_list(GROUPS)"))]), set())
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_DBUpgrade(self):
</span><span class="cx">
</span><span class="lines">@@ -150,7 +158,6 @@
</span><span class="cx"> self.assertEqual(membershipsB, set(("A",)))
</span><span class="cx"> self.assertEqual(set([row[1] for row in (yield db.query("PRAGMA index_list(GROUPS)"))]), set(("GROUPNAMES", "MEMBERS")))
</span><span class="cx"> db.close()
</span><del>- db = None
</del><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -253,7 +260,9 @@
</span><span class="cx">
</span><span class="cx"> yield db.clean()
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_cachingDBRemove(self):
</span><span class="cx">
</span><span class="lines">@@ -297,7 +306,9 @@
</span><span class="cx">
</span><span class="cx"> yield db.clean()
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_cachingDBRemoveSpecial(self):
</span><span class="cx">
</span><span class="lines">@@ -333,7 +344,9 @@
</span><span class="cx">
</span><span class="cx"> yield db.clean()
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_cachingDBInsertUncached(self):
</span><span class="cx">
</span><span class="lines">@@ -365,8 +378,10 @@
</span><span class="cx">
</span><span class="cx"> yield db.clean()
</span><span class="cx">
</span><ins>+ db.close()
</ins><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> class ProxyPrincipalDBPostgreSQL (twistedcaldav.test.util.TestCase):
</span><span class="cx"> """
</span><span class="cx"> Directory service provisioned principals.
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavlocalizationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/localization.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/localization.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/localization.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -27,9 +27,8 @@
</span><span class="cx"> from pycalendar.duration import Duration
</span><span class="cx">
</span><span class="cx"> try:
</span><del>- from Foundation import (
- NSPropertyListImmutable, NSPropertyListSerialization, NSData, NSLocale
- )
</del><ins>+ from osx.corefoundation import CFError
+ from osx.utils import CFLocaleRef, CFDataRef, CFPropertyListRef
</ins><span class="cx"> foundationImported = True
</span><span class="cx"> except ImportError:
</span><span class="cx"> foundationImported = False
</span><span class="lines">@@ -444,16 +443,18 @@
</span><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> # Parse the binary plist .strings file:
</span><del>- parser = NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription_
- data = NSData.dataWithContentsOfMappedFile_(src)
- strings, format, error = parser(data, NSPropertyListImmutable, None, None)
- if error:
</del><ins>+ with open(src) as f:
+ data = f.read()
+ data = CFDataRef.fromString(data)
+ try:
+ parsed = CFPropertyListRef.createFromData(data)
+ strings = parsed.toDict()
+ except CFError as error:
</ins><span class="cx"> raise ParseError(error)
</span><span class="cx">
</span><span class="cx"> # The format of GNUtext MO files is described here:
</span><span class="cx"> # http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html
</span><span class="cx">
</span><del>- strings = dict(strings)
</del><span class="cx"> originals = strings.keys()
</span><span class="cx"> originals.sort()
</span><span class="cx">
</span><span class="lines">@@ -538,7 +539,7 @@
</span><span class="cx"> return config.Localization.Language
</span><span class="cx">
</span><span class="cx"> try:
</span><del>- language = NSLocale.preferredLanguages()[0]
</del><ins>+ language = CFLocaleRef.preferredLanguages()[0]
</ins><span class="cx"> language = _remapLanguageCode(language)
</span><span class="cx"> except:
</span><span class="cx"> language = "en"
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavnotificationspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/notifications.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/notifications.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/notifications.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -156,7 +156,10 @@
</span><span class="cx"> db_filename = os.path.join(self.resource.fp.path, NotificationsDatabase.db_basename)
</span><span class="cx"> super(NotificationsDatabase, self).__init__(db_filename, True, autocommit=True)
</span><span class="cx">
</span><ins>+ self.resource._txn.postCommit(self._db_close)
+ self.resource._txn.postAbort(self._db_close)
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def allRecords(self):
</span><span class="cx">
</span><span class="cx"> records = self._db_execute("select * from NOTIFICATIONS")
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavsqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/sql.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/sql.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/sql.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -192,17 +192,17 @@
</span><span class="cx"> # want other processes to get stomped on or stomp on us.
</span><span class="cx"> old_isolation = self._db_connection.isolation_level
</span><span class="cx"> self._db_connection.isolation_level = None
</span><del>- q.execute("begin exclusive transaction")
</del><ins>+ try:
+ q.execute("begin exclusive transaction")
</ins><span class="cx">
</span><del>- # We re-check whether the schema table is present again AFTER we've got an exclusive
- # lock as some other server process may have snuck in and already created it
- # before we got the lock, or whilst we were waiting for it.
- if not self._test_schema_table(q):
- self._db_init_schema_table(q)
- self._db_init_data_tables(q)
- self._db_recreate(False)
</del><ins>+ # We re-check whether the schema table is present again AFTER we've got an exclusive
+ # lock as some other server process may have snuck in and already created it
+ # before we got the lock, or whilst we were waiting for it.
+ if not self._test_schema_table(q):
+ self._db_init_schema_table(q)
+ self._db_init_data_tables(q)
+ self._db_recreate(False)
</ins><span class="cx">
</span><del>- try:
</del><span class="cx"> q.execute("commit")
</span><span class="cx"> except DatabaseError:
</span><span class="cx"> pass
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -1210,7 +1210,8 @@
</span><span class="cx"> parser = NoUnicodePlistParser()
</span><span class="cx"> configDict = None
</span><span class="cx"> try:
</span><del>- configDict = parser.parse(open(filename))
</del><ins>+ with open(filename) as f:
+ configDict = parser.parse(f)
</ins><span class="cx"> except (IOError, OSError):
</span><span class="cx"> log.error("Configuration file does not exist or is inaccessible: %s" % (filename,))
</span><span class="cx"> raise ConfigurationError("Configuration file does not exist or is inaccessible: %s" % (filename,))
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstorebridgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/storebridge.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/storebridge.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twisted.internet.defer import succeed, inlineCallbacks, returnValue, maybeDeferred
</span><span class="cx"> from twisted.internet.protocol import Protocol
</span><del>-from twisted.python.hashlib import md5
</del><span class="cx"> from twisted.python.util import FancyEqMixin
</span><span class="cx"> from twistedcaldav import customxml, carddavxml, caldavxml, ical
</span><span class="cx"> from twistedcaldav.caldavxml import (
</span><span class="lines">@@ -657,7 +656,7 @@
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> # Create a new name if one was not provided
</span><del>- name = md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
</del><ins>+ name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
</ins><span class="cx">
</span><span class="cx"> # Get a resource for the new item
</span><span class="cx"> newchildURL = joinURL(request.path, name)
</span><span class="lines">@@ -3342,7 +3341,7 @@
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> # Create a new name if one was not provided
</span><del>- name = md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
</del><ins>+ name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
</ins><span class="cx">
</span><span class="cx"> # Get a resource for the new item
</span><span class="cx"> newchildURL = joinURL(request.path, name)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_calendarquerypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_calendarquery.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_calendarquery.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_calendarquery.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -85,7 +85,8 @@
</span><span class="cx"> calendar = yield self.calendarUnderTest(name="calendar", home=record.uid)
</span><span class="cx"> for f in os.listdir(self.holidays_dir):
</span><span class="cx"> if f.endswith(".ics"):
</span><del>- component = Component.fromString(open(os.path.join(self.holidays_dir, f)).read())
</del><ins>+ with open(os.path.join(self.holidays_dir, f)) as fin:
+ component = Component.fromString(fin.read())
</ins><span class="cx"> yield calendar._createCalendarObjectWithNameInternal(f, component, internal_state=ComponentUpdateState.RAW)
</span><span class="cx"> yield self.commit()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_configpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_config.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -136,7 +136,8 @@
</span><span class="cx"> TestCase.setUp(self)
</span><span class="cx"> config.setProvider(PListConfigProvider(DEFAULT_CONFIG))
</span><span class="cx"> self.testConfig = self.mktemp()
</span><del>- open(self.testConfig, "w").write(testConfig)
</del><ins>+ with open(self.testConfig, "w") as f:
+ f.write(testConfig)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def tearDown(self):
</span><span class="lines">@@ -565,10 +566,12 @@
</span><span class="cx"> config.setProvider(PListConfigProvider(DEFAULT_CONFIG))
</span><span class="cx">
</span><span class="cx"> self.testInclude = self.mktemp()
</span><del>- open(self.testInclude, "w").write(testConfigInclude)
</del><ins>+ with open(self.testInclude, "w") as f:
+ f.write(testConfigInclude)
</ins><span class="cx">
</span><span class="cx"> self.testMaster = self.mktemp()
</span><del>- open(self.testMaster, "w").write(testConfigMaster % (self.testInclude,))
</del><ins>+ with open(self.testMaster, "w") as f:
+ f.write(testConfigMaster % (self.testInclude,))
</ins><span class="cx">
</span><span class="cx"> config.load(self.testMaster)
</span><span class="cx"> self.assertEquals(config.HTTPPort, 9008)
</span><span class="lines">@@ -630,10 +633,12 @@
</span><span class="cx">
</span><span class="cx"> self.testIncludeRoot = self.mktemp()
</span><span class="cx"> self.testInclude = self.testIncludeRoot + "." + socket.getfqdn()
</span><del>- open(self.testInclude, "w").write(testConfigInclude)
</del><ins>+ with open(self.testInclude, "w") as f:
+ f.write(testConfigInclude)
</ins><span class="cx">
</span><span class="cx"> self.testMaster = self.mktemp()
</span><del>- open(self.testMaster, "w").write(testConfigMaster % (self.testIncludeRoot,))
</del><ins>+ with open(self.testMaster, "w") as f:
+ f.write(testConfigMaster % (self.testIncludeRoot,))
</ins><span class="cx">
</span><span class="cx"> config.load(self.testMaster)
</span><span class="cx"> self.assertEquals(config.HTTPPort, 9008)
</span><span class="lines">@@ -695,10 +700,12 @@
</span><span class="cx">
</span><span class="cx"> self.testIncludeRoot = self.mktemp()
</span><span class="cx"> self.testInclude = self.testIncludeRoot + "." + socket.gethostbyname(socket.getfqdn())
</span><del>- open(self.testInclude, "w").write(testConfigInclude)
</del><ins>+ with open(self.testInclude, "w") as f:
+ f.write(testConfigInclude)
</ins><span class="cx">
</span><span class="cx"> self.testMaster = self.mktemp()
</span><del>- open(self.testMaster, "w").write(testConfigMaster % (self.testIncludeRoot,))
</del><ins>+ with open(self.testMaster, "w") as f:
+ f.write(testConfigMaster % (self.testIncludeRoot,))
</ins><span class="cx">
</span><span class="cx"> config.load(self.testMaster)
</span><span class="cx"> self.assertEquals(config.HTTPPort, 9008)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_databasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_database.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_database.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_database.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx"> self.assertFalse(db.initialized)
</span><span class="cx"> yield db.open()
</span><span class="cx"> self.assertTrue(db.initialized)
</span><ins>+ db.close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -154,6 +155,7 @@
</span><span class="cx"> self.assertEqual(items, (("FOO", "BAR"),))
</span><span class="cx"> items = (yield db.queryList("SELECT * from TESTTYPE"))
</span><span class="cx"> self.assertEqual(items, ("FOO",))
</span><ins>+ db.close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -189,6 +191,7 @@
</span><span class="cx"> yield self.inlineCallbackRaises(Database.TestDBRecreateUpgrade.RecreateDBException, db.open)
</span><span class="cx"> items = (yield db.query("SELECT * from TESTTYPE"))
</span><span class="cx"> self.assertEqual(items, ())
</span><ins>+ db.close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -215,6 +218,7 @@
</span><span class="cx"> yield db.open()
</span><span class="cx"> items = (yield db.query("SELECT * from TESTTYPE"))
</span><span class="cx"> self.assertEqual(items, (("FOO", "BAR"),))
</span><ins>+ db.close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -235,3 +239,4 @@
</span><span class="cx"> yield db.open()
</span><span class="cx"> items = (yield db.query("SELECT * from TESTTYPE"))
</span><span class="cx"> self.assertEqual(items, (("FOO", "BAR"),))
</span><ins>+ db.close()
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_multigetpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_multiget.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_multiget.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_multiget.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -161,8 +161,8 @@
</span><span class="cx">
</span><span class="cx"> # Now forcibly corrupt one piece of calendar data
</span><span class="cx"> calendar_path = os.path.join(self.docroot, "calendar_multiget_events/", "bad.ics")
</span><del>- f = open(calendar_path, "w")
- f.write("""BEGIN:VCALENDAR
</del><ins>+ with open(calendar_path, "w") as f:
+ f.write("""BEGIN:VCALENDAR
</ins><span class="cx"> CALSCALE:GREGORIAN
</span><span class="cx"> PRODID:-//Apple Computer\, Inc//iCal 2.0//EN
</span><span class="cx"> VERSION:2.0
</span><span class="lines">@@ -173,7 +173,6 @@
</span><span class="cx"> DTSTAMP:20020101T121212Z
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"))
</span><del>- f.close
</del><span class="cx">
</span><span class="cx"> okuids = ["good", ]
</span><span class="cx"> baduids = ["bad", ]
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_sql.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_sql.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_sql.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx"> self.assertFalse(hasattr(db, "_db_connection"))
</span><span class="cx"> self.assertTrue(db._db() is not None)
</span><span class="cx"> self.assertTrue(db._db_connection is not None)
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_connect_autocommit(self):
</span><span class="lines">@@ -117,6 +118,7 @@
</span><span class="cx"> self.assertFalse(hasattr(db, "_db_connection"))
</span><span class="cx"> self.assertTrue(db._db() is not None)
</span><span class="cx"> self.assertTrue(db._db_connection is not None)
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_readwrite(self):
</span><span class="lines">@@ -129,6 +131,7 @@
</span><span class="cx"> q = db._db().execute("SELECT * from TESTTYPE")
</span><span class="cx"> items = [i for i in q.fetchall()]
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_readwrite_autocommit(self):
</span><span class="lines">@@ -140,6 +143,7 @@
</span><span class="cx"> q = db._db().execute("SELECT * from TESTTYPE")
</span><span class="cx"> items = [i for i in q.fetchall()]
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_readwrite_cursor(self):
</span><span class="lines">@@ -150,6 +154,7 @@
</span><span class="cx"> db._db_execute("INSERT into TESTTYPE (KEY, VALUE) values (:1, :2)", "FOO", "BAR")
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_readwrite_cursor_autocommit(self):
</span><span class="lines">@@ -160,6 +165,7 @@
</span><span class="cx"> db._db_execute("INSERT into TESTTYPE (KEY, VALUE) values (:1, :2)", "FOO", "BAR")
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_readwrite_rollback(self):
</span><span class="lines">@@ -171,6 +177,7 @@
</span><span class="cx"> db._db_rollback()
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_close(self):
</span><span class="lines">@@ -194,6 +201,7 @@
</span><span class="cx"> try:
</span><span class="cx"> db = SQL.TestDBPauseInInit(dbname)
</span><span class="cx"> db._db()
</span><ins>+ db._db_close()
</ins><span class="cx"> self.result = True
</span><span class="cx"> except:
</span><span class="cx"> self.result = False
</span><span class="lines">@@ -224,6 +232,7 @@
</span><span class="cx"> self.assertRaises(SQL.TestDBRecreateUpgrade.RecreateDBException, db._db)
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_version_upgrade_persistent(self):
</span><span class="lines">@@ -249,6 +258,7 @@
</span><span class="cx"> self.assertTrue(db._db() is not None)
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_version_upgrade_persistent_add_index(self):
</span><span class="lines">@@ -268,3 +278,4 @@
</span><span class="cx"> self.assertTrue(db._db() is not None)
</span><span class="cx"> items = db._db_execute("SELECT * from TESTTYPE")
</span><span class="cx"> self.assertEqual(items, [("FOO", "BAR")])
</span><ins>+ db._db_close()
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_timezonespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_timezones.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_timezones.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_timezones.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -325,3 +325,5 @@
</span><span class="cx">
</span><span class="cx"> self.assertTrue(os.path.exists(os.path.join(config.DataRoot, "zoneinfo")))
</span><span class="cx"> self.assertTrue(os.path.exists(os.path.join(config.DataRoot, "zoneinfo", "America", "New_York.ics")))
</span><ins>+
+ test_copyPackage_Concurrency.skip = "This tests needs to use separate processes rather than threads to work properly as the FilesystemLock object is process-based "
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_upgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_upgrade.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_upgrade.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_upgrade.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -1502,6 +1502,7 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> yield txn.commit()
</span><ins>+ sqliteProxyService.close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_resourcesXML(self):
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_xmlutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_xmlutil.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_xmlutil.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/test/test_xmlutil.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -85,7 +85,8 @@
</span><span class="cx"> def _checkXML(self, node, data):
</span><span class="cx"> xmlfile = self.mktemp()
</span><span class="cx"> writeXML(xmlfile, node)
</span><del>- newdata = open(xmlfile).read()
</del><ins>+ with open(xmlfile) as f:
+ newdata = f.read()
</ins><span class="cx"> self.assertEqual(newdata, data)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtimezonespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/timezones.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/timezones.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/timezones.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -102,7 +102,8 @@
</span><span class="cx"> @staticmethod
</span><span class="cx"> def getTZVersion(dbpath):
</span><span class="cx"> try:
</span><del>- return open(os.path.join(dbpath, "version.txt")).read().strip()
</del><ins>+ with open(os.path.join(dbpath, "version.txt")) as f:
+ return f.read().strip()
</ins><span class="cx"> except IOError:
</span><span class="cx"> return ""
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtimezonestdservicepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/timezonestdservice.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/timezonestdservice.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/timezonestdservice.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -696,7 +696,9 @@
</span><span class="cx"> # Build TimezoneInfo object
</span><span class="cx"> tzid = os.path.join(path, item[:-4])
</span><span class="cx"> try:
</span><del>- md5 = hashlib.md5(open(fullPath).read()).hexdigest()
</del><ins>+ with open(fullPath) as f:
+ tzdata = f.read()
+ md5 = hashlib.md5(tzdata).hexdigest()
</ins><span class="cx"> except IOError:
</span><span class="cx"> log.error("Unable to read timezone file: %s" % (fullPath,))
</span><span class="cx"> continue
</span><span class="lines">@@ -711,7 +713,8 @@
</span><span class="cx">
</span><span class="cx"> # Try links (aliases) file
</span><span class="cx"> try:
</span><del>- aliases = open(os.path.join(self.basepath, "links.txt")).read()
</del><ins>+ with open(os.path.join(self.basepath, "links.txt")) as f:
+ aliases = f.read()
</ins><span class="cx"> except IOError, e:
</span><span class="cx"> log.error("Unable to read links.txt file: %s" % (str(e),))
</span><span class="cx"> aliases = ""
</span><span class="lines">@@ -922,9 +925,8 @@
</span><span class="cx"> tzpath = os.path.join(self.basepath, tzinfo.tzid) + ".ics"
</span><span class="cx"> if not os.path.exists(os.path.dirname(tzpath)):
</span><span class="cx"> os.makedirs(os.path.dirname(tzpath))
</span><del>- f = open(tzpath, "w")
- f.write(ical)
- f.close()
</del><ins>+ with open(tzpath, "w") as f:
+ f.write(ical)
</ins><span class="cx"> except IOError, e:
</span><span class="cx"> log.error("Unable to write calendar file for %s: %s" % (tzinfo.tzid, str(e),))
</span><span class="cx"> else:
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/upgrade.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/upgrade.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -342,7 +342,8 @@
</span><span class="cx"> def createMailTokensDatabase(config, uid, gid):
</span><span class="cx"> # Cause the tokens db to be created on disk so we can set the
</span><span class="cx"> # permissions on it now
</span><del>- MailGatewayTokensDatabase(config.DataRoot).lookupByToken("")
</del><ins>+ db = MailGatewayTokensDatabase(config.DataRoot)
+ db.lookupByToken("")
</ins><span class="cx">
</span><span class="cx"> dbPath = os.path.join(config.DataRoot, MailGatewayTokensDatabase.dbFilename)
</span><span class="cx"> if os.path.exists(dbPath):
</span><span class="lines">@@ -352,6 +353,8 @@
</span><span class="cx"> if os.path.exists(journalPath):
</span><span class="cx"> os.chown(journalPath, uid, gid)
</span><span class="cx">
</span><ins>+ db._db_close()
+
</ins><span class="cx"> cuaCache = {}
</span><span class="cx">
</span><span class="cx"> docRoot = config.DocumentRoot
</span><span class="lines">@@ -1074,6 +1077,7 @@
</span><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="cx"> # Remove the old file
</span><ins>+ service.close()
</ins><span class="cx"> os.remove(service.dbpath)
</span><span class="cx"> journalPath = service.dbpath + "-journal"
</span><span class="cx"> if os.path.exists(journalPath):
</span></span></pre></div>
<a id="CalendarServertrunktxdavbasedatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/base/datastore/file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/base/datastore/file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/base/datastore/file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">
</span><span class="cx"> from zope.interface.declarations import implements
</span><span class="cx">
</span><del>-from twisted.python import hashlib
</del><ins>+import hashlib
</ins><span class="cx">
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twext.enterprise.ienterprise import AlreadyFinishedError
</span><span class="lines">@@ -249,7 +249,8 @@
</span><span class="cx"> # present. However, our unit tests use static files for their data store and those currently
</span><span class="cx"> # do not include the md5 xattr.
</span><span class="cx"> try:
</span><del>- data = self._path.open().read()
</del><ins>+ with self._path.open() as f:
+ data = f.read()
</ins><span class="cx"> except IOError:
</span><span class="cx"> return None
</span><span class="cx"> md5 = hashlib.md5(data).hexdigest()
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreindex_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/index_file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/index_file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/index_file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -95,7 +95,10 @@
</span><span class="cx"> db_filename = self.resource.fp.child(db_basename).path
</span><span class="cx"> super(AbstractCalendarIndex, self).__init__(db_filename, False)
</span><span class="cx">
</span><ins>+ self.resource._txn.postCommit(self._db_close)
+ self.resource._txn.postAbort(self._db_close)
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def create(self):
</span><span class="cx"> """
</span><span class="cx"> Create the index and initialize it.
</span><span class="lines">@@ -1103,8 +1106,11 @@
</span><span class="cx"> if name.startswith("."):
</span><span class="cx"> continue
</span><span class="cx">
</span><ins>+ child = fp.child(name)
+ if not child.isfile():
+ continue
</ins><span class="cx"> try:
</span><del>- stream = fp.child(name).open()
</del><ins>+ stream = child.open()
</ins><span class="cx"> except (IOError, OSError), e:
</span><span class="cx"> log.error("Unable to open resource %s: %s" % (name, e))
</span><span class="cx"> continue
</span><span class="lines">@@ -1215,8 +1221,11 @@
</span><span class="cx"> if name.startswith("."):
</span><span class="cx"> continue
</span><span class="cx">
</span><ins>+ child = fp.child(name)
+ if not child.isfile():
+ continue
</ins><span class="cx"> try:
</span><del>- stream = fp.child(name).open()
</del><ins>+ stream = child.open()
</ins><span class="cx"> except (IOError, OSError), e:
</span><span class="cx"> log.error("Unable to open resource %s: %s" % (name, e))
</span><span class="cx"> continue
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimipmailgatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/mailgateway.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/mailgateway.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/mailgateway.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -235,6 +235,7 @@
</span><span class="cx"> yield txn.imipCreateToken(organizer, attendee, icaluid, token=token)
</span><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><ins>+ oldDB._db_close()
</ins><span class="cx"> os.remove(oldDB.dbpath)
</span><span class="cx"> journalPath = oldDB.dbpath + "-journal"
</span><span class="cx"> if os.path.exists(journalPath):
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_mailgatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_mailgateway.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -49,3 +49,4 @@
</span><span class="cx"> self.assertEquals(records[0].organizer, "urn:uuid:user01")
</span><span class="cx"> self.assertEquals(records[0].attendee, "mailto:attendee@example.com")
</span><span class="cx"> self.assertEquals(records[0].icaluid, "icaluid1")
</span><ins>+ oldDB._db_close()
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_outboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -833,6 +833,7 @@
</span><span class="cx"> self.assertEquals(self.sender._scrubHeader("ABC: 123\nXYZ: 456"), "ABC: 123 XYZ: 456")
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def partByType(message, contentType):
</span><span class="cx"> """
</span><span class="cx"> Retrieve a MIME part from an L{email.message.Message} based on a content
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduledkimpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -494,7 +494,9 @@
</span><span class="cx"> def generateSignature(self, headers):
</span><span class="cx"> # Sign the hash
</span><span class="cx"> if self.key_file not in self.keys:
</span><del>- self.keys[self.key_file] = RSA.importKey(open(self.key_file).read())
</del><ins>+ with open(self.key_file) as f:
+ key = f.read()
+ self.keys[self.key_file] = RSA.importKey(key)
</ins><span class="cx"> return DKIMUtils.sign(headers, self.keys[self.key_file], self.hash_func)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduletesttest_dkimpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_dkim.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_dkim.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_dkim.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx"> super(TestDKIMBase, self).setUp()
</span><span class="cx">
</span><span class="cx"> self.private_keyfile = self.mktemp()
</span><del>- f = open(self.private_keyfile, "w")
- f.write("""-----BEGIN RSA PRIVATE KEY-----
</del><ins>+ with open(self.private_keyfile, "w") as f:
+ f.write("""-----BEGIN RSA PRIVATE KEY-----
</ins><span class="cx"> MIIEogIBAAKCAQEAw7bJxD1k5VSA5AqdfmJ7vj99oKQ4qYtSeJ5HiK6W40dzC++k
</span><span class="cx"> LweUWLzeUErgXwcJlyOC6rqVVPBfSJq4l7yPdVqpWUo6s2jnUsSWOfhpre22yc4B
</span><span class="cx"> K0QY2Euc3R+gT59eM0mtJPtWaQw5BmQ2GrV6f0OUiKi17jEPasKcxf1qZrWU0+Ik
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx"> CAXnxZHhrExMGIIa7KV33W5v7Hstl7SnPWKFgCvlBH2QoMTjoUE=
</span><span class="cx"> -----END RSA PRIVATE KEY-----
</span><span class="cx"> """)
</span><del>- f.close()
</del><span class="cx">
</span><span class="cx"> pkey_data = """MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw7bJxD1k5VSA5AqdfmJ7
</span><span class="cx"> vj99oKQ4qYtSeJ5HiK6W40dzC++kLweUWLzeUErgXwcJlyOC6rqVVPBfSJq4l7yP
</span><span class="lines">@@ -97,11 +96,10 @@
</span><span class="cx"> jQIDAQAB
</span><span class="cx"> """
</span><span class="cx"> self.public_keyfile = self.mktemp()
</span><del>- f = open(self.public_keyfile, "w")
- f.write("""-----BEGIN PUBLIC KEY-----
</del><ins>+ with open(self.public_keyfile, "w") as f:
+ f.write("""-----BEGIN PUBLIC KEY-----
</ins><span class="cx"> %s-----END PUBLIC KEY-----
</span><span class="cx"> """ % (pkey_data,))
</span><del>- f.close()
</del><span class="cx"> self.public_key_data = pkey_data.replace("\n", "")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -155,7 +153,9 @@
</span><span class="cx">
</span><span class="cx"> result = request.generateSignature(sign_this)
</span><span class="cx">
</span><del>- key = RSA.importKey(open(self.private_keyfile).read())
</del><ins>+ with open(self.private_keyfile) as f:
+ key = f.read()
+ key = RSA.importKey(key)
</ins><span class="cx"> signature = DKIMUtils.sign(sign_this, key, DKIMUtils.hash_func(algorithm))
</span><span class="cx">
</span><span class="cx"> self.assertEqual(result, signature)
</span><span class="lines">@@ -214,7 +214,9 @@
</span><span class="cx"> ischedule-version:1.0
</span><span class="cx"> ischedule-message-id:%s
</span><span class="cx"> dkim-signature:v=1; d=example.com; s=dkim; t=%s; x=%s; a=%s; q=private-exchange:http/well-known:dns/txt; c=ischedule-relaxed/simple; h=Originator:Recipient:Content-Type:iSchedule-Version:iSchedule-Message-ID; bh=%s; b=""".replace("\n", "\r\n") % (headers.getRawHeaders("Content-Type")[0], request.message_id, request.time, request.expire, algorithm, bodyhash)
</span><del>- key = RSA.importKey(open(self.private_keyfile).read())
</del><ins>+ with open(self.private_keyfile) as f:
+ key = f.read()
+ key = RSA.importKey(key)
</ins><span class="cx"> signature = DKIMUtils.sign(sign_this, key, DKIMUtils.hash_func(algorithm))
</span><span class="cx">
</span><span class="cx"> self.assertEqual(result, signature)
</span><span class="lines">@@ -224,7 +226,9 @@
</span><span class="cx"> self.assertEqual(request.headers.getRawHeaders("DKIM-Signature")[0], updated_header)
</span><span class="cx">
</span><span class="cx"> # Try to verify result using public key
</span><del>- pubkey = RSA.importKey(open(self.public_keyfile).read())
</del><ins>+ with open(self.public_keyfile) as f:
+ pubkey = f.read()
+ pubkey = RSA.importKey(pubkey)
</ins><span class="cx"> self.assertEqual(DKIMUtils.verify(sign_this, result, pubkey, DKIMUtils.hash_func(algorithm)), None)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduletesttest_remoteserverspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_remoteservers.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_remoteservers.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/test_remoteservers.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -27,7 +27,8 @@
</span><span class="cx"> def test_readXML(self):
</span><span class="cx">
</span><span class="cx"> fp = FilePath(self.mktemp())
</span><del>- fp.open("w").write("""<?xml version="1.0" encoding="utf-8"?>
</del><ins>+ with fp.open("w") as f:
+ f.write("""<?xml version="1.0" encoding="utf-8"?>
</ins><span class="cx"> <!DOCTYPE servers SYSTEM "servertoserver.dtd">
</span><span class="cx"> <servers>
</span><span class="cx"> <server>
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/sql.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> from txweb2.stream import readStream
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><del>-from twisted.python import hashlib
</del><span class="cx"> from twisted.python.failure import Failure
</span><span class="cx">
</span><span class="cx"> from twistedcaldav import customxml, ical
</span><span class="lines">@@ -114,6 +113,7 @@
</span><span class="cx"> from urlparse import urlparse, urlunparse
</span><span class="cx"> import collections
</span><span class="cx"> import datetime
</span><ins>+import hashlib
</ins><span class="cx"> import itertools
</span><span class="cx"> import urllib
</span><span class="cx"> import uuid
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoretestcommonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/test/common.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/test/common.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/common.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> from twisted.internet.defer import Deferred, inlineCallbacks, returnValue, \
</span><span class="cx"> maybeDeferred
</span><span class="cx"> from twisted.internet.protocol import Protocol
</span><del>-from twisted.python import hashlib
</del><span class="cx">
</span><span class="cx"> from twext.python.clsprop import classproperty
</span><span class="cx"> from twistedcaldav.ical import Component as VComponent
</span><span class="lines">@@ -54,6 +53,7 @@
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from calendarserver.push.util import PushPriority
</span><span class="cx">
</span><ins>+import hashlib
</ins><span class="cx"> import json
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoretesttest_attachmentspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_attachments.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/test/test_attachments.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_attachments.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -1789,12 +1789,14 @@
</span><span class="cx"> txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> dattachment2 = (yield DropBoxAttachment.load(txn, "1.2", "attach_1_2.txt"))
</span><span class="cx"> self.assertEqual(dattachment2, None)
</span><ins>+ yield txn.commit()
</ins><span class="cx">
</span><span class="cx"> # Managed attachment present
</span><span class="cx"> txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> mattachment2 = (yield ManagedAttachment.load(txn, None, None, attachmentID=dattachment._attachmentID))
</span><span class="cx"> self.assertNotEqual(mattachment2, None)
</span><span class="cx"> self.assertTrue(mattachment2.isManaged())
</span><ins>+ yield txn.commit()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoretesttest_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> # FileStorageTests, or implementation-agnostic methods on CommonTests.
</span><span class="cx">
</span><span class="cx"> from pycalendar.datetime import DateTime
</span><ins>+from twext.enterprise.ienterprise import AlreadyFinishedError
</ins><span class="cx"> from twext.python.filepath import CachingFilePath as FilePath
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks
</span><span class="cx"> from twisted.trial import unittest
</span><span class="lines">@@ -121,6 +122,15 @@
</span><span class="cx"> setUpCalendarStore(self)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def tearDown(self):
+ super(CalendarStoreTest, self).tearDown()
+ try:
+ yield self.txn.commit()
+ except AlreadyFinishedError:
+ pass
+
+
</ins><span class="cx"> def test_calendarHomeWithUID_dot(self):
</span><span class="cx"> """
</span><span class="cx"> Filenames starting with "." are reserved by this
</span><span class="lines">@@ -141,6 +151,15 @@
</span><span class="cx"> return setUpHome1(self)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def tearDown(self):
+ super(CalendarHomeTest, self).tearDown()
+ try:
+ yield self.txn.commit()
+ except AlreadyFinishedError:
+ pass
+
+
</ins><span class="cx"> def test_init(self):
</span><span class="cx"> """
</span><span class="cx"> L{CalendarHome} has C{_path} and L{_calendarStore} attributes,
</span><span class="lines">@@ -199,6 +218,15 @@
</span><span class="cx"> return setUpCalendar1(self)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def tearDown(self):
+ super(CalendarTest, self).tearDown()
+ try:
+ yield self.txn.commit()
+ except AlreadyFinishedError:
+ pass
+
+
</ins><span class="cx"> def test_init(self):
</span><span class="cx"> """
</span><span class="cx"> L{Calendar.__init__} sets private attributes to reflect its constructor
</span><span class="lines">@@ -236,6 +264,7 @@
</span><span class="cx"> index = calendar._index
</span><span class="cx"> self.assertEquals(set((yield index.calendarObjects())),
</span><span class="cx"> set((yield calendar.calendarObjects())))
</span><ins>+ index._oldIndex._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -381,11 +410,13 @@
</span><span class="cx"> (yield self.calendar1.calendarObjectWithName("1.ics")).component(),
</span><span class="cx"> VComponent.fromString(event1modified_text)
</span><span class="cx"> )
</span><ins>+ index = self.calendar1._index
</ins><span class="cx"> yield self.doThenUndo()
</span><span class="cx"> self.assertEquals(
</span><span class="cx"> (yield self.calendar1.calendarObjectWithName("1.ics")).component(),
</span><span class="cx"> originalComponent
</span><span class="cx"> )
</span><ins>+ index._oldIndex._db_close()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @testUnimplemented
</span><span class="lines">@@ -423,6 +454,15 @@
</span><span class="cx"> self.object1 = yield self.calendar1.calendarObjectWithName("1.ics")
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def tearDown(self):
+ super(CalendarObjectTest, self).tearDown()
+ try:
+ yield self.txn.commit()
+ except AlreadyFinishedError:
+ pass
+
+
</ins><span class="cx"> def test_init(self):
</span><span class="cx"> """
</span><span class="cx"> L{CalendarObject} has instance attributes, C{_path} and C{_calendar},
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoretesttest_index_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_index_file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/test/test_index_file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_index_file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -45,7 +45,8 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def iCalendar(self):
</span><del>- text = self.fp.open().read()
</del><ins>+ with self.fp.open() as f:
+ text = f.read()
</ins><span class="cx"> try:
</span><span class="cx"> component = Component.fromString(text)
</span><span class="cx"> # Fix any bogus data we can
</span><span class="lines">@@ -66,8 +67,18 @@
</span><span class="cx"> by L{Index}.
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+ class MinimalTxn(object):
+
+ def postCommit(self, _ignore):
+ pass
+
+ def postAbort(self, _ignore):
+ pass
+
+
</ins><span class="cx"> def __init__(self, filePath):
</span><span class="cx"> self.fp = filePath
</span><ins>+ self._txn = MinimalResourceReplacement.MinimalTxn()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def isCalendarCollection(self):
</span><span class="lines">@@ -98,6 +109,10 @@
</span><span class="cx"> self.db = Index(MinimalResourceReplacement(self.indexDirPath))
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def tearDown(self):
+ self.db._db_close()
+
+
</ins><span class="cx"> def test_reserve_uid_ok(self):
</span><span class="cx"> uid = "test-test-test"
</span><span class="cx"> d = self.db.isReservedUID(uid)
</span><span class="lines">@@ -294,9 +309,8 @@
</span><span class="cx"> for description, name, calendar_txt, reCreate, ok in data:
</span><span class="cx"> calendar = Component.fromString(calendar_txt)
</span><span class="cx"> if ok:
</span><del>- f = open(os.path.join(self.indexDirPath.path, name), "w")
- f.write(calendar_txt)
- del f
</del><ins>+ with open(os.path.join(self.indexDirPath.path, name), "w") as f:
+ f.write(calendar_txt)
</ins><span class="cx">
</span><span class="cx"> self.db.addResource(name, calendar, reCreate=reCreate)
</span><span class="cx"> self.assertTrue(self.db.resourceExists(name), msg=description)
</span><span class="lines">@@ -460,9 +474,8 @@
</span><span class="cx"> for description, name, calendar_txt, trstart, trend in data:
</span><span class="cx"> calendar = Component.fromString(calendar_txt)
</span><span class="cx">
</span><del>- f = open(os.path.join(self.indexDirPath.path, name), "w")
- f.write(calendar_txt)
- del f
</del><ins>+ with open(os.path.join(self.indexDirPath.path, name), "w") as f:
+ f.write(calendar_txt)
</ins><span class="cx">
</span><span class="cx"> self.db.addResource(name, calendar)
</span><span class="cx"> self.assertTrue(self.db.resourceExists(name), msg=description)
</span><span class="lines">@@ -646,9 +659,8 @@
</span><span class="cx"> for description, name, calendar_txt, trstart, trend, organizer, instances in data:
</span><span class="cx"> calendar = Component.fromString(calendar_txt)
</span><span class="cx">
</span><del>- f = open(os.path.join(self.indexDirPath.path, name), "w")
- f.write(calendar_txt)
- del f
</del><ins>+ with open(os.path.join(self.indexDirPath.path, name), "w") as f:
+ f.write(calendar_txt)
</ins><span class="cx">
</span><span class="cx"> self.db.addResource(name, calendar)
</span><span class="cx"> self.assertTrue(self.db.resourceExists(name), msg=description)
</span><span class="lines">@@ -1053,9 +1065,8 @@
</span><span class="cx"> for description, name, calendar_txt, trstart, trend, organizer, peruserinstances in data:
</span><span class="cx"> calendar = Component.fromString(calendar_txt)
</span><span class="cx">
</span><del>- f = open(os.path.join(self.indexDirPath.path, name), "w")
- f.write(calendar_txt)
- del f
</del><ins>+ with open(os.path.join(self.indexDirPath.path, name), "w") as f:
+ f.write(calendar_txt)
</ins><span class="cx">
</span><span class="cx"> self.db.addResource(name, calendar)
</span><span class="cx"> self.assertTrue(self.db.resourceExists(name), msg=description)
</span><span class="lines">@@ -1163,6 +1174,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def tearDown(self):
</span><ins>+ super(MemcacheTests, self).tearDown()
</ins><span class="cx"> for _ignore_k, v in self.memcache._timeouts.iteritems():
</span><span class="cx"> if v.active():
</span><span class="cx"> v.cancel()
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/carddav/datastore/file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> from txweb2.dav.resource import TwistedGETContentMD5
</span><span class="cx"> from txweb2.http_headers import MimeType
</span><span class="cx">
</span><del>-from twisted.python import hashlib
</del><span class="cx">
</span><span class="cx"> from twistedcaldav.vcard import Component as VComponent, InvalidVCardDataError
</span><span class="cx"> from txdav.carddav.datastore.index_file import AddressBookIndex as OldIndex
</span><span class="lines">@@ -53,6 +52,8 @@
</span><span class="cx">
</span><span class="cx"> from zope.interface import implements
</span><span class="cx">
</span><ins>+import hashlib
+
</ins><span class="cx"> contentTypeKey = PropertyName.fromElement(GETContentType)
</span><span class="cx"> md5key = PropertyName.fromElement(TwistedGETContentMD5)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastoreindex_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/index_file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/index_file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/carddav/datastore/index_file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -265,7 +265,10 @@
</span><span class="cx"> else:
</span><span class="cx"> self.reserver = SQLUIDReserver(self)
</span><span class="cx">
</span><ins>+ self.resource._txn.postCommit(self._db_close)
+ self.resource._txn.postAbort(self._db_close)
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def create(self):
</span><span class="cx"> """
</span><span class="cx"> Create the index and initialize it.
</span><span class="lines">@@ -635,8 +638,11 @@
</span><span class="cx"> if name.startswith("."):
</span><span class="cx"> continue
</span><span class="cx">
</span><ins>+ child = fp.child(name)
+ if not child.isfile():
+ continue
</ins><span class="cx"> try:
</span><del>- stream = fp.child(name).open()
</del><ins>+ stream = child.open()
</ins><span class="cx"> except (IOError, OSError), e:
</span><span class="cx"> log.error("Unable to open resource %s: %s" % (name, e))
</span><span class="cx"> continue
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/sql.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/sql.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/carddav/datastore/sql.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> from txweb2.responsecode import FORBIDDEN
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><del>-from twisted.python import hashlib
</del><span class="cx">
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from twistedcaldav.vcard import Component as VCard, InvalidVCardDataError, Property, \
</span><span class="lines">@@ -69,7 +68,9 @@
</span><span class="cx">
</span><span class="cx"> from zope.interface.declarations import implements
</span><span class="cx">
</span><ins>+import hashlib
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> class AddressBookHome(CommonHome):
</span><span class="cx">
</span><span class="cx"> implements(IAddressBookHome)
</span><span class="lines">@@ -767,7 +768,8 @@
</span><span class="cx"> missingNameIDs
</span><span class="cx"> ).on(self._txn, resourceIDs=missingNameIDs)
</span><span class="cx"> )
</span><del>- idToNameMap = dict(dict(idToNameMap), **dict(memberIDNameRows))
</del><ins>+ idToNameMap = dict(idToNameMap)
+ idToNameMap.update(dict(memberIDNameRows))
</ins><span class="cx">
</span><span class="cx"> # now do revisions
</span><span class="cx"> if revision:
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastoretestcommonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/test/common.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/test/common.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/carddav/datastore/test/common.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> from txweb2.responsecode import FORBIDDEN
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, maybeDeferred
</span><del>-from twisted.python import hashlib
</del><span class="cx">
</span><span class="cx"> from twistedcaldav.vcard import Component as VComponent
</span><span class="cx">
</span><span class="lines">@@ -42,7 +41,9 @@
</span><span class="cx"> from txdav.xml.element import WebDAVUnknownElement
</span><span class="cx"> from calendarserver.push.util import PushPriority
</span><span class="cx">
</span><ins>+import hashlib
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> storePath = FilePath(__file__).parent().child("addressbook_store")
</span><span class="cx">
</span><span class="cx"> home1Root = storePath.child("ho").child("me").child("home1")
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastoretesttest_index_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/test/test_index_file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/test/test_index_file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/carddav/datastore/test/test_index_file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -33,8 +33,18 @@
</span><span class="cx"> by L{Index}.
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+ class MinimalTxn(object):
+
+ def postCommit(self, _ignore):
+ pass
+
+ def postAbort(self, _ignore):
+ pass
+
+
</ins><span class="cx"> def __init__(self, filePath):
</span><span class="cx"> self.fp = filePath
</span><ins>+ self._txn = MinimalResourceReplacement.MinimalTxn()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def isAddressBookCollection(self):
</span><span class="lines">@@ -65,6 +75,10 @@
</span><span class="cx"> self.db = AddressBookIndex(MinimalResourceReplacement(self.indexDirPath))
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def tearDown(self):
+ self.db._db_close()
+
+
</ins><span class="cx"> def test_reserve_uid_ok(self):
</span><span class="cx"> uid = "test-test-test"
</span><span class="cx"> d = self.db.isReservedUID(uid)
</span><span class="lines">@@ -139,9 +153,8 @@
</span><span class="cx">
</span><span class="cx"> for description, name, vcard_txt in data:
</span><span class="cx"> calendar = Component.fromString(vcard_txt)
</span><del>- f = open(os.path.join(self.site.resource.fp.path, name), "w")
- f.write(vcard_txt)
- del f
</del><ins>+ with open(os.path.join(self.site.resource.fp.path, name), "w") as f:
+ f.write(vcard_txt)
</ins><span class="cx">
</span><span class="cx"> self.db.addResource(name, calendar)
</span><span class="cx"> self.assertTrue(self.db.resourceExists(name), msg=description)
</span><span class="lines">@@ -210,6 +223,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def tearDown(self):
</span><ins>+ super(MemcacheTests, self).tearDown()
</ins><span class="cx"> for _ignore_k, v in self.memcache._timeouts.iteritems():
</span><span class="cx"> if v.active():
</span><span class="cx"> v.cancel()
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/file.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/file.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/common/datastore/file.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import succeed, inlineCallbacks, returnValue
</span><span class="cx"> from twisted.python.util import FancyEqMixin
</span><del>-from twisted.python import hashlib
</del><span class="cx"> from twisted.python.failure import Failure
</span><span class="cx">
</span><span class="cx"> from twistedcaldav import customxml
</span><span class="lines">@@ -60,6 +59,7 @@
</span><span class="cx"> from errno import EEXIST, ENOENT
</span><span class="cx"> from zope.interface import implements, directlyProvides
</span><span class="cx">
</span><ins>+import hashlib
</ins><span class="cx"> import json
</span><span class="cx"> import uuid
</span><span class="cx"> from twistedcaldav.sql import AbstractSQLDatabase, db_prefix
</span><span class="lines">@@ -1458,6 +1458,7 @@
</span><span class="cx"> """
</span><span class="cx"> def __init__(self, resource):
</span><span class="cx"> self.resource = resource
</span><ins>+ self._txn = self.resource._txn
</ins><span class="cx"> self.fp = self.resource._path
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/directory.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/directory.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/who/directory.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -743,7 +743,7 @@
</span><span class="cx"> params["EMAIL"] = list(self.emailAddresses)[0].encode("utf-8")
</span><span class="cx"> if "CUTYPE" not in params:
</span><span class="cx"> cuType = self.getCUType()
</span><del>- if cuType is not "INDIVIDUAL":
</del><ins>+ if cuType != "INDIVIDUAL":
</ins><span class="cx"> params["CUTYPE"] = cuType
</span><span class="cx">
</span><span class="cx"> return Property("ATTENDEE", self.canonicalCalendarUserAddress().encode("utf-8"), params=params)
</span></span></pre></div>
<a id="CalendarServertrunktxdavxmlbasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/xml/base.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/xml/base.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/xml/base.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> if not name:
</span><span class="cx"> invalid()
</span><span class="cx">
</span><del>- if name[0] is "{":
</del><ins>+ if name[0] == "{":
</ins><span class="cx"> index = name.find("}")
</span><span class="cx"> if (index is -1 or not len(name) > index):
</span><span class="cx"> invalid()
</span></span></pre></div>
<a id="CalendarServertrunktxdavxmlparser_saxpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/xml/parser_sax.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/xml/parser_sax.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/xml/parser_sax.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">
</span><span class="cx"> attributes_dict = {}
</span><span class="cx">
</span><del>- if attributes.getLength() is not 0:
</del><ins>+ if attributes.getLength() != 0:
</ins><span class="cx"> for attr_name in attributes.getQNames():
</span><span class="cx"> attributes_dict[attr_name.encode("utf-8")] = attributes.getValueByQName(attr_name)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavxmlrfc2518py"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/xml/rfc2518.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/xml/rfc2518.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txdav/xml/rfc2518.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -313,8 +313,8 @@
</span><span class="cx"> )
</span><span class="cx"> )
</span><span class="cx">
</span><del>- if status_count is 0:
- if propstat_count is 0:
</del><ins>+ if status_count == 0:
+ if propstat_count == 0:
</ins><span class="cx"> raise ValueError(
</span><span class="cx"> "{0} element must have one of {1} or {2}".format(
</span><span class="cx"> cls.sname(), Status.sname(), PropertyStatus.sname()
</span></span></pre></div>
<a id="CalendarServertrunktxweb2authdigestpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/auth/digest.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/auth/digest.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/auth/digest.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -31,7 +31,8 @@
</span><span class="cx">
</span><span class="cx"> from zope.interface import implements
</span><span class="cx">
</span><del>-from twisted.python.hashlib import md5, sha1
</del><ins>+from hashlib import md5, sha1
+
</ins><span class="cx"> from twisted.cred import credentials
</span><span class="cx">
</span><span class="cx"> # FIXME: Technically speaking - although you can't tell from looking at them -
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davfileoppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/fileop.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/fileop.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/dav/fileop.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -468,6 +468,7 @@
</span><span class="cx"> ))
</span><span class="cx">
</span><span class="cx"> # Remove stat info from filepath since we modified the backing file
</span><ins>+ resource_file.close()
</ins><span class="cx"> filepath.changed()
</span><span class="cx"> yield success_code
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davmethodpropfindpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/method/propfind.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/method/propfind.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/dav/method/propfind.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">
</span><span class="cx"> for resource, uri in resources:
</span><span class="cx">
</span><del>- if search_properties is "names":
</del><ins>+ if search_properties == "names":
</ins><span class="cx"> try:
</span><span class="cx"> resource_properties = waitForDeferred(resource.listProperties(request))
</span><span class="cx"> yield resource_properties
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> responsecode.NOT_FOUND : [],
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if search_properties is "all":
</del><ins>+ if search_properties == "all":
</ins><span class="cx"> properties_to_enumerate = waitForDeferred(resource.listAllprop(request))
</span><span class="cx"> yield properties_to_enumerate
</span><span class="cx"> properties_to_enumerate = properties_to_enumerate.getResult()
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davtesttest_xattrpropspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/test/test_xattrprops.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/test/test_xattrprops.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/dav/test/test_xattrprops.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> error = self.assertRaises(HTTPError, self.propertyStore.get, property)
</span><span class="cx"> self.assertEquals(error.response.code, INTERNAL_SERVER_ERROR)
</span><span class="cx"> self.assertEquals(
</span><del>- len(self.flushLoggedErrors(UnpicklingError)), 1)
</del><ins>+ len(self.flushLoggedErrors(UnpicklingError, IndexError)), 1)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_set(self):
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/util.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/util.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/dav/util.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> (scheme, host, path, _ignore_query, _ignore_fragment) = urlsplit(normalizeURL(url))
</span><span class="cx">
</span><span class="cx"> index = path.rfind("/")
</span><del>- if index is 0:
</del><ins>+ if index == 0:
</ins><span class="cx"> if path == "/":
</span><span class="cx"> return None
</span><span class="cx"> else:
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davxattrpropspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/xattrprops.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/xattrprops.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/dav/xattrprops.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -188,6 +188,12 @@
</span><span class="cx"> err(None, msg)
</span><span class="cx"> raise HTTPError(
</span><span class="cx"> StatusResponse(responsecode.INTERNAL_SERVER_ERROR, msg))
</span><ins>+ except Exception:
+ format = "Invalid property value stored on server: %s %s"
+ msg = format % (encodeXMLName(*qname), data)
+ err(None, msg)
+ raise HTTPError(
+ StatusResponse(responsecode.INTERNAL_SERVER_ERROR, msg))
</ins><span class="cx"> else:
</span><span class="cx"> legacy = True
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxweb2staticpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/static.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/static.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/static.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -551,6 +551,7 @@
</span><span class="cx"> fileobject = os.fdopen(os.open(outname, flags, self.permissions), 'wb', 0)
</span><span class="cx">
</span><span class="cx"> stream.readIntoFile(filestream, fileobject)
</span><ins>+ fileobject.close()
</ins><span class="cx">
</span><span class="cx"> return outname
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxweb2testtest_httpauthpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/test/test_httpauth.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/test/test_httpauth.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/test/test_httpauth.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -1,7 +1,6 @@
</span><span class="cx"> # Copyright (c) 2006-2009 Twisted Matrix Laboratories.
</span><span class="cx"> # See LICENSE for details.
</span><span class="cx">
</span><del>-from twisted.python.hashlib import md5
</del><span class="cx"> from twisted.internet import address
</span><span class="cx"> from twisted.trial import unittest
</span><span class="cx"> from twisted.cred import error
</span><span class="lines">@@ -13,6 +12,7 @@
</span><span class="cx"> from txweb2.test import test_server
</span><span class="cx">
</span><span class="cx"> import base64
</span><ins>+from hashlib import md5
</ins><span class="cx">
</span><span class="cx"> _trivial_GET = SimpleRequest(None, 'GET', '/')
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxweb2testtest_streampy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/test/test_stream.py (15284 => 15285)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/test/test_stream.py        2015-11-04 17:17:02 UTC (rev 15284)
+++ CalendarServer/trunk/txweb2/test/test_stream.py        2015-11-04 19:06:32 UTC (rev 15285)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> Tests for the stream implementations in L{txweb2}.
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+from hashlib import md5
</ins><span class="cx"> import os
</span><span class="cx"> import sys
</span><span class="cx"> import tempfile
</span><span class="lines">@@ -13,7 +14,6 @@
</span><span class="cx">
</span><span class="cx"> from twisted.python.util import sibpath
</span><span class="cx"> sibpath # sibpath is *not* unused - the doctests use it.
</span><del>-from twisted.python.hashlib import md5
</del><span class="cx"> from twisted.internet import reactor, defer, interfaces
</span><span class="cx"> from twisted.trial import unittest
</span><span class="cx"> from txweb2 import stream
</span></span></pre>
</div>
</div>
</body>
</html>