[issue512981] readline /dev/tty problem

2021-05-01 Thread Pierre
Pierre added the comment: I suggest to reopen this issue as there was a regression with python3. import sys sys.stdin = open("/dev/tty", "r") import readline print(input()) Write some text and press left. Expected: the cursor goes left. Actual: prints '^[[D

[issue512981] readline /dev/tty problem

2021-05-10 Thread Pierre
Pierre added the comment: Please, let me know if I should re-open a new bug for this one. -- ___ Python tracker <https://bugs.python.org/issue512981> ___ ___

[issue512981] readline /dev/tty problem

2021-05-13 Thread Pierre
Pierre added the comment: A workaround consists in replacing fd(0) with /dev/tty without modifying sys.stdin import os stdin = os.dup(0) os.close(0) tty = os.open("/dev/tty", os.O_RDONLY) assert tty == 0 import readline print("input:", input()) print("

[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Pierre Fortin
New submission from Pierre Fortin : var = "u2" var.strip()[0] Works as expected, except that it returns IndexError (instead of "u") if used in a list comprehension -- at least, that's where I found it. Attached example script illustrates the issue. Call it wit

[issue46302] IndexError inside list comprehension + workaround

2022-01-08 Thread Pierre Fortin
Pierre Fortin added the comment: [Thanks for the replies! I was trying to post this before seeing them.] Major egg on face... The more complex the code becomes, the more likely you will be burned by a rookie mistake... var = '' var[0] WILL give IndexError -- Duh! It was bur

[issue46767] [Doc] sqlite3 Cursor.execute() return value is unspecified

2022-02-16 Thread Pierre Thierry
New submission from Pierre Thierry : In the documentation of the sqlite3 module, the return value for Connection.execute() is told to be the Cursor that was implicitly created, but nothing is said about the return value/type when using Cursor.execute(). -- components: Library (Lib

[issue12411] cgi.parse_multipart is broken on 3.x

2011-07-04 Thread Pierre Quentel
Pierre Quentel added the comment: When the FieldStorage class was fixed there was a discussion in issue 4953 about the module-level functions parse() and parse_multipart(). The code was very similar to methods of the FieldStorage class so the idea was to use FieldStorage inside the functions

[issue12922] StringIO and seek()

2011-09-07 Thread Pierre Quentel
Changes by Pierre Quentel : -- nosy: +quentel ___ Python tracker <http://bugs.python.org/issue12922> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11352] Buf in cgi module doc

2011-02-28 Thread Pierre Quentel
New submission from Pierre Quentel : Hi, I wrote a patch for the cgi module in version 3.2rc1 (#4953). Small changes should be done to the documentation of this module to reflect the changes in the module API : - in section "20.2.2. Using the cgi module" original text : &

[issue11352] Bug in cgi module doc

2011-02-28 Thread Pierre Quentel
Pierre Quentel added the comment: "bug", not "buf"... -- title: Buf in cgi module doc -> Bug in cgi module doc ___ Python tracker <http://

[issue11916] A few errnos from OSX

2011-04-24 Thread Pierre Carrier
New submission from Pierre Carrier : A few errnos from OSX are missing in the eponymous module. --- 8< --- #ifdef EAUTH inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error"); #endif #ifdef EBADARCH inscode(d, ds, de, "EBADARCH", EBADARCH, &quo

[issue10689] _scproxy extension is NOT build

2010-12-12 Thread Pierre Vinet
New submission from Pierre Vinet : >From Python 2.7 http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tar.bz2 >released on November 27th, 2010. At compile time : $ ../Python-2.7.1/configure --enable-framework $ make we obtain within standard output: building '_scproxy

[issue10768] Bug in scrolledtext

2010-12-24 Thread Pierre Quentel
New submission from Pierre Quentel : The scrolledtext example crashes with this message : TypeError: unsupported operand type(s) for +: 'dict_keys' and 'dict_keys' It works if keys() are converted to lists in line 33 : methods = list(vars(Pack).keys()) + list(vars(Grid).k

[issue10768] Bug in scrolledtext

2010-12-25 Thread Pierre Quentel
Pierre Quentel added the comment: The function example(), line 44 of the module - Pierre 2010/12/24 R. David Murray > > R. David Murray added the comment: > > Where is this example? > > -- > assignee: -> d...@python > components: +Documentation > nosy

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-02 Thread Pierre Quentel
Pierre Quentel added the comment: Hi, I have started working on the port of a simplified version of Karrigell (a web framework) to Python3. I experienced the same problem as the other posters : in the current version, file upload doesn't work. So I've been working on the cgi mo

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-02 Thread Pierre Quentel
Pierre Quentel added the comment: I attach the svn diff file against the present version (generated by Tortoise SVN), hope it's what you expect -- Added file: http://bugs.python.org/file20229/cgi_diff.txt ___ Python tracker <http://bugs.py

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-02 Thread Pierre Quentel
Pierre Quentel added the comment: Please ignore previous post. I worked on the version of cgi.py included in version 3.2b2, and I just realized there were changes commited to the svn repository since this version. I will post the diff file later, but you can always test the files in the zip

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-02 Thread Pierre Quentel
Pierre Quentel added the comment: Here is the correct diff file I also introduced a test to exit from the loop in read_multi() if the total number of bytes read reaches "content-length". It was necessary for my framework, which uses cgi.FieldStorage to read from the attribute rfi

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Pierre Quentel
Pierre Quentel added the comment: Other version of the diff file. Nothing changed but I'm afraid I had left duplicate definitions of some methods in the FieldStorage class I follow the discussion on this thread, but would like to know if the patch has been tested and works --

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Pierre Quentel
Pierre Quentel added the comment: I agree that the only consistent solution is to impose that the attribute self.fp must read bytes in all cases, all required conversions should occur inside FieldStorage, using "some" encoding (not sure how to define it...) If no argument fp is

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-07 Thread Pierre Quentel
Pierre Quentel added the comment: Option 1 is impossible, because the CGI script sometimes has no control on the stream : for instance on a shared web host, it will receive sys.stdin as a text stream I also vote for option 3 ; explaining that if no argument is passed, the program will use

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-09 Thread Pierre Quentel
Pierre Quentel added the comment: Here is the diff file for the revised version of cgi.py FieldStorage tests if the stream is an instance of (a subclass of) io.TextIOBase. If true, data is read from its attribute buffer ; if it hasn't one (eg for StringIO instances), an AttributeExcepti

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-09 Thread Pierre Quentel
Pierre Quentel added the comment: cgi tests -- Added file: http://bugs.python.org/file20323/cgi_tests.zip ___ Python tracker <http://bugs.python.org/issue4

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-10 Thread Pierre Quentel
Pierre Quentel added the comment: @Glenn "Also, the use of FeedParser could be replaced by BytesFeedParser, thus eliminating the need to decode header lines in that loop." BytesFeedParser only uses the ascii codec ; if the header has non ASCII characters (filename in a multipart

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-10 Thread Pierre Quentel
Pierre Quentel added the comment: @Glenn " The _defined_ encoding of the original stream is irrelevant, in the same manner that if it is a text stream, that is irrelevant. The stream is binary, and latin-1, or it is non-standard" I wish it could be as simple, but I'm afraid

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-11 Thread Pierre Quentel
Pierre Quentel added the comment: @Glenn "I'm curious what your system (probably Windows since you mention cp-) and browser, and HTTP server is, that you used for that test. Is it possible to capture the data stream for that test? Describe how, and at what stage the data

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-12 Thread Pierre Quentel
Pierre Quentel added the comment: Many thoughts and tests after... Glenn, the both of us were wrong : the encoding to use in FieldStorage is neither latin-1, nor sys.stdin.encoding : I tested form fields with characters whose utf-8 encoding has bytes that map to undefined in cp1252, the

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: I knew the builtins hack was terrible, thanks for the replies... I changed cgi.py with Glenn's IOMix class, and included the changes in make_file(). The patch is attached to this message Is it really too late to include it in 3.2 ? Missing a workin

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: diff for the updated version of test_cgi.py, compatible with cgi.py -- Added file: http://bugs.python.org/file20384/test_cgi_20111013.diff ___ Python tracker <http://bugs.python.org/issue4

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: zip file with the updated cgi_test.py and associated files -- Added file: http://bugs.python.org/file20385/cgi_tests.zip ___ Python tracker <http://bugs.python.org/issue4

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20229/cgi_diff.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20235/cgi_diff.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20322/cgi_diff_20110109.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20323/cgi_tests.zip ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20356/cgi_diff_20110111.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20382/cgi_diff_20110112.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20383/cgi_20110113.diff ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20384/test_cgi_20111013.diff ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20244/cgi_diff.txt ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: Ok Eric, thanks for the tips I attach the diff for the 2 modified modules (cgi.py and test_cgi.py). For the other tests, they are not in the branch and there are many test files so I leave the zip file I removed outdated diffs -- Added file: http

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: Ok, thanks. Here is a summary of the API changes : - the argument fp passed to FieldStorage is either an instance of (a subclass of) io.TextIOBase with a "buffer" attribute for the underlying binary layer (thus, it can't be a StringIO in

[issue7936] sys.argv contains only scriptname

2011-01-13 Thread Pierre Bourgault
Pierre Bourgault added the comment: I had the same problem with another version of python on Windows 7. We are using python 2.4.2 for production and it is installed in D:\Tools\Python. For experimentation purpose, I installed Python 2.7 in the usual location. It broke a few things and I

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Pierre Quentel added the comment: Comment ça, no up to date patch ? cgi_32.patch is up to date, the API changes are documented, the unittests work, what else do you want ? -- ___ Python tracker <http://bugs.python.org/issue4

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Pierre Quentel added the comment: @Victor Thanks for the comments "- I don't understand why FieldStorage changes sys.stdout and sys.stderr (see remarks about IOMix above): please remove the charset argument (it is also confusing to have two encoding arguments). it should be done

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20387/cgi_32.patch ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Pierre Quentel added the comment: Glenn, you read my mind ;-) Thanks for mentioning the O_BINARY thing. New (last !) patch attached -- Added file: http://bugs.python.org/file20403/cgi_32.patch ___ Python tracker <http://bugs.python.org/issue4

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20402/cgi_32.patch ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Pierre Quentel added the comment: Thanks a lot Victor ! I wrote the patch : Pierre Quentel (pierre.quen...@gmail.com) with many inputs by Glenn Linderman 2011/1/14 STINNER Victor > > STINNER Victor added the comment: > > Oh, I forgot to credit the author(s): who wro

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel : Removed file: http://bugs.python.org/file20405/unnamed ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list mailin

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel
Pierre Quentel added the comment: My latest patch for test_cgi is in cgi_32.patch I will try to add more tests later -- ___ Python tracker <http://bugs.python.org/issue4

[issue10911] cgi: add more tests

2011-01-21 Thread Pierre Quentel
Pierre Quentel added the comment: Hi, I have written more tests, but also propose changes to cgi.py : - rewrite the parse_qs() and parse_multipart() functions so that they use FieldStorage methods instead of duplicating them - add a function set_stdout_encoding(encoding), using the IOMix

[issue10911] cgi: add more tests

2011-01-29 Thread Pierre Quentel
Pierre Quentel added the comment: Here is the diff file for test_cgi.py I added a test for a multipart/form-data form with non ASCII data to test the "encoding" parameter of FieldStorage -- keywords: +patch Added file: http://bugs.python.org/file20611/tes

[issue11066] cgi.py proposals : sys.stdout encoding + rewriting of parsing functions

2011-01-29 Thread Pierre Quentel
New submission from Pierre Quentel : Python 3.2rc1 introduced a new version of cgi.py that handles correctly file uploads In this version, the FieldStorage constructor receives an argument "encoding" which is the encoding used by the document holding the submitted form On the CGI s

[issue10911] cgi: add more tests

2011-02-04 Thread Pierre Quentel
Pierre Quentel added the comment: I opened issue #11066 for the code refactoring -- ___ Python tracker <http://bugs.python.org/issue10911> ___ ___ Python-bug

[issue3062] Turtle speed() function has no effect under Mac OS X

2008-06-08 Thread Pierre Bourdon
New submission from Pierre Bourdon <[EMAIL PROTECTED]>: When using the speed() function of the turtle module under Mac OS X, it has no effect : the turtle always draws lines with the same speed. An easy fix is to replace line 553 of the turtle.py file by "sleep(self._delay / 1000.0

[issue2490] Assertion failure in datetime.strftime()

2008-03-25 Thread Pierre Metras
New submission from Pierre Metras <[EMAIL PROTECTED]>: datetime.strftime(pattern) fails in assertion if pattern is big enough (> 100 chars) while time.strftime(pattern) gives the expected result. This occurs on Python 2.5 (tested on OLPC XO laptop, Fedora 9). Python 2.4 (Debian Etch)

[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Pierre Metras
Pierre Metras <[EMAIL PROTECTED]> added the comment: There is an example of a long strftime pattern in the test.py file attached to that issue. Just change the length of the pattern to see that it works for smaller patterns in Python 2.5. The pattern where it occured in my applicatio

[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Pierre Metras
Pierre Metras <[EMAIL PROTECTED]> added the comment: I did a mistake: OLPC XO is based on Fedora 7 and not 9. They plan to upgrade to 9 later this year (http://wiki.laptop.org/go/Fedora), so this bug will disappear by itself if it's confirmed that test.py runs correctly on Pytho

[issue2504] Add gettext.pgettext() and variants support

2008-03-28 Thread Pierre Metras
New submission from Pierre Metras <[EMAIL PROTECTED]>: Please add support for pgettext(msgctxt, msgid) and variants (dpgettext, dcpgettext...) in the gettext module. I will not rephrase the justification for these functions and why contexts are essential for good localization

[issue4825] TypeError with complex.real() and complex.imag()

2009-01-03 Thread Pierre Bourdon
Pierre Bourdon added the comment: I don't think this is a valid issue : real and imag are just properties of complex objects, not methods ! -- nosy: +delroth ___ Python tracker <http://bugs.python.org/i

[issue47259] string sorting often incorrect

2022-04-08 Thread Pierre Ossman
New submission from Pierre Ossman : There is a big gotcha in Python that is easily overlooked and should at the very least be more prominently pointed out in the documentation. Sorting strings will produce results that is very confusing for humans. I happens to work for ASCII, but will

[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2019-09-10 Thread Pierre Glaser
New submission from Pierre Glaser : If I am not mistaken, when creating a new process on Python3.7 and later on Windows, if using a virtualenv, Python now uses a launcher. The launcher is being notified that it must create a virtual-environment Python (and not a system Python) program using

[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2019-09-10 Thread Pierre Glaser
Pierre Glaser added the comment: > Dropping this into Lib/multiprocessing/spawn.py should cause a repro: if WINSERVICE: _python_exe = os.path.join(sys.exec_prefix, 'python.exe') else: _python_exe = getattr(sys, '_base_executable', sys.ex

[issue38082] datetime.time object incorrectly shows associated date in strftime() output

2019-09-10 Thread Pierre Glaser
Change by Pierre Glaser : -- pull_requests: +15523 pull_request: https://github.com/python/cpython/pull/15882 ___ Python tracker <https://bugs.python.org/issue38

[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2019-09-10 Thread Pierre Glaser
Change by Pierre Glaser : -- keywords: +patch pull_requests: +15524 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15883 ___ Python tracker <https://bugs.python.org/issu

[issue21705] cgi.py: Multipart with more than one file is misparsed

2019-09-13 Thread Pierre Quentel
Pierre Quentel added the comment: The patch has been applied some time ago (I couldn't find the exact commit), cf. https://github.com/python/cpython/blob/master/Lib/cgi.py#L750 I think we can close the issue. -- nosy: +quentel ___ Python tr

[issue21705] cgi.py: Multipart with more than one file is misparsed

2019-09-24 Thread Pierre Quentel
Pierre Quentel added the comment: @ethan.furman Yes, in test_cgi.py, the method test_fieldstorage_multipart_w3c https://github.com/python/cpython/blob/master/Lib/test/test_cgi.py#L316) uses a multipart content with 2 files in it (https://github.com/python/cpython/blob/master/Lib/test

[issue20504] cgi.FieldStorage, multipart, missing Content-Length

2019-09-29 Thread Pierre Quentel
Pierre Quentel added the comment: Now that the PR has been merged, can someone close the issue ? -- ___ Python tracker <https://bugs.python.org/issue20

[issue38469] PEP 572 : assignment expression to a global variable in a comprehension

2019-10-13 Thread Pierre Quentel
New submission from Pierre Quentel : PEP 572 says that "an assignment expression occurring in a (...) comprehension (...) binds the target in the containing scope, honoring a nonlocal or global declaration for the target in that scope, if one exists." In Appendix B, the PEP

[issue38469] PEP 572 : assignment expression to a global variable in a comprehension

2019-10-14 Thread Pierre Quentel
Pierre Quentel added the comment: That was a quick fix, thanks ! -- ___ Python tracker <https://bugs.python.org/issue38469> ___ ___ Python-bugs-list mailin

[issue44052] patch object as argument should be explicit

2021-05-05 Thread Pierre Ossman
New submission from Pierre Ossman : Right now if you use unittest.mock.patch() as a decorator it may or may not pass the object as an argument to the test function. The behaviour is a side effect of the argument "new" rather than something the caller can explicitly control. In

[issue44052] patch object as argument should be explicit

2021-05-06 Thread Pierre Ossman
Pierre Ossman added the comment: I've always been cautious about running patch() manually since it was easy to miss the cleanup. But those fears might be irrelevant these days when we have addCleanup(). Still, decorators are a more robust in more complex setups since you don'

[issue44085] Remaining invalid rules in simplified grammar

2021-05-09 Thread Pierre Quentel
New submission from Pierre Quentel : In the simplified version of Python grammar at https://docs.python.org/3.10/reference/grammar.html, most 'invalid_' from the complete grammar at https://github.com/python/cpython/blob/3.10/Grammar/python.gram have been removed, but 2 of t

[issue44185] mock_open file handle __exit__ does not call close

2021-05-20 Thread Pierre Ossman
Change by Pierre Ossman : -- nosy: +CendioOssman ___ Python tracker <https://bugs.python.org/issue44185> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44503] Hide __enter__ calls in mock_open

2021-06-24 Thread Pierre Ossman
New submission from Pierre Ossman : I'd like to write this test case: with patch('builtins.open') as pyopen: mock_open(pyopen, read_data="foo") run() pyopen.assert_has_calls([call("filename", "wt"),

[issue44503] Hide __enter__ calls in mock_open

2021-06-24 Thread Pierre Ossman
Pierre Ossman added the comment: Also see Issue44185 for __exit__. -- ___ Python tracker <https://bugs.python.org/issue44503> ___ ___ Python-bugs-list mailin

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Pierre Quentel
New submission from Pierre Quentel : PEP 634 specifies that "A mapping pattern may not contain duplicate key values. (If all key patterns are literal patterns this is considered a syntax error; otherwise this is a runtime error and will raise ValueError.)" but this is not what ha

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Pierre Quentel
Pierre Quentel added the comment: Sorry, I don't know C so I can't write a PR for this change. -- ___ Python tracker <https://bugs.python.o

[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-26 Thread Pierre Quentel
New submission from Pierre Quentel : This code match range(42): case [x, *w, y]: z = 0 sets w to a list with 40 items : the length of the subject, minus the number of non-star subpatterns. But this code (adapted from test_patma_186) enters an infinite loop

[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-26 Thread Pierre Quentel
Pierre Quentel added the comment: Thanks for the explanations, but I feel unconfortable with the fact that variable-length sequence patterns are implemented the same as unpacking. (sorry if this has been discussed before, I can't find references to the discussions that lead to the cu

[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-27 Thread Pierre Quentel
Pierre Quentel added the comment: Oh, I did not invent this class, it is in the test script for pattern matching : https://github.com/python/cpython/blob/6948964ecf94e858448dd28eea634317226d2913/Lib/test/test_patma.py#L1932 With this class, [x, *_, y] matches, but not [x, *w, y] : this is

[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-29 Thread Pierre Quentel
Pierre Quentel added the comment: I found why len() is required, it's to avoid trying to match the subject (thus consuming a part of it) if its length is less than the number of non-star patterns, as explained in the PEP. My mistake,

[issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer

2021-07-30 Thread Pierre Carbonnelle
New submission from Pierre Carbonnelle : The following code print("outside:", sys.stdout.encoding) with redirect_stdout(io.StringIO()) as f: print("inside: ", sys.stdout.encoding) print(f.getvalue()) yields: outside: utf-8 inside: None B

[issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer

2021-07-30 Thread Pierre Carbonnelle
Pierre Carbonnelle added the comment: I expect sys.stdout to have utf-8 encoding inside the redirect because the buffer accepts unicode code points (not bytes), just as it does outside of the redirect. In other words, I expect the 'encoding' attribute of sys.stdout to have the

[issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer

2021-07-30 Thread Pierre Carbonnelle
Pierre Carbonnelle added the comment: As a work around, I had to use a temporary file (instead of a memory buffer): print("outside:", sys.stdout.encoding) with open("/tmp/log.txt", mode='w', encoding='utf-8') as buf: with redirect_std

[issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer

2021-07-30 Thread Pierre Carbonnelle
Pierre Carbonnelle added the comment: I can live with the workaround, so, you can close the issue if you wish. As you say, maybe it's an issue with z3. Thank you for your time. -- ___ Python tracker <https://bugs.python.org/is

[issue45807] Strange SyntaxError message / suggestions for "@x = 123"

2021-11-15 Thread Pierre Quentel
New submission from Pierre Quentel : In CPython 3.10 : Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> @x = 123 File

[issue32371] Delay-loading of python dll is impossible when using some C macros

2019-11-19 Thread Pierre Chatelier
Pierre Chatelier added the comment: Can't reproduce any more. It might have been specific to the Visual Studio version I used at that time. -- ___ Python tracker <https://bugs.python.org/is

[issue32371] Delay-loading of python dll is impossible when using some C macros

2019-11-19 Thread Pierre Chatelier
Pierre Chatelier added the comment: Just reproduced and solved it at the same time ! It happened with Debug build, where I linked to pythonxx.lib instead of pythonxx_d.lib, because I did not download the debug binaries. Ultimately : my fault

[issue32371] Delay-loading of python dll is impossible when using some C macros

2019-11-19 Thread Pierre Chatelier
Change by Pierre Chatelier : -- versions: +Python 3.8 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue32371> ___ ___ Python-bugs-list mailin

[issue32371] Delay-loading of python dll is impossible when using some C macros

2019-11-19 Thread Pierre Chatelier
Pierre Chatelier added the comment: Aaand finally there is still something : it depends on the call context. Once in a C++/CLI class, the link bug occurs again. Here is attached a minimal project. -- status: closed -> open Added file: https://bugs.python.org/file48721/PythonFromC.

[issue39492] reference cycle affecting Pickler instances (Python3.8+)

2020-01-29 Thread Pierre Glaser
New submission from Pierre Glaser : The new Pickler reducer_override mechanism introduced in `Python3.8` generates a reference cycle: for optimization purposes, a the pickler.reducer_override bound method is referenced into the reducer_override attribute of the Pickler's struct. Thus,

[issue39492] reference cycle affecting Pickler instances (Python3.8+)

2020-01-29 Thread Pierre Glaser
Change by Pierre Glaser : -- keywords: +patch pull_requests: +17643 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18266 ___ Python tracker <https://bugs.python.org/issu

[issue42556] unittest.mock.patch() cannot properly mock methods

2020-12-03 Thread Pierre Ossman
New submission from Pierre Ossman : unittest.mock.patch() as it currently works cannot properly mock a method as it currently replaces it with something more mimicking a function. I.e. the descriptor magic that includes "self" isn't properly set up. In most cases this doesn&

[issue41915] unittest.mock.create_autospec(Obj, instance=True) has self keyword in _spec_signature if Obj implements __call__

2020-12-04 Thread Pierre Ossman
Pierre Ossman added the comment: autospec's behaviour for methods is currently needed to work around Issue42556, so be careful with any fixes here so they don't break that workaround. -- nosy: +CendioOssman ___ Python track

[issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive

2021-01-05 Thread Pierre Tardy
Change by Pierre Tardy : -- components: +Library (Lib) status: open -> pending ___ Python tracker <https://bugs.python.org/issue42833> ___ ___ Python-bugs-lis

[issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive

2021-01-05 Thread Pierre Tardy
New submission from Pierre Tardy : original bug report: https://github.com/buildbot/buildbot/issues/5743 Twisted by default advertises its algorithm in lowercase, which is uncommon, but allowed by the spec. https://tools.ietf.org/html/rfc3230#section-4.1.1 python's request.py is

[issue42833] Lib/urllib/request.py: digest algorithm should be case insensitive

2021-01-05 Thread Pierre Tardy
Change by Pierre Tardy : -- pull_requests: +22953 status: pending -> open pull_request: https://github.com/python/cpython/pull/24122 ___ Python tracker <https://bugs.python.org/issu

[issue14317] index.simple module licking in distutils2

2012-03-15 Thread Pierre Lecointre
New submission from Pierre Lecointre : Got an error, in debian squeeze (python 2.6) and Ubuntu 11.10 (python 2.7) : plec@cezoffsrv04:~$ python Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "lice

[issue14317] index.simple module lacking in distutils2

2012-03-15 Thread Pierre Lecointre
Changes by Pierre Lecointre : -- title: index.simple module licking in distutils2 -> index.simple module lacking in distutils2 versions: +Python 2.6 ___ Python tracker <http://bugs.python.org/issu

  1   2   3   >