[issue34486] "RuntimeError: release unlocked lock" when starting a thread
Radek added the comment: Any progress on this topic? I think I've encountered this (or similar) issue: >Traceback (most recent call last): > File "logging/__init__.py", line 1944, in shutdown > File "logging/__init__.py", line 813, in acquire > File "site-packages/utils/signals.py", line 58, in signal_wrapper > File "utils/utils.py", line 147, in sigterm_handler >SystemExit: 0 > >During handling of the above exception, another exception occurred: > >Traceback (most recent call last): > File "logging/__init__.py", line 1954, in shutdown > File "logging/__init__.py", line 821, in release >RuntimeError: cannot release un-acquired lock -- nosy: +radek_kujawa ___ Python tracker <https://bugs.python.org/issue34486> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24209] Allow IPv6 bind in http.server
Change by Radek Podgorny : -- nosy: +rpodgorny ___ Python tracker <https://bugs.python.org/issue24209> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30786] getaddrinfo emulation does not support AI_NUMERICSERV
Changes by Radek Smejkal <radek.smej...@laicatc.com>: -- pull_requests: +2485 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30786> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
Changes by Radek Smejkal <radek.smej...@laicatc.com>: -- pull_requests: +2484 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
Changes by Radek Smejkal <radek.smej...@laicatc.com>: -- pull_requests: +2483 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
Radek Smejkal added the comment: See also issue30786. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30786] getaddrinfo emulation does not support AI_NUMERICSERV
New submission from Radek Smejkal: Modules/getaddrinfo.c should support AI_NUMERICSERV. Moreover, not supporting AI_NUMERICSERV may cause troubles on platforms where the getaddrinfo function is available but it's buggy (see configure.ac and Modules/socketmodule.c), because Modules/addrinfo.h does not #undef AI_NUMERICSERV and Modules/socketmodule.c exports AI_NUMERICSERV defined in a system header that may collide with another flag defined in Modules/addrinfo.h and confuse the user. ./configure --with-pydebug Comment out HAVE_GETADDRINFO in pyconfig.h Comment out ENABLE_IPV6 in pyconfig.h on platforms where getipnodebyname and friends are not available make -j ./python Python 3.7.0a0 (default, Jun 27 2017, 11:59:50) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.AI_NUMERICSERV >>> socket.getaddrinfo(None, "http", flags=socket.AI_NUMERICSERV) Traceback (most recent call last): File "", line 1, in File "/home/radek/src/github/cpython/Lib/socket.py", line 743, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 3] invalid value for ai_flags. >>> -- components: Extension Modules messages: 297020 nosy: smejkar priority: normal severity: normal status: open title: getaddrinfo emulation does not support AI_NUMERICSERV type: behavior versions: Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30786> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
Radek Smejkal added the comment: See also issue30710. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
Changes by Radek Smejkal <radek.smej...@laicatc.com>: Removed file: http://bugs.python.org/file46965/getaddrinfo_invalid_port.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
Changes by Radek Smejkal <radek.smej...@laicatc.com>: -- components: +Extension Modules -Library (Lib) keywords: +patch Added file: http://bugs.python.org/file46965/getaddrinfo_invalid_port.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
Radek Smejkal added the comment: > I like your idea about getting rid of OverflowError. But wouldn't it make the > problem with other reported by you issue, issue30711, worse? It depends on the implementation of the underlying getaddrinfo. For Modules/getaddrinfo.c, it will be worse for positive numbers outside the C long range. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
Radek Smejkal added the comment: > Why can't the user simply pass in a string service name in the first place? He/she can. But I don't propose to change that. The patch only changes the way a given number is converted to a string. That is, without an intermediate C long. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
Radek Smejkal added the comment: > But how large is the performance hit of this change? It adds at least one > additional memory allocation for the str object. If the slowdown is > significant perhaps it is worth to keep the old code as a fast path. commit 5cc7ac24da10568d2a910a91a24183b904118cf8 ./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, 1000)' 2000 loops, best of 5: 139 usec per loop ./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, "1000")' 2000 loops, best of 5: 142 usec per loop with getaddrinfo_overflow_error.patch ./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, 1000)' 2000 loops, best of 5: 140 usec per loop ./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, "1000")' 2000 loops, best of 5: 139 usec per loop It seems the impact on performance is negligible/not measurable. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
Radek Smejkal added the comment: Use PyObject_Str and PyUnicode_AsUTF8 if the port argument is a PyLong instead of converting it to an intermediate C long that may raise OverflowError. See getaddrinfo_overflow_error.patch -- components: +Extension Modules -Library (Lib) keywords: +patch Added file: http://bugs.python.org/file46964/getaddrinfo_overflow_error.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30711] getaddrinfo invalid port number
New submission from Radek Smejkal: Some getaddrinfo implementations do not detect invalid numeric services and blindly pass the port number to htons(). For example, service "960179" is returned as port 42675. glibc https://sourceware.org/bugzilla/show_bug.cgi?id=16208 https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/getaddrinfo.c;h=a8bdd9a1829409bd797637b2c4fca4d67a11012d;hb=HEAD#l435 https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/getaddrinfo.c;h=a8bdd9a1829409bd797637b2c4fca4d67a11012d;hb=HEAD#l2313 AIX 7.1 libc Broken Modules/getaddrinfo https://github.com/python/cpython/blob/master/Modules/getaddrinfo.c#L342 On the other hand, for example, OpenBSD and musl check the port range https://github.com/openbsd/src/blob/master/lib/libc/asr/getaddrinfo_async.c#L477 https://git.musl-libc.org/cgit/musl/tree/src/network/lookup_serv.c#n53 Modules/getaddrinfo should be fixed. The configure script should detect whether the system getaddrinfo is broken. If so, a wrapper that checks numeric services, and returns EAI_SERVICE or calls the system getaddrinfo should be used in place of the system getaddrinfo. -- components: Library (Lib) messages: 296423 nosy: smejkar priority: normal severity: normal status: open title: getaddrinfo invalid port number type: behavior versions: Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30711> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30710] getaddrinfo raises OverflowError
New submission from Radek Smejkal: If the port argument is a number, getaddrinfo attempts to convert it to a C long, that raises OverflowError if the conversion fails. Instead, getaddrinfo should convert the port to a string (bytes) directly and rely on the underlying getaddrinfo to return EAI_SERVICE. This is also consistent with the case when a numeric port is passed as a string. -- components: Library (Lib) messages: 296421 nosy: smejkar priority: normal severity: normal status: open title: getaddrinfo raises OverflowError type: behavior versions: Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Quote of the day
2016-05-17 9:50 GMT+02:00 Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info>: > Overhead in the office today: > > > "I don't have time to learn an existing library - much faster to make my > own > mistakes!" > > > > -- > Steve > > -- > https://mail.python.org/mailman/listinfo/python-list > *THUMBS UP* At least they are aware of that "own mistakes" part... Not like my employer... -- https://mail.python.org/mailman/listinfo/python-list
Re: Pylint prefers list comprehension over filter...
2016-05-07 21:17 GMT+02:00 Christopher Reimer: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > >> On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> >>> Which is one is correct (Pythonic)? Or does it matter? >>> >> First, pylint is somewhat opinionated, and its default options shouldn't >> be taken as gospel. There's no correct: filter is fine. >> > > Since the code I'm working on is resume fodder (i.e., "Yes, I code in > Python! Check out my chess engine code on GitHub!"), I want it to be as > Pythonic and PEP8-compliant as possible. That includes scoring 10/10 with > pylint. Never know when an asshat hiring manager would reject my resume out > of hand because my code fell short with pylint. > > For my purposes, I'm using the list comprehension over filter to keep > pylint happy. > > > Thank you, > > Chris R. > -- > https://mail.python.org/mailman/listinfo/python-list > Don't forget that you can also place a pylintrc file (with some reasonable comments) into the repository or use the other means to disable selected rules -- https://mail.python.org/mailman/listinfo/python-list
HTTPServer and SSL
Hello, some people recommend following implementation of a simple HTTP server that supports SSL: Handler = http.server.BaseHTTPRequestHandlerhttpd = http.server.HTTPServer(("", 4443), Handler) httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True) httpd.serve_forever() I wonder whether this usage is *supported* or not. The documentation is not explicit about whether the httpd.socket attribute can be safely reassigned. Also there were some questions regarding a simple HTTPS server on this list already and none of the answerers mentioned this approach. Also there used to be a HTTPSServer in the test suite of Python 2.7 in 2014 that did a similar thing but in the "get_request" method but it isn't there anymore. So, is there a *supported* way of combining http.server.HTTPServer and ssl? Best regards -- Radek -- https://mail.python.org/mailman/listinfo/python-list
[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse
Radek Novacek added the comment: There is still problem with col_offset is some situations, for example col_offset of the ast.Attribute should be 4 but is 0 instead: >>> for x in ast.walk(ast.parse('foo.bar')): ... if hasattr(x, 'col_offset'): ... print("%s: %d" % (x, x.col_offset)) ... <_ast.Expr object at 0x7fcdc84722b0>: 0 <_ast.Attribute object at 0x7fcdc84723c8>: 0 <_ast.Name object at 0x7fcdc8472438>: 0 Is there any solution to this problem? It causes problems in python support in KDevelop (kdev-python). -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21295> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse
Radek Novacek added the comment: Aivar, I have to admit that my knowledge of this is limited, but as I understand it, the attribute is "bar" in the "foo.bar" expression. I can get beginning of the assignment by >>> ast.parse('foo.bar').body[0].value.value.col_offset 0 But how can I get position of the 'bar'? My guess is this: >>> ast.parse('foo.bar').body[0].value.col_offset but it still returns 0. Why this two col_offsets returns the same value? How can I get the position of 'bar' in 'foo.bar'? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21295> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse
Radek Novacek added the comment: I've ran the tests from first and second comment using python 3.5.0 and it seems it produces correct results: >>> import ast >>> tree = ast.parse("sin(0.5)") >>> first_stmt = tree.body[0] >>> call = first_stmt.value >>> print("col_offset of call expression:", call.col_offset) col_offset of call expression: 0 >>> print("col_offset of func of the call:", call.func.col_offset) col_offset of func of the call: 0 >>> tree = ast.parse("(sin\n(0.5))") >>> first_stmt = tree.body[0] >>> call = first_stmt.value >>> print("col_offset of call expression:", call.col_offset) col_offset of call expression: 1 >>> print("col_offset of func of the call:", call.func.col_offset) col_offset of func of the call: 1 >>> print("lineno of call expression:", call.lineno) lineno of call expression: 1 >>> print("lineno of func of the call:", call.lineno) lineno of func of the call: 1 -- nosy: +rnovacek ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21295> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6057] sqlite3 error classes should be documented
Radek Holý added the comment: One reason why I would like to have it mentioned in the documentation is that the fact that it is not documented there causes sqlite3.Error to be missing in the objects.inv file generated by Sphinx so that enabling the nitpicky mode with intersphinx extension when generating my documentation using Sphinx results in many WARNING: py:exc reference target not found: sqlite3.Error false positives. (I'd also like to have it backported to Python 2.6 but I know that it's impossible) -- nosy: +PyDeq ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6057 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23169] Reflect that PreReq and BuildPreReq are deprecated in the latest RPM
New submission from Radek Simko: When I try to make custom package of Python 2.7, I use the spec file attached in `/Misc/RPM`. I don't really use it to build Python as I want to define some specific options, but I do use it as a source of RPM package meta data which I can simply reuse when creating the final RPM, e.g.: rpm -q --specfile ./Misc/RPM/python-2.7.spec --queryformat '%{DESCRIPTION}' Manipulation with that specfile in RPM 4.4.2.3 (CentOS 5.6) is fine, but there are warnings in RPM 4.8.0 (CentOS 6.5): warning: line 71: buildprereq is deprecated: BuildPrereq: expat-devel warning: line 72: buildprereq is deprecated: BuildPrereq: db4-devel warning: line 73: buildprereq is deprecated: BuildPrereq: gdbm-devel warning: line 74: buildprereq is deprecated: BuildPrereq: sqlite-devel warning: line 91: prereq is deprecated: Prereq: python2.6 = %{PACKAGE_VERSION} warning: line 122: prereq is deprecated: Prereq: python2.6 = %{PACKAGE_VERSION}-1pydotorg Here's related thread: https://groups.google.com/forum/#!topic/comp.lang.python/R8ahiZ5wyhc and most importantly here's proof/explanation: http://www.rpm.org/wiki/Releases/4.8.0#Packagebuilding - PreReq and BuildPreReq are now officially deprecated, with warnings at build-time - PreReq is mapped to Requires(pre,preun) at build-time Requires(pre,preun) is backwards compatible, so it works in RPM 4.4 too, I would therefore suggest to change [Build]Prereq to [Build]Requires(pre,preun) respectively in the specfile to reflect this. I'm happy to send a patch if some maintainers will agree with proposed solution. -- components: Build messages: 233462 nosy: radeksimko priority: normal severity: normal status: open title: Reflect that PreReq and BuildPreReq are deprecated in the latest RPM type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23169 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Shear image (numpy.ndarray)
Yes, I already find that scipy.ndimage.interpolation.affine_transform will solve this (but thank you Robert anyway!). Just for others (if somebody will find this thread): The 'matrix' parameter is transformation matrix for shear transformation. For more detailes see: http://en.wikipedia.org/wiki/Shear_matrix Radek -- http://mail.python.org/mailman/listinfo/python-list
Shear image (numpy.ndarray)
Hi, I am looking for some function that would shear my 2D numpy.ndarray array. Since the numpy (probably) does not provide such a functionality (numpy.roll does not do what I need), I hope the PIL might do the trick. Google give me page that says: 'This function (im.transform) can be used to scale, translate, rotate, and shear the original image.', however I was not able to get it work. So could anybody give me a hand how to use it (or how to shear the image in different way)? The input array is 2D (NxM) type numpy.float32. Thanks Radek -- http://mail.python.org/mailman/listinfo/python-list
[issue5148] gzip.open breaks with 'U' flag
Radek szklarc...@yahoo.com added the comment: Same bug in 2.5, I don't know if the patch applies to 2.5 -- nosy: +radek768 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5148 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: fetch html page via isa proxy
So you have already tried NTLM Authorization Proxy Server?http://ntlmaps.sourceforge.net/ This used to work fine for me but that was at least 3-4 years ago. Actually NTLM proxy server works for most intranet addresses. Not for the outside Internet ones, though. Radek -- http://mail.python.org/mailman/listinfo/python-list
fetch html page via isa proxy
Hi, I have been trying several days to get the html page of www.python.org when behind the corporate MS isa proxy. I have tried setting http_proxy environment, played with proxy openers, use ntlm proxy server all without success. I can get the page using Firefox and IE with proxy settings. As the last resort I started to play with pywin32 win32inet, but even the test_win32inet.py does not get there. Any advice? Or better working example? Thanks a lot, Radek -- http://mail.python.org/mailman/listinfo/python-list
Re: run subprocess in separate window
Hello, as you can see, I tried subprocess methods. But could not find the right call. Radek [EMAIL PROTECTED] wrote: Radek a écrit : Hi, I am trying to create GUI launcher of several applications using Python and Tkinter. Currently when using subprocess.Popen(mycommand) all output goes to the stdout of my launcher. For some command line applications I need to launch them so that their output goes into the separate terminal window. How can I make it? Thanks, Radek Hello, have a look at the subprocess module, it might help you get to what you want. -- http://mail.python.org/mailman/listinfo/python-list
run subprocess in separate window
Hi, I am trying to create GUI launcher of several applications using Python and Tkinter. Currently when using subprocess.Popen(mycommand) all output goes to the stdout of my launcher. For some command line applications I need to launch them so that their output goes into the separate terminal window. How can I make it? Thanks, Radek -- http://mail.python.org/mailman/listinfo/python-list
Re: What editor shall I use?
What editor shall I use if my Python script must contain utf-8 characters? I use XP vim :-) Thank you for reply l.b. not for all :-) -- http://mail.python.org/mailman/listinfo/python-list