[issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary)
New submission from Shlomi Fish : As the pure-Python code below demonstrates, when called as `python3 test.py jitshift` it is much faster than when called as `python3 test.py builtinops` (which takes many seconds/minutes past the 24th iteration). I am using fedora 32 x86-64 on a Cannon lake intel core i5 NUC. Tested with latest cpython3 git master and with /usr/bin/pypy3 The improvement was done in pure-python / userland and may be improved upon further given these or others: https://gmplib.org/ and https://github.com/ridiculousfish/libdivide . ``` #!/usr/bin/env python3 # The Expat License # # Copyright (c) 2020, Shlomi Fish # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import sys OPT = "builtinops" def mytest(p): pint2p = p << p myrange = range(1000) if OPT == "builtinpow": ret = pow(2, (1 << p), pint2p) elif OPT == "builtinops": ret = 2 for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret %= pint2p print('after mod', i, (ret % 10 ** 20), flush=True) else: class ShiftMod: """docstring for ShiftMod:d""" def __init__(self, base, shift): self.base = base self.shift = shift self.mask = (1 << shift) - 1 self.n = base << shift def mod(self, inp): if inp < self.n: return inp return inp >> self.shift) % self.base) << self.shift) | (inp & self.mask)) def gen_shift_mod(x): s = 0 for offset in (20, 2, 2000, 200, 20, 1): bits_mask = (1 << offset) - 1 while x & bits_mask == 0: s += offset x >>= offset return ShiftMod(x, s) ret = 2 if OPT == "shiftmodpre": m = ShiftMod(p, p) for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) # m = gen_shift_mod(pint2p) ret = m.mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) elif OPT == "gen_shift_mod": m = gen_shift_mod(pint2p) for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret = m.mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) elif OPT == "jitshift": for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret = gen_shift_mod(pint2p).mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) return ret % (p*p) // p def main(which): global OPT OPT = which ''' if which == "builtinpow": OPT = 1 elif which == "builtinops": OPT = 0 elif which == "shiftmod": OPT = 2 else: raise Exception("unknown choice") ''' x = mytest(9816593) print(x) return if __name__ == "__main__": main(sys.argv[1]) ``` -- components: Interpreter Core files: modtest.py messages: 374869 nosy: shlomif2 priority: normal severity: normal status: open title: Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) type: performance versions: Python 3.10 Added file: https://bugs.python.org/file49369/modtest.py ___ Python tracker <https://bugs.python.org/issue41487> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37371] Optimize and refactor readline().
Shlomi Fish added the comment: @Serhiy: here is the test data - https://www.shlomifish.org/Files/files/arcs/0fc-log--python-37371-issue.7z (shlomif[0fc]:$this$ sha256sum 0fc-log--python-37371-issue.7z aad93f103e255222ab8a06b9cc1c0930c6fc451ea148c46e098c74aa19aec021 0fc-log--python-37371-issue.7z shlomif[0fc]:$this$ ). run it like "time python3 collect-stats.py 0fc-log.txt". I gave the results of a sample run in the main comment. -- ___ Python tracker <https://bugs.python.org/issue37371> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37371] Optimize and refactor readline().
Shlomi Fish added the comment: @Serhiy: I used https://github.com/shlomif/freecell-pro-0fc-deals/blob/master/collect-stats.py . -- ___ Python tracker <https://bugs.python.org/issue37371> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37371] Optimize and refactor readline().
New submission from Shlomi Fish : See: https://github.com/python/cpython/pull/14306 === 1. Merge two duplicate branches. 2. Extract some constants. 3. Convert to prefix-++ instead of suffix-++. === Benchmarks: before: + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.655s user0m6.599s sys 0m0.054s + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.817s user0m6.772s sys 0m0.045s + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.763s user0m6.706s sys 0m0.057s After: + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.651s user0m6.595s sys 0m0.056s + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.625s user0m6.559s sys 0m0.066s + PATH=/home/shlomif/apps/python3/bin:/home/shlomif/apps/fcs/bin:/home/shlomif/progs/freecell/git/0fc-b/:/home/shlomif/progs/freecell/git/0fc-b//board_gen:/home/shlomif/bin:/home/shlomif/apps/perl/modules/bin:/home/shlomif/apps/perl/modules/local/bin:/home/shlomif/apps/neovim/bin:/home/shlomif/apps/fop/fop-20140425:/home/shlomif/apps/vim/bin:/home/shlomif/apps/golang/bin:/home/shlomif/.local/bin:/home/shlomif/.perl6/bin:/home/shlomif/.cargo/bin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/usr/games + export LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + LD_LIBRARY_PATH=/home/shlomif/apps/python3/lib + python3 collect-stats.py 0fc-log.txt S 18474775 Int 617438 real0m6.601s user0m6.559s sys 0m0.042s = Based on https://github.com/shlomif/freecell-pro-0fc-deals . -- components: IO messages: 346280 nosy: shlomif priority: normal pull_requests: 14130 severity: normal status: open title
[issue1464444] ctypes should be able to link with installed libffi
Changes by Shlomi Fish : -- pull_requests: +2760 ___ Python tracker <http://bugs.python.org/issue146> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30912] python 3 git master fails to find libffi and build _ctypes on Mageia v6 x86-64
New submission from Shlomi Fish: Running "make" in cpython git master on mageia linux v6 x86-64 gives me this problem with ffi: <<<<<<<< running build running build_ext Header file /usr/include/ffi.h does not define LIBFFI_H or ffi_wrapper_h INFO: Could not locate ffi libs and/or headers The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: atexitpwd time Failed to build these modules: _ctypes running build_scripts copying and adjusting /home/shlomif/Download/unpack/prog/python/cpython/Tools/scripts/pydoc3 -> build/scripts-3.7 copying and adjusting /home/shlomif/Download/unpack/prog/python/cpython/Tools/scripts/idle3 -> build/scripts-3.7 copying and adjusting /home/shlomif/Download/unpack/prog/python/cpython/Tools/scripts/2to3 -> build/scripts-3.7 copying and adjusting /home/shlomif/Download/unpack/prog/python/cpython/Tools/scripts/pyvenv -> build/scripts-3.7 changing mode of build/scripts-3.7/pydoc3 from 644 to 755 changing mode of build/scripts-3.7/idle3 from 644 to 755 changing mode of build/scripts-3.7/2to3 from 644 to 755 changing mode of build/scripts-3.7/pyvenv from 644 to 755 renaming build/scripts-3.7/pydoc3 to build/scripts-3.7/pydoc3.7 renaming build/scripts-3.7/idle3 to build/scripts-3.7/idle3.7 renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7 renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7 >>>>>>> <<<<<< commit d1cc037d1442cc35d1b194ec8e50901514360949 Author: Victor Stinner Date: Wed Jul 12 16:05:43 2017 +0200 bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) tearDown() now clears explicitly the self.server variable to make sure that the thread is completely cleared when tearDownClass() checks if all threads have been cleaned up. Fix the following warning: $ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os (...) Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2) (...) Tests result: ENV CHANGED >>>>> The problem is that my /usr/include/ffi.h looks like this: <<<< #define _MULTIARCH_HEADER ffi.h #include >>>> -- components: Build messages: 298243 nosy: shlomif, zach.ware priority: normal severity: normal status: open title: python 3 git master fails to find libffi and build _ctypes on Mageia v6 x86-64 type: compile error versions: Python 3.7 ___ Python tracker <http://bugs.python.org/issue30912> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"
Shlomi Fish added the comment: You're welcome, and thanks for applying the patch so quickly. -- ___ Python tracker <http://bugs.python.org/issue28303> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28300] [PATCH] Fix misspelled "implemented" word
Shlomi Fish added the comment: You're welcome and thanks for applying it (and so quickl). -- ___ Python tracker <http://bugs.python.org/issue28300> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"
New submission from Shlomi Fish: Currently the comment in the example in "pydoc3 unittest" reads: « ## test method names begin 'test*' » This is broken grammar and the attached patch against the hg default branch corrects it. All tests are passing and I disclaim any implicit or explicit ownership of my changes. -- components: Library (Lib) files: python-fix-broken-grammar-in-pydoc3-unittest.patch keywords: patch messages: 277623 nosy: shlomif priority: normal severity: normal status: open title: [PATCH] Fix broken grammar in "pydoc3 unittest" versions: Python 3.7 Added file: http://bugs.python.org/file44867/python-fix-broken-grammar-in-pydoc3-unittest.patch ___ Python tracker <http://bugs.python.org/issue28303> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28300] [PATCH] Fix misspelled "implemented" word
New submission from Shlomi Fish: This patch fixes two places where "implement" was misspelled. I hereby disclaim all ownership of my changes (but crediting me will be appreciated.) -- files: python-fix-spelling-of-implement.patch keywords: patch messages: 277616 nosy: shlomif priority: normal severity: normal status: open title: [PATCH] Fix misspelled "implemented" word versions: Python 3.7 Added file: http://bugs.python.org/file44866/python-fix-spelling-of-implement.patch ___ Python tracker <http://bugs.python.org/issue28300> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
Shlomi Fish added the comment: Martin: [sorry for misspelling your name] I was now able to reproduce the same problem using rlwrap (see http://utopia.knoware.nl/~hlub/rlwrap/ ). I'll report it to the readline problem. -- ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
Shlomi Fish added the comment: Marting Panter: I'm getting the same problem with a completely empty ~/.python_history file. Moreover, I was able to reproduce a similar bug in gdb. I'll try seeing if I can create a minimal GNU readline-using program here that reproduces it. -- ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
Shlomi Fish added the comment: gdb by full attached. -- Added file: http://bugs.python.org/file40296/py3.gdb-bt.txt ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
Shlomi Fish added the comment: Hi all! Thanks for the investigation. I have now built readline-6.3 from source using: ./configure --prefix="$HOME/apps/readline-TO_DEL" --with-curses=yes --enable-multibyte and installed it. Then I built python 3.4.3 from source against it by setting LIBRARY_PATH/CPATH/etc. and by this patch to setup.py: if True: # if cross_compiling: self.add_gcc_paths() After I built it and ran it, it still segfaults after I type "r" and press PgUp twice. I've attached the strace output (compressed with xz). -- Added file: http://bugs.python.org/file40295/py3.strace.xz ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
Shlomi Fish added the comment: I'm attaching here the reduced, minimal, inputrc. I think it's a bug in Python because it doesn't happen with any other program that uses readline (bash, perl -d, etc.) that I checked. I'll check with a vanilla readline compiled from source from the GNU site , though. -- Added file: http://bugs.python.org/file40294/_inputrc ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24958] Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6)
New submission from Shlomi Fish: After I run python3 (to run the REPL) and type "r" and then PgUp twice, I get a segfault. I'm on Mageia Linux x86-64 6 , but recall a similar problem happening before: shlomif@telaviv1:~$ python3 Python 3.4.3 (default, Aug 13 2015, 21:40:54) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> rSegmentation fault shlomif@telaviv1:~$ python3^C I'm attaching the /etc/inputrc. -- components: Interpreter Core files: inputrc messages: 249322 nosy: shlomif priority: normal severity: normal status: open title: Segfault in REPL after pressing "r" and PgUp twice (on Mageia Linux x86-64 6) type: crash versions: Python 3.4 Added file: http://bugs.python.org/file40293/inputrc ___ Python tracker <http://bugs.python.org/issue24958> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24957] python3 -mpdb gets stuck in an unexitable infinite prompt loop when running some Python 2 code with syntax errors
Shlomi Fish added the comment: I should note that I am using python3-3.4.3-6.mga6 on Mageia Linux x86-64 6/Cauldron. -- ___ Python tracker <http://bugs.python.org/issue24957> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24957] python3 -mpdb gets stuck in an unexitable infinite prompt loop when running some Python 2 code with syntax errors
New submission from Shlomi Fish: I tried Ctrl+C, Ctrl+D, "quit" and "exit", and "q" - nothing exits from the infinite prompt loop. shlomif@telaviv1:~/Docs/homepage/homepage/trunk$ cd /home/shlomif/progs/riddles/project-euler/hg/project-euler/234 shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ ls brute-force.pl euler-234-description.txt euler-234-v1.py brute-force.pl~ euler-234-description.txt~ euler-234-v1.py~ shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ python3 euler-234-v1.py File "euler-234-v1.py", line 21 print "Found[] = ", n ^ SyntaxError: Missing parentheses in call to 'print' shlomif@telaviv1:~/progs/riddles/project-euler/hg/project-euler/234$ python3 -mpdb euler-234-v1.py 1000 Traceback (most recent call last): File "/usr/lib64/python3.4/pdb.py", line 1661, in main pdb._runscript(mainpyfile) File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript self.run(statement) File "/usr/lib64/python3.4/bdb.py", line 431, in run exec(cmd, globals, locals) File "", line 1, in File "/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py", line 21 print "Found[] = ", n ^ SyntaxError: Missing parentheses in call to 'print' Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > (1)() (Pdb) (Pdb) exit Post mortem debugger finished. The euler-234-v1.py will be restarted Traceback (most recent call last): File "/usr/lib64/python3.4/pdb.py", line 1661, in main pdb._runscript(mainpyfile) File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript self.run(statement) File "/usr/lib64/python3.4/bdb.py", line 431, in run exec(cmd, globals, locals) File "", line 1, in File "/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py", line 21 print "Found[] = ", n ^ SyntaxError: Missing parentheses in call to 'print' Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > (1)() (Pdb) quit Post mortem debugger finished. The euler-234-v1.py will be restarted Traceback (most recent call last): File "/usr/lib64/python3.4/pdb.py", line 1661, in main pdb._runscript(mainpyfile) File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript self.run(statement) File "/usr/lib64/python3.4/bdb.py", line 431, in run exec(cmd, globals, locals) File "", line 1, in File "/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py", line 21 print "Found[] = ", n ^ SyntaxError: Missing parentheses in call to 'print' Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > (1)() (Pdb) Post mortem debugger finished. The euler-234-v1.py will be restarted Traceback (most recent call last): File "/usr/lib64/python3.4/pdb.py", line 1661, in main pdb._runscript(mainpyfile) File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript self.run(statement) File "/usr/lib64/python3.4/bdb.py", line 431, in run exec(cmd, globals, locals) File "", line 1, in File "/home/shlomif/progs/riddles/project-euler/hg/project-euler/234/euler-234-v1.py", line 21 print "Found[] = ", n ^ SyntaxError: Missing parentheses in call to 'print' Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > (1)() (Pdb) --KeyboardInterrupt-- (Pdb) --KeyboardInterrupt-- (Pdb) exit Post mortem debugger finished. The euler-234-v1.py will be restarted Traceback (most recent call last): File "/usr/lib64/python3.4/pdb.py", line 1661, in main pdb._runscript(mainpyfile) File "/usr/lib64/python3.4/pdb.py&q
[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags
Shlomi Fish added the comment: Here is the new output of the "make test" with Python-3.4.1 : shlomif@telaviv1:~$ uname -a Linux telaviv1.shlomifish.org 3.15.6-desktop-1.mga5 #1 SMP Wed Jul 23 22:28:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux You may wish to install a Mageia Linux x86-64 Cauldron Virtual Machine instead of depending of waiting for me to do all that. See: http://www.joelonsoftware.com/articles/fog43.html Namely: " 9. Do you use the best tools money can buy?". -- Added file: http://bugs.python.org/file36434/python-3.4.1-make-test.txt ___ Python tracker <http://bugs.python.org/issue18188> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags
Shlomi Fish added the comment: I see regarding test_ftp.py and the verbosity of the tests and the absence of bdist_rpm in the output - however, shouldn't the test suite handle the presence of the PYTHONDONTWRITEBYTECODE=1 flag better? (E.g: refuse to run the tests to begin with (with an error), or not run the failing tests, or unset the flag before running the test suite, or whatever?) -- ___ Python tracker <http://bugs.python.org/issue18188> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags
Shlomi Fish added the comment: Hi, I don't understand the issue in questioned - it's too wordy and unclear. I don't know how to do the debugging in question - please guide me. I should note that after I do «unset PYTHONDONTWRITEBYTECODE» then all tests pass except for test_ftp.py, which gives me this. However, I don't see the bdist_rpm anywhere in the output. Was it skipped? If so, how, where and why? [QUOTE] == error: test_ftp (test.test_urllib2net.othernetworktests) -- traceback (most recent call last): file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 2307, in retrfile self.ftp.cwd(file) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 591, in cwd return self.voidcmd(cmd) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 264, in voidcmd return self.voidresp() file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 238, in voidresp resp = self.getresp() file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 233, in getresp raise error_perm(resp) ftplib.error_perm: 550 failed to change directory. during handling of the above exception, another exception occurred: traceback (most recent call last): file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 112, in test_ftp self._test_urls(urls, self._extra_handlers()) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 218, in _test_urls f = urlopen(url, req, timeout) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 33, in wrapped return _retry_thrice(func, exc, *args, **kwargs) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 23, in _retry_thrice return func(*args, **kwargs) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 469, in open response = self._open(req, data) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 487, in _open '_open', req) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 447, in _call_chain result = func(*args) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 1464, in ftp_open fp, retrlen = fw.retrfile(file, type) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 2309, in retrfile raise urlerror('ftp error: %d' % reason) from reason typeerror: %d format: a number is required, not error_perm ------ ran 15 tests in 14.820s [/QUOTE] Also see: https://bugs.mageia.org/show_bug.cgi?id=9395 Regards, -- Shlomi Fish -- ___ Python tracker <http://bugs.python.org/issue18188> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags
New submission from Shlomi Fish: After I build Python-3.3.2 from the .tar.xz using the following script (on Mageia Linux Cauldron x86-64): <<< #!/bin/bash ./configure --prefix="$HOME/apps/python3" --with-threads \ --enable-ipv6 --with-dbmliborder=gdbm \ --with-system-expat \ --with-system-ffi \ --enable-shared \ --with-valgrind shlomif@telaviv1:~/Download/unpack/prog/python/Python-3.3.2$ >>> then I get this test failure in the «test_no_optimize_flag»: [ QUOTE ] == ERROR: test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase) -- Traceback (most recent call last): File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/tests/test_bdist_rpm.py", line 125, in test_no_optimize_flag cmd.run() File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/command/bdist_rpm.py", line 366, in run self.spawn(rpm_cmd) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/cmd.py", line 366, in spawn spawn(cmd, search_path, dry_run=self.dry_run) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/spawn.py", line 32, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/spawn.py", line 163, in _spawn_posix % (cmd[0], exit_status)) distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 1 https://bugs.mageia.org/show_bug.cgi?id=9395 [ / QUOTE] More info can be found at http://bugs.python.org/issue18142 . Please look into fixing it. Regards, -- Shlomi Fish -- components: Tests messages: 190959 nosy: shlomif priority: normal severity: normal status: open title: ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue18188> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18142] Tests fail on Mageia Linux Cauldron x86-64 with some configure flags
New submission from Shlomi Fish: After I build Python-3.3.2 from the .tar.xz using the following script (on Mageia Linux Cauldron x86-64): <<< #!/bin/bash ./configure --prefix="$HOME/apps/python3" --with-threads \ --enable-ipv6 --with-dbmliborder=gdbm \ --with-system-expat \ --with-system-ffi \ --enable-shared \ --with-valgrind shlomif@telaviv1:~/Download/unpack/prog/python/Python-3.3.2$ >>> I get many test failures in make test (in the file attached to this repository). Can you look into fixing them? This is a precursor for fixing this bug: https://bugs.mageia.org/show_bug.cgi?id=9395 Regards, -- Shlomi Fish -- components: Tests files: python-make-test-output.txt messages: 190665 nosy: shlomif priority: normal severity: normal status: open title: Tests fail on Mageia Linux Cauldron x86-64 with some configure flags versions: Python 3.3 Added file: http://bugs.python.org/file30471/python-make-test-output.txt ___ Python tracker <http://bugs.python.org/issue18142> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com