Skip to content

Conversation

adrien-n
Copy link
Contributor

It is not currently possible to fetch files through a proxy. Until this functionality is added, the test cases will always fail so just skip them since they are meant to test something else.

The detection is based on the presend of the http_proxy environment variable which should be appropriate in the vast majority of cases (I think HTTPS_PROXY may be finer but it's probably nitpicking in practice).

It is not currently possible to fetch files through a proxy. Until this
functionality is added, the test cases will always fail so just skip
them since they are meant to test something else.

The detection is based on the presend of the http_proxy environment
variable which should be appropriate in the vast majority of cases (I
think HTTPS_PROXY may be finer but it's probably nitpicking in
practice).
@luisza luisza merged commit 5f2520e into xhtml2pdf:master Feb 23, 2025
1 check passed
sharisurehire added a commit to SureHire/xhtml2pdf that referenced this pull request Aug 27, 2025
* remove pathlib import and .resolve()

* import arabic_format and delete util import

* remove try and remove copy from asian_language_list

* just filename is needed

* Documentation for Asian Fonts added

* Update reference.rst

* Update reference.rst

* Update context.py

* Fixed some minor stuff in the README.rst file.

* Ttf file metadata same name fix (xhtml2pdf#506)

* checking prefix to update face.name

* Documentation about updating face-name

* Updated changelog and prepared for pip new version

* Updated README.rst (xhtml2pdf#512)

* Improved README.rst

* Changed log.warn() to log.warning() as the .warn() method is depreciated since Python 3.3. (xhtml2pdf#509)

* Fixed xhtml2pdf#513 (issue with type 'basestring') (xhtml2pdf#515)

* Removed 'inch' and 'i' as possible length units. 'inch' wasn't even working and we already have 'in' as unit. Also 'inch' and 'i' aren't official units for CSS/HTML.

* Fixed letter-spacing (xhtml2pdf#490)

* Fixed incorrect calculation when entering "0.0" as value. Now it's acting the same way as "0".

* Removed test for unit "i" in test_utils.py

* Updated CHANGELOG.txt

* Arabic and Asian font Unit Tests (xhtml2pdf#514)

* checking prefix to update face.name

* Documentation about updating face-name

* checking prefix to update face.name

* Update context.py

Add support for multiple fonts and unicode

Change string detection to use basestring

checking prefix to update face.name

checking prefix to update face.name

Documentation about updating face-name

Fixed some minor stuff in the README.rst file.

Updated changelog and prepared for pip new version

Ttf file metadata same name fix (xhtml2pdf#506)

* checking prefix to update face.name

* Documentation about updating face-name

unit_test_asian_font

Update test_asian_font_support.py

Update reference.rst

Update testrender.py

Update arabic_font_rendering.html

Update ttf_file_metadata_same_name.html

Create test_arabic_font_support.py

Update test_asian_font_support.py

Create test_update_face_name.py

Update context.py

Update document.py

Update util.py

Update reference.rst

adding test to testrender

Update testrender.py

moved to testrender

* Ascii

* Update test_asian_font_support.py

* Update test_update_face_name.py

* Update test_update_face_name.py

* .

* .

* .

* .

* .

* .

* .

* find

* find2

* Update test_asian_font_support.py

* Update test_asian_font_support.py

* x2

* Update test_arabic_font_support.py

* new app

* x3

* x5

* Update test_update_face_name.py

* x6

* Update test_update_face_name.py

* x6

* upper

* slide

* complete

* Ascii

* Fixed calculation of pagesize & orientation (xhtml2pdf#510)

* Fixed calculation of pagesize & orientation
* Updated CHANGELOG.txt

* Improved unittests; added Chinese, Hebrew, Persian, Urdu, Pashto, Sindhi font-support; removed unlicensed .ttf fonts (xhtml2pdf#520)

* Updated Travis/AppVeyor

* Updated Travis/AppVeyor

* Add Luisza to AUTHORS

* Bump 0.2.5

* Fix attribute error when parsing list of fonts (xhtml2pdf#522)

Thanks

* Release Notes section in Read-the-Docs documentation (xhtml2pdf#521)

* Changelog move to documentation

* Release Notes section in Read-the-Docs documentation; Updated Sphinx

* requirements.txt updated

* Changed dependency html5lib to at least version 1.0.1 (xhtml2pdf#519)

* Changed dependency html5lib to at least version 1.0.1;

Version 1.0 was a bad release according to https://html5lib.readthedocs.io/en/latest/changes.html#id3 and was replaced be 1.0.1 the same day.

* Fixed invalid escape sequences (xhtml2pdf#473) (xhtml2pdf#523)

* Fixed invalid escape sequences (xhtml2pdf#473)

* Optimized imports (xhtml2pdf#518)

* Optimized imports, without Wildcard

* More unit tests (for cssSpecial.py) (xhtml2pdf#524)

* Added table unittests

* background-image wasn't detected properly.

* Used a temp-file instead of creating a real file.

* Renamed, because "TestCase" is already a class name in unittest

* Lots of unit tests for the cssSpecial.py file!

* Fix for Python 2.7

* Updated reference images.

* Small reformat; added a TODO

* imports sorted

* Fixed Resource Warnings (xhtml2pdf#529)

* Fixed Resource Warnings

* Small fix for images from an URL

* Fixed double import of urllib2

* Renamed variables to avoid shadowing built-ins (xhtml2pdf#526)

* Imagemagick warning fixed (xhtml2pdf#527)

* Reportlab drop python3.5 suppport on 3.5.54

* Add fallback to @media type "all" (xhtml2pdf#533)

* Add fallback to @media type "all" (xhtml2pdf#498)

* Add unittests for css @media rule

* Upgrade Pillow due to high severity vulnerability (xhtml2pdf#549)

* use svglib if available to rasterise SVG to PNG

* wip actually draw vector to pdf

* handle pisa temp file in pmlimage

* fixed tuple passed to setCharSpace

* getVector -> getDrawing

* removed 'import svglib'

* Add Python 3.9, 3.10

* switch from PyPDF2 to PyPDF3

* Remove AppVeyor and Travis

* Switch to GitHub Actions

* Configure Tox for github actions

* reduce reportlab matrix

* Update rendertest tox config

* can't deal with reportlab compatibility

* undo parser.py changes

* Switch to PyPDF3 (xhtml2pdf#582)

* Add Python 3.9, 3.10

* switch from PyPDF2 to PyPDF3

* Drop support for Python 2.7

PyPDF3 declares support for Python2, but its
broken currently: sfneal/PyPDF3#10

* Add python 3.x releases to appveyor

* Drop support for <Python 3.6

- PyPDF3 breaks with Python 3.5 or earlier

* Fix and drop unsupported combinations

* Upgrade build image

* Keep tests quieter (xhtml2pdf#581)

- Asserts for one intentional warning on empty tables
- Fixes width to "None" to avoid another warning where an empty string
  results in a warning

* Add svglib as requirement

* Create a Security Policy

* all code in python3

* remove six in cssSpecial

* Remove six dependency and update Readme

* Checking test execution and update Readme

* tests/test_utils.py

* New file manager system and remove python2 code

* fixed test on workflow

* Fix test on workflow based on linux

* Remove usage of getStringIO (xhtml2pdf#590)

reportlab 3.6.7 removed getStringIO and getByteIO: MrBitBucket/reportlab-mirror@684d21e

This should resolve: Cannot import name 'getStringIO' from 'reportlab.lib.utils'  xhtml2pdf#589

* Fix UnboundLocalError in reportlab_paragraph (xhtml2pdf#585) (xhtml2pdf#586)

* Fix color invalid (xhtml2pdf#594)

* Fix color and backgroup-color default value

* Fix type error: expected str instance, tuple found

* rtl languages revesed lines fix (xhtml2pdf#541)

* rtl languages revesed lines fix

* rtl added as a ParaFrag

* check if Paragraph has 'rtl' attribute

* fixed color asignation on tr and fixed infinite loop when download a file

* Set default timeout to 5 s

* Add new pagesizes

* Changing fonts with open licenses

* Fixing fonts on testrender

* Bump version to 0.2.6

* packaging new version 0.2.6

* Update README.rst

* Add Patreon link

* Create FUNDING.yml

* Include bitcoin link

* Move Funding to a better place

* Update README.rst

* Adding canvas tag

* Updating chart properties

* Adding template graph test

* Loading char properties

* Fixed recursive import between utils.py and default.py

* fix xhtml2pdf.utils

* Adding label properties

* Allow document encryption and password protect

* Update release notes on documentation

* Start with notes for new release and Deprecation

* Adding properties chart

* Customizing properties bar charts

* Updating slices properties

* Removing import color

* Watermark reimplementation

* working watermark

* Adding digital signature builder based on pyhanko

* Build documentation

* Add pkcs11 as not required package

* fixed file path when files are in current folder

* automatic build examples rendering pdf

* Configure build with readthedocs

* update doc to docs

* doc conf repair

* Add canvas documentation

* Fixed watermarks and add new functionalities for page background

* Bump v0.2.7

* Fix typo and enhance grammar in usage.rst (xhtml2pdf#610)

* Fix CSSParseError for minified @font-face definitions (xhtml2pdf#609)

- Add test case with minified @font-face declaration which throws the following error on the current master branch:
  CSSParseError: Declaration group opening '{' not found:: ('', 'font-family: Noto_Re')

- Allow @font-face declaration without space delimiter before curly bracket

Fixes xhtml2pdf#88

* Fix background-image (xhtml2pdf#619)

* Update watermarks.py

Try and fix watermark bug.

* Update watermarks.py

* Bump 0.2.8

* Creating only tar file on sdis

* Update files.py (xhtml2pdf#632)

* fix for xhtml2pdf#618 (xhtml2pdf#628)

* add option to return bytes object (xhtml2pdf#626)

this allows pdf to stay in memory and allow caller to handle writing of the data vs writing to a temp file, dumping from memory and then re-loading to memory for certain scenarios

* fix ListItem styling (xhtml2pdf#635)

* fix ListItem styling

* prevent unwanted list icons

* fix inline icons not being rendered correctly (xhtml2pdf#637)

* check if attribute exists before accessing it (xhtml2pdf#643)

* Update arabic-reshaper (xhtml2pdf#659)

Upgrade to 3.0.0 to remove the vulnerable 'future' dependency

* Fixed implementation fo cleanFiles which did nothing (xhtml2pdf#665)

* Replace PyPDF3 by pypdf (xhtml2pdf#656)

* updated to enable textfield in html form.  Use rows/cols (xhtml2pdf#604)

to control the size of the field (which isn't really avaialble
in the html fields of a regular text element).  As such we
can use the textfield as a text input by settings rows=1

Co-authored-by: Luis Zárate <luis.zarate@solvosoft.com>

* Fixed addFromURI in pisaPDF class (xhtml2pdf#667)

* Thread safe temp files (xhtml2pdf#668)

* Support add pagenumber and page count as simple text

* ol with start attribute

* rtl languages reverse text words

* Fix changelog location in README.rst (xhtml2pdf#669)

* Fix changelog location in README.rst

* Remove CHANGELOG.txt from MANIFEST.in

* rtl language new approach

* Prepare for new release

* Release 0.2.9

* Update documentation

* Add issue templates (xhtml2pdf#671)

* Add pull request template (xhtml2pdf#672)

* Add CODEOWNERS file (xhtml2pdf#673)

* Update security policy (xhtml2pdf#674)

* Add missing import to fix canvas graph (xhtml2pdf#678)

* Remove duplicate pypdf entry from `setup.py` (xhtml2pdf#686)

* setup.py: Remove duplicate pypdf entry
* setup.py: Sort install_requires to avoid duplicates in the future
* setup.py: list exactly one dependency per line

* Bump to version 0.2.10 (xhtml2pdf#687)

Accepted.

* Add support for Python 3.11 (xhtml2pdf#680)

* Fixed reportlab <4 (xhtml2pdf#690)

It is intended to eliminate the error related to reportlab 4.0 and pycairo.

* Bump 0.2.11

* Update make and readme

* Fix duplicate page number/number of pages (xhtml2pdf#695)

* Change print statement to log.exception (xhtml2pdf#700)

* Update CODEOWNERS

* Remove Python2 compatibility (xhtml2pdf#706)

- Remove __future__ imports
- Remove six

* Update README.rst (xhtml2pdf#707)

Fix typo in name "Holtwick" and streamline the timeline

* Modernize Sphinx configuration (xhtml2pdf#711)

* fix build warnings
* fix extlinks directive usages

* Update release notes

* Depend on html5lib >= 1.1 (xhtml2pdf#709)

* Update to reportlab 4 (xhtml2pdf#708)

- Remove version restriction
- Document installation of C extensions

* Migrate Python2 code to Python3 (xhtml2pdf#712)

* Add license notes for the `w3c` module (xhtml2pdf#713)

* Migrate setup.py to pyproject.toml (xhtml2pdf#692)

- PEP 621 + setuptools pyproject.toml
- Replace old install/test commands
- Remove files that have been made redundant by pyproject.toml

Co-authored-by: Timo Brembeck <github@timo.brembeck.email>

* Apply black code style (xhtml2pdf#714)

* Add black formatting tools

- Add Github Action
- Add pre-commit hook
- Add default config

* Apply black code style

* Add general pre-commit hooks (xhtml2pdf#715)

* Add ruff linter (xhtml2pdf#716)

* Start using type hints (xhtml2pdf#717)

- Partially annotate the code base
- Include MyPy for type hint checking

* Drop support for Python 3.7 (xhtml2pdf#718)

* Add support for Python 3.12 (xhtml2pdf#719)

* Upload test coverage to coveralls (xhtml2pdf#721)

* Fix readthedocs build (xhtml2pdf#722)

* Fix readthedocs build (xhtml2pdf#724)

* Add more type hints

* Add `src` attribute to `PmlImage` class

This allows additional logging output

* Fix `ZeroDivisionError` on broken image files

* Add more type hints

* Remove stack trace when images cannot be identified

* Bump to v0.2.12

* Fix TypeError on column widths specified as percentages

* Fix table width typing

* Bump to v0.2.13

* Add pre-commit hooks to check .rst validity

* Add sphinx_reredirects to move pages

* Re-arrange existing pages

* Rewrite the development guide

* Write the new "Quickstart" guide

* Write the new CLI reference

* Write a new Python reference

* Move bits of HTML to a separate file

* Rewrite the fonts guide

* Parse additional parameters in base64-encoded data URI

RFC 2397 allows additional parameters inside mediatype part, separated
by semicolons. Previous implementation fails to parse URI completely
when these parameters are encountered.

* Add support of TTF base64-encoded fonts

Now fonts can be used inside CSS @font-face declaration in
base64-endoded form with 'font/ttf' mimetype.
Example: "src:url("data:font/ttf;charset=utf-8;base64,B64DATA");"

* Fix linting errors

* Only include xhtml2pdf package in wheel (xhtml2pdf#737)

Previously, the wheel included these top-level packages in addition to
xhtml2pdf:

* demo
* docs
* testrender

Resolves xhtml2pdf#736.

* Make cairo dependency optional (xhtml2pdf#742)

* Fix image rendering with link_callback (xhtml2pdf#746)

* Bump to v0.2.14 (xhtml2pdf#747)

* Pin `reportlab>=4.0.4,<4.1` (xhtml2pdf#752)

* Bump to v0.2.15 (xhtml2pdf#753)

* reportlab Compatibility: Adapt to New ShowBoundaryValue Import (xhtml2pdf#754)

* Adapt to new ShowBoundaryValue import

* remove upper bound for reportlab

* reformat imports

* pin to major release

* Bump to v0.2.16

* Update import for breaking changes in python-bidi 0.5.0

* Limit python-bidi versions

Co-authored-by: Timo Brembeck <github@timo.brembeck.email>

* Pylint fixes (xhtml2pdf#773)

* Pylint fixes

* Placate the black code formatter

* pre-commit autoupdate 2024-07-24 (xhtml2pdf#774)

* pre-commit autoupdate 2024-07-24

* Why run black outside of pre-commit?

* GitHub Actions: Add Python 3.13 beta 4 to the testing (xhtml2pdf#775)

* https://www.python.org/download/pre-releases
* https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#allow-pre-releases

* Keep GitHub Actions up to date with GitHub's Dependabot (xhtml2pdf#772)

Fixes software supply chain safety warnings like at the bottom right of
https://github.com/xhtml2pdf/xhtml2pdf/actions/runs/9430536130

* [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)
* [Configuration options for the dependabot.yml file - package-ecosystem](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem)

* fix reDOS CVE in getColor function (xhtml2pdf#784)

* Reuse background PDF file over multiple pages (xhtml2pdf#778) (xhtml2pdf#779)

* Allow python-bidi 0.6.0

* Format code with black

* fixed mypy checks

* mypy try to make it work

* try using types-setuptools

* Fixing precommit

* Fixing precommit

* Fixing precommit

* Fixing precommit

* tests: skip cases that download artifacts when http_proxy is set (xhtml2pdf#793)

It is not currently possible to fetch files through a proxy. Until this
functionality is added, the test cases will always fail so just skip
them since they are meant to test something else.

The detection is based on the presend of the http_proxy environment
variable which should be appropriate in the vast majority of cases (I
think HTTPS_PROXY may be finer but it's probably nitpicking in
practice).

* Typos workflow (xhtml2pdf#795)

* Fix various typos

* Rename pc/pn vars to pageCount and pageNumber

* Fix a couple of manual test typos

* Add basic spell-check GH workflow

* Add typos to pre-commit config

* Add typos config to pyproject.toml

* Bump 0.2.7 and fixed tests

* Fixing test and linting

* Fixing ruff black linting

* pre-commit fixes

* build and publish a wheel (xhtml2pdf#796)

* Fix typos (xhtml2pdf#801)

Found via `codespell -S
./tests,testrender,manual_test,reportlab_paragraph.py -L splitted`

* Fix TypeError: sequence item 0: expected str instance, list found (xhtml2pdf#800)

* Bump the github-actions group across 1 directory with 2 updates (xhtml2pdf#798)

Bumps the github-actions group with 2 updates in the / directory: [jpetrucciani/mypy-check](https://github.com/jpetrucciani/mypy-check) and [crate-ci/typos](https://github.com/crate-ci/typos).


Updates `jpetrucciani/mypy-check` from 1.14.1 to 1.15.0
- [Release notes](https://github.com/jpetrucciani/mypy-check/releases)
- [Commits](jpetrucciani/mypy-check@1.14.1...1.15.0)

Updates `crate-ci/typos` from 1.29.7 to 1.30.0
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.29.7...v1.30.0)

---
updated-dependencies:
- dependency-name: jpetrucciani/mypy-check
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove github workflows directory

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: pedros.zg <69447117+pedroszg@users.noreply.github.com>
Co-authored-by: Luis Zárate <luis.zarate@solvosoft.com>
Co-authored-by: fbernhart <florian-bernhart@hotmail.com>
Co-authored-by: fbernhart <70264417+fbernhart@users.noreply.github.com>
Co-authored-by: Michał Godkowicz <michalgodkowicz@gmail.com>
Co-authored-by: Timo Ludwig <ti.ludwig@web.de>
Co-authored-by: Mouhamadou Sall <Momoumar@users.noreply.github.com>
Co-authored-by: Ashleigh Udoh <ash@tickitto.com>
Co-authored-by: Nemo <me@captnemo.in>
Co-authored-by: Anže Pečar <anze@pecar.me>
Co-authored-by: Megan Yu <mtyu227@gmail.com>
Co-authored-by: LeonardoBein <leonardobein@gmail.com>
Co-authored-by: Roman914 <58525262+Roman914@users.noreply.github.com>
Co-authored-by: Marcela González Zúñiga <marcegz31@gmail.com>
Co-authored-by: Muhammed Nihad <33249669+MuhammedNihad@users.noreply.github.com>
Co-authored-by: Jeff Gordon <flash@taphunter.com>
Co-authored-by: lalmadaneogeo <56248990+lalmadaneogeo@users.noreply.github.com>
Co-authored-by: Joren <jhammudoglu@gmail.com>
Co-authored-by: Tyler Raber <tyler555g@gmail.com>
Co-authored-by: charludo <47758554+charludo@users.noreply.github.com>
Co-authored-by: Luboš Mátl <matllubos@gmail.com>
Co-authored-by: Martin Thoma <info@martin-thoma.de>
Co-authored-by: Walt Dixon <walt.dixon.us@gmail.com>
Co-authored-by: Lucas Berg <55436804+BergLucas@users.noreply.github.com>
Co-authored-by: brandonlake-semaphore <87142887+brandonlake-semaphore@users.noreply.github.com>
Co-authored-by: Po-Chuan Hsieh <sunpoet@sunpoet.net>
Co-authored-by: JanEgner <JanEgner@users.noreply.github.com>
Co-authored-by: lucasgadams <36425095+lucasgadams@users.noreply.github.com>
Co-authored-by: Timo Brembeck <github@timo.brembeck.email>
Co-authored-by: Alexandre Detiste <alexandre.detiste@gmail.com>
Co-authored-by: Dirk Holtwick <holtwick@users.noreply.github.com>
Co-authored-by: Stefan <96178532+stefan6419846@users.noreply.github.com>
Co-authored-by: Nikita Karamov <me@kytta.dev>
Co-authored-by: Vladimir Gorbunov <vsg@suburban.me>
Co-authored-by: Carl Smedstad <carl.smedstad@protonmail.com>
Co-authored-by: Ben Gosney <bengosney@googlemail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Trupal00p <davetrupiano@gmail.com>
Co-authored-by: Sjoerd Job Postmus <sjoerdjob@sjec.nl>
Co-authored-by: adrien-n <adrien@notk.org>
Co-authored-by: Mike Manger <ohmanger@gmail.com>
Co-authored-by: David Hotham <david.hotham@microsoft.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Hugo Smett <hsmett@hybird.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants