/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to parser.py

fix date parsing bug found while importing samba

Show diffs side-by-side

added added

removed removed

Lines of Context:
504
504
        """
505
505
        match = _WHO_AND_WHEN_RE.search(s)
506
506
        if match:
507
 
            datestr = match.group(3)
 
507
            datestr = match.group(3).lstrip()
508
508
            if self.date_parser is None:
509
509
                # auto-detect the date format
510
510
                if len(datestr.split(' ')) == 2:
514
514
                else:
515
515
                    format = 'rfc2822'
516
516
                self.date_parser = dates.DATE_PARSERS_BY_NAME[format]
517
 
            when = self.date_parser(datestr, self.lineno)
 
517
            try:
 
518
                when = self.date_parser(datestr, self.lineno)
 
519
            except ValueError:
 
520
                print "failed to parse datestr '%s'" % (datestr,)
 
521
                raise
518
522
        else:
519
523
            match = _WHO_RE.search(s)
520
524
            if accept_just_who and match: