Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/distutils/config.py

    r2 r391  
    55"""
    66import os
    7 import sys
    87from ConfigParser import ConfigParser
    98
     
    4443        """Creates a default .pypirc file."""
    4544        rc = self._get_rc_file()
    46         f = open(rc, 'w')
     45        f = os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w')
    4746        try:
    4847            f.write(DEFAULT_PYPIRC % (username, password))
    4948        finally:
    5049            f.close()
    51         try:
    52             os.chmod(rc, 0600)
    53         except OSError:
    54             # should do something better here
    55             pass
    5650
    5751    def _read_pypirc(self):
     
    6155            self.announce('Using PyPI login from %s' % rc)
    6256            repository = self.repository or self.DEFAULT_REPOSITORY
    63             realm = self.realm or self.DEFAULT_REALM
    64 
    6557            config = ConfigParser()
    6658            config.read(rc)
     
    8375                    current = {'server': server}
    8476                    current['username'] = config.get(server, 'username')
    85                     current['password'] = config.get(server, 'password')
    8677
    8778                    # optional params
    8879                    for key, default in (('repository',
    8980                                          self.DEFAULT_REPOSITORY),
    90                                          ('realm', self.DEFAULT_REALM)):
     81                                         ('realm', self.DEFAULT_REALM),
     82                                         ('password', None)):
    9183                        if config.has_option(server, key):
    9284                            current[key] = config.get(server, key)
Note: See TracChangeset for help on using the changeset viewer.