New submission from STINNER Victor :
FileIO.readall() reads the file position and size before each call to read(),
to adjust the buffer size.
Moreover FileIO.readall() calls lseek() on Windows: it should use _lseeki64()
instead, to handle correctly file bigger than 2 GB (or maybe 4 GB? I
STINNER Victor added the comment:
Oh, FileIO.readall() doesn't raise a ValueError if the file is closed => patch
attached to fix this.
--
Added file: http://bugs.python.org/file22107/fileio_readall_closed.patch
___
Python tracke
STINNER Victor added the comment:
RawIOBase.readall() fails if .read() returns None: fix attached.
--
Added file: http://bugs.python.org/file22108/rawiobase_readall.patch
___
Python tracker
<http://bugs.python.org/issue12
STINNER Victor added the comment:
bufferedreader_readall.patch: BufferedReader.read(None) calls raw.readall() if
available.
bufferedreader_readall.patch requires fileio_readall_closed.patch and
rawiobase_readall.patch fixes.
--
Added file: http://bugs.python.org/file22109
STINNER Victor added the comment:
Number of syscalls without the patch -> with the patch:
- read the README file, text mode: 17 -> 12 syscalls (-5)
- read the README file, binary mode: 15 -> 11 syscalls (-4)
- read a binary file of 10 MB: 17 -> 12 syscalls (-5)
Quick benchmark
Changes by STINNER Victor :
--
nosy: +charles-francois.natali, haypo, pitrou
___
Python tracker
<http://bugs.python.org/issue12179>
___
___
Python-bugs-list mailin
STINNER Victor added the comment:
> New changeset 3e3cd0ed82bb by Senthil Kumaran in branch 'default':
> News entry for issue11109.
> http://hg.python.org/cpython/rev/3e3cd0ed82bb
Please try to format NEWS entries using "Issue #xxx: xxx" instead of "Issue
#xx
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12180>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> Don't hesitate to ask me if you need information.
It looks like the crash occurs on r[0].data in testPair() of test_kqueue. Can
you confirm this? Comment the line in test_kqueue.py to check if it works
around the crash.
What is the size of intp
STINNER Victor added the comment:
> Attached patch [fileio_readall.patch] fixes both problems.
> Looks ok to me. Did you test under Windows?
Yes, test_io pass on Windows Vista 64 bits.
> Did you run some benchmarks?
Yes, see msg136853. Do you mean that I should not touch FileIO.rea
STINNER Victor added the comment:
> You must Py_DECREF(all) first.
> Also, you should check that "all" is either None or a bytes object.
Right, fixed in bufferedreader_readall-2.patch. By the way, thanks for your
reviews.
So, do you think that fileio_readall.patch and buffer
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file22117/bufferedreader_readall-2.patch
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Changes by STINNER Victor :
Added file: http://bugs.python.org/file22118/bufferedreader_readall-2.patch
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file22109/bufferedreader_readall.patch
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file22107/fileio_readall_closed.patch
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Pytho
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file22108/rawiobase_readall.patch
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Pytho
STINNER Victor added the comment:
> Since it's a OOM issue, can we close?
Yes, I don't want to investigate, and I already changed the size of my swap
partition, so I cannot reproduce the bug anymore.
--
resolution: -> wont fix
status
STINNER Victor added the comment:
Le mercredi 25 mai 2011 à 08:23 +, Marc-Andre Lemburg a écrit :
> > Do we need an additional method? It seems that this reset() could
> > also be written encoder.encode('', final=True)
>
> +1
>
> I think that'
STINNER Victor added the comment:
The initial problem (reset() at each call to .encode()) is fixed in Python 2.7,
3.1, 3.2 and 3.3.
I opened a new issue, #12171, for the second problem noticed by Armin (decreset
vs encreset).
--
resolution: -> fixed
status: open ->
STINNER Victor added the comment:
cjk_encreset.patch: Fix multibytecodec.MultibyteIncrementalEncoder.reset(),
call encreset() instead of decreset(). Improve also incremental encoder tests:
reset the encoder using .encode('', final=True) and check the output.
I also prefer to
STINNER Victor added the comment:
> I'm not sure what you mean by "discard the output".
>
> Calling .reset() should still add the closing sequence to the output
> buffer, if needed.
Incremental encoders don't have any buffer.
Python 3.3a0 (default:3c77
STINNER Victor added the comment:
We can use a class attribute to set the attribute before calling __init__:
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -664,6 +664,8 @@ _PLATFORM_DEFAULT_CLOSE_FDS = object()
class Popen(object
STINNER Victor added the comment:
> True, this is clever. Will you commit?
I'm not sure that it's the pythonic way to solve such problem. Can you work on
a patch including a test?
--
___
Python tracker
<http://bugs.pytho
STINNER Victor added the comment:
Does your filesystem store the modification time? Why don't you have/want
fstat()? Do you have stat() or a similar function?
--
___
Python tracker
<http://bugs.python.org/is
STINNER Victor added the comment:
Patch applied, thanks for your patch!
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12182>
___
___
Python-bug
STINNER Victor added the comment:
> Should I attempt to modify my patch to include a comment and a test?
Yes please, you can use support.captured_stderr() tool.
--
___
Python tracker
<http://bugs.python.org/issu
New submission from STINNER Victor :
Polling should be avoided when it's possible. For subprocess.wait(), we can do
something with signals (SIGCHLD and/or SIGCLD).
sigtimedwait() can be used to wait a the "a child process terminated" with a
timeout, but not wait a specific pro
STINNER Victor added the comment:
On Linux, the clone() syscall allows the change the signal send by the child to
the parent when it terminates. It's also possible to choose to not send a
signal when at child exit... But I don't think that subprocess uses suc
STINNER Victor added the comment:
> I propose to merge both files, this would ease maintenance
> and understanding of how these paths are determined.
You mean to have only one function? I would prefer to keep two functions, but
one should call the another one :) (you should factorize th
STINNER Victor added the comment:
Le jeudi 26 mai 2011 à 14:54 +, Charles-François Natali a écrit :
> Charles-François Natali added the comment:
>
> OpenBSD's struct kevent definition looks fishy:
> http://www.openbsd.org/cgi-bin/cvsweb/src/sys/sys/event.h?rev=1.15;
STINNER Victor added the comment:
The bug is specific to compile(), the import machinery supports Windows
newlines on Linux for example.
marge$ python2.6
Type "help", "copyright", "credits" or "license" for more information.
>>> code=open(&quo
STINNER Victor added the comment:
If there are only two versions of the structure on all operating systems, we
can add a check in configure (e.g. test the size of the ident attribute, =int
or >=void*?) to define a macro (e.g. HAVE_OPENBSD_KEVENT_STRUCT). You might be
able to change the t
STINNER Victor added the comment:
+self.assertRaises(TypeError, os.pipe2, (0, 0))
Do you want to call the function with two arguments or one tuple with 2 items?
You may test both :-)
+# try a write big enough to fill-up the pipe (64K on most kernels):
this
+# should
STINNER Victor added the comment:
+# A constant likely larger than the underlying OS pipe buffer size.
+# Windows limit seems to be around 512B, and most Unix kernels have a 64K pipe
+# buffer size: take 1MB to be sure.
+PIPE_MAX_SIZE = 1024 * 1024
Hum, I am not sure that the comment is
STINNER Victor added the comment:
Oh, sigwait() doesn't accept a timeout! I would be nice to have also
sigwaitinfo().. and maybe also its friend, sigwaitinfo() (if we implement the
former, it's trivial to implement the latter). Python 3.3 adds optional timeout
to subpr
STINNER Victor added the comment:
> If've added a test to skip this test on Linux kernels older than 2.6.27:
> like O_CLOEXEC, the problem is that the libc defines pipe2() while the
> kernel doesn't support it, so when syscall() is called it bails out with
> ENOSYS. (This
STINNER Victor added the comment:
What do you call a "stack trace"? I use this term in the C language, especially
when using the "where" command of gdb. In Python, the stack trace is called a
"traceback". Anyway, faulthandler prints the Python trace, not the C tr
Changes by STINNER Victor :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue12175>
___
___
Python-bugs-list
New submission from STINNER Victor :
The following code displays "Xbc" using io, and "bc" using _pyio (or an
unbuffered file, e.g. io.FileIO):
-
import _pyio, io
with io.BytesIO(b'abc') as raw:
#with _pyio.BufferedRandom(raw) as f:
wi
Changes by STINNER Victor :
--
components: +IO
___
Python tracker
<http://bugs.python.org/issue12213>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> I already noticed the implement difference of BufferedRandom.write(),
> but I don't remember if I reported it or not!?
Yes, I already reported the difference:
http://bugs.python.org/issue1206
Changes by STINNER Victor :
--
resolution: fixed ->
status: closed -> open
___
Python tracker
<http://bugs.python.org/issue1195>
___
___
Python-bugs-list
STINNER Victor added the comment:
> The last change appears to have fixed the problem;
> AFAIK there have been no test_logging failures on the buildbots
> for several days.
Great job, thanks!
--
___
Python tracker
<http://bug
Changes by STINNER Victor :
--
title: BufferedRandom: write(); read() gives different result using io and
_pyio -> BufferedRandom, BufferedRWPair: issues with interlaced read-write
___
Python tracker
<http://bugs.python.org/issu
STINNER Victor added the comment:
io_interlaced_read_write.patch:
- add interlaced read/write tests for BufferedRandom and BufferedRWPair
- _pyio: move "undo readahead" code into BufferedReader.flush()
- io: BufferedRandom.flush() doesn't undo readahead if the write buffer is
New submission from STINNER Victor :
The following code fails on an assertion error (Python exception for _pyio, C
assertion for io):
--
with io.BytesIO(b'abcd') as raw:
with _pyio.TextIOWrapper(raw, encoding='ascii') as f:
f.read(1
STINNER Victor added the comment:
See also issue #12215: TextIOWrapper has also issues on interlaced read-write.
--
___
Python tracker
<http://bugs.python.org/issue12
STINNER Victor added the comment:
textiowrapper_interlaced_read_write.patch: TextIOWrapper.write() calls
self.seek(self.tell()) if it has a decoder or if snapshot is not None.
I suppose that we can do better, but at least it does fix this issue.
"read(); write(); write()"
Changes by STINNER Victor :
--
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/issue12215>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
versions: +Python 2.7
___
Python tracker
<http://bugs.python.org/issue12215>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
versions: +Python 2.7, Python 3.2
___
Python tracker
<http://bugs.python.org/issue12213>
___
___
Python-bugs-list mailing list
Unsub
STINNER Victor added the comment:
> dumping the traceback on CPython crashes?
faulthandler is no more specific to crashes: you can dump the tracebacks while
Python is running using a signal or an explicit call to
faulthandler.dump_traceb
Changes by STINNER Victor :
--
nosy: +benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue12216>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
http://patch-tracker.debian.org/patch/series/view/python3.2/3.2.1~rc1-1/platform-lsbrelease.diff
This patch fails if "(?:DISTRIB_CODENAME\s*=)\s*(.*)" regex doesn't match
(_u_id variable is not set).
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12188>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> Its documentation in both 2.6 and 2.7 notes:
>
> Deprecated since version 2.6: This function is obsolete.
> Use the subprocess module.
The deprecation should be removed from Python 2.7: os.popen() will not be
removed from Python 2 because 2.7
STINNER Victor added the comment:
> Should the .pyc/.pyo file writing be disabled altogether
> if stat() and/or fstat() is not available.
If we cannot get the file modification time, .pyc/.pyo writing must be
disabled. If your OS/libc/filesystem doesn't have fstat(), you don&
STINNER Victor added the comment:
> Victor: did you notice that getoutput and friends call os.popen?
Yes, because I wrote a patch to call directly subprocess :-) => see the issue
#10197. I don't want to remove os.popen() anymore, it's too much work for a
minor gain (we w
STINNER Victor added the comment:
> See the patch attached.
I like your patch, it removes many duplicate code :-)
Some comments:
- I don't like an if surrounding the whole function, I prefer "if not ...:
return" to avoid the (useless) indentation. Well, it's my coding
STINNER Victor added the comment:
> Should I go on and write a patch?
Yes please, write a patch, I will review it.
To emulate a system without stat or fstat, you may use:
#define fstat dont_have_fstat
#define stat dont_have_stat
The link will fail if the code still refer to fstat() or s
STINNER Victor added the comment:
The original issue (use backslashreplace for stdout in regrtest) is now fixed,
and so I closed it.
@ocean-city: Can you please open a new issue for unittest? (for
py3k_also_no_unicode_error_on_direct_test_run.patch)
--
resolution: -> fixed
sta
STINNER Victor added the comment:
> Here is an interesting case for your collection: PyDict_GetItemString.
It's easier to guess the encoding of such function: Python 3 always use UTF-8,
but yes, the encoding should be documented.
I documented many functions, directly in the header fi
Changes by STINNER Victor :
--
Removed message: http://bugs.python.org/msg137334
___
Python tracker
<http://bugs.python.org/issue12016>
___
___
Python-bugs-list m
STINNER Victor added the comment:
Ooops, I specified the wrong issue number in my commits :-/
New changeset 3b1b06570cf9 by Victor Stinner in branch '2.7':
Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix
http://hg.python.org/cpython/rev/3b1b06570cf9
New
STINNER Victor added the comment:
> The patch still does not handle the case where the eof indicator
> is already set when calling raw_input. My original patch does.
I commited your original patch but I kept mine because it doesn't hurt to clear
the error on EOF at exit. Reopen t
STINNER Victor added the comment:
We have know tests for some ISO 2022 codecs and the HZ codec, it's much better!
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.
STINNER Victor added the comment:
- I added tests for the HZ codec and some ISO 2022 codecs: #12057
- I fixed IncrementalEncoder.encode() (of multibytecodec ): #12100
- I fixed IncrementalEncoder.reset() (of multibytecodec): #12171
I can now work confidently on this issue. I will try to
STINNER Victor added the comment:
Extract of manpage signal(7):
"The following interfaces are never restarted after being interrupted by a
signal handler, regardless of the use of SA_RESTART; they always fail with the
error EINTR when interrupted by a signal handler:
* ...
*
STINNER Victor added the comment:
Using signalfd() (require Linux 2.6.22+), specified signals are written in a
file and don't interrupt system calls (select). Bonus: we can wait for a signal
using select!
Using pthread_sigmask(), you can also block signals before calling select, but
STINNER Victor added the comment:
I think that #12224 is a duplicate of this issue.
--
___
Python tracker
<http://bugs.python.org/issue7978>
___
___
Python-bug
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12221>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
support_linux_version.diff: cool, it's even better than the previous patch. You
can commit it, except if you are motived for a last change: display the write
also version in the SkipTest message (as it is done actually).
pipe2_whatsnew.diff: I don'
STINNER Victor added the comment:
I applied your fix, thanks.
--
___
Python tracker
<http://bugs.python.org/issue12229>
___
___
Python-bugs-list mailin
New submission from STINNER Victor :
test_subprocess.test_pass_fds() failed on x86 Tiger 3.x:
test test_subprocess failed -- Traceback (most recent call last):
File
"/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_subprocess.py", line
1296, in test_pass_fds
"
New submission from STINNER Victor :
Attached patch adds -k/--func-regex and -K/--file-regex options to filter tests
by function/file names. It modifies makeSuite() and getTestCaseNames()
functions of unittest.loader to add an optional filter argument: callback
taking a function name as
STINNER Victor added the comment:
> Attached patch adds -k/--func-regex and -K/--file-regex options to filter
> tests by function/file names.
We need maybe a third option to filter tests by their class name. And we need
also maybe the opposite option: exclude tests matching a regex. A
STINNER Victor added the comment:
Cool, "x86 FreeBSD 6.4 3.x" is green for the first time since a long time,
thanks to my commit 29e08a98281d (test_signal doesn't check signal delivery
order).
--
___
Python tracker
<http
STINNER Victor added the comment:
I ran the test more than 1000 times on Linux (using -m test -F test_io, and
manually patched test_io to only run this test, see also #12231 !!!) without
being able to reproduce the failure. So it may be specific to Mac OS X Tiger
STINNER Victor added the comment:
> Could this be related to http://bugs.python.org/issue6559#msg123958?
> Or Issue10826?
These failures were specific to Solaris/OpenIndiana: they were "door files".
Extract of fd_status.py:
1.34 +# Ignore Solaris door files
STINNER Victor added the comment:
The leaking file descriptor is a the read end of a pipe created in the test
(the test creates 5 pipes, 10 file descriptors). On creation (in the parent
process), this file descriptor has the mode : st_mode=4528. In the child
process, the file descriptor has
STINNER Victor added the comment:
> support_linux_version.diff: cool, it's even better than the previous patch.
> You can commit it, except if you are motived for a last change: display
> the write also version in the SkipTest message (as it is done actually).
I just added
STINNER Victor added the comment:
Your last support_linux_version.diff patch looks good. If you are motivated,
this new function can also be added to test.support of Python 3.2
(test_socket.py has the original linux_version() function
STINNER Victor added the comment:
Le vendredi 03 juin 2011 10:02:12, vous avez écrit :
> The implicit timeout in regrtest.py makes it harder to write automated
> test scripts for 3rd party modules. First, you have to remember to
> set --timeout=0 for long running tests.
Ah? Which te
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12251>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> How about reusing unittest discovery in regrtest?
Does this feature support filtering by keyword for file names and function
names?
--
___
Python tracker
<http://bugs.python.org/issu
STINNER Victor added the comment:
> If I understand, the essence of the patch is to do
> the file positioning automatically internally when needed.
My patch is just a proposition to fix the issue. I wrote "I suppose that we can
do better": self.seek(self.tell()) is more a w
STINNER Victor added the comment:
cjk_decode.patch:
- patch *all* CJK decoders to replace only the first byte of an invalid byte
sequence (by U+FFFD). Example from the issue title: b'\xff\n'.decode('gb2312',
'replace') gives now '�\n' instead of ju
STINNER Victor added the comment:
> Victor, I understand your response as saying that there is no bug,
> which would suggest closing this. Correct? If not, what is
> the requested action?
siginterrupt(False) has no effect on select().
I listed some solutions to not interrupt sele
New submission from STINNER Victor :
b'abc\xff'.decode('punycode', 'ignore') raises the same error than
b'abc\xff'.decode('punycode', 'replace') or b'abc\xff'.decode('punycode'): it
uses the strict error han
STINNER Victor added the comment:
base64_codec.py uses an assertion to check the error handler: it should use an
if+raise (assertions are ignored in optimized mode, python -O).
--
___
Python tracker
<http://bugs.python.org/issue12
New submission from STINNER Victor :
import parser; parser.expr("a", "b") raises a TypeError('expr() takes at most 1
argument (2 given)') but corrupt also the reference count of an object (I don't
know which one): "python: Modules/gcmodule.c:327: visit
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue12276>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
issue12084.diff:
- test_os pass with patched Python 3.3 on Windows 7 64 bits (and on Linux,
Debian Sid)
- in test_os: "finally: os.remove(file1)" fails with file1 doesn't exist: a
new try/finally should be used after "with open(file1, &
STINNER Victor added the comment:
Win32SymlinkTests.test_rmdir_on_directory_link_to_missing_target() pass on my
Windows 7 64 bits VM (with and without the patch), but is skipped:
@unittest.skip("currently fails; consider for improvement"
STINNER Victor added the comment:
Oh oh. The situation is not a simple as expected. 3 functions only accept
Unicode strings and 3 other functions decode "manually" byte strings from the
ANSI code page.
--
chdir(), rmdir(), unlink(), access(), chmod(), link(), listdir(),
_g
New submission from STINNER Victor :
Starting at Python 3.2, the MBCS codec uses MultiByteToWideChar() to decode
bytes using flags=MB_ERR_INVALID_CHARS by default (strict error handler),
flags=0 for the ignore error handler, and raise a ValueError for other error
handlers.
The problem is
STINNER Victor added the comment:
MBCS codec was changed by #850997. Martin von Loewis proposed solutions to
implement other error handlers in msg19180.
--
___
Python tracker
<http://bugs.python.org/issue12
Changes by STINNER Victor :
--
nosy: +loewis
___
Python tracker
<http://bugs.python.org/issue12281>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
Yes, you should check the Mac OS X version at runtime (as you should check the
Linux kernel at runtime). platform.mac_ver() uses something like:
sysv = _gestalt.gestalt('sysv')
if sysv:
major = (sysv & 0xFF00) >> 8
minor = (sysv &a
STINNER Victor added the comment:
mbcs.patch fixes PyUnicode_DecodeMBCS():
- only use flags=0 if errors="replace" on Windows >= Vista or if
errors="ignore" on Windows < Vista
- support any error handler
- support any code page (but the code page is hardcoded t
1401 - 1500 of 35168 matches
Mail list logo