Commit 7f555609 authored by Benjamin Peterson's avatar Benjamin Peterson

merge heads

parents f22913b8 d88d9836
...@@ -552,9 +552,9 @@ For an example of the usage of queues for interprocess communication see ...@@ -552,9 +552,9 @@ For an example of the usage of queues for interprocess communication see
Return ``True`` if the queue is full, ``False`` otherwise. Because of Return ``True`` if the queue is full, ``False`` otherwise. Because of
multithreading/multiprocessing semantics, this is not reliable. multithreading/multiprocessing semantics, this is not reliable.
.. method:: put(item[, block[, timeout]]) .. method:: put(obj[, block[, timeout]])
Put item into the queue. If the optional argument *block* is ``True`` Put obj into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until (the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`queue.Full` exception if no most *timeout* seconds and raises the :exc:`queue.Full` exception if no
...@@ -563,9 +563,9 @@ For an example of the usage of queues for interprocess communication see ...@@ -563,9 +563,9 @@ For an example of the usage of queues for interprocess communication see
available, else raise the :exc:`queue.Full` exception (*timeout* is available, else raise the :exc:`queue.Full` exception (*timeout* is
ignored in that case). ignored in that case).
.. method:: put_nowait(item) .. method:: put_nowait(obj)
Equivalent to ``put(item, False)``. Equivalent to ``put(obj, False)``.
.. method:: get([block[, timeout]]) .. method:: get([block[, timeout]])
......
...@@ -595,7 +595,7 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar( ...@@ -595,7 +595,7 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
/* Convert the Unicode object to a wide character string. The output string /* Convert the Unicode object to a wide character string. The output string
always ends with a nul character. If size is not NULL, write the number of always ends with a nul character. If size is not NULL, write the number of
wide characters (including the nul character) into *size. wide characters (excluding the null character) into *size.
Returns a buffer allocated by PyMem_Alloc() (use PyMem_Free() to free it) Returns a buffer allocated by PyMem_Alloc() (use PyMem_Free() to free it)
on success. On error, returns NULL, *size is undefined and raises a on success. On error, returns NULL, *size is undefined and raises a
......
...@@ -40,9 +40,8 @@ class install_egg_info(Command): ...@@ -40,9 +40,8 @@ class install_egg_info(Command):
"Creating "+self.install_dir) "Creating "+self.install_dir)
log.info("Writing %s", target) log.info("Writing %s", target)
if not self.dry_run: if not self.dry_run:
f = open(target, 'w') with open(target, 'w', encoding='UTF-8') as f:
self.distribution.metadata.write_pkg_file(f) self.distribution.metadata.write_pkg_file(f)
f.close()
def get_outputs(self): def get_outputs(self):
return self.outputs return self.outputs
......
...@@ -306,7 +306,10 @@ class sdist(Command): ...@@ -306,7 +306,10 @@ class sdist(Command):
try: try:
self.filelist.process_template_line(line) self.filelist.process_template_line(line)
except DistutilsTemplateError as msg: # the call above can raise a DistutilsTemplateError for
# malformed lines, or a ValueError from the lower-level
# convert_path function
except (DistutilsTemplateError, ValueError) as msg:
self.warn("%s, line %d: %s" % (template.filename, self.warn("%s, line %d: %s" % (template.filename,
template.current_line, template.current_line,
msg)) msg))
......
...@@ -1010,11 +1010,9 @@ class DistributionMetadata: ...@@ -1010,11 +1010,9 @@ class DistributionMetadata:
def write_pkg_info(self, base_dir): def write_pkg_info(self, base_dir):
"""Write the PKG-INFO file into the release tree. """Write the PKG-INFO file into the release tree.
""" """
pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w') with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
try: encoding='UTF-8') as pkg_info:
self.write_pkg_file(pkg_info) self.write_pkg_file(pkg_info)
finally:
pkg_info.close()
def write_pkg_file(self, file): def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object. """Write the PKG-INFO format data to a file object.
......
...@@ -15,6 +15,7 @@ from distutils.tests.test_config import PyPIRCCommandTestCase ...@@ -15,6 +15,7 @@ from distutils.tests.test_config import PyPIRCCommandTestCase
from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsOptionError
from distutils.spawn import find_executable from distutils.spawn import find_executable
from distutils.log import WARN from distutils.log import WARN
from distutils.filelist import FileList
from distutils.archive_util import ARCHIVE_FORMATS from distutils.archive_util import ARCHIVE_FORMATS
SETUP_PY = """ SETUP_PY = """
...@@ -78,9 +79,6 @@ class SDistTestCase(PyPIRCCommandTestCase): ...@@ -78,9 +79,6 @@ class SDistTestCase(PyPIRCCommandTestCase):
dist.include_package_data = True dist.include_package_data = True
cmd = sdist(dist) cmd = sdist(dist)
cmd.dist_dir = 'dist' cmd.dist_dir = 'dist'
def _warn(*args):
pass
cmd.warn = _warn
return dist, cmd return dist, cmd
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
...@@ -235,7 +233,8 @@ class SDistTestCase(PyPIRCCommandTestCase): ...@@ -235,7 +233,8 @@ class SDistTestCase(PyPIRCCommandTestCase):
# with the `check` subcommand # with the `check` subcommand
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.run() cmd.run()
warnings = self.get_logs(WARN) warnings = [msg for msg in self.get_logs(WARN) if
msg.startswith('warning: check:')]
self.assertEqual(len(warnings), 2) self.assertEqual(len(warnings), 2)
# trying with a complete set of metadata # trying with a complete set of metadata
...@@ -244,7 +243,8 @@ class SDistTestCase(PyPIRCCommandTestCase): ...@@ -244,7 +243,8 @@ class SDistTestCase(PyPIRCCommandTestCase):
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.metadata_check = 0 cmd.metadata_check = 0
cmd.run() cmd.run()
warnings = self.get_logs(WARN) warnings = [msg for msg in self.get_logs(WARN) if
msg.startswith('warning: check:')]
self.assertEqual(len(warnings), 0) self.assertEqual(len(warnings), 0)
def test_check_metadata_deprecated(self): def test_check_metadata_deprecated(self):
...@@ -266,7 +266,6 @@ class SDistTestCase(PyPIRCCommandTestCase): ...@@ -266,7 +266,6 @@ class SDistTestCase(PyPIRCCommandTestCase):
self.assertEqual(len(output), num_formats) self.assertEqual(len(output), num_formats)
def test_finalize_options(self): def test_finalize_options(self):
dist, cmd = self.get_cmd() dist, cmd = self.get_cmd()
cmd.finalize_options() cmd.finalize_options()
...@@ -286,6 +285,32 @@ class SDistTestCase(PyPIRCCommandTestCase): ...@@ -286,6 +285,32 @@ class SDistTestCase(PyPIRCCommandTestCase):
cmd.formats = 'supazipa' cmd.formats = 'supazipa'
self.assertRaises(DistutilsOptionError, cmd.finalize_options) self.assertRaises(DistutilsOptionError, cmd.finalize_options)
# the following tests make sure there is a nice error message instead
# of a traceback when parsing an invalid manifest template
def _test_template(self, content):
dist, cmd = self.get_cmd()
os.chdir(self.tmp_dir)
self.write_file('MANIFEST.in', content)
cmd.ensure_finalized()
cmd.filelist = FileList()
cmd.read_template()
warnings = self.get_logs(WARN)
self.assertEqual(len(warnings), 1)
def test_invalid_template_unknown_command(self):
self._test_template('taunt knights *')
def test_invalid_template_wrong_arguments(self):
# this manifest command takes one argument
self._test_template('prune')
@unittest.skipIf(os.name != 'nt', 'test relevant for Windows only')
def test_invalid_template_wrong_path(self):
# on Windows, trailing slashes are not allowed
# this used to crash instead of raising a warning: #8286
self._test_template('include examples/')
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_get_file_list(self): def test_get_file_list(self):
# make sure MANIFEST is recalculated # make sure MANIFEST is recalculated
......
...@@ -458,4 +458,4 @@ class HTMLParser(_markupbase.ParserBase): ...@@ -458,4 +458,4 @@ class HTMLParser(_markupbase.ParserBase):
return '&'+s+';' return '&'+s+';'
return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));",
replaceEntities, s, re.ASCII) replaceEntities, s, flags=re.ASCII)
# Generated by h2py from /usr/include/linux/cdrom.h
CDROMPAUSE = 0x5301
CDROMRESUME = 0x5302
CDROMPLAYMSF = 0x5303
CDROMPLAYTRKIND = 0x5304
CDROMREADTOCHDR = 0x5305
CDROMREADTOCENTRY = 0x5306
CDROMSTOP = 0x5307
CDROMSTART = 0x5308
CDROMEJECT = 0x5309
CDROMVOLCTRL = 0x530a
CDROMSUBCHNL = 0x530b
CDROMREADMODE2 = 0x530c
CDROMREADMODE1 = 0x530d
CDROMREADAUDIO = 0x530e
CDROMEJECT_SW = 0x530f
CDROMMULTISESSION = 0x5310
CDROM_GET_MCN = 0x5311
CDROM_GET_UPC = CDROM_GET_MCN
CDROMRESET = 0x5312
CDROMVOLREAD = 0x5313
CDROMREADRAW = 0x5314
CDROMREADCOOKED = 0x5315
CDROMSEEK = 0x5316
CDROMPLAYBLK = 0x5317
CDROMREADALL = 0x5318
CDROMGETSPINDOWN = 0x531d
CDROMSETSPINDOWN = 0x531e
CDROMCLOSETRAY = 0x5319
CDROM_SET_OPTIONS = 0x5320
CDROM_CLEAR_OPTIONS = 0x5321
CDROM_SELECT_SPEED = 0x5322
CDROM_SELECT_DISC = 0x5323
CDROM_MEDIA_CHANGED = 0x5325
CDROM_DRIVE_STATUS = 0x5326
CDROM_DISC_STATUS = 0x5327
CDROM_CHANGER_NSLOTS = 0x5328
CDROM_LOCKDOOR = 0x5329
CDROM_DEBUG = 0x5330
CDROM_GET_CAPABILITY = 0x5331
CDROMAUDIOBUFSIZ = 0x5382
DVD_READ_STRUCT = 0x5390
DVD_WRITE_STRUCT = 0x5391
DVD_AUTH = 0x5392
CDROM_SEND_PACKET = 0x5393
CDROM_NEXT_WRITABLE = 0x5394
CDROM_LAST_WRITTEN = 0x5395
CDROM_PACKET_SIZE = 12
CGC_DATA_UNKNOWN = 0
CGC_DATA_WRITE = 1
CGC_DATA_READ = 2
CGC_DATA_NONE = 3
CD_MINS = 74
CD_SECS = 60
CD_FRAMES = 75
CD_SYNC_SIZE = 12
CD_MSF_OFFSET = 150
CD_CHUNK_SIZE = 24
CD_NUM_OF_CHUNKS = 98
CD_FRAMESIZE_SUB = 96
CD_HEAD_SIZE = 4
CD_SUBHEAD_SIZE = 8
CD_EDC_SIZE = 4
CD_ZERO_SIZE = 8
CD_ECC_SIZE = 276
CD_FRAMESIZE = 2048
CD_FRAMESIZE_RAW = 2352
CD_FRAMESIZE_RAWER = 2646
CD_FRAMESIZE_RAW1 = (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)
CD_FRAMESIZE_RAW0 = (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE)
CD_XA_HEAD = (CD_HEAD_SIZE+CD_SUBHEAD_SIZE)
CD_XA_TAIL = (CD_EDC_SIZE+CD_ECC_SIZE)
CD_XA_SYNC_HEAD = (CD_SYNC_SIZE+CD_XA_HEAD)
CDROM_LBA = 0x01
CDROM_MSF = 0x02
CDROM_DATA_TRACK = 0x04
CDROM_LEADOUT = 0xAA
CDROM_AUDIO_INVALID = 0x00
CDROM_AUDIO_PLAY = 0x11
CDROM_AUDIO_PAUSED = 0x12
CDROM_AUDIO_COMPLETED = 0x13
CDROM_AUDIO_ERROR = 0x14
CDROM_AUDIO_NO_STATUS = 0x15
CDC_CLOSE_TRAY = 0x1
CDC_OPEN_TRAY = 0x2
CDC_LOCK = 0x4
CDC_SELECT_SPEED = 0x8
CDC_SELECT_DISC = 0x10
CDC_MULTI_SESSION = 0x20
CDC_MCN = 0x40
CDC_MEDIA_CHANGED = 0x80
CDC_PLAY_AUDIO = 0x100
CDC_RESET = 0x200
CDC_IOCTLS = 0x400
CDC_DRIVE_STATUS = 0x800
CDC_GENERIC_PACKET = 0x1000
CDC_CD_R = 0x2000
CDC_CD_RW = 0x4000
CDC_DVD = 0x8000
CDC_DVD_R = 0x10000
CDC_DVD_RAM = 0x20000
CDS_NO_INFO = 0
CDS_NO_DISC = 1
CDS_TRAY_OPEN = 2
CDS_DRIVE_NOT_READY = 3
CDS_DISC_OK = 4
CDS_AUDIO = 100
CDS_DATA_1 = 101
CDS_DATA_2 = 102
CDS_XA_2_1 = 103
CDS_XA_2_2 = 104
CDS_MIXED = 105
CDO_AUTO_CLOSE = 0x1
CDO_AUTO_EJECT = 0x2
CDO_USE_FFLAGS = 0x4
CDO_LOCK = 0x8
CDO_CHECK_TYPE = 0x10
CD_PART_MAX = 64
CD_PART_MASK = (CD_PART_MAX - 1)
GPCMD_BLANK = 0xa1
GPCMD_CLOSE_TRACK = 0x5b
GPCMD_FLUSH_CACHE = 0x35
GPCMD_FORMAT_UNIT = 0x04
GPCMD_GET_CONFIGURATION = 0x46
GPCMD_GET_EVENT_STATUS_NOTIFICATION = 0x4a
GPCMD_GET_PERFORMANCE = 0xac
GPCMD_INQUIRY = 0x12
GPCMD_LOAD_UNLOAD = 0xa6
GPCMD_MECHANISM_STATUS = 0xbd
GPCMD_MODE_SELECT_10 = 0x55
GPCMD_MODE_SENSE_10 = 0x5a
GPCMD_PAUSE_RESUME = 0x4b
GPCMD_PLAY_AUDIO_10 = 0x45
GPCMD_PLAY_AUDIO_MSF = 0x47
GPCMD_PLAY_AUDIO_TI = 0x48
GPCMD_PLAY_CD = 0xbc
GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1e
GPCMD_READ_10 = 0x28
GPCMD_READ_12 = 0xa8
GPCMD_READ_CDVD_CAPACITY = 0x25
GPCMD_READ_CD = 0xbe
GPCMD_READ_CD_MSF = 0xb9
GPCMD_READ_DISC_INFO = 0x51
GPCMD_READ_DVD_STRUCTURE = 0xad
GPCMD_READ_FORMAT_CAPACITIES = 0x23
GPCMD_READ_HEADER = 0x44
GPCMD_READ_TRACK_RZONE_INFO = 0x52
GPCMD_READ_SUBCHANNEL = 0x42
GPCMD_READ_TOC_PMA_ATIP = 0x43
GPCMD_REPAIR_RZONE_TRACK = 0x58
GPCMD_REPORT_KEY = 0xa4
GPCMD_REQUEST_SENSE = 0x03
GPCMD_RESERVE_RZONE_TRACK = 0x53
GPCMD_SCAN = 0xba
GPCMD_SEEK = 0x2b
GPCMD_SEND_DVD_STRUCTURE = 0xad
GPCMD_SEND_EVENT = 0xa2
GPCMD_SEND_KEY = 0xa3
GPCMD_SEND_OPC = 0x54
GPCMD_SET_READ_AHEAD = 0xa7
GPCMD_SET_STREAMING = 0xb6
GPCMD_START_STOP_UNIT = 0x1b
GPCMD_STOP_PLAY_SCAN = 0x4e
GPCMD_TEST_UNIT_READY = 0x00
GPCMD_VERIFY_10 = 0x2f
GPCMD_WRITE_10 = 0x2a
GPCMD_WRITE_AND_VERIFY_10 = 0x2e
GPCMD_SET_SPEED = 0xbb
GPCMD_PLAYAUDIO_TI = 0x48
GPCMD_GET_MEDIA_STATUS = 0xda
GPMODE_R_W_ERROR_PAGE = 0x01
GPMODE_WRITE_PARMS_PAGE = 0x05
GPMODE_AUDIO_CTL_PAGE = 0x0e
GPMODE_POWER_PAGE = 0x1a
GPMODE_FAULT_FAIL_PAGE = 0x1c
GPMODE_TO_PROTECT_PAGE = 0x1d
GPMODE_CAPABILITIES_PAGE = 0x2a
GPMODE_ALL_PAGES = 0x3f
GPMODE_CDROM_PAGE = 0x0d
DVD_STRUCT_PHYSICAL = 0x00
DVD_STRUCT_COPYRIGHT = 0x01
DVD_STRUCT_DISCKEY = 0x02
DVD_STRUCT_BCA = 0x03
DVD_STRUCT_MANUFACT = 0x04
DVD_LAYERS = 4
DVD_LU_SEND_AGID = 0
DVD_HOST_SEND_CHALLENGE = 1
DVD_LU_SEND_KEY1 = 2
DVD_LU_SEND_CHALLENGE = 3
DVD_HOST_SEND_KEY2 = 4
DVD_AUTH_ESTABLISHED = 5
DVD_AUTH_FAILURE = 6
DVD_LU_SEND_TITLE_KEY = 7
DVD_LU_SEND_ASF = 8
DVD_INVALIDATE_AGID = 9
DVD_LU_SEND_RPC_STATE = 10
DVD_HOST_SEND_RPC_STATE = 11
DVD_CPM_NO_COPYRIGHT = 0
DVD_CPM_COPYRIGHTED = 1
DVD_CP_SEC_NONE = 0
DVD_CP_SEC_EXIST = 1
DVD_CGMS_UNRESTRICTED = 0
DVD_CGMS_SINGLE = 2
DVD_CGMS_RESTRICTED = 3
CDROM_MAX_SLOTS = 256
# Generated by h2py from /usr/include/dlfcn.h
_DLFCN_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
__USE_ISOC99 = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506
__USE_POSIX = 1
__USE_POSIX2 = 1
__USE_POSIX199309 = 1
__USE_POSIX199506 = 1
__USE_XOPEN = 1
__USE_XOPEN_EXTENDED = 1
__USE_UNIX98 = 1
_LARGEFILE_SOURCE = 1
__USE_XOPEN2K = 1
__USE_ISOC99 = 1
__USE_XOPEN_EXTENDED = 1
__USE_LARGEFILE = 1
__USE_LARGEFILE64 = 1
__USE_FILE_OFFSET64 = 1
__USE_MISC = 1
__USE_BSD = 1
__USE_SVID = 1
__USE_GNU = 1
__USE_REENTRANT = 1
__STDC_IEC_559__ = 1
__STDC_IEC_559_COMPLEX__ = 1
__STDC_ISO_10646__ = 200009
__GNU_LIBRARY__ = 6
__GLIBC__ = 2
__GLIBC_MINOR__ = 2
# Included from sys/cdefs.h
_SYS_CDEFS_H = 1
def __PMT(args): return args
def __P(args): return args
def __PMT(args): return args
def __STRING(x): return #x
__flexarr = []
__flexarr = [0]
__flexarr = []
__flexarr = [1]
def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
def __attribute__(xyz): return
def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x)))
def __attribute_format_arg__(x): return
__USE_LARGEFILE = 1
__USE_LARGEFILE64 = 1
__USE_EXTERN_INLINES = 1
# Included from gnu/stubs.h
# Included from bits/dlfcn.h
RTLD_LAZY = 0x00001
RTLD_NOW = 0x00002
RTLD_BINDING_MASK = 0x3
RTLD_NOLOAD = 0x00004
RTLD_GLOBAL = 0x00100
RTLD_LOCAL = 0
RTLD_NODELETE = 0x01000
This diff is collapsed.
# Generated by h2py from /usr/include/sys/types.h
_SYS_TYPES_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
__USE_ISOC99 = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506
__USE_POSIX = 1
__USE_POSIX2 = 1
__USE_POSIX199309 = 1
__USE_POSIX199506 = 1
__USE_XOPEN = 1
__USE_XOPEN_EXTENDED = 1
__USE_UNIX98 = 1
_LARGEFILE_SOURCE = 1
__USE_XOPEN2K = 1
__USE_ISOC99 = 1
__USE_XOPEN_EXTENDED = 1
__USE_LARGEFILE = 1
__USE_LARGEFILE64 = 1
__USE_FILE_OFFSET64 = 1
__USE_MISC = 1
__USE_BSD = 1
__USE_SVID = 1
__USE_GNU = 1
__USE_REENTRANT = 1
__STDC_IEC_559__ = 1
__STDC_IEC_559_COMPLEX__ = 1
__STDC_ISO_10646__ = 200009
__GNU_LIBRARY__ = 6
__GLIBC__ = 2
__GLIBC_MINOR__ = 2
# Included from sys/cdefs.h
_SYS_CDEFS_H = 1
def __PMT(args): return args
def __P(args): return args
def __PMT(args): return args
def __STRING(x): return #x
__flexarr = []
__flexarr = [0]
__flexarr = []
__flexarr = [1]
def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
def __attribute__(xyz): return
def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x)))
def __attribute_format_arg__(x): return
__USE_LARGEFILE = 1
__USE_LARGEFILE64 = 1
__USE_EXTERN_INLINES = 1
# Included from gnu/stubs.h
# Included from bits/types.h
_BITS_TYPES_H = 1
__FD_SETSIZE = 1024
# Included from bits/pthreadtypes.h
_BITS_PTHREADTYPES_H = 1
# Included from bits/sched.h
SCHED_OTHER = 0
SCHED_FIFO = 1
SCHED_RR = 2
CSIGNAL = 0x000000ff
CLONE_VM = 0x00000100
CLONE_FS = 0x00000200
CLONE_FILES = 0x00000400
CLONE_SIGHAND = 0x00000800
CLONE_PID = 0x00001000
CLONE_PTRACE = 0x00002000
CLONE_VFORK = 0x00004000
__defined_schedparam = 1
# Included from time.h
_TIME_H = 1
# Included from bits/time.h
_BITS_TIME_H = 1
CLOCKS_PER_SEC = 1000000
CLOCK_REALTIME = 0
CLOCK_PROCESS_CPUTIME_ID = 2
CLOCK_THREAD_CPUTIME_ID = 3
TIMER_ABSTIME = 1
_STRUCT_TIMEVAL = 1
CLK_TCK = CLOCKS_PER_SEC
__clock_t_defined = 1
__time_t_defined = 1
__clockid_t_defined = 1
__timer_t_defined = 1
__timespec_defined = 1
def __isleap(year): return \
__BIT_TYPES_DEFINED__ = 1
# Included from endian.h
_ENDIAN_H = 1
__LITTLE_ENDIAN = 1234
__BIG_ENDIAN = 4321
__PDP_ENDIAN = 3412
# Included from bits/endian.h
__BYTE_ORDER = __LITTLE_ENDIAN
__FLOAT_WORD_ORDER = __BYTE_ORDER
LITTLE_ENDIAN = __LITTLE_ENDIAN
BIG_ENDIAN = __BIG_ENDIAN
PDP_ENDIAN = __PDP_ENDIAN
BYTE_ORDER = __BYTE_ORDER
# Included from sys/select.h
_SYS_SELECT_H = 1
# Included from bits/select.h
def __FD_ZERO(fdsp): return \
def __FD_ZERO(set): return \
# Included from bits/sigset.h
_SIGSET_H_types = 1
_SIGSET_H_fns = 1
def __sigmask(sig): return \
def __sigemptyset(set): return \
def __sigfillset(set): return \
def __sigisemptyset(set): return \
def __FDELT(d): return ((d) / __NFDBITS)
FD_SETSIZE = __FD_SETSIZE
def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp)
# Included from sys/sysmacros.h
_SYS_SYSMACROS_H = 1
def major(dev): return ((int)(((dev) >> 8) & 0xff))
def minor(dev): return ((int)((dev) & 0xff))
def major(dev): return (((dev).__val[1] >> 8) & 0xff)
def minor(dev): return ((dev).__val[1] & 0xff)
def major(dev): return (((dev).__val[0] >> 8) & 0xff)
def minor(dev): return ((dev).__val[0] & 0xff)
#! /bin/sh
case `uname` in
Linux*) ;;
*) echo Probably not on a Linux system 1>&2
exit 1;;
esac
set -v
h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
...@@ -2368,17 +2368,11 @@ class TarFile(object): ...@@ -2368,17 +2368,11 @@ class TarFile(object):
try: try:
g = grp.getgrnam(tarinfo.gname)[2] g = grp.getgrnam(tarinfo.gname)[2]
except KeyError: except KeyError:
try: g = tarinfo.gid
g = grp.getgrgid(tarinfo.gid)[2]
except KeyError:
g = os.getgid()
try: try:
u = pwd.getpwnam(tarinfo.uname)[2] u = pwd.getpwnam(tarinfo.uname)[2]
except KeyError: except KeyError:
try: u = tarinfo.uid
u = pwd.getpwuid(tarinfo.uid)[2]
except KeyError:
u = os.getuid()
try: try:
if tarinfo.issym() and hasattr(os, "lchown"): if tarinfo.issym() and hasattr(os, "lchown"):
os.lchown(targetpath, u, g) os.lchown(targetpath, u, g)
......
...@@ -377,7 +377,8 @@ class HTMLParserTolerantTestCase(TestCaseBase): ...@@ -377,7 +377,8 @@ class HTMLParserTolerantTestCase(TestCaseBase):
p = html.parser.HTMLParser() p = html.parser.HTMLParser()
self.assertEqual(p.unescape('&#bad;'),'&#bad;') self.assertEqual(p.unescape('&#bad;'),'&#bad;')
self.assertEqual(p.unescape('&'),'&') self.assertEqual(p.unescape('&'),'&')
# see #12888
self.assertEqual(p.unescape('{ ' * 1050), '{ ' * 1050)
def test_main(): def test_main():
support.run_unittest(HTMLParserTestCase, HTMLParserTolerantTestCase) support.run_unittest(HTMLParserTestCase, HTMLParserTolerantTestCase)
......
...@@ -661,6 +661,7 @@ Douglas Orr ...@@ -661,6 +661,7 @@ Douglas Orr
Michele Orrù Michele Orrù
Oleg Oshmyan Oleg Oshmyan
Denis S. Otkidach Denis S. Otkidach
Peter Otten
Michael Otteneder Michael Otteneder
R. M. Oudkerk R. M. Oudkerk
Russel Owen Russel Owen
......
...@@ -25,6 +25,12 @@ Core and Builtins ...@@ -25,6 +25,12 @@ Core and Builtins
Library Library
------- -------
- Issue #9561: distutils now reads and writes egg-info files using UTF-8,
instead of the locale encoding.
- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
more than 128 entities. Patch by Peter Otten.
- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses. - Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
- Issue #12636: IDLE reads the coding cookie when executing a Python script. - Issue #12636: IDLE reads the coding cookie when executing a Python script.
...@@ -70,6 +76,14 @@ Core and Builtins ...@@ -70,6 +76,14 @@ Core and Builtins
Library Library
------- -------
- Issue #8286: The distutils command sdist will print a warning message instead
of crashing when an invalid path is given in the manifest template.
- Issue #12841: tarfile unnecessarily checked the existence of numerical user
and group ids on extraction. If one of them did not exist the respective id
of the current user (i.e. root) was used for the file and ownership
information was lost.
- Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi - Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi
now respect a --skip-build option given to bdist. now respect a --skip-build option given to bdist.
......
...@@ -1187,12 +1187,12 @@ PyUnicode_FromFormat(const char *format, ...) ...@@ -1187,12 +1187,12 @@ PyUnicode_FromFormat(const char *format, ...)
/* Helper function for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(): /* Helper function for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString():
convert a Unicode object to a wide character string. convert a Unicode object to a wide character string.
- If w is NULL: return the number of wide characters (including the nul - If w is NULL: return the number of wide characters (including the null
character) required to convert the unicode object. Ignore size argument. character) required to convert the unicode object. Ignore size argument.
- Otherwise: return the number of wide characters (excluding the nul - Otherwise: return the number of wide characters (excluding the null
character) written into w. Write at most size wide characters (including character) written into w. Write at most size wide characters (including
the nul character). */ the null character). */
static Py_ssize_t static Py_ssize_t
unicode_aswidechar(PyUnicodeObject *unicode, unicode_aswidechar(PyUnicodeObject *unicode,
wchar_t *w, wchar_t *w,
...@@ -1240,7 +1240,7 @@ unicode_aswidechar(PyUnicodeObject *unicode, ...@@ -1240,7 +1240,7 @@ unicode_aswidechar(PyUnicodeObject *unicode,
return w - worig; return w - worig;
} }
else { else {
nchar = 1; /* nul character at the end */ nchar = 1; /* null character at the end */
while (u != uend) { while (u != uend) {
if (0xD800 <= u[0] && u[0] <= 0xDBFF if (0xD800 <= u[0] && u[0] <= 0xDBFF
&& 0xDC00 <= u[1] && u[1] <= 0xDFFF) && 0xDC00 <= u[1] && u[1] <= 0xDFFF)
...@@ -1278,7 +1278,7 @@ unicode_aswidechar(PyUnicodeObject *unicode, ...@@ -1278,7 +1278,7 @@ unicode_aswidechar(PyUnicodeObject *unicode,
return w - worig; return w - worig;
} }
else { else {
nchar = 1; /* nul character */ nchar = 1; /* null character */
while (u != uend) { while (u != uend) {
if (*u > 0xffff) if (*u > 0xffff)
nchar += 2; nchar += 2;
......
...@@ -90,4 +90,9 @@ product_codes = { ...@@ -90,4 +90,9 @@ product_codes = {
'3.2.1121':'{4f90de4a-83dd-4443-b625-ca130ff361dd}', # 3.2.1rc1 '3.2.1121':'{4f90de4a-83dd-4443-b625-ca130ff361dd}', # 3.2.1rc1
'3.2.1122':'{dc5eb04d-ff8a-4bed-8f96-23942fd59e5f}', # 3.2.1rc2 '3.2.1122':'{dc5eb04d-ff8a-4bed-8f96-23942fd59e5f}', # 3.2.1rc2
'3.2.1150':'{34b2530c-6349-4292-9dc3-60bda4aed93c}', # 3.2.1 '3.2.1150':'{34b2530c-6349-4292-9dc3-60bda4aed93c}', # 3.2.1
'3.2.2121':'{DFB29A53-ACC4-44e6-85A6-D0DA26FE8E4E}', # 3.2.2rc1
'3.2.2150':'{4CDE3168-D060-4b7c-BC74-4D8F9BB01AFD}', # 3.2.2
'3.2.3121':'{B8E8CFF7-E4C6-4a7c-9F06-BB3A8B75DDA8}', # 3.2.3rc1
'3.2.3150':'{789C9644-9F82-44d3-B4CA-AC31F46F5882}', # 3.2.3
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment