[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

[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, sorry

[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

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

2021-07-27 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 current

[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

[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.org/issue44

[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 wh

[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 them remain

[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

[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

[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

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

2019-09-25 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

[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 tracker

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-11-28 Thread Pierre Quentel
Pierre Quentel added the comment: I have submitted another Pull Request (10771) that seems to fix the bug while passing all the tests in test_cgi.py -- nosy: +quentel ___ Python tracker <https://bugs.python.org/issue27

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-11-28 Thread Pierre Quentel
Change by Pierre Quentel : -- pull_requests: +10015 ___ Python tracker <https://bugs.python.org/issue2> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-11-21 Thread Pierre Quentel
Pierre Quentel added the comment: I have submitted PR #10638 to fix this issue. -- ___ Python tracker <https://bugs.python.org/issue20504> ___ ___ Python-bug

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

2018-11-21 Thread Pierre Quentel
Change by Pierre Quentel : -- pull_requests: +9885 ___ Python tracker <https://bugs.python.org/issue20504> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-11-21 Thread Pierre Quentel
Change by Pierre Quentel : -- pull_requests: +9881 ___ Python tracker <https://bugs.python.org/issue20504> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-11-21 Thread Pierre Quentel
Change by Pierre Quentel : -- nosy: +quentel ___ Python tracker <https://bugs.python.org/issue20504> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10486] http.server doesn't set all CGI environment variables

2018-11-13 Thread Pierre Quentel
Pierre Quentel added the comment: The QUERY_STRING value is always set by the code at lines 1135-1137 of http.server: for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'): env.setdefault(k, "") The R

[issue10486] http.server doesn't set all CGI environment variables

2018-11-10 Thread Pierre Quentel
Change by Pierre Quentel : -- nosy: +quentel ___ Python tracker <https://bugs.python.org/issue10486> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30576] http.server should support HTTP compression (gzip)

2018-09-22 Thread Pierre Quentel
Pierre Quentel added the comment: I have released the module as httpcompressionserver on PyPI : https://pypi.org/project/httpcompressionserver/ -- ___ Python tracker <https://bugs.python.org/issue30

[issue30576] http.server should support HTTP compression (gzip)

2018-09-15 Thread Pierre Quentel
Pierre Quentel added the comment: Brett, Thanks for taking the time, you and other core devs, to review the PR and to explain why you took this decision. I am disappointed by the result, but I understand the reasons, having to face the same maintenance issues, on a much smaller scale

[issue30576] http.server should support HTTP compression (gzip)

2017-11-23 Thread Pierre Quentel
Pierre Quentel <pierre.quen...@gmail.com> added the comment: On the Github site Raymond Hettinger is mentioned as the reviewer. I don't know how to contact him, can anyone ask him if he can review the PR on time for inclusion in Python 3.7 ? I understand that it's difficult to fin

[issue30576] http.server should support HTTP compression (gzip)

2017-11-11 Thread Pierre Quentel
Pierre Quentel <pierre.quen...@gmail.com> added the comment: I think I have made all the changes requested in the code review (many thanks to the reviewer !). I see that the Pull Request has been flagged "awaiting core review". With the deadline for Python 3.7 comin

[issue30406] async and await should be keywords in 3.7

2017-11-04 Thread Pierre Quentel
Pierre Quentel <pierre.quen...@gmail.com> added the comment: According to PEP 492, async and await should have been deprecated in 3.5 and 3.6, but I don't think they have been : await = 1 def f(async=True): ... don't raise any deprecation warning in 3.6. Since version 3.7 will

[issue30576] http.server should support HTTP compression (gzip)

2017-08-15 Thread Pierre Quentel
Pierre Quentel added the comment: On Python-ideas someone asked if other compressions could be supported besides gzip. The latest version of the PR adds a mechanism for that : SimpleHTTPRequestHandler has a new attribute "compressions", a dictionary that maps compression encodings

[issue30576] http.server should support HTTP compression (gzip)

2017-08-02 Thread Pierre Quentel
Pierre Quentel added the comment: In the latest version of the PR, following Martin's comments : - apply Chunk Transfer for HTTP/1.1 only, change implementation of compression for previous protocols (send gzipped data without Content-Length) - use http.cookiejar to parse the Accept-Encoding

[issue29654] SimpleHTTPRequestHandler should support browser cache

2017-07-29 Thread Pierre Quentel
Pierre Quentel added the comment: Thanks for telling me. I must have run the test hundreds of times now, on a Windows 7 PC, and this bug never occured. Just for my information, why do you add temp.flush() in the "with" block ? I thought the context manager took care of this. 2017-0

[issue30576] http.server should support HTTP compression (gzip)

2017-07-28 Thread Pierre Quentel
Pierre Quentel added the comment: @martin.panter Please forget my previous message. There is a 3rd solution, and you gave it : no Content-Length and close the connection when all (compressed) data has been sent. -- ___ Python tracker <

[issue30576] http.server should support HTTP compression (gzip)

2017-07-26 Thread Pierre Quentel
Pierre Quentel added the comment: @martin.panter For HTTP/1.0, since chunked transfer is not supported, and storage in a temporary file is also not an option, I see 2 possible solutions : - give up compressing big files - it would be a pity, compression is actually made for them... - compress

[issue30576] http.server should support HTTP compression (gzip)

2017-07-25 Thread Pierre Quentel
Pierre Quentel added the comment: In the latest version of the Pull Request (https://github.com/python/cpython/pull/2078/commits/6466c93555bec521860c57e832b691fe7f0c6c20) : - compression is disabled by default (compressed_types is set to []) - as suggested by Chris Barker in the discussion

[issue29512] regrtest refleak: implement bisection feature

2017-07-25 Thread Pierre Quentel
Pierre Quentel added the comment: Maybe it's me who is doing things wrong, but when I run Lib/test/test_httpservers.py I get this strange error : Traceback (most recent call last): File "C:\cpython\Lib\test\test_httpservers.py", line 7, in from http.server import BaseHTTPRequ

[issue30576] http.server should support HTTP compression (gzip)

2017-07-22 Thread Pierre Quentel
Pierre Quentel added the comment: Thank you Terry and Victor for your comments. I understand that you agree on adding HTTP compression to http.server, but don't want it to be enabled by default. @terry.reedy With the implementation proposed in the Pull Request, to disable compression

[issue30576] http.server should support HTTP compression (gzip)

2017-07-19 Thread Pierre Quentel
Pierre Quentel added the comment: Is Python-ideas the appropriate place to get input from other core devs ? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30824] Add mimetype for extension .json

2017-07-01 Thread Pierre Quentel
New submission from Pierre Quentel: I propose to add a mapping of file extension .json to mime type "application/json". This is registered in https://www.iana.org/assignments/media-types -- components: Library (Lib) messages: 297494 nosy: quentel, r.david.murray priori

[issue30576] http.server should support HTTP compression (gzip)

2017-06-20 Thread Pierre Quentel
Pierre Quentel added the comment: Thanks for the comments. I agree with some of them, and have improved the PR accordingly, but I don't agree on the opinion that HTTP compression is beyond the scope of http.server : like browser cache (which also implies a negociation between client

[issue30576] http.server should support HTTP compression (gzip)

2017-06-10 Thread Pierre Quentel
Changes by Pierre Quentel <pierre.quen...@gmail.com>: -- pull_requests: +2142 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30576] http.server should support HTTP compression (gzip)

2017-06-10 Thread Pierre Quentel
Pierre Quentel added the comment: The compression is done on the fly : if compression criteria are satisfied, the original content is gzipped, either in memory or on a temporary file on disk, depending on the file size. The gzipped content is not cached, but since the server now supports

[issue30576] http.server should support HTTP compression (gzip)

2017-06-06 Thread Pierre Quentel
Pierre Quentel added the comment: I propose this as a minor improvement to the built-in server, like the support of browser cache that will be included in Python 3.7 (issue #29654, PR #298). I understand that the server is not supposed to be full-featured, but HTTP compression is widespread

[issue30576] http.server should support HTTP compression (gzip)

2017-06-05 Thread Pierre Quentel
Changes by Pierre Quentel <pierre.quen...@gmail.com>: -- type: -> enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30576] http.server should support HTTP compression (gzip)

2017-06-05 Thread Pierre Quentel
New submission from Pierre Quentel: The server in http.server currently doesn't support HTTP compression. I propose to implement it in the method send_head() of SimpleHTTPRequestHandler this way : for each GET request, if the request header "Accept-Encoding" is present and incl

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-11 Thread Pierre Quentel
Pierre Quentel added the comment: Senthil, Can you take a look at the Pull Request when you have time ? The correct PR is #991, not #990. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
Changes by Pierre Quentel <pierre.quen...@gmail.com>: -- pull_requests: +1163 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
Changes by Pierre Quentel <pierre.quen...@gmail.com>: -- pull_requests: +1162 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
New submission from Pierre Quentel: In the cgi module, the parse_multipart() function duplicates code from FieldStorage, and the result is not compliant with that of FieldStorage for requests sent with multipart/form-data : for non-file fields, the value associated with a key is a list

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

2017-04-04 Thread Pierre Quentel
Pierre Quentel added the comment: I close this issue and will open a more specific one for the rewriting of parse_multipart() -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.pytho

[issue29654] SimpleHTTPRequestHandler should support browser cache

2017-02-25 Thread Pierre Quentel
New submission from Pierre Quentel: SimpleHTTPServer send a Last-Modified response header, but doesn't take into account the If-Modified-Since header if it was sent by the user agent. If a url matches a file and this file was not modified after the value of the If-Modified-Since header

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2015-08-08 Thread Pierre Quentel
Pierre Quentel added the comment: Victor, you can apply the patch and close the issue. Le 7 août 2015 17:12, Peter Landry rep...@bugs.python.org a écrit : Peter Landry added the comment: A new patch that simply removes Content-Length from part headers when present. -- Added file

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2015-08-07 Thread Pierre Quentel
Pierre Quentel added the comment: I don't really see why there is a Content-Length in the headers of a multipart form data. The specification at http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 doesn't mention it, and it is absent in the example that looks like the one tested

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2015-08-01 Thread Pierre Quentel
Pierre Quentel added the comment: Yes, I will be able to review the patch next week 2015-07-31 18:13 GMT+02:00 STINNER Victor rep...@bugs.python.org: STINNER Victor added the comment: @Pierre Quentel: Hi! Are you still working on CGI? Can you please review this patch? Thanks

[issue11352] Update cgi module doc

2012-05-10 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: I attach a new version after sharing thought with Glenn CGI scripts are still unable to define which encoding to use to print the strings received from the user agent. A patch was proposed #11066 but the issue is still pending

[issue11352] Update cgi module doc

2012-05-09 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Hi, I started working on a revised version of the whole cgi documentation. I mostly changed paragraphs 2 3 (Using the CGI module and Higher level interface) and replaced them by a paragraph still called Using the CGI module + 2 other

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-08 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Hi Glenn, My proposal was not about optimization, I just thought that if x==y is simpler than if len(x)==len(y) and x==y. Since we don't expect that there will be many directories in the list, I don't think optimizing is so important

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-07 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Thanks for the explanation I still think that the patch can be simplified, not using path lengths and the found flag collapsed_path = _url_collapse_path(self.path) for head in self.cgi_directories: if head==collapsed_path

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-06 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Hi Glenn, good to hear from you ;-) I think the fix can be simplified replacing dir_sep = collapsed_path.find('/', 1) by dir_sep = collapsed_path.rfind('/', 1) -- nosy: +quentel

[issue8077] cgi handling of POSTed files is broken

2012-05-03 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: There are 2 different problems : - handling of data by cgi.FieldStorage (issue 4953) : fixed since version 3.2 - in http.server.CGIHTTPRequestHandler, for POST requests on Windows, before opening the subprocess in run_cgi() all data

[issue8077] cgi handling of POSTed files is broken

2012-05-02 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: -- nosy: +quentel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8077 ___ ___ Python-bugs-list

[issue11352] Update cgi module doc

2012-04-30 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Thanks Hynek for raising this issue from the dead Patch proposal attached. Sorry if there are markup errors, it's my first contact with rst -- Added file: http://bugs.python.org/file25416/cgi.rst

[issue11352] Update cgi module doc

2012-04-30 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Sorry about that. I didn't dare to say I was also a Mercurial newbie -- Added file: http://bugs.python.org/file25421/cgi-doc-update.patch ___ Python tracker rep...@bugs.python.org http

[issue11352] Update cgi module doc

2012-04-30 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file25416/cgi.rst ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11352

[issue11352] Update cgi module doc

2012-04-30 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Thanks Senthil I spot a typo in the first modified paragraph : cet instead of set -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11352

[issue12922] StringIO and seek()

2011-09-07 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: -- nosy: +quentel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12922 ___ ___ Python-bugs-list

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

2011-07-04 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

[issue11352] Buf in cgi module doc

2011-02-28 Thread Pierre Quentel
New submission from Pierre Quentel pierre.quen...@gmail.com: 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 pierre.quen...@gmail.com added the comment: bug, not buf... -- title: Buf in cgi module doc - Bug in cgi module doc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11352

[issue10911] cgi: add more tests

2011-02-04 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: I opened issue #11066 for the code refactoring -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10911

[issue10911] cgi: add more tests

2011-01-29 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-29 Thread Pierre Quentel
New submission from Pierre Quentel pierre.quen...@gmail.com: 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

[issue10911] cgi: add more tests

2011-01-21 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-14 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20387/cgi_32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-14 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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 rep

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

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20402/cgi_32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-14 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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 rep...@bugs.python.org STINNER Victor victor.stin...@haypocalc.com added the comment

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

2011-01-14 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20405/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

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

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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 rep...@bugs.python.org http

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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 rep...@bugs.python.org http://bugs.python.org

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20229/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20235/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20322/cgi_diff_20110109.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20323/cgi_tests.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20356/cgi_diff_20110111.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20382/cgi_diff_20110112.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20383/cgi_20110113.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20384/test_cgi_20111013.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20244/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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 rep...@bugs.python.org http

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

2011-01-12 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-11 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-10 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-10 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-09 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-09 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: cgi tests -- Added file: http://bugs.python.org/file20323/cgi_tests.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953

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

2011-01-07 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

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

2011-01-05 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com 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

  1   2   >