Changeset 514


Ignore:
Timestamp:
01/14/11 16:16:55 (13 years ago)
Author:
bas
Message:

changed tempfile.mktemp to tempfile.mkstemp

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r513 r514  
     12.0.2 (2011-02-13)
     2   * Use tempfile.mkstemp instead of tempfile.mktemp
     3     Reported by: Dennis Stam (SARA)
     4     Author: Bas van der Vlies
     5
    162.0.1 (2011-02-12)
    27   * An email address can match multiple trac accounts, closes #218
  • trunk/debian/changelog

    r509 r514  
     1email2trac (2.0.2-1) stable; urgency=low
     2
     3  * see Changelog
     4
     5 -- bas van der Vlies <bas@sara.nl>  Fri, 14 Jan 2011 16:04:21 +0100
     6
     7email2trac (2.0.1-4) stable; urgency=low
     8
     9  * added info message for syslog of charset not found
     10
     11 -- bas van der Vlies <basv@sara.nl>  Wed, 12 Jan 2011 15:32:16 +0100
     12
    113email2trac (2.0.1-3) stable; urgency=low
    214
  • trunk/email2trac.py.in

    r509 r514  
    415415    def debug_body(self, message_body, temporary_file=False):
    416416        if temporary_file:
    417             body_file = tempfile.mktemp('.email2trac')
     417            (fd, body_file) = tempfile.mkstemp('.email2trac')
     418            fx = os.fdopen(fd, 'wb')
    418419        else:
    419420            body_file = os.path.join(self.parameters.tmpdir, 'body.txt')
     421            fx = open(body_file, 'wb')
    420422
    421423        if self.parameters.dry_run:
     
    424426
    425427        print 'writing body to %s' %(body_file)
    426         fx = open(body_file, 'wb')
    427428        if not message_body:
    428429                message_body = '(None)'
     
    490491
    491492        if create_tempfile:
    492             msg_file = tempfile.mktemp('.email2trac')
     493            (fd, msg_file) = tempfile.mkstemp('.email2trac')
     494            fx = os.fdopen(fd, 'wb')
    493495        else:
    494496            #msg_file = '/var/tmp/msg.txt'
    495497            msg_file = os.path.join(self.parameters.tmpdir, 'msg.txt')
     498            fx = open(msg_file, 'wb')
    496499
    497500        if self.parameters.dry_run:
     
    500503            print 'saving email to %s' %(msg_file)
    501504
    502             fx = open(msg_file, 'wb')
    503505            fx.write('%s' % message)
    504506            fx.close()
     
    537539                    temp = unicode(text, 'iso-8859-15')
    538540                except LookupError, detail:
    539                     #text = 'ERROR: Could not find charset: %s, please install' %format
     541                    msg = 'ERROR: Could not find charset: %s, please install' %format
     542                    sys.logger.error(msg)
    540543                    #temp = unicode(text, 'iso-8859-15')
    541544                    temp = message_str
     
    614617        parsed_data = None
    615618        if self.parameters.html2text_cmd:
    616             tmp_file = tempfile.mktemp('email2trac.html')
     619            (fd, tmp_file) = tempfile.mkstemp('email2trac.html')
     620            f = os.fdopen(fd, 'w')
     621
    617622            cmd = '%s %s' %(self.parameters.html2text_cmd, tmp_file)
    618623            self.logger.debug('\t html2text conversion %s'%(cmd))
     
    622627
    623628            else:
    624                 f = open(tmp_file, "w+")
    625629                f.write(data)
    626630                f.close()
  • trunk/email2trac.spec

    r506 r514  
    11Summary: Utilities for converting emails to trac tickets
    22Name: email2trac
    3 Version: 2.0.1
     3Version: 2.0.2
    44Release: 1
    55License: GPL
Note: See TracChangeset for help on using the changeset viewer.