random832 added the comment:
That documentation isn't specific to StringIO, and in any case, the limitation
in question isn't documented. The actual implementation is at
https://github.com/python/cpython/blob/HEAD/Modules/_io/stringio.c#L484
But if examples would help, they're simple
New submission from random832 :
Currently this fails with a (misleading in the case of SEEK_END) "Can't do
nonzero cur-relative seeks" error, but there's no conceptual reason it
shouldn't be possible.
The offset should simply be taken as a character offset, without an
New submission from Random832 :
IDLE currently just returns to the interactive prompt when a script exits, even
if SystemExit has arguments. This can be confusing to new users if they are
using sys.exit to print a message.
--
assignee: terry.reedy
components: IDLE
files: run.py.patch
random832 added the comment:
It says *minimum* size for a reason. The *actual* sizes of the types used in
array are platform-dependent. 2 is the smallest that an int can be (it is
probably not that size on any currently supported platforms, but would have
been in DOS), and 4 is the smallest
New submission from random832:
I was writing something that iterates over all objects in gc.get_objects(). I
don't know precisely where the offending tuple is coming from, but nearby
objects in gc.get_objects() appear to be related to frozen_importlib.
A tuple exists somewhere with a null
random832 added the comment:
This bug should be closed since #16518 was accepted and the error is now
"TypeError: a bytes-like object is required, not 'int'"
--
nosy: +random832
___
Python tracker <rep...@bugs.python.org>
<htt
random832 added the comment:
Wouldn't the "symlink infinite loop" case be better handled by making it track
where it's already been? This can be done by inode and dev number on Unix; I'm
not sure what equivalent exists on Windows (though symlinks are uncommon on
Windows) but you
random832 added the comment:
In the analogous C operations, ftell (analogous to .tell) actually causes the
underlying file descriptor's position (analogous to the raw stream's position)
to be reset to be at the same value that ftell has returned. Which means, yes,
that you lose the benefits
Guido van Rossum writes:
> UnicodeEncodeError: 'ascii' codec can't encode character '\u1234' in
^ ^
> position 3: Header ('ሴ') is not valid Latin-1. Use
^ ^^^
> header.encode('utf-8') if you want to
random832 added the comment:
By "when no script [is] given", it is referring to the use in the interactive
interpreter, not in a python file.
--
nosy: +random832
___
Python tracker <rep...@bugs.python.org>
<http://bugs.py
random832 added the comment:
Looks like a result of searching and replacing PyInt with PyLong - the diff can
be found here, if anyone cares.
https://hg.python.org/cpython-fullhistory/rev/f324631462a2.
Oddly, there was _another, older_ revision that fixed this correctly:
https://hg.python.org
random832 added the comment:
Sorry, my mistake, I was looking at z_set instead of Z_set. The earlier fix had
left Z_set out for some reason. Anyway, just some historical interest anyway.
--
___
Python tracker <rep...@bugs.python.org>
random832 added the comment:
Oh, I just noticed, the help string is also wrong in 3.5 (which explains why
you removed 3.5 from the versions list, which I hadn't noticed until after
posting my previous comment).
--
___
Python tracker <
random832 added the comment:
What about fixing all methods so that they can take keywords? Are the functions
with their current C signatures part of the stable ABI? Is there somewhere we
could centrally add some magic "convert tuple+keywords to tuple, given list of
names&
random832 added the comment:
I guess the next question is what the intent is. Was there an intent, which was
not followed through on, to upgrade these methods to support keyword arguments?
Or is there an intent (here and everywhere) that documentation using keyword
argument syntax
random832 added the comment:
Whatever the case may be, it *doesn't* support keyword arguments. e.g.:
>>> eval("a+b", globals={'a':1}, locals={'b':2})
TypeError: eval() takes no keyword arguments
So as the current situation stands, the documentation is wrong, and the help
s
random832 added the comment:
Your "backward compatibility" argument makes me think of https://xkcd.com/1172/
99% of programs written in C or other languages will cut the value off at the
first null. One consequence of which is that no-one (except an unfortunate
Python program) wil
random832 added the comment:
> All registry values are blobs and it's up to the caller to decide how to read
> it - the "types" are hints and are not binding.
Just out of curiosity, what do we do if a REG_DWORD is more (or less?) than
four bytes?
random832 added the comment:
> I don't see why the original issue with matplotlib would only happen with
> Python 3 and not Python 2, though.
Is it possible that Python 2 is using a non-unicode Windows API to get the
values, and the non-unicode API is converting the string
random832 added the comment:
> The winreg module is a low-level interface
High enough to return a string instead of bytes, an int for REG_DWORD, and to
parse out REG_MULTI_SZ into a list. Maybe for if people really want the blob
there should be an interface that always returns by
random832 added the comment:
I can't reproduce without pickle. I did some further digging, though, and it
*looks like*...
1. Pickle causes the built-in UTF-8 representation of a string to be populated,
whereas encode('utf-8') does not. Can anyone think of any other operations that
do this?
2
random832 added the comment:
I've looked at the raw bytes [through a ctypes pointer to id(s)] of a string
affected by the issue, and decoded enough to be able to tell that the bad
string has an incorrect UTF-8 length and data, which pickle presumably relies
on.
HEADlength..hash
random832 added the comment:
> unicode_modifiable in Objects/unicodeobject.c should return 0 if there's
> cached PyUnicode_UTF8 data. In this case PyUnicode_Append won't operate in
> place but instead concatenate a new string.
Shouldn't it still operate in place but clear it?
23 matches
Mail list logo