Commit Graph

631 Commits

Author SHA1 Message Date
Shivank98 e3d1455fe4 Update opcode.h header comment to mention the source data file (GH-9935)
This is intended to help code explorers find out more about what's defined there.
2018-10-18 14:53:18 -05:00
Ned Deily 9d6d06e806
pypi.python.org -> pypi.org (GH-7613) 2018-06-11 00:45:50 -04:00
Christian Tismer ea62ce7f4f bpo-33738: Fix macros which contradict PEP 384 (GH-7477)
During development of the limited API support for PySide,
we saw an error in a macro that accessed a type field.

This patch fixes the 7 errors in the Python headers.
Macros which were not written as capitals were implemented
as function.

To do the necessary analysis again, a script was included that
parses all headers and looks for "->tp_" in serctions which can
be reached with active limited API.

It is easily possible to call this script as a test.

Error listing:

../../Include/objimpl.h:243
#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
    (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
Action: commented only

../../Include/objimpl.h:362
#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
Action: commented only

../../Include/objimpl.h:364
#define PyObject_GET_WEAKREFS_LISTPTR(o) \
    ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
Action: commented only

../../Include/pyerrors.h:143
#define PyExceptionClass_Name(x) \
     ((char *)(((PyTypeObject*)(x))->tp_name))
Action: implemented function

../../Include/abstract.h:593
#define PyIter_Check(obj) \
    ((obj)->ob_type->tp_iternext != NULL && \
     (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
Action: implemented function

../../Include/abstract.h:713
#define PyIndex_Check(obj)                              \
    ((obj)->ob_type->tp_as_number != NULL &&            \
     (obj)->ob_type->tp_as_number->nb_index != NULL)
Action: implemented function

../../Include/abstract.h:924
#define PySequence_ITEM(o, i)\
    ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
Action: commented only
2018-06-09 14:32:25 -04:00
Benjamin Peterson b8c0845fee
remove hg support from patchcheck (GH-7440) 2018-06-05 22:40:12 -07:00
Brett Cannon a8c342465b
bpo-25427: Remove pyvenv (GH-5962) 2018-04-20 14:15:40 -07:00
Miro Hrončok 5affd5c29e bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)
Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
2018-03-13 05:56:43 -04:00
Antoine Pitrou d7687eb4b6
bpo-31355: Travis-CI: re-enable macOS job (#5858)
The long build queues that plagued macOS builds on Travis seem to be
a thing of the past now.
2018-02-27 21:40:37 +01:00
Victor Stinner dc6b9462c0
bpo-20361: Remove workaround for a now fixed bug (#5283)
"python3 -bb -Wd" now works as expected:
"python3 -bb -Wd -Werror::BytesWarning" is no more needed.
2018-01-23 13:30:53 +01:00
Victor Stinner fe2d5babba
bpo-32159: Remove tools for CVS and Subversion (#4615)
CPython migrated from CVS to Subversion, to Mercurial, and then to
Git. CVS and Subversion are not more used to develop CPython.

* platform module: drop support for sys.subversion. The
  sys.subversion attribute has been removed in Python 3.3.
* Remove Misc/svnmap.txt
* Remove Tools/scripts/svneol.py
* Remove Tools/scripts/treesync.py
2017-11-28 22:29:32 +01:00
Victor Stinner 696b501cd1
bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)
* distutils.config: Use the PyPIRCCommand.realm attribute if set
* turtledemo: wait until macOS osascript command completes to not
  create a zombie process
* Tools/scripts/treesync.py: declare 'default_answer' and
  'create_files' as globals to modify them with the command line
  arguments. Previously, -y, -n, -f and -a options had no effect.

flake8 warning: "F841 local variable 'p' is assigned to but never
used".
2017-11-28 15:30:32 +01:00
Victor Stinner 87d332dcdb bpo-31810: Add smelly.py to check exported symbols (#4057)
* Add Tools/scripts/smelly.py: script checking if all symbols
  exported by libpython start with "Py" or "_Py".
* Modify "make smelly" to run smelly.py: the command now fails with a
  non-zero exit code if libpython leaks a "smelly" symbol.
* Travis CI now runs "make smelly"
2017-10-24 01:29:53 -07:00
Antoine Pitrou b091bec824 bpo-31536: Avoid wholesale rebuild after `make regen-all` (#3678)
* bpo-31536: Avoid wholesale rebuild after `make regen-all`

* Add NEWS
2017-09-20 14:57:56 -07:00
Antoine Pitrou d39dbf4cf1 Simplify run_tests.py (#3482) 2017-09-10 20:32:13 +02:00
Benjamin Peterson 069306312a remove IRIX support (closes bpo-31341) (#3310)
See PEP 11.
2017-09-04 16:36:05 -07:00
Victor Stinner 4a347ce426 bpo-31221: patchcheck ignores external libraries (#3109)
Tools/scripts/patchcheck.py now ignores changes in directories which
are copies of external libraries:

* Modules/_ctypes/libffi_msvc/
* Modules/_ctypes/libffi_osx/
* Modules/_decimal/libmpdec/
* Modules/expat/
* Modules/zlib/

Drop also support for Mercurial, since CPython migrated to Git.

Exclude also libmpdec

patchcheck: exclude also libffi_osx and libffi_msvc
2017-08-17 16:29:15 +02:00
Antoine Pitrou 1ba9469e9f Update `make patchcheck` for blurb and NEWS.d (#2381) 2017-06-25 11:21:49 +10:00
Brett Cannon 70cb1875bb Check the whitespace of pull requests on Travis (GH-2367) 2017-06-24 16:51:23 -07:00
Jon Dufresne 3972628de3 bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)
* Replaced list(<generator expression>) with list comprehension
* Replaced dict(<generator expression>) with dict comprehension
* Replaced set(<list literal>) with set literal
* Replaced builtin func(<list comprehension>) with func(<generator
  expression>) when supported (e.g. any(), all(), tuple(), min(), &
  max())
2017-05-18 07:35:54 -07:00
Mariatta 58f3c9dc8f bpo-30109: Fix reindent.py (GH-1207)
Skip the file if it has bad encoding.
2017-04-19 22:59:20 -07:00
Nick Coghlan 2abfdf5a81 Issue #29798: Handle git worktree in patchcheck (#1058)
The original attempted fix missed an `isdir()` call in
`get_base_branch()`.
2017-04-09 18:33:03 +10:00
Nick Coghlan 6a6d090612 bpo-29798: Handle git worktree in `make patchcheck` (#629)
In git worktree directories, `.git` is a configuration
file rather than a subdirectory
2017-03-12 19:37:09 +10:00
Nick Coghlan 482f7a274f bpo-29656: Handle PR branches in 'make patchcheck' (#302) 2017-03-12 13:19:08 +10:00
Victor Stinner 213cc388c7 Reintroduce Python2 support in generate_opcode_h.py
Issue #28821.

Add also a message to show that the command did something :-)
2016-11-28 18:13:52 +01:00
Victor Stinner 6193ecd779 Fix a ResourceWarning in generate_opcode_h.py
Use a context manager to close the Python file. Replace also open() with
tokenize.open() to handle coding cookie if any in Lib/opcode.py.
2016-11-25 11:59:52 +01:00
Victor Stinner 3e56c23e7d regrtest: add -u for unbuffered stdout/stderr 2016-09-21 17:12:50 +02:00
Berker Peksag 1cd53f6100 Issue #26830: Refactor Tools/scripts/google.py
Patch by Francisco Couzo.
2016-09-14 10:59:27 +03:00
Martin Panter bdb847ae99 Issue #27952: Merge fixcid.py from 3.5 2016-09-11 10:06:38 +00:00
Martin Panter b7665386bc Issue #27952: Get fixcid.py working with the re module 2016-09-11 09:32:26 +00:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) a68c1bca7b Remove legacy "from __future__ import with_statement" lines. 2016-09-08 13:47:41 -07:00
R David Murray 44b548dda8 #27364: fix "incorrect" uses of escape character in the stdlib.
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
2016-09-08 13:59:53 -04:00
Ned Deily 622b2f6ec9 Issue #24225: Fix additional renamed module references. 2016-06-03 17:50:44 -07:00
Serhiy Storchaka ccd047ea4b Removed unused imports. 2016-04-25 00:12:32 +03:00
Serhiy Storchaka a051bf3afb Issue #26581: Use the first coding cookie on a line, not the last one. 2016-03-20 23:47:48 +02:00
Serhiy Storchaka e431d3c9aa Issue #26581: Use the first coding cookie on a line, not the last one. 2016-03-20 23:36:29 +02:00
Serhiy Storchaka 885bdc4946 Issue #25985: sys.version_info is now used instead of sys.version
to format short Python version.
2016-02-11 13:10:36 +02:00
Martin Panter b4ce1fc31b Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure 2015-11-30 03:18:29 +00:00
Terry Jan Reedy 4df429618d Merge with 3.5 2015-10-30 19:26:03 -04:00
Terry Jan Reedy 3f209b63f5 Merge with 3.4 2015-10-30 19:25:50 -04:00
Terry Jan Reedy a05e7f6743 Issue #25505: Remove unused buggy method. 2015-10-30 19:25:34 -04:00
Brett Cannon dd1e670758 Fix a variable typo by switching to a f-string. 2015-10-26 17:11:04 -07:00
Brett Cannon f1c47e4751 Issue #25154: Make the file argument apply to the print function and
not str.format call.
2015-10-25 17:40:31 -07:00
Brett Cannon 9b63868f77 Issue #25154: Deprecate the pyvenv script.
This was done so as to move users to `python3 -m venv` which prevents
confusion over which Python interpreter will be used in the virtual
environment when more than one is installed.
2015-10-16 15:14:27 -07:00
Yury Selivanov f488fb422a Issue #19235: Add new RecursionError exception. Patch by Georg Brandl. 2015-07-03 01:04:23 -04:00
Serhiy Storchaka 3028c955fa Issue #24288: Generated opcode.h no longer contains trailing spaces and tabs. 2015-05-27 21:31:33 +03:00
Serhiy Storchaka ba9ac5b5c4 Issue #16261: Converted some bare except statements to except statements
with specified exception type.  Original patch by Ramchandra Apte.
2015-05-20 10:33:40 +03:00
Serhiy Storchaka d2a694c1be Issue #23330: h2py now supports arbitrary filenames in #include. 2015-05-03 15:36:37 +03:00
Serhiy Storchaka b9c04db64f Issue #23330: h2py now supports arbitrary filenames in #include. 2015-05-03 15:35:14 +03:00
Christian Heimes c314e28766 Issue #24031: make patchcheck now supports git checkouts, too. 2015-04-23 11:25:41 +02:00
Christian Heimes d98c6773fa Issue #24031: make patchcheck now supports git checkouts, too. 2015-04-23 11:24:14 +02:00
Serhiy Storchaka 45ec3288d0 Removed trailing whitespaces in miscalenous files. 2015-04-03 19:42:32 +03:00
Steve Dower 17be514d0a Closes #23437: Make user scripts directory versioned on Windows (patch by pmoore) 2015-02-14 09:50:59 -08:00
Benjamin Peterson 864d57c244 merge 3.4 (#23130) 2014-12-30 10:09:30 -06:00
Benjamin Peterson 3cd1af51f6 merge 3.3 (#23130) 2014-12-30 10:09:17 -06:00
Benjamin Peterson 9582b33933 merge 3.2 (#23130) 2014-12-30 10:08:52 -06:00
Benjamin Peterson 44e4b98ff0 delete old ftpmirror script, which now has security bugs (closes #23130) 2014-12-30 10:08:16 -06:00
Serhiy Storchaka 7a1104d292 Issue #22924: Scripts gprof2html.py and highlight.py now use html.escape()
instead of deperecated cgi.escape().  Original patch by Raymond Hettinger.
2014-12-01 10:50:33 +02:00
Serhiy Storchaka cac7ec485b Issue #22924: Scripts gprof2html.py and highlight.py now use html.escape()
instead of deperecated cgi.escape().  Original patch by Raymond Hettinger.
2014-12-01 10:51:37 +02:00
Georg Brandl 6e868b7bef merge with 3.4 2014-10-19 11:55:15 +02:00
Georg Brandl 24f0717b82 Closes #22663: patchcheck: only modify text files under Doc/ 2014-10-19 11:54:08 +02:00
Zachary Ware 51af1deb32 Merge removal of Tools/scripts/pydocgui.pyw 2014-07-16 13:30:27 -05:00
Zachary Ware 52b2bc0369 Remove Tools/scripts/pydocgui.pyw.
pydoc.gui was removed over 3 years ago (#10818), this script has been
utterly bereft of worth since then.
2014-07-16 13:24:55 -05:00
Serhiy Storchaka 992334127e Issue #18974: Tools/scripts/diff.py now uses argparse instead of optparse. 2014-07-15 13:23:58 +03:00
Berker Peksag 6960c1a94b Issue #21906: Merge from 3.4. 2014-07-11 20:44:39 +03:00
Berker Peksag 7aee3ecd57 Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
Patch by Zachary Ware.
2014-07-11 20:42:18 +03:00
Zachary Ware 69d2d013f1 Issue #21907: Exit with the correct return code 2014-07-07 15:07:46 -05:00
Zachary Ware e12fa65744 Issue #21907: Improved the batch scripts provided for building Python.
The user-facing scripts in PCbuild have been updated to be easier to use
and the buildbot scripts in Tools\buildbot have been updated to use the
user-facing scripts in PCbuild wherever possible.
2014-07-07 13:39:59 -05:00
Antoine Pitrou a171979a19 Remove a workaround for fixed issue #20355. 2014-04-29 00:58:02 +02:00
Ned Deily 7fae75a415 Issue #17861: Allow generate_opcode_h to run with a system Python 2.5.
Patch by David Bolen.
2014-04-28 13:46:36 -07:00
Thomas Wouters 67d8dc1f58 Fix Tools/scripts/generate_opcode_h.py from issue #17861 to work correctly
when building in a separate object tree. More people should build this way.
This may still fail if the source is unwritable, I haven't tested that yet.
2014-04-17 01:13:29 +02:00
Kushal Das 02d23a212a Closes Issue 17861: Autogenerate Include/opcode.h from opcode.py.
It includes required changes in Makefile.pre.in and configure.ac
among other files.
2014-04-15 23:50:06 +05:30
Serhiy Storchaka eb44b2d9e8 Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
Patch by Arfrever Frehtes Taifersar Arahesis.
2014-02-24 14:00:38 +02:00
Serhiy Storchaka 20f8728bf0 Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
Patch by Arfrever Frehtes Taifersar Arahesis.
2014-02-24 13:57:00 +02:00
Serhiy Storchaka 8f8ec92de8 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang lines in the unittestgui and checkpip scripts.
2014-01-16 17:33:23 +02:00
Serhiy Storchaka b992a0e102 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang line to use python3 executable in the unittestgui script.
2014-01-16 17:15:49 +02:00
Serhiy Storchaka f4c9664a24 Fixed the serve.py script.
The application object must return an iterable yielding bytestrings.
2014-01-11 11:53:13 +02:00
Serhiy Storchaka 02d5db2777 Fixed the serve.py script.
The application object must return an iterable yielding bytestrings.
2014-01-11 11:52:20 +02:00
Serhiy Storchaka 7282ff6d5b Issue #18960: Fix bugs with Python source code encoding in the second line.
* The first line of Python script could be executed twice when the source
encoding (not equal to 'utf-8') was specified on the second line.

* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment.

* As a consequence, 'python -x' works now again with files with the source
encoding declarations specified on the second file, and can be used again
to make Python batch files on Windows.

* The tokenize module now ignore the source encoding declaration on the second
line if the first line contains anything except a comment.

* IDLE now ignores the source encoding declaration on the second line if the
first line contains anything except a comment.

* 2to3 and the findnocoding.py script now ignore the source encoding
declaration on the second line if the first line contains anything except
a comment.
2014-01-09 18:41:59 +02:00
Serhiy Storchaka 768c16ce02 Issue #18960: Fix bugs with Python source code encoding in the second line.
* The first line of Python script could be executed twice when the source
encoding (not equal to 'utf-8') was specified on the second line.

* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment.

* As a consequence, 'python -x' works now again with files with the source
encoding declarations specified on the second file, and can be used again
to make Python batch files on Windows.

* The tokenize module now ignore the source encoding declaration on the second
line if the first line contains anything except a comment.

* IDLE now ignores the source encoding declaration on the second line if the
first line contains anything except a comment.

* 2to3 and the findnocoding.py script now ignore the source encoding
declaration on the second line if the first line contains anything except
a comment.
2014-01-09 18:36:09 +02:00
Serhiy Storchaka 6787a3806e Issue #15204: Deprecated the 'U' mode in file-like objects. 2013-11-23 22:12:06 +02:00
Nick Coghlan d0cf0635b3 Close #19406: Initial implementation of ensurepip
Patch by Donald Stufft and Nick Coghlan
2013-11-11 22:11:55 +10:00
Serhiy Storchaka 935349406a Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:57:00 +03:00
Serhiy Storchaka dafea85190 Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:51:56 +03:00
Ezio Melotti d640fe2af5 #18803: merge with 3.3. 2013-08-26 01:33:30 +03:00
Ezio Melotti 7c4a7e6f3c #18803: fix more typos. Patch by Févry Thibault. 2013-08-26 01:32:56 +03:00
Andrew Kuchling f3a2e9f937 #18445: update Tools/scripts/README.
- document abitype.py, analyze_dxp.py, get-remote-certificate.py,
  import_diagnostics.py, parse_html5_entities.py.
- remove redemo.py which was moved to Tools/Demo.
- sort list into alphabetical order

Patch by Seydou Dia.
2013-08-18 20:04:34 -04:00
Andrew Kuchling d36b515954 #18445: change permissions on some scripts to executable 2013-08-18 19:48:12 -04:00
Terry Jan Reedy db53ad7cf1 Merge with 3.3 2013-07-21 20:58:15 -04:00
Terry Jan Reedy 6e2711b345 Issue #18439: Make patchcheck work on Windows for ACKS, NEWS. 2013-07-21 20:57:44 -04:00
Brett Cannon 53e600c24a Issue #17177: update checkpyc to stop using imp 2013-06-15 18:10:18 -04:00
Serhiy Storchaka 369d05a616 Fix some bugs in Tools/scripts/abitype.py. 2013-05-17 10:17:43 +03:00
Serhiy Storchaka e67f8e7419 Fix some bugs in Tools/scripts/abitype.py. 2013-05-17 10:18:40 +03:00
Ned Deily dbccf6ad4c Issue #17801: fix shebang line of gprof2html.py 2013-04-20 14:08:16 -07:00
Ned Deily 67804e9838 Issue #17801: fix shebang line of gprof2html.py 2013-04-20 14:07:43 -07:00
Victor Stinner 765531d2d0 Issue #17516: use comment syntax for comments, instead of multiline string 2013-03-26 01:11:54 +01:00
doko@python.org 6951fea3ab - Issue #17029: Let h2py search the multiarch system include directory. 2013-01-25 13:20:46 +01:00
doko@python.org 0c77bf757f - Issue #17029: Let h2py search the multiarch system include directory. 2013-01-25 13:19:35 +01:00
doko@python.org 3e6e2ac31d - Issue #17029: Let h2py search the multiarch system include directory. 2013-01-25 13:12:29 +01:00
Serhiy Storchaka 1829bb4591 Issue #15539: Fix a backup file creation in pindent.py on Windows. 2013-01-11 22:21:45 +02:00
Serhiy Storchaka b4fb2e2aac Issue #15539: Fix a backup file creation in pindent.py on Windows. 2013-01-11 22:19:07 +02:00
Serhiy Storchaka a3a01b6ac3 Issue #15539: Fix a backup file creation in pindent.py on Windows. 2013-01-11 22:18:17 +02:00