Skip to content

Commit

Permalink
Branch merge
Browse files Browse the repository at this point in the history
  • Loading branch information
merwok committed Dec 9, 2012
2 parents d38c990 + 9e06e8d commit 367efc2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ directories.
these files is available in answer D2 of the `NFS FAQ page
<http://nfs.sourceforge.net/#section_d>`_.

.. versionchanged:: 2.7.4
NFS files are ignored.


.. function:: remove_tree(directory[, verbose=0, dry_run=0])

Expand Down
3 changes: 3 additions & 0 deletions Lib/distutils/command/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def __init__(self, source, report_level, halt_level, stream=None,

def system_message(self, level, message, *children, **kwargs):
self.messages.append((level, message, children, kwargs))
return nodes.system_message(message, level=level,
type=self.levels[level],
*children, **kwargs)

HAS_DOCUTILS = True
except ImportError:
Expand Down
5 changes: 0 additions & 5 deletions Lib/distutils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ def _store_pypirc(self, username, password):
f.write(DEFAULT_PYPIRC % (username, password))
finally:
f.close()
try:
os.chmod(rc, 0600)
except OSError:
# should do something better here
pass

def _read_pypirc(self):
"""Reads the .pypirc file."""
Expand Down
33 changes: 22 additions & 11 deletions Lib/distutils/tests/test_register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf8 -*-
"""Tests for distutils.command.register."""
import sys
import os
import unittest
import getpass
Expand All @@ -11,11 +10,14 @@

from distutils.command import register as register_module
from distutils.command.register import register
from distutils.core import Distribution
from distutils.errors import DistutilsSetupError

from distutils.tests import support
from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
from distutils.tests.test_config import PyPIRCCommandTestCase

try:
import docutils
except ImportError:
docutils = None

PYPIRC_NOPASSWORD = """\
[distutils]
Expand Down Expand Up @@ -192,6 +194,7 @@ def test_password_reset(self):
self.assertEqual(headers['Content-length'], '290')
self.assertTrue('tarek' in req.data)

@unittest.skipUnless(docutils is not None, 'needs docutils')
def test_strict(self):
# testing the script option
# when on, the register command stops if
Expand All @@ -204,13 +207,6 @@ def test_strict(self):
cmd.strict = 1
self.assertRaises(DistutilsSetupError, cmd.run)

# we don't test the reSt feature if docutils
# is not installed
try:
import docutils
except ImportError:
return

# metadata are OK but long_description is broken
metadata = {'url': 'xxx', 'author': 'xxx',
'author_email': u'éxéxé',
Expand Down Expand Up @@ -264,6 +260,21 @@ def test_strict(self):
finally:
del register_module.raw_input

@unittest.skipUnless(docutils is not None, 'needs docutils')
def test_register_invalid_long_description(self):
description = ':funkie:`str`' # mimic Sphinx-specific markup
metadata = {'url': 'xxx', 'author': 'xxx',
'author_email': 'xxx',
'name': 'xxx', 'version': 'xxx',
'long_description': description}
cmd = self._get_cmd(metadata)
cmd.ensure_finalized()
cmd.strict = True
inputs = RawInputs('2', 'tarek', '[email protected]')
register_module.raw_input = inputs
self.addCleanup(delattr, register_module, 'raw_input')
self.assertRaises(DistutilsSetupError, cmd.run)

def test_check_metadata_deprecated(self):
# makes sure make_metadata is deprecated
cmd = self._get_cmd()
Expand Down
2 changes: 2 additions & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ David Costanzo
Scott Cotton
Greg Couch
David Cournapeau
Julien Courteau
Steve Cousins
Alex Coventry
Matthew Dixon Cowles
Expand Down Expand Up @@ -572,6 +573,7 @@ Inyeol Lee
Thomas Lee
Christopher Lee
Luc Lefebvre
Pierre Paul Lefebvre
Glyph Lefkowitz
Vincent Legoll
Kip Lehman
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ Library

- Issue #16628: Fix a memory leak in ctypes.resize().

- Issue #13614: Fix setup.py register failure with invalid rst in description.
Patch by Julien Courteau and Pierre Paul Lefebvre.

- Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
Patch by Serhiy Storchaka.

Expand Down

0 comments on commit 367efc2

Please sign in to comment.