~msapiro/mailman/topics

« back to all changes in this revision

Viewing changes to cron/gate_news

  • Committer: Mark Sapiro
  • Date: 2008-12-03 19:44:51 UTC
  • mfrom: (1006.1.11 2.2)
  • Revision ID: mark@msapiro.net-20081203194451-fjqije6crun7iajf
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! @PYTHON@
2
2
#
3
 
# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
 
3
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
4
4
#
5
5
# This program is free software; you can redistribute it and/or
6
6
# modify it under the terms of the GNU General Public License
131
131
        glock.refresh()
132
132
        try:
133
133
            headers = conn.head(`num`)[3]
 
134
            # I don't know how this happens, but skip an empty message.
 
135
            if not headers:
 
136
                raise _ContinueLoop
134
137
            found_to = 0
135
138
            beenthere = 0
136
139
            for header in headers:
184
187
            syslog('fromusenet', str(e))
185
188
        except _ContinueLoop:
186
189
            continue
187
 
        # Even if we don't post the message because it was seen on the
188
 
        # list already, update the watermark
189
 
        mlist.usenet_watermark = num
 
190
    # Even if we don't post the message because it was seen on the
 
191
    # list already, or if we skipped it as unparseable or empty,
 
192
    # update the watermark. Note this used to be in the 'for' block
 
193
    # but if the last message(s) raised _ContinueLoop, they wouldn't
 
194
    # update the watermark.
 
195
    mlist.usenet_watermark = num
190
196
 
191
197
 
192
198
 
206
212
        # Open the newsgroup, but let most exceptions percolate up.
207
213
        try:
208
214
            conn, first, last = open_newsgroup(mlist)
209
 
        except (socket.error, nntplib.NNTPError):
210
 
            break
 
215
        except (socket.error, nntplib.NNTPError), e:
 
216
            syslog('fromusenet',
 
217
                   "%s: couldn't open newsgroup %s: skipping\n%s",
 
218
                   listname, mlist.linked_newsgroup, e)
 
219
            continue
211
220
        syslog('fromusenet', '%s: [%d..%d]' % (listname, first, last))
212
221
        try:
213
222
            try: