Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 729132 Details for
Bug 805920
dev-python/pydyf-0.0.3 fails tests
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
build.log
build.log (text/plain), 297.37 KB, created by
Agostino Sarubbo
on 2021-08-01 09:53:52 UTC
(
hide
)
Description:
build.log
Filename:
MIME Type:
Creator:
Agostino Sarubbo
Created:
2021-08-01 09:53:52 UTC
Size:
297.37 KB
patch
obsolete
> * Package: dev-python/pydyf-0.0.3 > * Repository: gentoo > * Maintainer: python@gentoo.org > * USE: abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python3_8 python_targets_python3_9 test userland_GNU > * FEATURES: network-sandbox preserve-libs sandbox test userpriv usersandbox > > >@@@@@ PLEASE PAY ATTENTION HERE!!! @@@@@ >This information may help you to understand if this is a duplicate or if this bug exists after you pushed a fix; >This ebuild was merged at the following commit: >https://github.com/gentoo/gentoo/commit/b1d5cf19402523b534a29124a08d5a647407435d (Sun Aug 1 08:16:03 UTC 2021) >@@@@@ END @@@@@ > > > >@@@@@ PLEASE PAY ATTENTION HERE!!! @@@@@ >This ebuild was merged (directly or as a dependency) because of the following commit: >https://github.com/gentoo/gentoo/commit/6efeb310dfe882511ff7050511e8be0c5ee46084 >@@@@@ END @@@@@ > > > >################## ># emerge --info: # >################## >Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1, gcc-11.2.0, glibc-2.33-r5, 4.19.174-gentoo x86_64) >================================================================= >System uname: Linux-4.19.174-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2650_v4_@_2.20GHz-with-glibc2.33 >KiB Mem: 264046488 total, 82789304 free >KiB Swap: 0 total, 0 free >sh bash 5.1_p8 >ld GNU ld (Gentoo 2.36.1 p5) 2.36.1 >app-shells/bash: 5.1_p8::gentoo >dev-lang/perl: 5.34.0-r1::gentoo >dev-lang/python: 2.7.18_p11::gentoo, 3.8.11::gentoo, 3.9.6::gentoo, 3.10.0_beta4::gentoo >dev-lang/rust: 1.53.0::gentoo >dev-util/cmake: 3.21.1::gentoo >sys-apps/baselayout: 2.7-r3::gentoo >sys-apps/openrc: 0.43.3::gentoo >sys-apps/sandbox: 2.24::gentoo >sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo >sys-devel/automake: 1.16.4::gentoo >sys-devel/binutils: 2.36.1-r2::gentoo >sys-devel/gcc: 11.2.0::gentoo >sys-devel/gcc-config: 2.4::gentoo >sys-devel/libtool: 2.4.6-r6::gentoo >sys-devel/make: 4.3::gentoo >sys-kernel/linux-headers: 5.13::gentoo (virtual/os-headers) >sys-libs/glibc: 2.33-r5::gentoo >Repositories: > >gentoo > location: /usr/portage > sync-type: rsync > sync-uri: rsync://rsync.gentoo.org/gentoo-portage > priority: -1000 > sync-rsync-extra-opts: > sync-rsync-verify-metamanifest: yes > sync-rsync-verify-max-age: 24 > sync-rsync-verify-jobs: 1 > >ACCEPT_KEYWORDS="amd64 ~amd64" >ACCEPT_LICENSE="* BSD" >CBUILD="x86_64-pc-linux-gnu" >CFLAGS="-O2 -pipe -march=x86-64 -frecord-gcc-switches" >CHOST="x86_64-pc-linux-gnu" >CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" >CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" >CXXFLAGS="-O2 -pipe -march=x86-64 -frecord-gcc-switches" >DISTDIR="/var/tmp/portage/dev-python/pydyf-0.0.3/distdir" >EMERGE_DEFAULT_OPTS="--with-bdeps=y -1 -k -b" >ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" >FCFLAGS="-O2 -pipe -march=x86-64 -frecord-gcc-switches" >FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign split-log strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" >FFLAGS="-O2 -pipe -march=x86-64 -frecord-gcc-switches" >GENTOO_MIRRORS="http://distfiles.gentoo.org" >LANG="en_US.utf8" >LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0" >MAKEOPTS="-j24" >PKGDIR="/root/.packages" >PORTAGE_CONFIGROOT="/" >PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" >PORTAGE_TMPDIR="/var/tmp" >USE="acl amd64 bzip2 cli crypt dri elogind fortran gdbm iconv ipv6 jumbo-build libglvnd libtirpc multilib native-symlinks ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd test unicode xattr zlib" ABI_X86="64" ELIBC="glibc" KERNEL="linux" PYTHON_TARGETS="python3_8 python3_9" USERLAND="GNU" >Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS > > > > > >############################## ># emerge history (qlop -mv): # >############################## >2021-08-01T10:48:22 >>> dev-python/pyproject2setuppy-17 >2021-08-01T10:48:28 >>> dev-python/pydyf-0.0.3 >2021-08-01T10:48:52 >>> media-libs/libjpeg-turbo-2.1.0-r2 >2021-08-01T10:48:52 >>> dev-python/iniconfig-1.1.1 >2021-08-01T10:48:53 >>> dev-python/more-itertools-8.8.0 >2021-08-01T10:48:54 >>> dev-python/py-1.10.0 >2021-08-01T10:48:55 >>> dev-python/pyparsing-2.4.7-r1 >2021-08-01T10:48:55 >>> dev-python/typing-extensions-3.10.0.0 >2021-08-01T10:48:56 >>> dev-python/zipp-3.5.0 >2021-08-01T10:48:58 >>> dev-lang/nasm-2.15.05 >2021-08-01T10:48:58 >>> dev-python/namespace-zope-1-r1 >2021-08-01T10:48:57 >>> dev-python/olefile-0.46-r1 >2021-08-01T10:49:23 >>> dev-python/packaging-21.0 >2021-08-01T10:49:29 >>> dev-python/importlib_metadata-4.6.2 >2021-08-01T10:49:32 >>> virtual/jpeg-100 >2021-08-01T10:49:36 >>> dev-python/zope-interface-5.4.0 >2021-08-01T10:49:52 >>> dev-python/pluggy-0.13.1-r1 >2021-08-01T10:49:55 >>> dev-python/pillow-8.3.1 >2021-08-01T10:49:58 >>> dev-python/attrs-21.2.0 >2021-08-01T10:50:14 >>> dev-python/pytest-6.2.4-r1 > > > > >####################################### ># installed packages (qlist -ICvUSS): # >####################################### >acct-group/input-0-r1:0 >acct-group/kvm-0-r1:0 >acct-group/man-0-r1:0 >acct-group/messagebus-0-r1:0 >acct-group/polkitd-0-r1:0 >acct-group/portage-0:0 >acct-group/render-0-r1:0 >acct-group/sshd-0-r1:0 >acct-user/man-1-r1:0 >acct-user/messagebus-0-r1:0 >acct-user/polkitd-0-r1:0 >acct-user/portage-0:0 >acct-user/sshd-0-r1:0 >app-admin/eselect-1.4.17:0 -doc -emacs -vim-syntax >app-admin/perl-cleaner-2.30:0 >app-arch/bzip2-1.0.8-r1:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 split-usr -static -static-libs >app-arch/gzip-1.10:0 -pic -static >app-arch/libarchive-3.5.1-r1:0/13 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 acl -blake2 bzip2 e2fsprogs -expat iconv -lz4 lzma -lzo -nettle -static-libs xattr zlib -zstd >app-arch/tar-1.34:0 acl -minimal nls -selinux xattr >app-arch/unzip-6.0_p26:0 bzip2 -natspec unicode >app-arch/xz-utils-5.2.5-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 extra-filters nls split-usr -static-libs >app-arch/zstd-1.5.0:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -lz4 -static-libs threads >app-crypt/gnupg-2.2.28:0 bzip2 -doc -ldap nls readline -selinux smartcard ssl -tofu -tools -usb -user-socket -wks-server >app-crypt/gpgme-1.16.0:1/11 -common-lisp cxx -python python_targets_python3_8 python_targets_python3_9 -qt5 -static-libs >app-crypt/libb2-0.98.1-r3:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -native-cflags openmp -static-libs >app-crypt/libmd-1.0.3-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >app-crypt/openpgp-keys-gentoo-release-20200704:0 -test >app-crypt/pinentry-1.1.1-r1:0 -caps -efl -emacs -gnome-keyring -gtk ncurses -qt5 >app-crypt/rhash-1.4.2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug nls ssl -static-libs >app-editors/nano-5.8-r2:0 -debug -justify -magic -minimal ncurses nls spell split-usr -static unicode >app-eselect/eselect-fontconfig-1.1-r1:0 >app-eselect/eselect-iptables-20200508:0 >app-eselect/eselect-lib-bin-symlink-0.1.1-r1:0 >app-eselect/eselect-pinentry-0.7.2:0 >app-eselect/eselect-rust-20210703:0 >app-i18n/man-pages-ja-20180315-r1:0 >app-i18n/man-pages-l10n-4.10.0:0 l10n_de l10n_es l10n_fr l10n_it l10n_nl l10n_pl l10n_pt-BR l10n_ro >app-i18n/man-pages-ru-5.03.2390.2390.20191017-r1:0 >app-i18n/man-pages-zh_CN-1.6.3.2:0 >app-misc/c_rehash-1.7-r1:0 >app-misc/ca-certificates-20210119.3.66:0 -cacert >app-misc/editor-wrapper-4-r1:0 >app-misc/mime-types-9:0 >app-misc/pax-utils-1.3.3:0 -caps -debug -python -python_single_target_python3_10 -python_single_target_python3_8 python_single_target_python3_9 seccomp >app-misc/tmux-3.2a:0 -debug -selinux -utempter -vim-syntax >app-portage/eix-0.35.2:0 -debug -doc nls -sqlite >app-portage/elt-patches-20201205:0 >app-portage/gemato-16.2:0 gpg python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test -tools >app-portage/gentoolkit-0.5.1:0 python_targets_pypy3 python_targets_python3_8 python_targets_python3_9 -test >app-portage/portage-utils-0.92:0 nls openmp qmanifest qtegrity -static >app-shells/bash-5.1_p8:0 -afs -bashlogger -examples -mem-scramble net nls -plugins readline >app-shells/push-3.4:0 >app-shells/quoter-4.2:0 >app-text/ansifilter-2.18:0 -qt5 >app-text/build-docbook-catalog-1.21:0 >app-text/docbook-xml-dtd-4.5-r2:4.5 >app-text/docbook-xml-dtd-4.4-r3:4.4 >app-text/docbook-xml-dtd-4.2-r3:4.2 >app-text/docbook-xml-dtd-4.1.2-r7:4.1.2 >app-text/docbook-xsl-stylesheets-1.79.1-r2:0 -ruby >app-text/manpager-1:0 >app-text/opensp-1.5.2-r6:0 -doc nls -static-libs -test >app-text/po4a-0.63-r1:0 -test >app-text/sgml-common-0.6.3-r7:0 >app-text/xmlto-0.0.28-r6:0 -latex -text >dev-db/sqlite-3.35.5:3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -doc -icu readline -secure-delete -static-libs -tcl -test -tools >dev-lang/nasm-2.15.05:0 -doc >dev-lang/perl-5.34.0-r1:0/5.34 -berkdb -debug -doc gdbm -ithreads -minimal >dev-lang/python-3.10.0_beta4:3.10 -bluetooth -build -examples gdbm -hardened ipv6 ncurses readline sqlite ssl -test -tk -verify-sig -wininst xml >dev-lang/python-3.9.6:3.9 -bluetooth -build -examples gdbm -hardened ipv6 ncurses readline sqlite ssl -test -tk -verify-sig -wininst xml >dev-lang/python-3.8.11:3.8 -bluetooth -build -examples gdbm -hardened ipv6 ncurses readline sqlite ssl -test -tk -verify-sig -wininst xml >dev-lang/python-2.7.18_p11:2.7 -berkdb -bluetooth -build -examples gdbm -hardened ipv6 ncurses readline sqlite ssl threads -tk -verify-sig wide-unicode -wininst xml >dev-lang/python-exec-2.4.8:2 native-symlinks python_targets_pypy3 python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-lang/python-exec-conf-2.4.6:2 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-lang/rust-1.53.0:stable/1.53 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -clippy cpu_flags_x86_sse2 -debug -doc -llvm_targets_AArch64 -llvm_targets_AMDGPU -llvm_targets_ARM -llvm_targets_AVR -llvm_targets_BPF -llvm_targets_Hexagon -llvm_targets_Lanai -llvm_targets_Mips -llvm_targets_MSP430 -llvm_targets_NVPTX -llvm_targets_PowerPC -llvm_targets_RISCV -llvm_targets_Sparc -llvm_targets_SystemZ -llvm_targets_WebAssembly llvm_targets_X86 -llvm_targets_XCore -miri -nightly -parallel-compiler -rls rustfmt -system-bootstrap -system-llvm -test -verify-sig -wasm >dev-lang/spidermonkey-78.12.0:78 -clang -cpu_flags_arm_neon -debug jit -lto -test >dev-lang/tcl-8.6.11:0/8.6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug threads >dev-libs/elfutils-0.185:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 bzip2 -lzma nls -static-libs -test -threads utils -valgrind -zstd >dev-libs/expat-2.4.1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -examples split-usr -static-libs unicode >dev-libs/glib-2.68.3-r1:2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -dbus -debug elf -fam -gtk-doc mime -selinux -static-libs -sysprof -systemtap -test -utils xattr >dev-libs/gmp-6.2.1-r1:0/10.4 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 asm cxx -doc -pic -static-libs >dev-libs/gobject-introspection-1.68.0:0 -doctool -gtk-doc -python_single_target_python3_10 -python_single_target_python3_8 python_single_target_python3_9 -test >dev-libs/gobject-introspection-common-1.68.0:0 >dev-libs/icu-69.1:0/69.1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -doc -examples -static-libs >dev-libs/isl-0.24:0/23 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >dev-libs/jsoncpp-1.9.4:0/24 -doc -test >dev-libs/libassuan-2.5.5:0 >dev-libs/libbsd-0.11.3:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >dev-libs/libevent-2.1.12:0/2.1-7 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 clock-gettime -debug -malloc-replacement ssl -static-libs -test threads -verbose-debug >dev-libs/libffi-3.4.2:0/8 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -exec-static-trampoline -pax-kernel -pax_kernel -static-libs -test >dev-libs/libgcrypt-1.9.3:0/20 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 asm -cpu_flags_arm_neon -cpu_flags_x86_aes -cpu_flags_x86_avx -cpu_flags_x86_avx2 -cpu_flags_x86_padlock -cpu_flags_x86_sha -cpu_flags_x86_sse4_1 -doc -o-flag-munging -static-libs >dev-libs/libgpg-error-1.42:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -common-lisp nls -static-libs >dev-libs/libksba-1.6.0:0 -static-libs >dev-libs/libltdl-2.4.6:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >dev-libs/libpcre-8.45:3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 bzip2 cxx jit -libedit pcre16 pcre32 readline recursion-limit split-usr -static-libs unicode zlib >dev-libs/libpcre2-10.37-r2:0/3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 bzip2 jit -libedit pcre16 pcre32 readline recursion-limit split-usr -static-libs unicode zlib >dev-libs/libpipeline-1.5.3:0 -static-libs -test >dev-libs/libtasn1-4.17.0:0/6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc -static-libs -test -valgrind >dev-libs/libunistring-0.9.10-r1:0/2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc -static-libs >dev-libs/libuv-1.41.1:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >dev-libs/libxml2-2.9.12-r3:2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -examples -icu ipv6 -lzma python python_targets_python3_8 python_targets_python3_9 readline -static-libs -test -verify-sig >dev-libs/libxslt-1.1.34-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 crypt -debug -examples -static-libs -verify-sig >dev-libs/lzo-2.10:2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -examples split-usr -static-libs >dev-libs/mpc-1.2.1:0/3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >dev-libs/mpfr-4.1.0:0/6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >dev-libs/nettle-3.7.3:0/8-6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 asm -cpu_flags_arm_neon -cpu_flags_x86_aes -cpu_flags_x86_sha -doc gmp -static-libs -test >dev-libs/npth-1.6-r1:0 >dev-libs/nspr-4.32:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug >dev-libs/openssl-1.1.1k-r1:0/1.1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 asm -bindist cpu_flags_x86_sse2 -rfc3779 -sctp -sslv3 -static-libs -test -tls-compression -tls-heartbeat -vanilla >dev-libs/popt-1.18:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 nls -static-libs >dev-perl/Encode-EUCJPASCII-0.30.0-r1:0 -test >dev-perl/Encode-HanExtra-0.230.0-r3:0 >dev-perl/Encode-Locale-1.50.0:0 -test >dev-perl/File-Listing-6.140.0:0 -test >dev-perl/HTML-Parser-3.760.0:0 -test >dev-perl/HTML-Tagset-3.200.0-r2:0 >dev-perl/HTTP-Cookies-6.100.0:0 -test >dev-perl/HTTP-Date-6.50.0:0 >dev-perl/HTTP-Message-6.320.0:0 -test -test >dev-perl/HTTP-Negotiate-6.10.0-r1:0 >dev-perl/IO-HTML-1.4.0:0 -test >dev-perl/IO-Socket-INET6-2.720.0-r1:0 >dev-perl/IO-Socket-SSL-2.71.0:0 -examples -idn -test >dev-perl/libwww-perl-6.550.0:0 ssl -test >dev-perl/Locale-gettext-1.70.0:0 >dev-perl/LWP-MediaTypes-6.40.0:0 -test >dev-perl/LWP-Protocol-https-6.100.0:0 -test >dev-perl/MIME-Charset-1.12.2:0 l10n_ja l10n_zh >dev-perl/Module-Build-0.423.100:0 -test >dev-perl/Mozilla-CA-20999999:0 >dev-perl/Net-HTTP-6.210.0:0 -minimal -test >dev-perl/Net-SSLeay-1.900.0:0 -examples -examples -minimal -test >dev-perl/Pod-Parser-1.630.0-r1:0 -test >dev-perl/SGMLSpm-1.1-r1:0 >dev-perl/Socket6-0.280.0:0 >dev-perl/TermReadKey-2.370.0:0 -examples >dev-perl/Text-CharWidth-0.40.0-r1:0 >dev-perl/Text-WrapI18N-0.60.0-r1:0 >dev-perl/TimeDate-2.330.0:0 >dev-perl/Try-Tiny-0.300.0:0 -minimal -test >dev-perl/Unicode-LineBreak-2019.1.0:0 >dev-perl/URI-1.730.0:0 -test >dev-perl/WWW-RobotRules-6.20.0-r1:0 >dev-perl/XML-Parser-2.460.0:0 >dev-perl/YAML-Tiny-1.730.0:0 -minimal -test >dev-python/attrs-21.2.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/certifi-10001-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/charset_normalizer-2.0.3:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/idna-3.2:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-python/importlib_metadata-4.6.2:0 -doc python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/iniconfig-1.1.1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/jinja-3.0.1:0 -doc -examples python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/markupsafe-2.0.1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/more-itertools-8.8.0:0 -doc python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/namespace-zope-1-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-python/olefile-0.46-r1:0 -doc python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/packaging-21.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/pillow-8.3.1:0 -examples -imagequant jpeg -jpeg2k -lcms python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test -test -tiff -tk -truetype -webp -xcb zlib >dev-python/pluggy-0.13.1-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/py-1.10.0:0 -doc python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/pydyf-0.0.3:0 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/pyparsing-2.4.7-r1:0 -examples python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-python/pyproject2setuppy-17:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/pypy3-7.3.4_p2:0/pypy37-pp73 bzip2 gdbm jit ncurses -sqlite -test -tk >dev-python/pypy3-exe-7.3.4:7.3.4 bzip2 -cpu_flags_x86_sse2 jit -low-memory ncurses >dev-python/PySocks-1.7.1-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-python/pytest-6.2.4-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/requests-2.26.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -socks5 -test >dev-python/setuptools-57.4.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/setuptools_scm-6.0.1-r1:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/toml-0.10.2:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test -test >dev-python/typing-extensions-3.10.0.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 >dev-python/urllib3-1.26.6:0 -brotli python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/zipp-3.5.0:0 -doc python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-python/zope-interface-5.4.0:0 python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-util/cmake-3.21.1:0 -doc -emacs ncurses -qt5 -test -test >dev-util/desktop-file-utils-0.26-r1:0 -emacs >dev-util/glib-utils-2.68.3:0 -python_single_target_python3_8 python_single_target_python3_9 >dev-util/gperf-3.1:0 >dev-util/gtk-doc-am-1.33.2:0 >dev-util/intltool-0.51.0-r2:0 >dev-util/itstool-2.0.6-r1:0 -python_single_target_python3_8 python_single_target_python3_9 >dev-util/meson-0.58.1:0 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test >dev-util/meson-format-array-0:0 python_targets_python3_8 python_targets_python3_9 >dev-util/ninja-1.10.2-r1:0 -doc -emacs -test -vim-syntax >dev-util/pkgconf-1.8.0:0/3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 pkg-config -test >dev-util/re2c-2.1.1-r1:0 -debug >dev-vcs/git-2.32.0:0 blksha1 -cgi curl -cvs -doc -emacs -gnome-keyring gpg -highlight iconv -mediawiki -mediawiki-experimental nls pcre -perforce -perl -ppcsha1 -python_single_target_python3_10 -python_single_target_python3_8 python_single_target_python3_9 -subversion -test threads -tk webdav -xinetd >media-fonts/liberation-fonts-2.1.3:0 -fontforge -X -X >media-gfx/graphite2-1.3.14:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -perl -test >media-libs/fontconfig-2.13.1-r2:1.0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc -static-libs >media-libs/freetype-2.11.0:2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 adobe-cff -brotli bzip2 cleartype-hinting -debug -doc -fontforge harfbuzz -infinality png -static-libs -utils -X >media-libs/harfbuzz-2.8.2-r1:0/0.9.18 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 cairo -debug -doc -experimental glib graphite -icu introspection -static-libs -test truetype >media-libs/libjpeg-turbo-2.1.0-r2:0/0.2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -cpu_flags_arm_neon -java -java -static-libs >media-libs/libpng-1.6.37-r2:0/16 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -apng -cpu_flags_arm_neon cpu_flags_x86_sse -static-libs >net-dns/libidn2-2.3.2:0/2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs -verify-sig >net-firewall/iptables-1.8.7:0/1.8.3 -conntrack ipv6 -netlink -nftables -pcap split-usr -static-libs >net-libs/gnutls-3.7.2:0/30 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 cxx -dane -doc -examples -guile idn nls openssl -pkcs11 seccomp -sslv2 -sslv3 -static-libs -test -test-full tls-heartbeat -tools -valgrind >net-libs/libmnl-1.0.4:0/0.2.0 -examples split-usr -static-libs >net-libs/libnsl-1.3.0-r1:0/2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >net-libs/libtirpc-1.3.2:0/3 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 ipv6 -kerberos split-usr -static-libs >net-libs/nghttp2-1.44.0:0/1.14 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -cxx -debug -hpack-tools -jemalloc -static-libs -test threads -utils -xml >net-misc/curl-7.78.0:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -adns -alt-svc -brotli -curl_ssl_gnutls -curl_ssl_mbedtls -curl_ssl_nss curl_ssl_openssl -curl_ssl_winssl ftp -gnutls -gopher -hsts http2 -idn imap ipv6 -kerberos -ldap -mbedtls -nghttp3 -nss openssl pop3 progress-meter -quiche -rtmp -samba smtp -ssh ssl -sslv3 -static-libs -telnet -test tftp -threads -winssl -zstd >net-misc/iputils-20210722:0 arping -caps -clockdiff -doc filecaps -gcrypt -idn ipv6 -nettle nls -rarpd -rdisc ssl -static -tftpd -tracepath -traceroute6 >net-misc/netifrc-0.7.3:0 >net-misc/openssh-8.6_p1-r2:0 -abi_mips_n32 -audit -bindist -debug -hpn -kerberos -ldns -libedit -livecd pam pie scp -sctp -security-key -selinux ssl -static -test -X -X509 -xmss >net-misc/rsync-3.2.3-r4:0 acl -examples iconv ipv6 -lz4 ssl -stunnel -system-zlib xattr -xxhash -zstd >net-misc/wget-1.21.1:0 -cookie_check -debug -gnutls -idn ipv6 -metalink nls -ntlm pcre ssl -static -test -uuid zlib >perl-core/File-Temp-0.231.100:0 >perl-core/Scalar-List-Utils-1.560.0:0 >sys-apps/acl-2.3.1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 nls split-usr -static-libs >sys-apps/attr-2.5.1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug nls split-usr -static-libs >sys-apps/baselayout-2.7-r3:0 -build split-usr >sys-apps/busybox-1.33.1:0 -debug ipv6 -livecd -make-symlinks -math -mdev -pam -savedconfig -selinux -sep-usr static -syslog -systemd >sys-apps/coreutils-8.32-r1:0 acl -caps -gmp -hostname -kill -multicall nls -selinux split-usr -static -test -vanilla xattr >sys-apps/dbus-1.12.20-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -doc elogind -selinux -static-libs -systemd -test -test -user-session -X >sys-apps/debianutils-4.11.2:0 installkernel -static >sys-apps/diffutils-3.7-r1:0 nls -static >sys-apps/file-5.40-r3:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 bzip2 -lzma -python -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -seccomp -static-libs zlib >sys-apps/findutils-4.8.0:0 nls -selinux -static -test >sys-apps/gawk-5.1.0:0 -mpfr nls readline >sys-apps/gentoo-functions-0.14:0 >sys-apps/grep-3.6:0 nls pcre -static >sys-apps/groff-1.22.4:0 -examples -uchardet -X >sys-apps/help2man-1.48.3:0 nls >sys-apps/hwids-20210613-r1:0 net pci -systemd udev usb >sys-apps/install-xattr-0.8:0 >sys-apps/iproute2-5.13.0:0 -atm -berkdb -bpf -caps -elf iptables ipv6 -libbsd -minimal -selinux >sys-apps/kbd-2.4.0:0 nls pam -test >sys-apps/kmod-29:0 -debug -doc lzma -pkcs7 -python python_targets_python3_8 python_targets_python3_9 -static-libs tools zlib -zstd >sys-apps/less-590:0 pcre unicode >sys-apps/man-db-2.9.4-r1:0 -berkdb gdbm manpager nls seccomp -selinux -static-libs zlib >sys-apps/man-pages-5.12-r2:0 l10n_de l10n_es l10n_fr l10n_it l10n_ja l10n_nl l10n_pl l10n_pt-BR l10n_ro l10n_ru l10n_zh-CN >sys-apps/man-pages-posix-2017a:0 >sys-apps/net-tools-2.10:0 arp hostname ipv6 -nis nls -plipconfig -selinux -slattach -static >sys-apps/openrc-0.43.3:0 -audit -bash -debug ncurses netifrc -newnet pam -prefix -selinux -sysv-utils unicode >sys-apps/portage-3.0.20-r6:0 -apidoc -build -doc -gentoo-dev ipc native-extensions python_targets_pypy3 -python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 rsync-verify -selinux -test xattr >sys-apps/sandbox-2.24:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 abi_x86_32 abi_x86_64 -abi_x86_x32 >sys-apps/sed-4.8:0 acl nls -selinux -static >sys-apps/shadow-4.9-r1:0 acl -audit -bcrypt -cracklib nls pam -selinux -skey split-usr su xattr >sys-apps/systemd-tmpfiles-248.3:0 -selinux -test >sys-apps/sysvinit-2.99:0 -ibm -selinux -static >sys-apps/texinfo-6.8:0 nls standalone -static >sys-apps/util-linux-2.37.1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -audit -build -caps cramfs -cryptsetup -fdformat -hardlink -kill logger -magic ncurses nls pam -python python_targets_python3_8 python_targets_python3_9 readline -selinux -slang split-usr -static-libs -su suid -systemd -test -tty-helpers -udev unicode >sys-apps/which-2.21:0 >sys-auth/elogind-246.10-r1:0 acl -audit -debug -doc pam policykit -selinux >sys-auth/pambase-20210201.1:0 -caps -debug elogind -gnome-keyring -homed -minimal -mktemp nullok -pam_krb5 -pam_ssh passwdqc -pwhistory -pwquality -securetty -selinux sha512 -systemd >sys-auth/passwdqc-2.0.2-r1:0 >sys-auth/polkit-0.119-r2:0 elogind -examples -gtk introspection -kde nls pam -selinux -systemd -test >sys-devel/autoconf-2.69-r5:2.69 -emacs >sys-devel/autoconf-2.13-r1:2.1 >sys-devel/autoconf-archive-2021.02.19:0 >sys-devel/autoconf-wrapper-15:0 >sys-devel/automake-1.16.4:1.16 -test >sys-devel/automake-wrapper-11:0 >sys-devel/binutils-2.36.1-r2:2.36 -cet -default-gold -doc gold -multitarget nls plugins -static-libs -test -vanilla >sys-devel/binutils-config-5.4:0 native-symlinks >sys-devel/bison-3.7.6:0 -examples nls -static -test >sys-devel/flex-2.6.4-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 nls -static -test >sys-devel/gcc-11.2.0:11 -ada -custom-cflags cxx -d -debug -doc -fixed-point fortran -go graphite -hardened -jit -libssp lto multilib nls nptl -objc -objc++ -objc-gc openmp pch -pgo pie sanitize ssp -systemtap -test -valgrind -vanilla -vtv -zstd >sys-devel/gcc-config-2.4:0 cc-wrappers native-symlinks >sys-devel/gettext-0.21-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 acl -cvs cxx -doc -emacs -git -java -java ncurses nls openmp -static-libs >sys-devel/gnuconfig-20210107:0 >sys-devel/libtool-2.4.6-r6:2 -vanilla >sys-devel/llvm-12.0.1:12 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -debug -doc -doc -exegesis -gold -libedit libffi -llvm_targets_AArch64 llvm_targets_AMDGPU -llvm_targets_ARC -llvm_targets_ARM -llvm_targets_AVR llvm_targets_BPF -llvm_targets_CSKY -llvm_targets_Hexagon -llvm_targets_Lanai -llvm_targets_Mips -llvm_targets_MSP430 llvm_targets_NVPTX -llvm_targets_PowerPC -llvm_targets_RISCV -llvm_targets_Sparc -llvm_targets_SystemZ -llvm_targets_VE -llvm_targets_WebAssembly llvm_targets_X86 -llvm_targets_XCore ncurses -test -xar -xml -z3 >sys-devel/llvm-common-12.0.1:0 >sys-devel/m4-1.4.19:0 -examples nls >sys-devel/make-4.3:0 -guile nls -static >sys-devel/patch-2.7.6-r4:0 -static -test xattr >sys-fs/e2fsprogs-1.46.3:0 -cron -fuse -lto nls split-usr -static-libs threads >sys-fs/eudev-3.2.10-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 hwdb -introspection kmod -rule-generator -selinux -static-libs -test >sys-fs/udev-init-scripts-34:0 >sys-kernel/installkernel-gentoo-3:0 >sys-kernel/linux-headers-5.13:0 -headers-only >sys-libs/binutils-libs-2.36.1-r2:0/2.36.1 -64-bit-bfd -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -cet -multitarget nls -static-libs >sys-libs/e2fsprogs-libs-1.46.3:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 split-usr -static-libs >sys-libs/gdbm-1.20:0/6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 berkdb nls readline -static-libs >sys-libs/glibc-2.33-r5:2.2 -audit -caps -cet -compile-locales -crypt -custom-cflags -doc -gd -headers-only multiarch multilib -multilib-bootstrap -nscd -profile -selinux ssp static-libs -static-pie -suid -systemd -systemtap -test -vanilla >sys-libs/libcap-2.51:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 pam split-usr -static-libs >sys-libs/libseccomp-2.5.1-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -python python_targets_python3_8 python_targets_python3_9 -static-libs >sys-libs/libxcrypt-4.4.23-r2:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 compat split-usr static-libs system -test >sys-libs/ncurses-6.2_p20210619:0/6 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -ada cxx -debug -doc -gpm -minimal -profile split-usr -static-libs -test tinfo -trace >sys-libs/pam-1.5.1_p20210622:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -audit -berkdb -debug filecaps -nis -selinux split-usr >sys-libs/readline-8.1_p1-r1:0/8 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 split-usr -static-libs unicode -utils >sys-libs/timezone-data-2021a-r1:0 -leaps-timezone nls -zic-slim >sys-libs/zlib-1.2.11-r4:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 minizip split-usr -static-libs >sys-process/procps-3.3.17-r1:0/8 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 elogind kill -modern-top ncurses nls -selinux split-usr -static-libs -systemd -test unicode >sys-process/psmisc-23.4-r1:0 ipv6 nls -selinux -X >virtual/acl-0-r2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >virtual/awk-1:0 >virtual/dev-manager-0-r2:0 >virtual/editor-0-r3:0 >virtual/jpeg-100:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs >virtual/libc-1-r1:0 >virtual/libcrypt-2:0/2 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 static-libs >virtual/libelf-3:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >virtual/libiconv-0-r2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >virtual/libintl-0-r2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >virtual/libudev-249:0/1 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -static-libs -systemd >virtual/man-0-r4:0 >virtual/os-headers-0-r2:0 >virtual/package-manager-1:0 >virtual/pager-0:0 >virtual/perl-Carp-1.520.0-r1:0 >virtual/perl-Compress-Raw-Bzip2-2.101.0:0 >virtual/perl-Compress-Raw-Zlib-2.101.0:0 >virtual/perl-CPAN-Meta-2.150.10-r5:0 >virtual/perl-CPAN-Meta-Requirements-2.140.0-r7:0 >virtual/perl-CPAN-Meta-YAML-0.18.0-r7:0 >virtual/perl-Data-Dumper-2.179.0:0 >virtual/perl-Digest-MD5-2.580.0:0 >virtual/perl-Encode-3.80.0:0 >virtual/perl-Exporter-5.760.0:0 >virtual/perl-ExtUtils-CBuilder-0.280.236:0 >virtual/perl-ExtUtils-Install-2.200.0:0 >virtual/perl-ExtUtils-MakeMaker-7.620.0:0 >virtual/perl-ExtUtils-Manifest-1.730.0:0 >virtual/perl-ExtUtils-ParseXS-3.430.0:0 >virtual/perl-File-Spec-3.800.0:0 >virtual/perl-File-Temp-0.231.100:0 >virtual/perl-Getopt-Long-2.520.0:0 >virtual/perl-IO-1.460.0:0 >virtual/perl-IO-Compress-2.102.0:0 >virtual/perl-IO-Socket-IP-0.410.0:0 >virtual/perl-JSON-PP-4.60.0:0 >virtual/perl-libnet-3.130.0:0 ssl >virtual/perl-MIME-Base64-3.160.0:0 >virtual/perl-Module-Metadata-1.0.37-r1:0 >virtual/perl-parent-0.238.0-r1:0 >virtual/perl-Parse-CPAN-Meta-2.150.10-r5:0 >virtual/perl-Perl-OSType-1.10.0-r5:0 >virtual/perl-podlators-4.140.0-r2:0 >virtual/perl-Scalar-List-Utils-1.560.0:0 >virtual/perl-Test-Harness-3.430.0:0 >virtual/perl-Text-ParseWords-3.300.0-r8:0 >virtual/perl-Time-Local-1.300.0:0 >virtual/perl-version-0.992.800:0 >virtual/perl-XSLoader-0.300.0-r4:0 >virtual/pkgconfig-2:0 >virtual/rust-1.53.0:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >virtual/service-manager-1:0 >virtual/ssh-0:0 -minimal >virtual/tmpfiles-0-r1:0 >virtual/ttf-fonts-1-r1:0 >virtual/udev-249:0 >virtual/yacc-0:0 >www-client/pybugz-0.13-r1:0 python_targets_python3_8 python_targets_python3_9 >x11-base/xcb-proto-1.14.1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 python_targets_python3_8 python_targets_python3_9 >x11-base/xorg-proto-2021.4:0 -test >x11-libs/cairo-1.16.0-r4:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -aqua -debug -gles2-only glib -opengl -static-libs svg -utils -valgrind -X >x11-libs/libX11-1.7.2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc ipv6 -test >x11-libs/libXau-1.0.9-r1:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc >x11-libs/libxcb-1.14:0/1.12 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc -doc -selinux -test xkb >x11-libs/libXdmcp-1.1.3:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc >x11-libs/libXext-1.3.4:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -doc >x11-libs/libXrender-0.9.10-r2:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 >x11-libs/pixman-0.40.0:0 -abi_mips_n32 -abi_mips_n64 -abi_mips_o32 -abi_s390_32 -abi_s390_64 -abi_x86_32 abi_x86_64 -abi_x86_x32 -cpu_flags_arm_iwmmxt -cpu_flags_arm_iwmmxt2 -cpu_flags_arm_neon -cpu_flags_ppc_altivec cpu_flags_x86_mmxext cpu_flags_x86_sse2 -cpu_flags_x86_ssse3 -loongson2f -static-libs >x11-libs/xtrans-1.4.0:0 -doc >x11-misc/compose-tables-1.7.2:0 >x11-misc/shared-mime-info-2.1:0 > > >####################### ># build.log # >####################### >>>> Unpacking source... >>>> Unpacking pydyf-0.0.3.gh.tar.gz to /var/tmp/portage/dev-python/pydyf-0.0.3/work >>>> Source unpacked in /var/tmp/portage/dev-python/pydyf-0.0.3/work >>>> Preparing source in /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3 ... >>>> Source prepared. >>>> Configuring source in /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3 ... >>>> Source configured. >>>> Compiling source in /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3 ... > * python3_8: running distutils-r1_run_phase distutils-r1_python_compile >python3.8 -m pyproject2setuppy build -j 24 >running build >running build_py >creating /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3-python3_8/lib/pydyf >copying pydyf/__init__.py -> /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3-python3_8/lib/pydyf >warning: build_py: byte-compiling is disabled, skipping. > > * python3_9: running distutils-r1_run_phase distutils-r1_python_compile >python3.9 -m pyproject2setuppy build -j 24 >running build >running build_py >creating /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3-python3_9/lib/pydyf >copying pydyf/__init__.py -> /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3-python3_9/lib/pydyf >warning: build_py: byte-compiling is disabled, skipping. > >>>> Source compiled. >>>> Test phase: dev-python/pydyf-0.0.3 > * python3_8: running distutils-r1_run_phase python_test >python3.8 -m pytest -vv -ra -l -Wdefault >============================= test session starts ============================== >platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3.8 >cachedir: .pytest_cache >rootdir: /var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3, configfile: pyproject.toml >collecting ... collected 21 items > >tests/test_pydyf.py::test_fill FAILED [ 4%] >tests/test_pydyf.py::test_stroke FAILED [ 9%] >tests/test_pydyf.py::test_line_to FAILED [ 14%] >tests/test_pydyf.py::test_set_color_rgb_stroke FAILED [ 19%] >tests/test_pydyf.py::test_set_color_rgb_fill FAILED [ 23%] >tests/test_pydyf.py::test_set_dash FAILED [ 28%] >tests/test_pydyf.py::test_curve_to FAILED [ 33%] >tests/test_pydyf.py::test_curve_start_to FAILED [ 38%] >tests/test_pydyf.py::test_curve_end_to FAILED [ 42%] >tests/test_pydyf.py::test_transform FAILED [ 47%] >tests/test_pydyf.py::test_set_state FAILED [ 52%] >tests/test_pydyf.py::test_fill_and_stroke FAILED [ 57%] >tests/test_pydyf.py::test_clip FAILED [ 61%] >tests/test_pydyf.py::test_clip_even_odd FAILED [ 66%] >tests/test_pydyf.py::test_close FAILED [ 71%] >tests/test_pydyf.py::test_stroke_and_close FAILED [ 76%] >tests/test_pydyf.py::test_fill_stroke_and_close FAILED [ 80%] >tests/test_pydyf.py::test_push_pop_state FAILED [ 85%] >tests/test_pydyf.py::test_types FAILED [ 90%] >tests/test_pydyf.py::test_compress FAILED [ 95%] >tests/test_pydyf.py::test_text FAILED [100%] > >=================================== FAILURES =================================== >__________________________________ test_fill ___________________________________ > > def test_fill(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.fill() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d9af70> >draw = <pydyf.Stream object at 0x7fd689d9ae80> > >tests/test_pydyf.py:21: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d9af70> > pdf = <_io.BytesIO object at 0x7fd689f71090> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 12\n>>\nstream\n2 2 5 6 ' > b're\nf\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents' > b' 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000000 65535 f' > b' \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 n \n0000000144' > b' 00000 n \n0000000206 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R\n/Info 2' > b' 0 R\n>>\nstartxref\n293\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689e26550> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689e26550> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 72 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689e26550> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >_________________________________ test_stroke __________________________________ > > def test_stroke(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.set_line_width(2) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _KKKKKKK__ > _KKKKKKK__ > _KK___KK__ > _KK___KK__ > _KK___KK__ > _KK___KK__ > _KKKKKKK__ > _KKKKKKK__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689a9b130> >draw = <pydyf.Stream object at 0x7fd689a9bb80> > >tests/test_pydyf.py:51: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689a9b130> > pdf = <_io.BytesIO object at 0x7fd689c462c0> > reference_pixels = ('\n' > ' __________\n' > ' _KKKKKKK__\n' > ' _KKKKKKK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KKKKKKK__\n' > ' _KKKKKKK__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 16\n>>\nstream\n2 2 5 6 ' > b're\n2 w\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/' > b'Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000000' > b' 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 n \n00' > b'00000144 00000 n \n0000000210 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R' > b'\n/Info 2 0 R\n>>\nstartxref\n297\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689a9bd30> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689a9bd30> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 73 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689a9bd30> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >_________________________________ test_line_to _________________________________ > > def test_line_to(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.set_line_width(2) > draw.line_to(2, 5) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > __________ > _KK_______ > _KK_______ > _KK_______ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d66a90> >draw = <pydyf.Stream object at 0x7fd689d66940> > >tests/test_pydyf.py:82: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d66a90> > pdf = <_io.BytesIO object at 0x7fd689f69040> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' _KK_______\n' > ' _KK_______\n' > ' _KK_______\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 17\n>>\nstream\n2 2 m\n2 ' > b'w\n2 5 l\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n' > b'/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n000000000' > b'0 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 n \n0' > b'000000144 00000 n \n0000000211 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 ' > b'R\n/Info 2 0 R\n>>\nstartxref\n298\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d66f10> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d66f10> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 74 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d66f10> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________ test_set_color_rgb_stroke ___________________________ > > def test_set_color_rgb_stroke(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.set_line_width(2) > draw.set_color_rgb(0, 0, 255, stroke=True) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _BBBBBBB__ > _BBBBBBB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BBBBBBB__ > _BBBBBBB__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d7e250> >draw = <pydyf.Stream object at 0x7fd689d7e550> > >tests/test_pydyf.py:113: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d7e250> > pdf = <_io.BytesIO object at 0x7fd689dcff40> > reference_pixels = ('\n' > ' __________\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 27\n>>\nstream\n2 2 5 6 ' > b're\n2 w\n0 0 255 RG\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Par' > b'ent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6' > b'\n0000000000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 ' > b'00000 n \n0000000144 00000 n \n0000000221 00000 n \ntrailer\n<<\n/Size 6\n' > b'/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n308\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d7e700> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d7e700> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 75 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d7e700> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >___________________________ test_set_color_rgb_fill ____________________________ > > def test_set_color_rgb_fill(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.set_color_rgb(255, 0, 0) > draw.fill() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __RRRRR___ > __RRRRR___ > __RRRRR___ > __RRRRR___ > __RRRRR___ > __RRRRR___ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689dc1400> >draw = <pydyf.Stream object at 0x7fd689dc16a0> > >tests/test_pydyf.py:143: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689dc1400> > pdf = <_io.BytesIO object at 0x7fd689de15e0> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __RRRRR___\n' > ' __RRRRR___\n' > ' __RRRRR___\n' > ' __RRRRR___\n' > ' __RRRRR___\n' > ' __RRRRR___\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 23\n>>\nstream\n2 2 5 6 ' > b're\n255 0 0 rg\nf\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 ' > b'R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000' > b'000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 n ' > b'\n0000000144 00000 n \n0000000217 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 ' > b'0 R\n/Info 2 0 R\n>>\nstartxref\n304\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689dc1850> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689dc1850> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 76 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689dc1850> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >________________________________ test_set_dash _________________________________ > > def test_set_dash(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.set_line_width(2) > draw.line_to(2, 6) > draw.set_dash([2, 1], 0) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > _KK_______ > __________ > _KK_______ > _KK_______ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689c7e130> >draw = <pydyf.Stream object at 0x7fd689c7e730> > >tests/test_pydyf.py:175: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689c7e130> > pdf = <_io.BytesIO object at 0x7fd689de7130> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' _KK_______\n' > ' __________\n' > ' _KK_______\n' > ' _KK_______\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 29\n>>\nstream\n2 2 m\n2 ' > b'w\n2 6 l\n[ 2 1 ] 0 d\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/P' > b'arent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0' > b' 6\n0000000000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n000000009' > b'5 00000 n \n0000000144 00000 n \n0000000223 00000 n \ntrailer\n<<\n/Size ' > b'6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n310\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689c7e970> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689c7e970> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 77 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689c7e970> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >________________________________ test_curve_to _________________________________ > > def test_curve_to(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 5) > draw.set_line_width(2) > draw.curve_to(2, 5, 3, 5, 5, 5) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > __KKK_____ > __KKK_____ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689db35b0> >draw = <pydyf.Stream object at 0x7fd689db3850> > >tests/test_pydyf.py:206: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689db35b0> > pdf = <_io.BytesIO object at 0x7fd689dedf90> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __KKK_____\n' > ' __KKK_____\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 25\n>>\nstream\n2 5 m\n2 ' > b'w\n2 5 3 5 5 5 c\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 ' > b'0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n00000' > b'00000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 ' > b'n \n0000000144 00000 n \n0000000219 00000 n \ntrailer\n<<\n/Size 6\n/Root ' > b'3 0 R\n/Info 2 0 R\n>>\nstartxref\n306\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689db3a60> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689db3a60> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 78 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689db3a60> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >_____________________________ test_curve_start_to ______________________________ > > def test_curve_start_to(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 5) > draw.set_line_width(2) > draw.curve_start_to(3, 5, 5, 5) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > __KKK_____ > __KKK_____ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689c233d0> >draw = <pydyf.Stream object at 0x7fd689c237c0> > >tests/test_pydyf.py:237: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689c233d0> > pdf = <_io.BytesIO object at 0x7fd689f71b30> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __KKK_____\n' > ' __KKK_____\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 21\n>>\nstream\n2 5 m\n2 ' > b'w\n3 5 5 5 v\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 ' > b'0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n00000' > b'00000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 ' > b'n \n0000000144 00000 n \n0000000215 00000 n \ntrailer\n<<\n/Size 6\n/Root ' > b'3 0 R\n/Info 2 0 R\n>>\nstartxref\n302\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689c23850> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689c23850> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 79 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689c23850> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >______________________________ test_curve_end_to _______________________________ > > def test_curve_end_to(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 5) > draw.set_line_width(2) > draw.curve_end_to(3, 5, 5, 5) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > __KKK_____ > __KKK_____ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d5ee20> >draw = <pydyf.Stream object at 0x7fd689d5e610> > >tests/test_pydyf.py:268: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d5ee20> > pdf = <_io.BytesIO object at 0x7fd689da89a0> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __KKK_____\n' > ' __KKK_____\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 21\n>>\nstream\n2 5 m\n2 ' > b'w\n3 5 5 5 y\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 ' > b'0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n00000' > b'00000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 ' > b'n \n0000000144 00000 n \n0000000215 00000 n \ntrailer\n<<\n/Size 6\n/Root ' > b'3 0 R\n/Info 2 0 R\n>>\nstartxref\n302\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d5efa0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d5efa0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 80 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d5efa0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >________________________________ test_transform ________________________________ > > def test_transform(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.set_line_width(2) > draw.line_to(2, 5) > draw.transform(1, 0, 0, 1, 1, 1) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > __KK______ > __KK______ > __KK______ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689abc580> >draw = <pydyf.Stream object at 0x7fd689abcc10> > >tests/test_pydyf.py:300: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689abc580> > pdf = <_io.BytesIO object at 0x7fd689de4950> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __KK______\n' > ' __KK______\n' > ' __KK______\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 32\n>>\nstream\n2 2 m\n2 ' > b'w\n2 5 l\n1 0 0 1 1 1 cm\nS\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page' > b'\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxre' > b'f\n0 6\n0000000000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n00' > b'00000095 00000 n \n0000000144 00000 n \n0000000226 00000 n \ntrailer\n<<' > b'\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n313\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689abcaf0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689abcaf0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 81 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689abcaf0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >________________________________ test_set_state ________________________________ > > def test_set_state(): > document = pydyf.PDF() > > graphic_state = pydyf.Dictionary({ > 'Type': '/ExtGState', > 'LW': 2, > }) > document.add_object(graphic_state) > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.set_state('GS') > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > 'Resources': pydyf.Dictionary({ > 'ExtGState': pydyf.Dictionary({'GS': graphic_state.reference}), > }), > })) > >> assert_pixels(document, ''' > __________ > _KKKKKKK__ > _KKKKKKK__ > _KK___KK__ > _KK___KK__ > _KK___KK__ > _KK___KK__ > _KKKKKKK__ > _KKKKKKK__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689a830d0> >draw = <pydyf.Stream object at 0x7fd689a83550> >graphic_state = {'LW': 2, 'Type': '/ExtGState'} > >tests/test_pydyf.py:339: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689a830d0> > pdf = <_io.BytesIO object at 0x7fd689c5d860> > reference_pixels = ('\n' > ' __________\n' > ' _KKKKKKK__\n' > ' _KKKKKKK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KK___KK__\n' > ' _KKKKKKK__\n' > ' _KKKKKKK__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 6 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Type /ExtGState\n/LW 2\n>>\nend' > b'obj\n5 0 obj\n<<\n/Length 19\n>>\nstream\n2 2 5 6 re\n/GS gs\nS\nendstrea' > b'm\nendobj\n6 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents 5 0 R\n/Media' > b'Box [ 0 0 10 10 ]\n/Resources <<\n/ExtGState <<\n/GS 4 0 R\n>>\n>>\n>>\nend' > b'obj\nxref\n0 7\n0000000000 65535 f \n0000000015 00000 n \n0000000074 0000' > b'0 n \n0000000095 00000 n \n0000000144 00000 n \n0000000188 00000 n \n0000000' > b'257 00000 n \ntrailer\n<<\n/Size 7\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref' > b'\n388\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689a83610> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689a83610> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 82 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689a83610> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >_____________________________ test_fill_and_stroke _____________________________ > > def test_fill_and_stroke(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.set_line_width(2) > draw.set_color_rgb(0, 0, 255, stroke=True) > draw.fill_and_stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _BBBBBBB__ > _BBBBBBB__ > _BBKKKBB__ > _BBKKKBB__ > _BBKKKBB__ > _BBKKKBB__ > _BBBBBBB__ > _BBBBBBB__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689aa6280> >draw = <pydyf.Stream object at 0x7fd689aa6070> > >tests/test_pydyf.py:370: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689aa6280> > pdf = <_io.BytesIO object at 0x7fd689c7a310> > reference_pixels = ('\n' > ' __________\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' _BBKKKBB__\n' > ' _BBKKKBB__\n' > ' _BBKKKBB__\n' > ' _BBKKKBB__\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 27\n>>\nstream\n2 2 5 6 ' > b're\n2 w\n0 0 255 RG\nB\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Par' > b'ent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6' > b'\n0000000000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 ' > b'00000 n \n0000000144 00000 n \n0000000221 00000 n \ntrailer\n<<\n/Size 6\n' > b'/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n308\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689aa69a0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689aa69a0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 83 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689aa69a0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________________ test_clip ___________________________________ > > def test_clip(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(3, 3, 5, 6) > draw.rectangle(4, 3, 2, 6) > draw.clip() > draw.end() > draw.move_to(0, 5) > draw.line_to(10, 5) > draw.set_color_rgb(255, 0, 0, stroke=True) > draw.set_line_width(2) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > ___RRRRR__ > ___RRRRR__ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689c30c40> >draw = <pydyf.Stream object at 0x7fd689c30f10> > >tests/test_pydyf.py:406: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689c30c40> > pdf = <_io.BytesIO object at 0x7fd689f64040> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ___RRRRR__\n' > ' ___RRRRR__\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 55\n>>\nstream\n3 3 5 6 ' > b're\n4 3 2 6 re\nW\nn\n0 5 m\n10 5 l\n255 0 0 RG\n2 w\nS\nendstream\nendobj' > b'\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 ' > b'0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n ' > b'\n0000000074 00000 n \n0000000095 00000 n \n0000000144 00000 n \n0000000249 ' > b'00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n336' > b'\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689c30040> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689c30040> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 84 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689c30040> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >______________________________ test_clip_even_odd ______________________________ > > def test_clip_even_odd(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(3, 3, 5, 6) > draw.rectangle(4, 3, 2, 6) > draw.clip(even_odd=True) > draw.end() > draw.move_to(0, 5) > draw.line_to(10, 5) > draw.set_color_rgb(255, 0, 0, stroke=True) > draw.set_line_width(2) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __________ > __________ > ___R__RR__ > ___R__RR__ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d669a0> >draw = <pydyf.Stream object at 0x7fd689d66d00> > >tests/test_pydyf.py:442: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d669a0> > pdf = <_io.BytesIO object at 0x7fd689c4e630> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ___R__RR__\n' > ' ___R__RR__\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 56\n>>\nstream\n3 3 5 6 ' > b're\n4 3 2 6 re\nW*\nn\n0 5 m\n10 5 l\n255 0 0 RG\n2 w\nS\nendstream\nendob' > b'j\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0' > b' 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n' > b' \n0000000074 00000 n \n0000000095 00000 n \n0000000144 00000 n \n0000000250' > b' 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n33' > b'7\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d660d0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d660d0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 85 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d660d0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________________ test_close __________________________________ > > def test_close(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.line_to(2, 8) > draw.line_to(7, 8) > draw.line_to(7, 2) > draw.close() > draw.set_color_rgb(0, 0, 255, stroke=True) > draw.set_line_width(2) > draw.stroke() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _BBBBBBB__ > _BBBBBBB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BBBBBBB__ > _BBBBBBB__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d0d5e0> >draw = <pydyf.Stream object at 0x7fd689d0d700> > >tests/test_pydyf.py:477: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d0d5e0> > pdf = <_io.BytesIO object at 0x7fd689a85400> > reference_pixels = ('\n' > ' __________\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 42\n>>\nstream\n2 2 m\n2 ' > b'8 l\n7 8 l\n7 2 l\nh\n0 0 255 RG\n2 w\nS\nendstream\nendobj\n5 0 obj\n<<\n/' > b'Type /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\n' > b'endobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n \n0000000074 0' > b'0000 n \n0000000095 00000 n \n0000000144 00000 n \n0000000236 00000 n \ntrai' > b'ler\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n323\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d0dca0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d0dca0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 86 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d0dca0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >____________________________ test_stroke_and_close _____________________________ > > def test_stroke_and_close(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.line_to(2, 8) > draw.line_to(7, 8) > draw.line_to(7, 2) > draw.set_color_rgb(0, 0, 255, stroke=True) > draw.set_line_width(2) > draw.stroke_and_close() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _BBBBBBB__ > _BBBBBBB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BB___BB__ > _BBBBBBB__ > _BBBBBBB__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d0f970> >draw = <pydyf.Stream object at 0x7fd689d0f7f0> > >tests/test_pydyf.py:511: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d0f970> > pdf = <_io.BytesIO object at 0x7fd689c24ef0> > reference_pixels = ('\n' > ' __________\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BB___BB__\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 40\n>>\nstream\n2 2 m\n2 ' > b'8 l\n7 8 l\n7 2 l\n0 0 255 RG\n2 w\ns\nendstream\nendobj\n5 0 obj\n<<\n/Ty' > b'pe /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nen' > b'dobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n \n0000000074 000' > b'00 n \n0000000095 00000 n \n0000000144 00000 n \n0000000234 00000 n \ntraile' > b'r\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n321\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d0f460> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d0f460> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 87 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d0f460> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________ test_fill_stroke_and_close __________________________ > > def test_fill_stroke_and_close(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.move_to(2, 2) > draw.line_to(2, 8) > draw.line_to(7, 8) > draw.line_to(7, 2) > draw.set_color_rgb(255, 0, 0) > draw.set_color_rgb(0, 0, 255, stroke=True) > draw.set_line_width(2) > draw.fill_stroke_and_close() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > _BBBBBBB__ > _BBBBBBB__ > _BBRRRBB__ > _BBRRRBB__ > _BBRRRBB__ > _BBRRRBB__ > _BBBBBBB__ > _BBBBBBB__ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689c23bb0> >draw = <pydyf.Stream object at 0x7fd689c230d0> > >tests/test_pydyf.py:546: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689c23bb0> > pdf = <_io.BytesIO object at 0x7fd689ded950> > reference_pixels = ('\n' > ' __________\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' _BBRRRBB__\n' > ' _BBRRRBB__\n' > ' _BBRRRBB__\n' > ' _BBRRRBB__\n' > ' _BBBBBBB__\n' > ' _BBBBBBB__\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 51\n>>\nstream\n2 2 m\n2 ' > b'8 l\n7 8 l\n7 2 l\n255 0 0 rg\n0 0 255 RG\n2 w\nb\nendstream\nendobj\n5 0' > b' obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10' > b' 10 ]\n>>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n \n000' > b'0000074 00000 n \n0000000095 00000 n \n0000000144 00000 n \n0000000245 0000' > b'0 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n332' > b'\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689c23610> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689c23610> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 88 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689c23610> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >_____________________________ test_push_pop_state ______________________________ > > def test_push_pop_state(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.push_state() > draw.rectangle(4, 4, 2, 2) > draw.set_color_rgb(255, 0, 0) > draw.pop_state() > draw.fill() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689db30d0> >draw = <pydyf.Stream object at 0x7fd689db3a90> > >tests/test_pydyf.py:579: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689db30d0> > pdf = <_io.BytesIO object at 0x7fd689c4e810> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 38\n>>\nstream\n2 2 5 6 ' > b're\nq\n4 4 2 2 re\n255 0 0 rg\nQ\nf\nendstream\nendobj\n5 0 obj\n<<\n/Type' > b' /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendo' > b'bj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 n \n0000000074 00000' > b' n \n0000000095 00000 n \n0000000144 00000 n \n0000000232 00000 n \ntrai' > b'ler\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n319\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689db3dc0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689db3dc0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 89 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689db3dc0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________________ test_types __________________________________ > > def test_types(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2.0, '5', b'6') > draw.set_line_width(2.3456) > draw.fill() > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689dc0ac0> >draw = <pydyf.Stream object at 0x7fd689dc0c10> > >tests/test_pydyf.py:609: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689dc0ac0> > pdf = <_io.BytesIO object at 0x7fd689db2130> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Length 23\n>>\nstream\n2 2 5 6 ' > b're\n2.345600 w\nf\nendstream\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 ' > b'R\n/Contents 4 0 R\n/MediaBox [ 0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000' > b'000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 n ' > b'\n0000000144 00000 n \n0000000217 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 ' > b'0 R\n/Info 2 0 R\n>>\nstartxref\n304\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689dc0730> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689dc0730> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 90 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689dc0730> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >________________________________ test_compress _________________________________ > > def test_compress(): > document = pydyf.PDF() > > draw = pydyf.Stream() > draw.rectangle(2, 2, 5, 6) > draw.fill() > assert b'2 2 5 6' in draw.data > > draw = pydyf.Stream(compress=True) > draw.rectangle(2, 2, 5, 6) > draw.fill() > assert b'2 2 5 6' not in draw.data > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > })) > >> assert_pixels(document, ''' > __________ > __________ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __KKKKK___ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689c3be20> >draw = <pydyf.Stream object at 0x7fd689c3bf70> > >tests/test_pydyf.py:644: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689c3be20> > pdf = <_io.BytesIO object at 0x7fd689c24040> > reference_pixels = ('\n' > ' __________\n' > ' __________\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __KKKKK___\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 5 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Filter /FlateDecode\n/Length 20\n>' > b'>\nstream\nx\x9c3R0R0U0S(J\xe5J\x03\x00\x0e\xb5\x02\x97\nendstream\nendo' > b'bj\n5 0 obj\n<<\n/Type /Page\n/Parent 1 0 R\n/Contents 4 0 R\n/MediaBox [ ' > b'0 0 10 10 ]\n>>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000015 00000 ' > b'n \n0000000074 00000 n \n0000000095 00000 n \n0000000144 00000 n \n000000023' > b'5 00000 n \ntrailer\n<<\n/Size 6\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n3' > b'22\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689c3b0d0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689c3b0d0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 91 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689c3b0d0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >__________________________________ test_text ___________________________________ > > def test_text(): > document = pydyf.PDF() > > font = pydyf.Dictionary({ > 'Type': '/Font', > 'Subtype': '/Type1', > 'Name': '/F1', > 'BaseFont': '/Helvetica', > 'Encoding': '/MacRomanEncoding', > }) > document.add_object(font) > > draw = pydyf.Stream() > draw.begin_text() > draw.set_font_size('F1', 200) > draw.text_matrix(1, 0, 0, 1, -20, 5) > draw.show_text(pydyf.String('l')) > draw.show_text(pydyf.String('Ã')) > draw.end_text() > > document.add_object(draw) > > document.add_page(pydyf.Dictionary({ > 'Type': '/Page', > 'Parent': document.pages.reference, > 'Contents': draw.reference, > 'MediaBox': pydyf.Array([0, 0, 10, 10]), > 'Resources': pydyf.Dictionary({ > 'ProcSet': pydyf.Array(['/PDF', '/Text']), > 'Font': pydyf.Dictionary({'F1': font.reference}), > }), > })) > >> assert_pixels(document, ''' > KKKKKKKKKK > KKKKKKKKKK > KKKKKKKKKK > KKKKKKKKKK > KKKKKKKKKK > __________ > __________ > __________ > __________ > __________ > ''') > >document = <pydyf.PDF object at 0x7fd689d66f70> >draw = <pydyf.Stream object at 0x7fd689d66e50> >font = {'BaseFont': '/Helvetica', > 'Encoding': '/MacRomanEncoding', > 'Name': '/F1', > 'Subtype': '/Type1', > 'Type': '/Font'} > >tests/test_pydyf.py:691: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >tests/__init__.py:35: in assert_pixels > png = run(command, input=pdf.getvalue(), stdout=PIPE).stdout > command = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > document = <pydyf.PDF object at 0x7fd689d66f70> > pdf = <_io.BytesIO object at 0x7fd6899f08b0> > reference_pixels = ('\n' > ' KKKKKKKKKK\n' > ' KKKKKKKKKK\n' > ' KKKKKKKKKK\n' > ' KKKKKKKKKK\n' > ' KKKKKKKKKK\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' __________\n' > ' ') >/usr/lib/python3.8/subprocess.py:493: in run > with Popen(*popenargs, **kwargs) as process: > capture_output = False > check = False > input = (b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n1 0 obj\n<<\n/Type /Pages\n/Kids [ 6 0 R ]\n/' > b'Count 1\n>>\nendobj\n2 0 obj\n<<\n>>\nendobj\n3 0 obj\n<<\n/Type /Catalog' > b'\n/Pages 1 0 R\n>>\nendobj\n4 0 obj\n<<\n/Type /Font\n/Subtype /Type1\n/Name' > b' /F1\n/BaseFont /Helvetica\n/Encoding /MacRomanEncoding\n>>\nendobj\n5 0 ' > b'obj\n<<\n/Length 58\n>>\nstream\nBT\n/F1 200 Tf\n1 0 0 1 -20 5 Tm\n[(l)]' > b' TJ\n[<feff00c9>] TJ\nET\nendstream\nendobj\n6 0 obj\n<<\n/Type /Page\n/Pare' > b'nt 1 0 R\n/Contents 5 0 R\n/MediaBox [ 0 0 10 10 ]\n/Resources <<\n/ProcSet ' > b'[ /PDF /Text ]\n/Font <<\n/F1 4 0 R\n>>\n>>\n>>\nendobj\nxref\n0 7\n00000' > b'00000 65535 f \n0000000015 00000 n \n0000000074 00000 n \n0000000095 00000 ' > b'n \n0000000144 00000 n \n0000000252 00000 n \n0000000360 00000 n \ntrail' > b'er\n<<\n/Size 7\n/Root 3 0 R\n/Info 2 0 R\n>>\nstartxref\n510\n%%EOF\n') > kwargs = {'stdin': -1, 'stdout': -1} > popenargs = (['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'],) > timeout = None >/usr/lib/python3.8/subprocess.py:858: in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] > bufsize = -1 > c2pread = 13 > c2pwrite = 14 > close_fds = True > creationflags = 0 > cwd = None > encoding = None > env = None > errors = None > errread = -1 > errwrite = -1 > executable = None > f = <_io.BufferedReader name=13> > p2cread = 11 > p2cwrite = 12 > pass_fds = () > preexec_fn = None > restore_signals = True > self = <subprocess.Popen object at 0x7fd689d668b0> > shell = False > start_new_session = False > startupinfo = None > stderr = None > stdin = -1 > stdout = -1 > text = None > universal_newlines = None >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <subprocess.Popen object at 0x7fd689d668b0> >args = ['gs', '-q', '-dNOPAUSE', '-dSAFER', '-sDEVICE=png16m', '-r576', ...] >executable = b'gs', preexec_fn = None, close_fds = True, pass_fds = () >cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False >p2cread = 11, p2cwrite = 12, c2pread = 13, c2pwrite = 14, errread = -1 >errwrite = -1, restore_signals = True, start_new_session = False > > def _execute_child(self, args, executable, preexec_fn, close_fds, > pass_fds, cwd, env, > startupinfo, creationflags, shell, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite, > restore_signals, start_new_session): > """Execute program (POSIX version)""" > > if isinstance(args, (str, bytes)): > args = [args] > elif isinstance(args, os.PathLike): > if shell: > raise TypeError('path-like args is not allowed when ' > 'shell is true') > args = [args] > else: > args = list(args) > > if shell: > # On Android the default shell is at '/system/bin/sh'. > unix_shell = ('/system/bin/sh' if > hasattr(sys, 'getandroidapilevel') else '/bin/sh') > args = [unix_shell, "-c"] + args > if executable: > args[0] = executable > > if executable is None: > executable = args[0] > > sys.audit("subprocess.Popen", executable, args, cwd, env) > > if (_USE_POSIX_SPAWN > and os.path.dirname(executable) > and preexec_fn is None > and not close_fds > and not pass_fds > and cwd is None > and (p2cread == -1 or p2cread > 2) > and (c2pwrite == -1 or c2pwrite > 2) > and (errwrite == -1 or errwrite > 2) > and not start_new_session): > self._posix_spawn(args, executable, env, restore_signals, > p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > return > > orig_executable = executable > > # For transferring possible exec failure from child to parent. > # Data format: "exception name:hex errno:description" > # Pickle is not used; it is complex and involves memory allocation. > errpipe_read, errpipe_write = os.pipe() > # errpipe_write must not be in the standard io 0, 1, or 2 fd range. > low_fds_to_close = [] > while errpipe_write < 3: > low_fds_to_close.append(errpipe_write) > errpipe_write = os.dup(errpipe_write) > for low_fd in low_fds_to_close: > os.close(low_fd) > try: > try: > # We must avoid complex work that could involve > # malloc or free in the child process to avoid > # potential deadlocks, thus we do all this here. > # and pass it to fork_exec() > > if env is not None: > env_list = [] > for k, v in env.items(): > k = os.fsencode(k) > if b'=' in k: > raise ValueError("illegal environment variable name") > env_list.append(k + b'=' + os.fsencode(v)) > else: > env_list = None # Use execv instead of execve. > executable = os.fsencode(executable) > if os.path.dirname(executable): > executable_list = (executable,) > else: > # This matches the behavior of os._execvpe(). > executable_list = tuple( > os.path.join(os.fsencode(dir), executable) > for dir in os.get_exec_path(env)) > fds_to_keep = set(pass_fds) > fds_to_keep.add(errpipe_write) > self.pid = _posixsubprocess.fork_exec( > args, executable_list, > close_fds, tuple(sorted(map(int, fds_to_keep))), > cwd, env_list, > p2cread, p2cwrite, c2pread, c2pwrite, > errread, errwrite, > errpipe_read, errpipe_write, > restore_signals, start_new_session, preexec_fn) > self._child_created = True > finally: > # be sure the FD is closed no matter what > os.close(errpipe_write) > > self._close_pipe_fds(p2cread, p2cwrite, > c2pread, c2pwrite, > errread, errwrite) > > # Wait for exec to fail or succeed; possibly raising an > # exception (limited in size) > errpipe_data = bytearray() > while True: > part = os.read(errpipe_read, 50000) > errpipe_data += part > if not part or len(errpipe_data) > 50000: > break > finally: > # be sure the FD is closed no matter what > os.close(errpipe_read) > > if errpipe_data: > try: > pid, sts = os.waitpid(self.pid, 0) > if pid == self.pid: > self._handle_exitstatus(sts) > else: > self.returncode = sys.maxsize > except ChildProcessError: > pass > > try: > exception_name, hex_errno, err_msg = ( > errpipe_data.split(b':', 2)) > # The encoding here should match the encoding > # written in by the subprocess implementations > # like _posixsubprocess > err_msg = err_msg.decode() > except ValueError: > exception_name = b'SubprocessError' > hex_errno = b'0' > err_msg = 'Bad exception data from child: {!r}'.format( > bytes(errpipe_data)) > child_exception_type = getattr( > builtins, exception_name.decode('ascii'), > SubprocessError) > if issubclass(child_exception_type, OSError) and hex_errno: > errno_num = int(hex_errno, 16) > child_exec_never_called = (err_msg == "noexec") > if child_exec_never_called: > err_msg = "" > # The error must be from chdir(cwd). > err_filename = cwd > else: > err_filename = orig_executable > if errno_num != 0: > err_msg = os.strerror(errno_num) >> raise child_exception_type(errno_num, err_msg, err_filename) >E FileNotFoundError: [Errno 2] No such file or directory: 'gs' > >args = ['gs', > '-q', > '-dNOPAUSE', > '-dSAFER', > '-sDEVICE=png16m', > '-r576', > '-dDownScaleFactor=8', > '-sOutputFile=-', > '-'] >c2pread = 13 >c2pwrite = 14 >child_exception_type = <class 'OSError'> >child_exec_never_called = False >close_fds = True >creationflags = 0 >cwd = None >env = None >env_list = None >err_filename = 'gs' >err_msg = 'No such file or directory' >errno_num = 2 >errpipe_data = bytearray(b'OSError:2:') >errpipe_read = 15 >errpipe_write = 16 >errread = -1 >errwrite = -1 >exception_name = bytearray(b'OSError') >executable = b'gs' >executable_list = (b'/var/tmp/portage/dev-python/pydyf-0.0.3/temp/python3.8/bin/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/xattr/gs', > b'/usr/lib/portage/python3.9/ebuild-helpers/gs', > b'/usr/local/sbin/gs', > b'/usr/local/bin/gs', > b'/usr/sbin/gs', > b'/usr/bin/gs', > b'/sbin/gs', > b'/bin/gs', > b'/opt/bin/gs', > b'/usr/lib/llvm/12/bin/gs') >fds_to_keep = {16} >hex_errno = bytearray(b'2') >low_fds_to_close = [] >orig_executable = 'gs' >p2cread = 11 >p2cwrite = 12 >part = b'' >pass_fds = () >pid = 92 >preexec_fn = None >restore_signals = True >self = <subprocess.Popen object at 0x7fd689d668b0> >shell = False >start_new_session = False >startupinfo = None >sts = 65280 > >/usr/lib/python3.8/subprocess.py:1704: FileNotFoundError >=========================== short test summary info ============================ >FAILED tests/test_pydyf.py::test_fill - FileNotFoundError: [Errno 2] No such ... >FAILED tests/test_pydyf.py::test_stroke - FileNotFoundError: [Errno 2] No suc... >FAILED tests/test_pydyf.py::test_line_to - FileNotFoundError: [Errno 2] No su... >FAILED tests/test_pydyf.py::test_set_color_rgb_stroke - FileNotFoundError: [E... >FAILED tests/test_pydyf.py::test_set_color_rgb_fill - FileNotFoundError: [Err... >FAILED tests/test_pydyf.py::test_set_dash - FileNotFoundError: [Errno 2] No s... >FAILED tests/test_pydyf.py::test_curve_to - FileNotFoundError: [Errno 2] No s... >FAILED tests/test_pydyf.py::test_curve_start_to - FileNotFoundError: [Errno 2... >FAILED tests/test_pydyf.py::test_curve_end_to - FileNotFoundError: [Errno 2] ... >FAILED tests/test_pydyf.py::test_transform - FileNotFoundError: [Errno 2] No ... >FAILED tests/test_pydyf.py::test_set_state - FileNotFoundError: [Errno 2] No ... >FAILED tests/test_pydyf.py::test_fill_and_stroke - FileNotFoundError: [Errno ... >FAILED tests/test_pydyf.py::test_clip - FileNotFoundError: [Errno 2] No such ... >FAILED tests/test_pydyf.py::test_clip_even_odd - FileNotFoundError: [Errno 2]... >FAILED tests/test_pydyf.py::test_close - FileNotFoundError: [Errno 2] No such... >FAILED tests/test_pydyf.py::test_stroke_and_close - FileNotFoundError: [Errno... >FAILED tests/test_pydyf.py::test_fill_stroke_and_close - FileNotFoundError: [... >FAILED tests/test_pydyf.py::test_push_pop_state - FileNotFoundError: [Errno 2... >FAILED tests/test_pydyf.py::test_types - FileNotFoundError: [Errno 2] No such... >FAILED tests/test_pydyf.py::test_compress - FileNotFoundError: [Errno 2] No s... >FAILED tests/test_pydyf.py::test_text - FileNotFoundError: [Errno 2] No such ... >============================== 21 failed in 1.57s ============================== > * ERROR: dev-python/pydyf-0.0.3::gentoo failed (test phase): > * pytest failed with python3.8 > * > * Call stack: > * ebuild.sh, line 127: Called src_test > * environment, line 2906: Called distutils-r1_src_test > * environment, line 1240: Called _distutils-r1_run_foreach_impl 'python_test' > * environment, line 510: Called python_foreach_impl 'distutils-r1_run_phase' 'python_test' > * environment, line 2573: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > * environment, line 2046: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' > * environment, line 2044: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test' > * environment, line 796: Called distutils-r1_run_phase 'python_test' > * environment, line 1179: Called python_test > * environment, line 2864: Called distutils-r1_python_test > * environment, line 1136: Called epytest > * environment, line 1564: Called die > * The specific snippet of code: > * "${@}" || die -n "pytest failed with ${EPYTHON}"; > * > * If you need support, post the output of `emerge --info '=dev-python/pydyf-0.0.3::gentoo'`, > * the complete build log and the output of `emerge -pqv '=dev-python/pydyf-0.0.3::gentoo'`. > * The complete build log is located at '/var/log/emerge-log/build/dev-python/pydyf-0.0.3:20210801-085020.log'. > * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/pydyf-0.0.3/temp/build.log'. > * The ebuild environment file is located at '/var/tmp/portage/dev-python/pydyf-0.0.3/temp/environment'. > * Working directory: '/var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3' > * S: '/var/tmp/portage/dev-python/pydyf-0.0.3/work/pydyf-0.0.3' >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 805920
: 729132