Commit 3fbf5670 authored by Matthias Klose's avatar Matthias Klose

- initial checkin

parents
Demo
Doc
Grammar
Include
LICENSE
Lib
Mac
Makefile.pre.in
Misc
Modules
Objects
PC
PCbuild
Parser
Python
README
RISCOS
Tools
aclocal.m4
config.guess
config.sub
configure.ac
install-sh
pyconfig.h.in
setup.py
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH 2TO3-2.7 "1" "January 2012" "2to3-2.7 2.7" "User Commands"
.SH NAME
2to3-2.7 \- Python2 to Python3 converter
.SH SYNOPSIS
.B 2to3
[\fIoptions\fR] \fIfile|dir \fR...
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-d\fR, \fB\-\-doctests_only\fR
Fix up doctests only
.TP
\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR
Each FIX specifies a transformation; default: all
.TP
\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR
Run 2to3 concurrently
.TP
\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR
Prevent a transformation from being run
.TP
\fB\-l\fR, \fB\-\-list\-fixes\fR
List available transformations
.TP
\fB\-p\fR, \fB\-\-print\-function\fR
Modify the grammar so that print() is a function
.TP
\fB\-v\fR, \fB\-\-verbose\fR
More verbose logging
.TP
\fB\-\-no\-diffs\fR
Don't show diffs of the refactoring
.TP
\fB\-w\fR, \fB\-\-write\fR
Write back modified files
.TP
\fB\-n\fR, \fB\-\-nobackups\fR
Don't write backups for modified files
This diff is collapsed.
Contents of the @PVER@-dbg package
-------------------------------------
For debugging python and extension modules, you may want to add the contents
of /usr/share/doc/@PVER@/gdbinit (found in the @PVER@-dev package) to your
~/.gdbinit file.
@PVER@-dbg contains two sets of packages:
- debugging symbols for the standard @PVER@ build. When this package
is installed, gdb will automatically load up the debugging symbols
from it when debugging @PVER@ or one of the included extension
modules.
- a separate @PVER@-dbg binary, configured --with-pydebug, enabling the
additional debugging code to help debug memory management problems.
For the latter, all extension modules have to be recompiled to
correctly load with an pydebug enabled build.
Debian and Ubuntu specific changes to the debug interpreter
-----------------------------------------------------------
The python2.4 and python2.5 packages in Ubuntu feisty are modified to
first look for extension modules under a different name.
normal build: foo.so
debug build: foo_d.so foo.so
This naming schema allows installation of the extension modules into
the same path (The naming is directly taken from the Windows builds
which already uses this naming scheme).
See https://wiki.ubuntu.com/PyDbgBuilds for more information.
Using the python-dbg builds
---------------------------
* Call the python-dbg or the pythonX.Y-dbg binaries instead of the
python or pythonX.Y binaries.
* Debugging a third party extension requires the availabilty of the
extension built for the debug interpreter. For an extension `foo'
make sure that the `python-foo-dbg' package is installed, or else
the interpreter falls back to the extension for the normal build.
The error on fallback is expected.
* Properties of the debug build are described in
/usr/share/doc/@PVER@/SpecialBuilds.txt.gz.
The debug interpreter is built with Py_DEBUG defined.
* From SpecialBuilds.txt: This is what is generally meant by "a debug
build" of Python. Py_DEBUG implies LLTRACE, Py_REF_DEBUG,
Py_TRACE_REFS, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled).
In addition, C assert()s are enabled (via the C way: by not defining
NDEBUG), and some routines do additional sanity checks inside
"#ifdef Py_DEBUG" blocks.
@PVER@-dbg binary: package-name-doesnt-match-sonames
@PVER@-dbg binary: non-dev-pkg-with-shlib-symlink
# no, it's not unusual
@PVER@-dbg binary: unusual-interpreter
# just the gdb debug file
@PVER@-dbg binary: python-script-but-no-python-dep
# pointless lintian ...
@PVER@-dbg binary: hardening-no-fortify-functions
@PVER@-dbg binary: command-with-path-in-maintainer-script
#! /bin/sh
set -e
if [ "$1" = configure ]; then
files=$(dpkg -L lib@PVER@-dbg@HOST_QUAL@ | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p')
if [ -n "$files" ]; then
/usr/bin/@PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
/usr/bin/@PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
fi
else
echo >&2 "@PVER@-dbg: can't get files for byte-compilation"
fi
fi
#DEBHELPER#
exit 0
#! /bin/sh
set -e
case "$1" in
remove)
rm -f /usr/lib/debug/usr/bin/@PVER@-gdb.py[co]
rm -f /usr/lib/debug/usr/lib/lib@PVER@.so.1.0-gdb.py[co]
dpkg -L lib@PVER@-dbg@HOST_QUAL@ \
| awk '/\.py$/ {print $0"c\n" $0"o"}' \
| xargs -r rm -f >&2
;;
upgrade)
dpkg -L lib@PVER@-dbg@HOST_QUAL@ \
| awk '/\.py$/ {print $0"c\n" $0"o"}' \
| xargs -r rm -f >&2
;;
deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
Document: @PVER@-api
Title: Python/C API Reference Manual (v@VER@)
Author: Guido van Rossum
Abstract: This manual documents the API used by C (or C++) programmers who
want to write extension modules or embed Python. It is a
companion to *Extending and Embedding the Python Interpreter*,
which describes the general principles of extension writing but
does not document the API functions in detail.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/c-api/index.html
Files: /usr/share/doc/@PVER@/html/c-api/*.html
Document: @PVER@-dist
Title: Distributing Python Modules (v@VER@)
Author: Greg Ward
Abstract: This document describes the Python Distribution Utilities
(``Distutils'') from the module developer's point-of-view, describing
how to use the Distutils to make Python modules and extensions easily
available to a wider audience with very little overhead for
build/release/install mechanics.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/distutils/index.html
Files: /usr/share/doc/@PVER@/html/distutils/*.html
Document: @PVER@-ext
Title: Extending and Embedding the Python Interpreter (v@VER@)
Author: Guido van Rossum
Abstract: This document describes how to write modules in C or C++ to extend
the Python interpreter with new modules. Those modules can define
new functions but also new object types and their methods. The
document also describes how to embed the Python interpreter in
another application, for use as an extension language. Finally,
it shows how to compile and link extension modules so that they
can be loaded dynamically (at run time) into the interpreter, if
the underlying operating system supports this feature.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/extending/index.html
Files: /usr/share/doc/@PVER@/html/extending/*.html
Document: @PVER@-inst
Title: Installing Python Modules (v@VER@)
Author: Greg Ward
Abstract: This document describes the Python Distribution Utilities
(``Distutils'') from the end-user's point-of-view, describing how to
extend the capabilities of a standard Python installation by building
and installing third-party Python modules and extensions.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/install/index.html
Files: /usr/share/doc/@PVER@/html/install/*.html
Document: @PVER@-lib
Title: Python Library Reference (v@VER@)
Author: Guido van Rossum
Abstract: This library reference manual documents Python's standard library,
as well as many optional library modules (which may or may not be
available, depending on whether the underlying platform supports
them and on the configuration choices made at compile time). It
also documents the standard types of the language and its built-in
functions and exceptions, many of which are not or incompletely
documented in the Reference Manual.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/library/index.html
Files: /usr/share/doc/@PVER@/html/library/*.html
Document: @PVER@-new
Title: What's new in Python @VER@
Author: A.M. Kuchling
Abstract: This documents lists new features and changes worth mentioning
in Python @VER@.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html
Files: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html
Document: @PVER@-ref
Title: Python Reference Manual (v@VER@)
Author: Guido van Rossum
Abstract: This reference manual describes the syntax and "core semantics" of
the language. It is terse, but attempts to be exact and complete.
The semantics of non-essential built-in object types and of the
built-in functions and modules are described in the *Python
Library Reference*. For an informal introduction to the language,
see the *Python Tutorial*. For C or C++ programmers, two
additional manuals exist: *Extending and Embedding the Python
Interpreter* describes the high-level picture of how to write a
Python extension module, and the *Python/C API Reference Manual*
describes the interfaces available to C/C++ programmers in detail.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/reference/index.html
Files: /usr/share/doc/@PVER@/html/reference/*.html
Document: @PVER@-tut
Title: Python Tutorial (v@VER@)
Author: Guido van Rossum, Fred L. Drake, Jr., editor
Abstract: This tutorial introduces the reader informally to the basic
concepts and features of the Python language and system. It helps
to have a Python interpreter handy for hands-on experience, but
all examples are self-contained, so the tutorial can be read
off-line as well.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/@PVER@/html/tutorial/index.html
Files: /usr/share/doc/@PVER@/html/tutorial/*.html
# this is referenced by the html docs
@PVER@-doc binary: extra-license-file
# don't care about permissions of the example files
@PVER@-examples binary: executable-not-elf-or-script
Contents of the @PVER@-minimal package
-----------------------------------------
@PVER@-minimal consists of a minimum set of modules which may be needed
for python scripts used during the boot process. If other packages
are needed in these scripts, don't work around the missing module, but
file a bug report against this package. The modules in this package
are:
__builtin__ builtin
__future__ module
_abcoll module
_bisect extension
_bytesio extension
_codecs builtin
_collections extension
_fileio extension
_functools extension
_hashlib extensionx
_heapq extension
_io extension
_locale extension
_md5 extension
_random extension
_sha extension
_sha256 extension
_sha512 extension
_socket extension
_sre builtin
_ssl extensionx
_struct extension
_symtable builtin
_sysconfigdata module
_types builtin
_warnings builtin
_weakref extension
_weakrefset module
abc module
atexit module
ConfigParser module
StringIO module
UserDict module
cPickle extension
cStringIO extension
array extension
base64 module
binascii extension
bisect module
cmath extension
calendar module
codecs module
collections module
compileall module
contextlib module
copy module
copy_reg module
datetime extension
dis module
encodings package
errno builtin
exceptions builtin
fcntl extension
fnmatch module
functools module
gc builtin
genericpath module
getopt module
glob module
grp extension
hashlib module
heapq module
imp builtin
inspect module
io module
itertools extension
keyword module
linecache module
locale module
logging package
marshal builtin
math extension
md5 module
opcode module
operator extension
optparse module
os module
pickle module
platform module
popen2 module
posix builtin
posixpath module
pkgutil module
pwd builtin
py_compile module
random module
re module
repr module
runpy module
select extension
sha module
shutil module
signal builtin
socket module
spwd extension
sre module
sre_compile module
sre_constants module
sre_parse module
ssl module
stat module
string module
strop extension
struct module
subprocess module
sys builtin
syslog extension
sysconfig module
tempfile module
textwrap module
time extension
token module
thread builtin
token module
tokenize module
traceback module
types module
unicodedata extension
weakref module
warnings module
zipimport extension
zlib extension
Included are as well the codecs and stringprep modules, and the encodings
modules for all encodings except the multibyte encodings and the bz2 codec.
The following modules are excluded, their import is guarded from the
importing module:
Used in Excluded
------------ ------------------------------------
os nt ntpath os2 os2emxpath mac macpath
riscos riscospath riscosenviron
optparse gettext
pickle doctest
subprocess threading
This list was derived by looking at the modules in the perl-base package,
then adding python specific "core modules".
TODO's
------
- time.strptime cannot be used. The required _strptime module is not
included in the -minimal package yet. _strptime, locale, _locale and
calendar have to be added.
- modules used very often in the testsuite: copy, cPickle, operator.
@PVER@-minimal binary: command-with-path-in-maintainer-script
#! /bin/sh
set -e
if [ ! -f /etc/@PVER@/sitecustomize.py ]; then
cat <<-EOF
# Empty sitecustomize.py to avoid a dangling symlink
EOF
fi
case "$1" in
configure)
# Create empty directories in /usr/local
if [ ! -e /usr/local/lib/@PVER@ ]; then
mkdir -p /usr/local/lib/@PVER@ 2> /dev/null || true
chmod 2775 /usr/local/lib/@PVER@ 2> /dev/null || true
chown root:staff /usr/local/lib/@PVER@ 2> /dev/null || true
fi
localsite=/usr/local/lib/@PVER@/dist-packages
if [ ! -e $localsite ]; then
mkdir -p $localsite 2> /dev/null || true
chmod 2775 $localsite 2> /dev/null || true
chown root:staff $localsite 2> /dev/null || true
fi
if which update-binfmts >/dev/null; then
update-binfmts --import @PVER@
fi
;;
esac
if [ "$1" = configure ]; then
if ls -L /usr/lib/@PVER@/sitecustomize.py >/dev/null 2>&1; then
filt='cat'
else
filt='fgrep -v sitecustomize.py'
fi
files=$(dpkg -L lib@PVER@-minimal@HOST_QUAL@ \
| sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p' | $filt)
if [ -n "$files" ]; then
/usr/bin/@PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
/usr/bin/@PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
fi
else
echo >&2 "@PVER@-minimal: can't get files for byte-compilation"
fi
bc=no
if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.7-9 \
|| [ -f /var/lib/python/@PVER@_installed ]; then
bc=yes
fi
if grep -sq '^unsupported-versions[^#]*@PVER@' /usr/share/python/debian_defaults
then
# FIXME: byte compile anyway?
bc=no
fi
if [ "$bc" = yes ]; then
# new installation or installation of first version with hook support
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime @PVER@..."
fi
version=$(dpkg -s @PVER@-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall @PVER@ "$2" "$version"
done
if [ -f /var/lib/python/@PVER@_installed ]; then
rm -f /var/lib/python/@PVER@_installed
rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
fi
fi
fi
#DEBHELPER#
exit 0
#! /bin/sh
set -e
if [ "$1" = "remove" ]; then
if [ -f /var/lib/python/@PVER@_installed ]; then
rm -f /var/lib/python/@PVER@_installed
rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
fi
fi
if [ "$1" = "purge" ]; then
for d in `find /usr/lib/@PVER@ -depth -type d -empty 2> /dev/null`; do \
while rmdir $d 2> /dev/null; do d=`dirname $d`; done; \
done
fi
#DEBHELPER#
exit 0
#!/bin/sh
set -e
syssite=/usr/lib/@PVER@/site-packages
oldsite=/usr/lib/@PVER@/old-site-packages
localsite=/usr/local/lib/@PVER@/dist-packages
syslink=../../${localsite#/usr/*}
case "$1" in
install)
if [ -z "$2" ] && [ -d $syssite ] && [ ! -h $syssite ]; then
echo "new installation of @PVER@-minimal; $syssite is a directory"
echo "which is expected a symlink to $localsite."
echo "please find the package shipping files in $syssite and"
echo "file a bug report to ship these in /usr/lib/@PVER@/dist-packages instead"
echo "aborting installation of @PVER@-minimal"
exit 1
fi
# remember newly installed runtime
mkdir -p /var/lib/python
touch /var/lib/python/@PVER@_installed
;;
upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
#! /bin/sh
set -e
case "$1" in
remove)
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Unlinking and removing bytecode for runtime @PVER@"
fi
for hook in /usr/share/python/runtime.d/*.rtremove; do
[ -x $hook ] || continue
$hook rtremove @PVER@ || continue
done
if which update-binfmts >/dev/null; then
update-binfmts --package @PVER@ --remove @PVER@ /usr/bin/@PVER@
fi
localsite=/usr/local/lib/@PVER@/dist-packages
[ -d $localsite ] && rmdir $localsite 2>/dev/null || true
[ -d $(dirname $localsite) ] \
&& rmdir $(dirname $localsite) 2>/dev/null || true
;;
upgrade)
;;
deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
[Desktop Entry]
Name=Python (v@VER@)
Comment=Python Interpreter (v@VER@)
Exec=/usr/bin/@PVER@
Icon=/usr/share/pixmaps/@PVER@.xpm
Terminal=true
Type=Application
Categories=Development;
StartupNotify=true
NoDisplay=true
# idlelib images
@PVER@ binary: image-file-in-usr-lib
# yes, we have to
@PVER@ binary: depends-on-python-minimal
@PVER@ binary: desktop-command-not-in-package
@PVER@ binary: menu-command-not-in-package
# license file referred by the standard library
@PVER@ binary: extra-license-file
# no, not useless
@PVER@ binary: manpage-has-useless-whatis-entry
@PVER@ binary: command-with-path-in-maintainer-script
#! /bin/sh
set -e