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
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>
___
___
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("
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
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
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
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
Changes by Pierre Quentel :
--
nosy: +quentel
___
Python tracker
<http://bugs.python.org/issue12922>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 :
&
Pierre Quentel added the comment:
"bug", not "buf"...
--
title: Buf in cgi module doc -> Bug in cgi module doc
___
Python tracker
<http://
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
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
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
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
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
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
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
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
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
--
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
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
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
Pierre Quentel added the comment:
cgi tests
--
Added file: http://bugs.python.org/file20323/cgi_tests.zip
___
Python tracker
<http://bugs.python.org/issue4
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
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
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
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
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
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
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
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
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
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20322/cgi_diff_20110109.txt
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bug
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
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20356/cgi_diff_20110111.txt
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bug
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20382/cgi_diff_20110112.txt
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bug
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20383/cgi_20110113.diff
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bug
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20384/test_cgi_20111013.diff
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bug
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
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
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
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
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
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
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
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
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
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
Changes by Pierre Quentel :
Removed file: http://bugs.python.org/file20405/unnamed
___
Python tracker
<http://bugs.python.org/issue4953>
___
___
Python-bugs-list mailin
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
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
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
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
Pierre Quentel added the comment:
I opened issue #11066 for the code refactoring
--
___
Python tracker
<http://bugs.python.org/issue10911>
___
___
Python-bug
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
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)
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
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
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
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
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
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
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
Change by Pierre Glaser :
--
pull_requests: +15523
pull_request: https://github.com/python/cpython/pull/15882
___
Python tracker
<https://bugs.python.org/issue38
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
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
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
Pierre Quentel added the comment:
Now that the PR has been merged, can someone close the issue ?
--
___
Python tracker
<https://bugs.python.org/issue20
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
Pierre Quentel added the comment:
That was a quick fix, thanks !
--
___
Python tracker
<https://bugs.python.org/issue38469>
___
___
Python-bugs-list mailin
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
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'
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
Change by Pierre Ossman :
--
nosy: +CendioOssman
___
Python tracker
<https://bugs.python.org/issue44185>
___
___
Python-bugs-list mailing list
Unsubscribe:
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"),
Pierre Ossman added the comment:
Also see Issue44185 for __exit__.
--
___
Python tracker
<https://bugs.python.org/issue44503>
___
___
Python-bugs-list mailin
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
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
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
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
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
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,
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
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
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
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
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
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
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
Change by Pierre Chatelier :
--
versions: +Python 3.8 -Python 3.6
___
Python tracker
<https://bugs.python.org/issue32371>
___
___
Python-bugs-list mailin
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.
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,
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
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&
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
Change by Pierre Tardy :
--
components: +Library (Lib)
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue42833>
___
___
Python-bugs-lis
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
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
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
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 - 100 of 281 matches
Mail list logo