New submission from Christoph Zwerschke <[EMAIL PROTECTED]>:
When you sort a list with list.sort() or sorted(list), and set the
reverse parameter to None, then you get the following misleading error
message:
TypeError: an integer is required
I would expect a more proper error messa
Christoph Zwerschke <[EMAIL PROTECTED]> added the comment:
The problem is not only that the error message "TypeError: an integer is
required" has "integer" instead of "boolean", but it does not mention
the attribute name "reverse", i.e. it does n
Christoph Zwerschke <[EMAIL PROTECTED]> added the comment:
The unspecific error message is thrown by the vgetargskeywords()
function, so changing this behavior would be a larger, more difficult
and general issue (similar to #1283289). We could go another path and
require an object for
Christoph Zwerschke <[EMAIL PROTECTED]> added the comment:
Agree. Seems to be a more general weakness of the argument parsing of
builtin functions and methods, that calls for a general solution instead
of a local patch. Luckily there are not so many cases where the errors
are misleading,
Christoph Zwerschke <[EMAIL PROTECTED]> added the comment:
Small improvement of the patch: Instead of hardcoding the BOM as
'\xef\xbb\xbf', we should use codecs.BOM_UTF8.
___
Python tracker <[EMAIL PROTECTED]>
<http://bug
New submission from Christoph Zwerschke:
The following code throws a NameError which seems to be a bug existing
since Python 2.4 up to the current 2.5.2.
class A:
a = 'test'
[c for c in a]
(c for c in a)
tuple(c for c in a)
[c for c in a if c in a]
(c for c in
Christoph Zwerschke added the comment:
Thanks for the quick explanation. I understand that class scopes don't
extend and this is documented behavior.
However, the question is why the if clause is executed in a scope of its
own and where this is documented.
You would expect that the proble
Christoph Zwerschke added the comment:
Thanks, this now makes sense to me. You're right, it's rather an ugly
wart than a bug.
But I think the Python reference needs to be improved to make this clear
enough.
How about the following proposed addtions (in square brackets) to
section 5
New submission from Christoph Zwerschke <[EMAIL PROTECTED]>:
While locale.strcoll seems to work with Unicode strings, locale.strxfrm
gives a UnicodeError. Example:
###
try:
locale.setlocale(locale.LC_ALL, 'de')
except locale.Error: # Windoof
locale.setlocale(locale.LC_A
New submission from Christoph Zwerschke :
If you install sgmlop (downloadable from
http://effbot.org/downloads/#sgmlop) under Python 2.x, then this can
break xmlrpclib.
You can reproduce this problem as follows (I have tested with Py 2.4,
2.5 and 2.6):
data = "&quo
Changes by Christoph Zwerschke :
--
keywords: +patch
Added file: http://bugs.python.org/file12418/xmlrpclib.patch
___
Python tracker
<http://bugs.python.org/issue4
New submission from Christoph Zwerschke :
A new action "extend" has been added to argparse in
https://github.com/python/cpython/commit/aa32a7e1116f7aaaef9fec453db910e90ab7b101
The documentation should specify that this is new in Python 3.8 addition. I
wondered why it didn't
New submission from Christoph Zwerschke :
Just noticed the following code in urrlib.parse_qsl:
pairs = [s1 for s1 in qs.split(separator)]
for name_value in pairs:
...
see
https://github.com/python/cpython/blob/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b/Lib/urllib/parse.py#L755
Christoph Zwerschke added the comment:
I saw you submitted a PR already which looks good to me.
--
___
Python tracker
<https://bugs.python.org/issue43
Christoph Zwerschke added the comment:
I don't mind if you reopen your PR. But thanks for asking.
--
___
Python tracker
<https://bugs.python.org/is
Christoph Zwerschke added the comment:
This patch should really be included.
As carl already mentioned, the relevant spec is RFC 6265, see section 5.4.2:
"The user agent SHOULD sort the cookie-list in the following order: Cookies
with longer paths are listed before cookies with sh
Christoph Zwerschke added the comment:
Just created a test case for this problem after a pentest provoked this error
on one of my web apps. Then I found this bug report which already has a similar
test case attached.
The problem is that read_binary() as the name says reads binary data, but
Christoph Zwerschke added the comment:
Had the same problem for years and wondered why nobody else complained.
Still reproducable with Win 10 Pro 2004, Python 3.8, cp1252 locale.
Deleting hh.dat did not solve the problem for me.
--
nosy: +cito
Change by Christoph Zwerschke :
--
nosy: +cito
___
Python tracker
<https://bugs.python.org/issue18319>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Christoph Zwerschke :
The Python documentation says about hashability in the glossary
(https://docs.python.org/3/glossary.html#term-hashable):
"Objects which are instances of user-defined classes are hashable by default."
This is not quite true. Objects of a us
Christoph Zwerschke added the comment:
My point was that it's not immediately obvious what "by default" means and that
hashability is not only affected by the __hash__ method but also by __eq__.
But I agree, you can argue that "by default" already includes not ad
Change by Christoph Zwerschke :
--
nosy: +cito
___
Python tracker
<https://bugs.python.org/issue2>
___
___
Python-bugs-list mailing list
Unsubscribe:
Christoph Zwerschke added the comment:
This also happens when sending POST requests with JSON payload from a browser
with XMLHttpRequest to a Python 3.7 backend using FieldStorage. It seems
XMLHttpRequest adds the content length automatically
Christoph Zwerschke added the comment:
> Corresponding GNU gettext issue [1] was closed as "Not a Bug".
Though I think the rationale given there pointing to RFC3629 section 6 is
wrong, since that section explicitly refers to Internet protocols, but PO files
are not an Inte
Christoph Zwerschke added the comment:
I can confirm that the problem still exists in Python 3.6.4 and 3.7.0a4.
Here is another way to demonstrate it:
Create the following file test.py:
# test
hello = f"{world)}"
Note that there is a syntax error in the f-string in line 2
Change by Christoph Zwerschke :
--
nosy: +cito
___
Python tracker
<https://bugs.python.org/issue34730>
___
___
Python-bugs-list mailing list
Unsubscribe:
Christoph Zwerschke added the comment:
After this patch, some of the values in mimetypes.types_map now appear as
unicode instead of str in Python 2.7.7 under Windows. For compatibility and
consistency reasons, I think this should be fixed so that all values are
returned as str again under
New submission from Christoph Zwerschke :
The cgi.Fieldstorage class supports the __contains__ method since Py
2.2, but the documentation of Py 2.6 still only mentions the old
fashioned has_key method. See patch.
--
assignee: georg.brandl
components: Documentation
files: cgi.patch
New submission from Christoph Zwerschke :
The Python 2.6.2 tutorial says at the end of secton 8.3
(http://docs.python.org/tutorial/errors.html#handling-exceptions):
"But use of .args is discouraged. Instead, the preferred use is to pass
a single argument to an exception (which can be a
Changes by Christoph Zwerschke :
--
nosy: +cito
___
Python tracker
<http://bugs.python.org/issue2504>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Christoph Zwerschke :
In the section "Using the batteries" of the "Idioms and Anti-Idioms in
Python" document
(http://docs.python.org/dev/howto/doanddont.html#using-the-batteries),
the reduce statement is used for summing up numbers as an example. I
thi
Christoph Zwerschke added the comment:
My point was that the passage starts with "there are also many useful
built-in functions people seem not to be aware of for some reasons" and
then it looks like the author himself was not aware of sum() for some
reason because he gives calcula
Christoph Zwerschke added the comment:
This is a related problem on Windows:
'%g' % 1e400 -> '1.#INF'
'%.f' % 1e400 --> '1'
--
nosy: +cito
___
Pyt
New submission from Christoph Zwerschke:
The first paragraph in PCbuild/readme.txt of Python 3.3 still talks about
Visual C++ 2008 Express and Visual Studio 2008. It says that VS 2008 is
required at the very least (which may be still true, I'm not sure), but then it
also says "th
34 matches
Mail list logo