[issue21571] Python build should check CPATH, C_INCLUDE_PATH for module dependencies
Jan Kanis added the comment: I can write a patch. I haven't signed a contributor agreement but I have no problem doing so. I am not sure when I will have time to write a patch though, so it could take some time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21571 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21910] File protocol should document if writelines must handle generators sensibly
New submission from Jan Kanis: The resolution of issue 5445 should be documented somewhere properly, so people can depend on it or not. IOBase.writelines handles generator arguments without problems, i.e. without first draining the entire generator and then writing the result in one go. That would require large amounts of memory if the generator is large, and fail entirely if the generator is infinite. codecs.StreamWriter.writelines uses self.write(''.join(argument)) as implementation, which fails on very large or infinite arguments. According to issue 5445 it is not part of the file protocol that .writelines must handle (large/infinite) generators, only list-like iterables. However as far as I know this is not documented anywhere, and sometimes people assume that writelines is meant for this case. E.g. jinja (https://github.com/mitsuhiko/jinja2/blob/master/jinja2/environment.py#L1153, the dump method is explicitly documented to stream). The guarantees that .writelines makes or does not make in this regard should be documented somewhere, so that either .writeline implementations that don't handle large generators can be pointed out as bugs, or code that makes assumptions on .writeline handling large generators can be. I personally think .writelines should handle large generators, since in the python 3 world a lot of apis were iterator-ified and it is wat a lot of people would probably expect. But having a clear and documented decision on this is more important. (note: I've copied most of the nosy list from #5445) -- assignee: docs@python components: Documentation, IO messages: 222165 nosy: JanKanis, benjamin.peterson, dlesco, docs@python, hynek, lemburg, pitrou, stutzbach, terry.reedy priority: normal severity: normal status: open title: File protocol should document if writelines must handle generators sensibly versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21910 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: I tested 2.7 tip (6dfbe504f659), which does not show the problem, as expected. I think there was a real bug in that the tkinter.TclError global was being set to None on exit, but a TclError being raised is expected if I go by the comment in tkinter. The bug was fixed in commit 79e2f5bbc30c. -- resolution: - out of date status: open - closed versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: I tried changing the last block in turtulemodule/__init__.py to if __name__ == '__main__': demo = DemoWindow() print(ENTERING mainloop) demo.root.mainloop() print(Bye) but that does not solve the problem: python3 -m turtledemo ENTERING mainloop Exception ignored in: bound method PhotoImage.__del__ of tkinter.PhotoImage object at 0x7ffef193b948 Traceback (most recent call last): File /home/jan/test/lib/python3.4/tkinter/__init__.py, line 3330, in __del__ TypeError: catching classes that do not inherit from BaseException is not allowed so still the same error. (Although it is probably still good to make that change.) Tested on cpython revision dfcb64f51f7b, so the same as I originally made the bugreport from. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: I have verified that DemoWindow._destroy(self) indeed gets called before the exception is raised. I did a bisect, on the default branch the bug was introduced by commit f0833e6ff2d2: Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown. I will try bisecting the 3.3 branch to se where the bug stops appearing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: The 3.3 branch is not affected as the f0833e6ff2d2 changeset was never merged into that branch. In the default branch the exception stops appearing after commit 79e2f5bbc30c: Issue #18214: Improve finalization of Python modules to avoid setting their globals to None, in most cases. This changeset is also part of the current 3.4 tip (19172062e5c0), so 3.4 tip does not display the buggy behaviour. Judging by the commit message, that commit also supersedes the attached patch as it at least prevents the visible symptoms. I am not sure if there still might be a deeper issue that is hidden by the changeset as Terry suggested. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
Jan Kanis added the comment: I wasn't aware that mixing grid and pack was a bad idea, as I was looking over turtledemo to learn how to use tkinter. The patch replaces a packing in one frame with a grid. All direct children of the graph_frame are gridded. graph_frame itself is still packed and so are the children of btn_frame which is a child of graph_frame. Also I wasn't able to find a clear definition of what is meant by 'master window' in the grid/pack warning, but supposedly that is the top level Tk() rather than a parent widget. I would offer to create a better patch but Lita Cho already did so in #21597. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: The main block has been like that from the beginning of recorded time. I could see a use for this if the turtle demo allowed changing of the code in the gui, but it doesn't. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21571] Python build should check CPATH, C_INCLUDE_PATH for module dependencies
New submission from Jan Kanis: When building, pythons setup.py tries to find external sources for optional modules such as ssl, sqlite, etc. For that it searches the CFLAGS environment variable for -I options. C compilers such as gcc and clang also interpret CPATH and C_INCLUDE_PATH as extra search paths for headers/sources. Setup.py should do the same and also look in paths specified in those environment variables. -- components: Build messages: 219056 nosy: JanKanis priority: normal severity: normal status: open title: Python build should check CPATH, C_INCLUDE_PATH for module dependencies type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21571 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
Jan Kanis added the comment: I've created a patch, replacing the packed layout by a gridded layout -- hgrepos: +195 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
Changes by Jan Kanis jan.pyt...@jankanis.nl: -- keywords: +patch Added file: http://bugs.python.org/file30469/7cdaf0223e67.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
New submission from Jan Kanis: While fixing #18132 I noticed that when closing the turtledemo window an exception is thrown (and ignored) because the __del__ tries to catch a TclError exception, but the TclError global has already been deleted and set to None. I could only reproduce this in my self built pydebug build, at least on revision dfcb64f51f7b, but not on the v3.3.2 tag. (compiled with --with-pydebug on linux x86-64) traceback: me@mymachine ~/d/cpython ./python -m turtledemo BYE! Exception ignored in: bound method PhotoImage.__del__ of tkinter.PhotoImage object at 0x7fbddb4f0a18 Traceback (most recent call last): File ~/devel/cpython/Lib/tkinter/__init__.py, line 3330, in __del__ TypeError: catching classes that do not inherit from BaseException is not allowed -- components: Tkinter messages: 190654 nosy: JanKanis priority: normal severity: normal status: open title: tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: added a fix -- hgrepos: +196 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Changes by Jan Kanis jan.pyt...@jankanis.nl: -- keywords: +patch Added file: http://bugs.python.org/file30470/3fdd418be9f8.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order
Jan Kanis added the comment: Oops, the diff includes patches for both this issue and #18132, that should be just commit 3fdd418be9f8. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
Changes by Jan Kanis jan.pyt...@jankanis.nl: -- components: +Demos and Tools type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
New submission from Jan Kanis: If the window of the turtledemo is small enough, the start/stop/clear buttons disappear. This is specifically a problem when running on a netbook with a small screen, because the buttons are never shown. For a newcommer checking out the demo app this could be very confusing as there is no indication on what went wrong, and the notification area just says 'press start button'. -- messages: 190596 nosy: JanKanis priority: normal severity: normal status: open title: buttons in turtledemo disappear on small screens versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com