Commit Graph

1109 Commits

Author SHA1 Message Date
Hugo van Kemenade
2cf510e596
Improve handling of file resources (#3577)
Improve handling of file resources
2019-11-01 12:07:53 +02:00
Hugo
37f492cbbc Add support for Fedora 31 2019-10-31 12:35:26 +02:00
Andrew Murray
b8023838cc Added GHA [ci skip] 2019-10-29 19:07:45 +11:00
Hugo
ef0fa7a651 Remove soon-EOL Fedora 29 2019-10-26 17:10:07 +11:00
Hugo
a80a45219f Pillow 6.2.1 is the last to support Python 2.7 2019-10-20 23:06:22 +03:00
Hugo
6f3464e1cb Add release notes for Pillow 6.2.1 2019-10-20 16:31:09 +03:00
Andrew Murray
aaf9720c58 Updated CI target Python versions for macOS [ci skip] 2019-10-20 21:00:26 +11:00
Hugo
2ab518edcb Add support for Python 3.8 2019-10-15 12:44:21 +03:00
Jon Dufresne
4cd4adddc3 Improve handling of file resources
Follow Python's file object semantics. User code is responsible for
closing resources (usually through a context manager) in a deterministic
way.

To achieve this, remove __del__ functions. These functions used to
closed open file handlers in an attempt to silence Python
ResourceWarnings. However, using __del__ has the following drawbacks:

- __del__ isn't called until the object's reference count reaches 0.
  Therefore, resource handlers remain open or in use longer than
  necessary.

- The __del__ method isn't guaranteed to execute on system exit. See the
  Python documentation:

  https://docs.python.org/3/reference/datamodel.html#object.__del__

  > It is not guaranteed that __del__() methods are called for objects
  > that still exist when the interpreter exits.

- Exceptions that occur inside __del__ are ignored instead of raised.
  This has the potential of hiding bugs. This is also in the Python
  documentation:

  > Warning: Due to the precarious circumstances under which __del__()
  > methods are invoked, exceptions that occur during their execution
  > are ignored, and a warning is printed to sys.stderr instead.

Instead, always close resource handlers when they are no longer in use.
This will close the file handler at a specified point in the user's code
and not wait until the interpreter chooses to. It is always guaranteed
to run. And, if an exception occurs while closing the file handler, the
bug will not be ignored.

Now, when code receives a ResourceWarning, it will highlight an area
that is mishandling resources. It should not simply be silenced, but
fixed by closing resources with a context manager.

All warnings that were emitted during tests have been cleaned up. To
enable warnings, I passed the `-Wa` CLI option to Python. This exposed
some mishandling of resources in ImageFile.__init__() and
SpiderImagePlugin.loadImageSeries(), they too were fixed.
2019-10-12 08:27:17 -07:00
Andrew Murray
a8c07e3d5f Added orientation note [ci skip] 2019-10-11 22:40:31 +11:00
Andrew Murray
fab0205abc Updated documentation [ci skip] 2019-10-08 21:12:15 +11:00
Andrew Murray
e8cf9a6bc1
Merge pull request #4108 from hugovk/rm-deprecated-qt
Drop support for EOL PyQt4 and PySide
2019-10-07 12:35:56 +11:00
Hugo van Kemenade
ac563f77ad
Merge pull request #4118 from radarhere/backticks
Use double backticks
2019-10-06 12:03:49 +03:00
Andrew Murray
e0d67a1f9f Use double backticks [ci skip] 2019-10-06 14:39:10 +11:00
Andrew Murray
ecb3a30487 Clarified documentation [ci skip] 2019-10-06 13:52:58 +11:00
Andrew Murray
732eb7223f
Merge branch 'master' into rm-deprecated-qt 2019-10-06 13:35:38 +11:00
Andrew Murray
d6ae0a99a7 Removed deprecated setting of TIFF image sizes 2019-10-03 22:12:28 +10:00
Hugo van Kemenade
7821b34924
Merge branch 'master' into rm-deprecated-qt 2019-10-03 14:14:00 +03:00
Hugo
f898ccbaf8 Remove deprecated PILLOW_VERSION 2019-10-01 14:43:15 +03:00
Hugo
f0a87e25a4 Drop support for EOL PyQt4 and PySide 2019-09-30 17:58:31 +03:00
Andrew Murray
f85258a167 Documented #3950 [ci skip] 2019-09-28 16:43:54 +10:00
Hugo van Kemenade
310d2c9005
Add option to capture all monitors on Windows (#3950)
Add option to capture all monitors on Windows
2019-09-27 08:47:55 +03:00
nulano
3c311f5619 add version added [ci skip] 2019-09-27 00:58:32 +02:00
Andrew Murray
ffe1965b74 Documented #4086 [ci skip] 2019-09-26 19:30:32 +10:00
nulano
6a2d8f8da0 rename parameter, add note to docs 2019-09-20 17:35:08 +02:00
Andrew Murray
28f0940d59 Added example image [ci skip] 2019-09-15 06:06:28 +10:00
Andrew Murray
11c9e6c0dd Added release notes [ci skip] 2019-09-14 21:39:58 +10:00
Hugo
f792ab6c02 RST uses double backticks for code (MD uses 1) 2019-09-13 08:56:33 +03:00
Andrew Murray
da39d40342
Merge pull request #3978 from radarhere/stroke
Added text stroking
2019-09-06 19:14:49 +10:00
Hugo van Kemenade
97f6fc96f2
Merge pull request #4047 from radarhere/modes
Documented more limited support modes
2019-09-05 23:20:24 +03:00
Andrew Murray
5ad5be4a32 Reference Pillow not PIL [ci skip] 2019-09-06 06:13:12 +10:00
Andrew Murray
51457311de
Reference Pillow not PIL [ci skip]
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
2019-09-06 06:10:40 +10:00
Andrew Murray
2a7ad14172 Added more limited support modes [ci skip] 2019-09-05 20:10:43 +10:00
Andrew Murray
1c8aae3016 Added Tidelift Subscription link [ci skip] 2019-09-05 19:31:55 +10:00
Andrew Murray
92e80b8b49
Merge pull request #3993 from radarhere/libimagequant
Updated libimagequant to 2.12.5
2019-08-17 20:02:12 +10:00
nulano
fa6b80fddf add option to capture all monitors on Windows 2019-08-15 20:03:33 +10:00
Andrew Murray
0527efd593 Corrected documentation of TIFF saving arguments [ci skip] 2019-08-07 19:53:35 +10:00
Andrew Murray
a9f34f221b Changed MAX_CONCURRENCY description [ci skip] 2019-08-05 20:32:01 +10:00
Andrew Murray
4283683948 Corrected note syntax [ci skip] 2019-08-03 23:24:28 +10:00
Andrew Murray
fa2f27244c Updated libimagequant to 2.12.5 2019-07-29 19:32:12 +10:00
Andrew Murray
f93a5d0972 Added text stroking 2019-07-29 06:40:03 +10:00
Andrew Murray
dfed1424d1 Improved ImageFont documentation 2019-07-25 20:04:45 +10:00
Andrew Murray
d87593633a Update Linux prerequisite packages 2019-07-20 19:30:28 +10:00
Hugo van Kemenade
1ab5670eb1
Introduce isort to automate import ordering and formatting (#3954)
Introduce isort to automate import ordering and formatting
2019-07-16 23:02:31 +03:00
Andrew Murray
9bfbd56d1a Updated Alpine Python version 2019-07-10 06:54:59 +10:00
Andrew Murray
6f0c51fb4a Added Debian Buster 2019-07-10 06:54:54 +10:00
Hugo
1f4900e51f
Merge branch 'master' into unused-sidebar 2019-07-07 07:45:33 +03:00
Hugo
82ec19ed6d
Merge pull request #3955 from jdufresne/static
Remove empty, unused directory docs/_static
2019-07-07 07:40:40 +03:00
Jon Dufresne
388803006c Remove unused docs/_templates directory
The only file, sidebarhelp.html, applies to the sphinx-better-theme
which is unused and was removed in
02f3685b2d.
2019-07-06 17:27:06 -07:00
Jon Dufresne
8fac23b3df Clean up several Sphinx warnings
Appeared as:

    Pillow/docs/reference/ImageDraw.rst:137: WARNING: Unexpected indentation.
    Pillow/docs/reference/ImageDraw.rst:164: WARNING: Unexpected indentation.
    Pillow/docs/reference/ImageDraw.rst:177: WARNING: Unexpected indentation.
    Pillow/docs/reference/ImageDraw.rst:208: WARNING: Unexpected indentation.
    Pillow/docs/reference/ImageStat.rst:24: WARNING: Explicit markup ends without a blank line; unexpected unindent.
2019-07-06 17:12:09 -07:00