[issue16423] urllib data URL
Mathias Panzenböck added the comment: Great! Feels awesome to have my first bit of code contributed to the Python project. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Mathias Panzenböck added the comment: Will do (later today). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Mathias Panzenböck added the comment: Hmm, which of the two initial licenses should I choose? Which one do you rather want me to choose? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Mathias Panzenböck added the comment: On 11/18/2012 12:36 AM, Antoine Pitrou wrote: Antoine Pitrou added the comment: A couple of comments: - the patch needs a test (and docs too) Will do (when I have time). - are you sure ignoring POSTed data is the right thing to do? Shouldn't we forbid it instead? - I think it would be nice to reference the RFC number somewhere - not sure why you raise IOError on a bad URL; I would say ValueError is the right exception here I did that because that's what the old URLopener code does (ignoring POSTed data and raising an IOError). The comment is actually a 1:1 copy of the old code. +1 on the general idea, by the way. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Mathias Panzenböck added the comment: On 11/18/2012 12:36 AM, Antoine Pitrou wrote: - the patch needs a test (and docs too) - are you sure ignoring POSTed data is the right thing to do? Shouldn't we forbid it instead? Btw.: The file:// protocol handler also just ignores posted data, so I think the data url handler shouldn't deviate from that. Either both raise an error when data is posted or none. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Mathias Panzenböck added the comment: Ok, I've added a documentation and some tests. Is it ok this way? More tests? More/other documentation? -- Added file: http://bugs.python.org/file28017/urllib.request-data-url.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Changes by Mathias Panzenböck grosser.meister.mo...@gmx.net: Removed file: http://bugs.python.org/file28017/urllib.request-data-url.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Changes by Mathias Panzenböck grosser.meister.mo...@gmx.net: Added file: http://bugs.python.org/file28018/urllib.request-data-url.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Changes by Mathias Panzenböck grosser.meister.mo...@gmx.net: Removed file: http://bugs.python.org/file27994/urllib.request-data-url.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL recipe
Mathias Panzenböck added the comment: New patch. Instead of adding the data URL support to the doc as a recipe I added it to urllib.request directly. I think this is better and justified, because the old legacy URLopener had (some kind) of support for data URLs. OT: I think that the legacy URLopener has bugs. It only unquotes the data if it's base64 encoded, but it should be unquoted in any case. Also it returns a StringIO and decodes the content as latin-1. This is wrong, the content is a binary string. It could be text encoded in any kind of charset or not text at all (e.g. an image). -- Added file: http://bugs.python.org/file27994/urllib.request-data-url.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL
Changes by Mathias Panzenböck grosser.meister.mo...@gmx.net: -- components: +Library (Lib) -Documentation title: urllib data URL recipe - urllib data URL type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9156] socket._fileobject: read raises AttributeError when closed in another thread
Mathias Panzenböck added the comment: The problem is that the other thread is blocked, waiting for new client connections. A common pattern for very simple server applications (like you write during exercises at universities) is: 2 threads: 1. A server thread waiting for clients, maybe spawning even more threads for each connection. 2. A small shell thread reading commands from stdin. When quit is read it closes the server socket, which shuts down the server (the server thread just notices that the socket was closed and shuts down properly). This pattern we used all the time when writing exercises in Java. However, it seems to work quite differently in Python 3. I have to check if this problem still exists. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9156 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9156] socket._fileobject: read raises AttributeError when closed in another thread
Mathias Panzenböck added the comment: Yeah, I don't remember anymore. It was so long ago. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9156 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16423] urllib data URL recipe
New submission from Mathias Panzenböck: I think it would be really helpful if urllib would support data URLs. However, I was told on the python-ideas mailing list that it would probably only added as recipe in the documentation. The attached patch adds such an recipe to the urllib.request documentation. I've never written a doc patch (or any patch) for python before, so I don't know if I added it at the right place in the right format. -- assignee: docs@python components: Documentation files: doc-urllib.request-data-url-recipe.patch hgrepos: 160 keywords: patch messages: 175041 nosy: docs@python, panzi priority: normal severity: normal status: open title: urllib data URL recipe versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file27914/doc-urllib.request-data-url-recipe.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9156] socket._fileobject: read raises AttributeError when closed in another thread
New submission from Mathias Panzenböck grosser.meister.mo...@gmx.net: When you open a socket._fileobject through sock.makefile('rb') or similar and you read blocking in one thread and close the file object from another thread the reading thread gets an AttributeError. This is because the close method sets the underlying fileobject._sock member to None and the read/readline/... methods call recv on this member without checking if its None. I think the _sock member should not be set to None at all but a flag should be set that this file object is closed. For the time being I use the bugfix I attached and therefore do not call sock.makefile('rb') but FileObject(sock, 'rb'). FileObject is a subtype of socket._fileobject that overrides the close method and closed property. I don't know if this bug persists in 2.7 or 3.x. I still use Fedora 12 and that comes with Python 2.6.2. -- components: Library (Lib) files: FileObject.py messages: 109281 nosy: panzi priority: normal severity: normal status: open title: socket._fileobject: read raises AttributeError when closed in another thread type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file17860/FileObject.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9156 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7949] idle does not handle dark gtk color schemes
Mathias Panzenböck grosser.meister.mo...@gmx.net added the comment: I just noticed that the debugger also suffers from this problem. Doing a quick grep over the source reveals even more places that might cause problems (where only the bg or only the fg color is set). I think in ScrolledList.py the background=white should just be removed. This and setting the fg color to black when the bg color is set to yellow (Debugger.py) makes the debugger usable. Checkboxes and radiobuttons seem to be messed up in general (forced white bg but using system fg color (white on white on my system); not idles but Tkinters or TKs fault). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com