[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-02-14 Thread Mateusz Loskot
Mateusz Loskot added the comment: Possibly, the new partial-input mode of the parser (https://bugs.python.org/issue46521#msg412832) will improve this issue in 3.11. I'm going to play with it soon and I will report back. -- ___ Python tracker

[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Mateusz Loskot
Mateusz Loskot added the comment: Not quite the answer I'd like to received, but thank you very much for the explanation. I've submitted pull request removing the deprecated FAQ entry https://github.com/python/cpython/pull/30925 -- ___ Python

[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-25 Thread Mateusz Loskot
Mateusz Loskot added the comment: Irit, I can and I will submit a patch. However, I'm very keen to learn what is an alternative solution then to distinguish hard invalid from incomplete input. IOW, what would be the new way of achieving what's described in the old FAQ? I believe it would

[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-24 Thread Mateusz Loskot
New submission from Mateusz Loskot : Something has changed in Python 3.7 through 3.10 (I'm observing it in 3.10) in behaviour of the Python C API function Py_CompileString such that for an incomplete input it no longer raises SyntaxError: "unexpected EOF while parsing" but Indent

[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Mateusz
New submission from Mateusz : A descriptor that is raising AttributeError in __get__() causes that the Python's interpreter continues searching for attributes in __mro__ calling __getattr__() function in inherited classes. Let's take a look for example script with this bug. class A1

[issue32599] Add dtrace hook for PyCFunction_Call

2021-08-10 Thread Mateusz Piotrowski
Change by Mateusz Piotrowski <0...@freebsd.org>: -- nosy: +0mp ___ Python tracker <https://bugs.python.org/issue32599> ___ ___ Python-bugs-list mailing list

[issue29077] build failure when enabling dtrace on FreeBSD

2021-08-10 Thread Mateusz Piotrowski
Mateusz Piotrowski <0...@freebsd.org> added the comment: Patch for the FreeBSD Ports to fix the build failure: https://reviews.freebsd.org/D31489 -- ___ Python tracker <https://bugs.python.org/i

[issue29077] build failure when enabling dtrace on FreeBSD

2021-08-09 Thread Mateusz Piotrowski
Change by Mateusz Piotrowski <0...@freebsd.org>: -- nosy: +0mp versions: +Python 3.10, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/i

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-05-05 Thread Mateusz Loskot
Change by Mateusz Loskot : -- nosy: +mloskot ___ Python tracker <https://bugs.python.org/issue39511> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32954] Lazy Literal String Interpolation (PEP-498-based fl-strings)

2019-12-17 Thread Mateusz Bysiek
Change by Mateusz Bysiek : -- nosy: +mbdevpl ___ Python tracker <https://bugs.python.org/issue32954> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31871] Support for file descriptor params in os.path

2017-10-25 Thread Mateusz Kurek
New submission from Mateusz Kurek <master.mate...@gmail.com>: Since Python 3.3, some os module functions, like os.stat (https://docs.python.org/3/library/os.html#os.stat), support passing file descriptor instead of a path. os.path functions, on the other hand (like os.path.exists -

[issue31826] Misleading __version__ attribute of modules in standard library

2017-10-20 Thread Jakub Mateusz Dzik
New submission from Jakub Mateusz Dzik <bugs.python.org20171...@amix.org.pl>: Several modules of the standard library (at least `re` and `csv`) have `__version__` strings. The string is the same for Python 2.7-3.6: >>> import re, csv; print(re.__version__, csv.__version__

[issue29715] Argparse improperly handles "-_"

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- title: Arparse improperly handles "-_" -> Argparse improperly handles "-_" ___ Python tracker <rep...@bugs.python.org>

[issue28964] AST literal_eval exceptions provide no information about line number

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- nosy: +mbdevpl ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28964> ___ __

[issue10399] AST Optimization: inlining of function calls

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- nosy: +mbdevpl ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10399> ___ __

[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- nosy: +mbdevpl ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11549> ___ __

[issue29471] AST: add an attribute to FunctionDef to distinguish functions from generators and coroutines

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- nosy: +mbdevpl ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29471> ___ __

[issue24119] Carry comments with the AST

2017-03-15 Thread Mateusz Bysiek
Mateusz Bysiek added the comment: For some time now, there's an alternate ast implementation https://github.com/python/typed_ast that carries PEP 484 type comments with the AST as attributes of certain nodes. Their approach is described here: https://github.com/python/typed_ast/blob/master

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-03-15 Thread Mateusz Bysiek
Changes by Mateusz Bysiek <r...@mbdev.pl>: -- nosy: +mbdevpl ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29051> ___ __

[issue29814] parsing f-strings -- opening brace of expression gets duplicated when preceeded by backslash

2017-03-15 Thread Mateusz Bysiek
New submission from Mateusz Bysiek: with Python 3.6.0 and the following script: ``` #!/usr/bin/env python3.6 import ast code1 = '''"\\{x}"''' code2 = '''f"\\{x}"''' tree1 = ast.parse(code1, mode='eval') print(ast.dump(tree1)) tree2 = ast.parse(code2, mode='eval')

[issue29025] random.seed() relation to hash() function and its determinism is vague

2016-12-21 Thread Jakub Mateusz Kowalski
Jakub Mateusz Kowalski added the comment: Python 2.7 I think note to the docs is enough. Python 3.5+ I have a doubt. Isn't .seed(a, version=1) still coupled with PYTHONHASHSEED? The manual says version 1 is "reproducing random sequences from older versions of Python", and for 3.1 (a

[issue29025] random.seed() relation to hash() function and its determinism is vague

2016-12-20 Thread Jakub Mateusz Kowalski
New submission from Jakub Mateusz Kowalski: 2.7 (https://docs.python.org/2/library/random.html#random.seed) - warning about PYTHONHASHSEED (environmental variable) voiding determinism - no warning on -R interpreter switch - relation to hash() function omitted 2.6 (https://docs.python.org/2.6

[issue29023] Results of random.seed() call with integer argument should be claimed deterministic.

2016-12-20 Thread Jakub Mateusz Kowalski
New submission from Jakub Mateusz Kowalski: In https://docs.python.org/2/library/random.html#random.seed I can find that "If a hashable object is given, deterministic results are only assured when PYTHONHASHSEED is disabled." Both int and long are hashable. However, tests on the ran

[issue14597] Cannot unload dll in ctypes until script exits

2016-12-13 Thread Mateusz Loskot
Changes by Mateusz Loskot <mate...@loskot.net>: -- nosy: +mloskot ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14597> ___ __

[issue28364] Windows - Popen (subprocess.py) does not call _handle.Close() at all

2016-10-05 Thread Mateusz Klatt
New submission from Mateusz Klatt: _subprocess.TerminateProcess(self._handle, 1) is not enough, on windows need to call self._handle.Close() after that self._handle.Close() should be also called in __del__ - for the process es that ware not killed bu user, but terminated by themselves

[issue26608] RLock undocumented behavior in case of multiple acquire

2016-03-22 Thread Mateusz
New submission from Mateusz: The number of acquisitions must be the same as the number of releases or else lock will not be released for other threads leading to deadlock. This is not mentioned in documentation. First acquisition returns boolean and further acquisitions return 1

[issue24490] DeprecationWarning hidden even after warnings.filterwarnings('always') called

2015-06-23 Thread Jakub Mateusz Kowalski
New submission from Jakub Mateusz Kowalski: The error occurs when there was a warning before the call to filterwarnings(): $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type help, copyright, credits or license for more information. import warnings warnings.warn

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-05-20 Thread Mateusz Loskot
Mateusz Loskot added the comment: Re msg238016, I confirm python-3.5.0a2-fdvalidation.patch fixes the problem for Python 3.5.0a4 and VS2013. The only issue I encountered was with HAVE_FSTAT which is missing from PC/pyconifg.h, so I edited the patch and removed the check if defined(HAVE_FSTAT

[issue22526] file iteration crashes for huge lines (2GiB+)

2014-09-30 Thread Jakub Mateusz Kowalski
New submission from Jakub Mateusz Kowalski: File /tmp/2147483648zeros is 2^31 (2GiB) zero-bytes ('\0'). Readline method works fine: fh = open('/tmp/2147483648zeros', 'rb') line = fh.readline() len(line) 2147483648 However when I try to iterate over the file: fh = open('/tmp/2147483648zeros

[issue22353] re.findall() documentation lacks information about finding THE LAST iteration of repeated capturing group (greedy)

2014-09-08 Thread Mateusz Dobrowolny
Mateusz Dobrowolny added the comment: The official help https://docs.python.org/3/library/re.html?highlight=findall#re.findall in fact contains more information, especially the one mentioned in http://bugs.python.org/issue3384. Regarding my issue - I am afraid it was my misunderstanding

[issue22353] re.findall() documentation lacks information about finding THE LAST iteration of reoeated capturing group (greedy)

2014-09-07 Thread Mateusz Dobrowolny
New submission from Mateusz Dobrowolny: Python 3.4.1, Windows. help(re.findall) shows me: findall(pattern, string, flags=0) Return a list of all non-overlapping matches in the string. If one or more capturing groups are present in the pattern, return a list of groups

[issue22353] re.findall() documentation lacks information about finding THE LAST iteration of repeated capturing group (greedy)

2014-09-07 Thread Mateusz Dobrowolny
Changes by Mateusz Dobrowolny mateusz.dobrowo...@gmail.com: -- title: re.findall() documentation lacks information about finding THE LAST iteration of reoeated capturing group (greedy) - re.findall() documentation lacks information about finding THE LAST iteration of repeated

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2014-06-21 Thread Mateusz Loskot
Mateusz Loskot added the comment: FYI, I've got it confirmed fix for the bug in VS has been released [1] We have fixed this behavior for the next major release, Visual Studio 14. The fix is present in the Visual Studio 14 CTP that was released earlier this month. [1] https

[issue21452] make_buildinfo.exe with VS2013 fails due ill-formed IntDir path

2014-05-12 Thread Mateusz Łoskot
Mateusz Łoskot added the comment: On 9 May 2014 19:21, Tim Golden rep...@bugs.python.org wrote: Fixed. Thanks for the report Thank you for the fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21452

[issue21452] make_buildinfo.exe with VS2013 fails due ill-formed IntDir path

2014-05-08 Thread Mateusz Loskot
New submission from Mateusz Loskot: While building Python 3.2 or Python 3.4 with Visual Studio 2013 on Windows 8.1, pythoncore.vcxproj fails to build due to illformed pre-link event command. (FYI, I have upgraded all .vcxproj files to VS2013 locally.) Here is the command and the error: pre

[issue21452] make_buildinfo.exe with VS2013 fails due ill-formed IntDir path

2014-05-08 Thread Mateusz Łoskot
Mateusz Łoskot added the comment: On 8 May 2014 11:53, Tim Golden rep...@bugs.python.org wrote: What effect does your patch have on a VS2010 build? I don't know. I don't use VS2010. However, I suspect the option 1) fix should be applied anyway as it is suggested by the comment

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-30 Thread Mateusz Loskot
Mateusz Loskot added the comment: I have just tested Windows GUI application built against Python 3.2.1 with is_valid_fd patch according to http://hg.python.org/cpython/rev/f15943505db0/ All built using VS2012. Again, I can confirm that is_valid_fd does NOT solve the problem. Here is extract

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: @Antoine (Re msg197480) I'm not sure which minor version of Python 3.2 it was, but in my comment in msg187362, I confirmed that I have tested the later version with added is_valid_fd function. As far as I understand, the changes in http://hg.python.org

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: On 11 September 2013 12:34, Antoine Pitrou rep...@bugs.python.org wrote: I'm not sure which minor version of Python 3.2 it was, but in my comment in msg187362, I confirmed that I have tested the later version with added is_valid_fd function. As far as I

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: On 12 September 2013 00:06, Antoine Pitrou rep...@bugs.python.org wrote: Shortly, is_valid_fd always returns true because fd 0 is always false as my tests with Visual Studio 2012 Well, that's not all there is, is_valid_fd() does other checks before

[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-07-21 Thread Mateusz Lenik
Mateusz Lenik added the comment: I finally managed to find some time to clean up the script I used to compile multiarch openssl. The diff is available at https://bitbucket.org/_mlen/cpython/commits/319f10362eb4b947b12750a6eb66fb622bbb0079 For 10.8 I had to comment out Tk related part and use

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-07-08 Thread Mateusz Loskot
Mateusz Loskot added the comment: This is still an issue in VS 2012 Version 11.0.60610.01 Update 3 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17797

[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-07-08 Thread Mateusz Lenik
Mateusz Lenik added the comment: The other way to solve problem with CA certs may be this script[1] that can be used to generate pem files from mozilla CA cert bundle[2] during compilation or installation. [1]: http://curl.haxx.se/docs/caextract.html [2]: http://mxr.mozilla.org/mozilla

[issue17557] test_getgroups of test_posix can fail on OS X 10.8 if more than 16 groups

2013-07-07 Thread Mateusz Lenik
Mateusz Lenik added the comment: I signed it today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17557 ___ ___ Python-bugs-list mailing list

[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-07-07 Thread Mateusz Lenik
Mateusz Lenik added the comment: I managed to build Python with OpenSSL 1.0.1e on Mac OS 10.8.4 using build-installer.py script during Europython sprint. I'll attach patches in few days, as I'll try to clean the code a bit. Currently the build works only for intel. Here is an example output

[issue17557] test_getgroups of test_posix can fail on OS X 10.8 if more than 16 groups

2013-07-06 Thread Mateusz Lenik
Mateusz Lenik added the comment: I attached a patch implementing a workaround for getgroups(2) call. When compiled for OS X it first calls getgroups with 0 as the first argument to get number of groups and then in subsequent call the code fetches the gids. This patch applies cleanly on 2.7

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-29 Thread Mateusz Loskot
Mateusz Loskot added the comment: I've just got an update on the bug report [1] I submitted to Microsoft. The Visual C++ team confirmed It does appear to be a regression from Visual Studio 2010. So, it's not a bug in Python, but I think it may be important for Python to consider applying some

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-19 Thread Mateusz Loskot
New submission from Mateusz Loskot: In pythonrun.c, there is function initstdio() with the following test: static int initstdio(void) { ... /* Set sys.stdin */ fd = fileno(stdin); /* Under some conditions stdin, stdout and stderr may not be connected * and fileno() may point

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-19 Thread Mateusz Loskot
Mateusz Loskot added the comment: Yes, it does. In file Modulfileio.c, in function fileio_init, there is this code: if (fd = 0) { if (check_fd(fd)) goto error; self-fd = fd; self-closefd = closefd; } The check_fd tests: if (!_PyVerify_fd(fd

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-19 Thread Mateusz Loskot
Mateusz Loskot added the comment: In file Modulfileio.c, I messed the path and filename above I meant: In file Modules/_io/fileio.c, -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17797

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-19 Thread Mateusz Loskot
Mateusz Loskot added the comment: Replacing if the current test in Python 3.2 if (fd 0) with if (check_fd(fd) 0) Seems to be a working solution. I just noticed, that in current Python/pythonrun.c in the repo, there the fd 0 tests have been replaced with new function is_valid_fd

[issue4442] document immutable type subclassing via __new__

2012-06-13 Thread Mateusz Loskot
Mateusz Loskot mate...@loskot.net added the comment: Chris Withers' note clarifies it to me, that this should be Python-level rather than C-level documentation. Then the note under __new__() in 3. Data model seems right. Simply, I expected to have some notes in C API too Side note: as mainly

[issue4442] document immutable type subclassing via __new__

2012-06-07 Thread Mateusz Loskot
Changes by Mateusz Loskot mate...@loskot.net: -- nosy: +mloskot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4442 ___ ___ Python-bugs-list

[issue4442] document immutable type subclassing via __new__

2012-06-07 Thread Mateusz Loskot
Mateusz Loskot mate...@loskot.net added the comment: Is this report about documenting of the concept of immutable types in Python in general or regarding existing built-in types, like datetime.datetime? Generally, the concept of immutable type with relation to tp_new is mentioned (sneaked

[issue15029] Update Defining New Types chapter according to PEP 253

2012-06-07 Thread Mateusz Loskot
New submission from Mateusz Loskot mate...@loskot.net: The chapter '2. Defining New Types in the Python 3.2 documentation [1] does not cover all important elements, especially in the subsection 2.1.4. Subclassing other types. The accepted PEP 253 [2] provides much more detailed and thorough

[issue15029] Update Defining New Types chapter according to PEP 253

2012-06-07 Thread Mateusz Loskot
Mateusz Loskot mate...@loskot.net added the comment: Similar request has been rejected in response to the Issue 621526 [1], but I'm not proposing to include PEP into docs, but to update and improve docs with material discussed in accepted PEPs. [1] http://bugs.python.org/issue621526

[issue621526] docs do not include spec info from PEPs

2012-06-07 Thread Mateusz Loskot
Mateusz Loskot mate...@loskot.net added the comment: I reported issue 15029 [1] which may be related to this one. [1] http://bugs.python.org/issue15029 -- nosy: +mloskot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue621526