New submission from STINNER Victor :
The following code does deadlock if the subprocess writes a lot of output to
stdout and stderr:
pipe = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
try:
stdout, stderr = pipe.stdout.read(), pipe.stderr.read()
finally
STINNER Victor added the comment:
I ported a distutils fix (for non-ASCII path) into packaging:
New changeset cc5cfeaa4a8d by Victor Stinner in branch 'default':
Issue #10419, issue #6011: port 6ad356525381 fix from distutils to packaging
http://hg.python.org/cpython/rev/cc
New submission from STINNER Victor :
Example:
with open("setup.py", "rb") as f:
# read smaller than the file size to fill the readahead buffer
f.read(1)
# seek doesn't seek
f.seek(0)
print("f pos=", f.tell())
print("f.raw pos="
STINNER Victor added the comment:
Note: _pyio.BufferedReader(), _pyio.BufferedWriter(), _pyio.BufferedRandom()
don't use this optimization. They might be patched too.
--
___
Python tracker
<http://bugs.python.org/is
STINNER Victor added the comment:
And how can I seek the raw file to zero?
Using buffer.raw.seek(0), buffer.tell() becomes inconsistent:
$ ./python
Python 3.2.1b1 (3.2:bd5e4d8c8080, May 15 2011, 10:22:54)
>>> buffer=open('setup.py', 'rb')
>>&
STINNER Victor added the comment:
What is the MainProgram.inspect_file() function in packaging.create? Which kind
of file should it process? => What is the encoding of the input files?
--
___
Python tracker
<http://bugs.python.org/issu
STINNER Victor added the comment:
Using spawn_python() to check that os.O_CLOEXEC flag is correctly set seems
overkill. Why not just testing fcntl.fcntl(f.fileno(), fcntl.F_GETFL) &
FD_CLOEXEC)? I don't think that there are OSes with O_CLOEXEC but without
fcntl(F_GETFL).
> Note
New submission from STINNER Victor :
"python -m test test_packaging test_zipimport" fails with:
==
FAIL: testAFakeZlib (test.test_zipimport.CompressedZipImpo
STINNER Victor added the comment:
OMG! I understood why the bug was not seen before: "python -m test
test_zipimport test_zipimport" succeed because test_zipimport REMOVES
testAFakeZlib tests after the first run!
New patch to remove this ugly hack (it is no more needed with my pa
STINNER Victor added the comment:
"test_zipimport REMOVES testAFakeZlib tests after the first run" hack was
introduced by a commit supposed to "test zipimport a bit more" :-)
changeset: 36383:7b3d915b6e9d
branch: legacy-trunk
user:Neal Norwitz
date:
New submission from STINNER Victor :
It looks like a test of test_packaging removes some data from
sysconfig._SCHEMES:
http://www.python.org/dev/buildbot/all/builders/AMD64%20OpenIndiana%203.x/builds/1239/steps/test/logs/stdio
STINNER Victor added the comment:
Duplicate of #12117.
--
nosy: +haypo
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Duplicate of #12117.
--
nosy: +haypo
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Duplicate of #12117.
--
nosy: +haypo
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Duplicate of #12117.
--
nosy: +haypo
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Duplicate of #12117.
--
nosy: +haypo
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
The following issues has been marked as a duplicate of this issue:
- issue #12118 (test_imp)
- issue #12119 (test_distutils)
- issue #12120 (test_packaging)
- issue #12122 (test_runpy)
- issue #12123 (test_import)
Tarek did the following commit to try to
STINNER Victor added the comment:
Traceback of the duplicate issues:
==
ERROR: test_issue5604 (test.test_imp.ImportTests)
--
Traceback (most recent call last
Changes by STINNER Victor :
--
nosy: +alexis, eric.araujo
___
Python tracker
<http://bugs.python.org/issue12117>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
title: test_importlib failure -> Failures with PYTHONDONTWRITEBYTECODE:
test_importlib, test_imp, test_distutils, test_packaging, test_runpy,
test_import
___
Python tracker
<http://bugs.python.org/issu
STINNER Victor added the comment:
> Why not to implement 'e' letter in py3k ?
>
> In systems where O_CLOEXEC is not supported in open(), flag should be set
> non-atomically using fcntl.
Having an atomic or non-atomic behaviour depending on the
STINNER Victor added the comment:
> that patch looks good
I tested it with non-ASCII interface names: it works as expected with
ASCII and UTF-8 locales. It's the first time that I see the "O&" format
for Py_BuildValue(), I didn't know this one. The patch looks good.
Changes by STINNER Victor :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue12124>
___
___
Python-bugs-list
STINNER Victor added the comment:
Is it still useful to ensure that ISO C89 compilers are supported in 2011?
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue4
STINNER Victor added the comment:
+kill(getpid(), SIGINT);
kill() doesn't exist on Windows: use raise() which is more portable and doesn't
require a PID argument.
We may need to do something on Windows for console applications: see
SetConsoleCtrlHandler(),
http://msdn.mic
STINNER Victor added the comment:
I think that issue #12100 should be fixed (wontfix/fixed) before this one.
--
dependencies: +Incremental encoders of CJK codecs reset the codec at each call
to encode()
___
Python tracker
<http://bugs.python.
Changes by STINNER Victor :
--
nosy: +pitrou
___
Python tracker
<http://bugs.python.org/issue5715>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> Victor, you broke the Solaris gcc buildbot on 2.7.
It should be fixed by d5771ed4ec4e.
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
On Friday 19 November 2010 20:42:53 you wrote:
> Alexander Belopolsky added the comment:
>
> I don't understand Victor's argument in msg115889. According to UTF-8 RFC,
> <http://www.ietf.org/rfc/rfc2279.txt>:
>
>
STINNER Victor added the comment:
> My build error seems actually unrelated to encoding issues. Working
> directory is ASCII-only, locale is UTF-8.
>
> $ ./configure --with-pydebug
> [snip]
> $ make
> [snip]
> ranlib libpython3.2dm.a
> gcc -pthread -Xlinker -expor
STINNER Victor added the comment:
On Friday 19 November 2010 21:58:25 you wrote:
> > I choosed to use ASCII instead of UTF-8, because an UTF-8 decoder is long
> > (210 lines) and complex (see PyUnicode_DecodeUTF8Stateful()), whereas
> > ASCII decode is just: "unicode_
STINNER Victor added the comment:
> no cookie found, returns ('utf-8', [line1, line2])
I never understood the usage of the second item. IMO it should be None if no
cookie found.
--
___
Python tracker
<http://bugs.pyth
New submission from STINNER Victor :
Python3 doc tells that UTF-16-LE and UTF-16-BE only support BMP characters.
What? I think that it is wrong.
It was maybe wrong with Python2 and narrow build (unichr() only supports BMP
characters), but it is no more true in Python3.
--
assignee: d
Changes by STINNER Victor :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue10541>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
I don't like macro having a result and using multiple instructions using the
evil magic trick (the ","). It's harder to maintain the code and harder to
debug than a classical function.
Don't you think that modern compilers are abl
STINNER Victor added the comment:
About the topic:
> subprocess seems to use local 8-bit encoding and gives no choice
I don't understand that: by default, Python 2 and Python 3 use byte strings, so
there is no encoding (nor error handler).
I don't see how you can get unicode f
STINNER Victor added the comment:
> ... it always seems to use the local 8-bit encoding
The locale encoding is not necessary a 8-bit encoding, it can by a multibyte
like... UTF-8 :-)
--
subprocess.patch: You should maybe use io.open(process.stdout.fileno(),
encoding=..., err
New submission from STINNER Victor :
On Windows, the Python interpreter fails to display a result if stdout encoding
is unable to encode it. This problem exists since Python 3.0. Eg. see issue
#1602.
This problem is not specific to Windows. Even if stdout encoding is UTF-8
(which is the
STINNER Victor added the comment:
This issue is opposed to the PEP 3128:
<< Default error-handler of sys.stdout should be 'backslashreplace'.
Stuff written to stdout might be consumed by another program that might
misinterpret the escapes. For interactive session, it is
STINNER Victor added the comment:
I created a new issue for Ezio's proposition to patch sys.displayhook: issue
#10601.
To answer the initial question, "Should repr() print unicode characters outside
the BMP?", Marc-Andre, Ezio and me agree that we should keep the current
b
Changes by STINNER Victor :
--
nosy: +amaury.forgeotdarc, lemburg
___
Python tracker
<http://bugs.python.org/issue10601>
___
___
Python-bugs-list mailin
Changes by STINNER Victor :
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue9198>
___
___
Python-bugs-list
STINNER Victor added the comment:
> This issue is opposed to the PEP 3128:
>
> << Default error-handler of sys.stdout should be 'backslashreplace'
Oops sorry, no it is not opposed to the PEP (this issue doesn't propose to
change the defau
STINNER Victor added the comment:
Use surrogateescape error handler to decode a Windows path is not a good idea.
On Windows, the problem is not to decode a path (ANSI => wide char), but to
encode a path (wide char => ANSI) to use a function expecting bytes path
encoded to the ANSI cod
STINNER Victor added the comment:
See also #10601: "sys.displayhook: use backslashreplace error handler if
repr(value) is not encodable to sys.stdout".
--
___
Python tracker
<http://bugs.python.o
STINNER Victor added the comment:
> If it's an env variable, though, it should be clear that it's
> CPython-specific, so I'm not sure how to call it.
Why do you think that only this variable is CPython-specific? CPython has an
option called PYTHONDONTWRITEBYTECODE, bu
STINNER Victor added the comment:
I agree that clamping is a nice solution, and attached patch implements it.
About the question of the loop: FileIO.readall() uses while(1) without checking
for signals. It looks like new_buffersize() maximum size is not BIGCHUNK but
(BIGCHUNK-1)*2
STINNER Victor added the comment:
(oops, the patch contained unrelated changes: remove trailing spaces)
--
Added file: http://bugs.python.org/file19899/read_write_32bits.patch
___
Python tracker
<http://bugs.python.org/issue9
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file19898/read_write_32bits.patch
___
Python tracker
<http://bugs.python.org/issue9611>
___
___
Python-bug
STINNER Victor added the comment:
Great!
--
___
Python tracker
<http://bugs.python.org/issue10603>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
nosy: -haypo
___
Python tracker
<http://bugs.python.org/issue10557>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
@Hirokazu: Can you attach a small test archive?
Yes, we can add a "default_encoding" attribute to ZipFile and add an optional
default_encoding argument to its constructor.
--
nosy: +haypo
___
Python trac
STINNER Victor added the comment:
-def getstatusoutput(cmd):
+def getstatusoutput(cmd, shell=True):
shell=True is dangerous, it can lead to shell command injection. I would prefer
to set its default value to False. The function already exists in Python 3.1,
but it is not used in Python
STINNER Victor added the comment:
Dummy question: why don't you use KeyboardInterrupt instead of a custom SIGINT
handler?
try:
for i in range(100):
print(i)
except KeyboardInterrupt:
print("got sigint")
Python SIGINT handler raises a KeyboardInterrupt
STINNER Victor added the comment:
This issue remembers me #3618 (opened 2 years ago): I proposed to use RLock
instead of Lock, but RLock was implemented in Python and were too slow. Today,
we have RLock implemented in C and it may be possible to use them. Would it
solve this issue
STINNER Victor added the comment:
This issue remembers me #3618 (opened 2 years ago): I proposed to use RLock
instead of Lock, but RLock was implemented in Python and were too slow. Today,
we have RLock implemented in C and it may be possible to use them. Would it
solve this issue
Changes by STINNER Victor :
--
Removed message: http://bugs.python.org/msg123242
___
Python tracker
<http://bugs.python.org/issue10478>
___
___
Python-bugs-list m
STINNER Victor added the comment:
Ok, so +1 to apply immediatly your patch which "fixes" the deadlock. If someone
is motived to make Buffered* classes reentrant, (s)he can remove this exception.
io and signal documentation should also be improved to indicate that using
buffere
New submission from STINNER Victor :
b'abc'.partition(':') raises a confusing TypeError('expected an object with the
buffer interface'): what is a buffer? what is the buffer interface?
The error comes from PyObject_AsCharBuffer() which is used by:
- bytes method
STINNER Victor added the comment:
See also #10616.
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue6780>
___
___
Python-bugs-list mailin
STINNER Victor added the comment:
See also #6780.
--
___
Python tracker
<http://bugs.python.org/issue10616>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> complex(): raise a better but incomplete error message on error
> ("complex() arg is not a string"), incomplete because number is not
> mentionned
Fixed by r86977.
--
___
Python tracker
<
STINNER Victor added the comment:
Commited to Python 3.2 (r87054).
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Fixed by r87135.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue10546>
___
__
STINNER Victor added the comment:
Can you add a test to your patch?
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue7213>
___
___
Python-bug
STINNER Victor added the comment:
issue6697-lsprof.diff:
- Oh, I did recently a similar change on PyModule: I created
PyModule_GetFilenameObject()
- "PyObject * mod" => "PyObject *mod"
- modname is not initialized if fn->m_module (mod) is NULL => initialize
STINNER Victor added the comment:
Yes, I patched the C code to not clear exceptions anymore at startup: r78826
(issue #3137). But this issue is different: here the bug is in the 3rd party
module (loaded by site.py), not in Python, and Donald proposes to *ignore*
errors (where I did the
STINNER Victor added the comment:
> I wonder if tkinter should use this encoding.
Tkinter is used to build graphical interfaces. I don't think that users write
nul bytes with their keyboard. But there is maybe a use case?
--
___
Python
STINNER Victor added the comment:
You can reproduce the bug with:
$ lang=fr_fr.iso885...@euro ./python -c 'import pdb;
pdb.Pdb(nosigint=True).run("exec(%r)" % "x=12")'
> /home/haypo/prog/SVN/py3k/Lib/encodings/iso8859_15.py(15)decode()
-> retur
STINNER Victor added the comment:
See a more complex solution: #3080 (don't decode the filename in the parser,
keep unicode strings).
--
___
Python tracker
<http://bugs.python.org/is
Changes by STINNER Victor :
--
title: site.py crashes on python startup due to defective .pth file -> Improve
the error message of addpackage() (site.py) for defective .pth file
___
Python tracker
<http://bugs.python.org/issu
STINNER Victor added the comment:
subprocess-cloexec-atomic-py3k-tests2-close_fds.patch adds a test called to
Win32ProcessTestCase which is specific to Windows. And this class has already a
test with the same name. You should move your test to ProcessTestCase (and so
it will test the C
STINNER Victor added the comment:
> subprocess-cloexec-atomic-py3k-tests2-close_fds.patch adds a test
> called [test_close_fds] to Win32ProcessTestCase ...
Oops, forget my last comment, I didn't applied the patches in the right order.
There are too much patches :-p Can you try to
STINNER Victor added the comment:
subprocess-cloexec-atomic-py3k.patch:
+case $ac_sys_system in
+ GNU*|Linux*)
+ AC_CHECK_FUNC(pipe2, AC_DEFINE(HAVE_PIPE2, 1, [Define if the OS supports
pipe2()]), )
+esac
I think that you can remove the test on the OS name. AC_CHECK_FUNC() doesn
STINNER Victor added the comment:
test_pipe_cloexec_unix_tools() is specific to UNIX/BSD because it requires cat
and grep programs. You should try to reuse the Python interpreter to have a
portable test (eg. working on Windows), as you did with fd_status.py.
+data
STINNER Victor added the comment:
fd_status.py:
+try:
+_MAXFD = os.sysconf("SC_OPEN_MAX")
+except:
+_MAXFD = 256
It looks like this code (256 constant) comes from subprocess.py. Is that a good
value? On Linux, SC_OPEN_MAX is usually 1024, and it can be 4096. Should we
STINNER Victor added the comment:
> Haypo describes his complicated patch as "useful on Windows",
> but not critical
Usecase on Windows: your japanese friend gives you an USB key (eg. created on
Windows with code page 932) with his Python project, you cannot run it on your
STINNER Victor added the comment:
> Haypo describes his complicated patch as "useful on Windows",
> but not critical
Usecase on Windows: your japanese friend gives you an USB key (eg. created on
Windows with code page 932) with his Python project, you cannot run it on your
STINNER Victor added the comment:
"Ooops", sorry. I just applied the patch suggested by Marc-Andre Lemburg in
msg22885 (#1054943). As the patch worked for the examples given in Unicode PRI
29 and the test suite passed, it was enough for me. I don't understand the
normaliza
STINNER Victor added the comment:
It looks like it's not possible to choose between float and (int, int) output
type for datetime.totimestamp(). One is more practical (and enough for people
who doesn't need an exact result), and one is needed to keep the same
resolution than th
STINNER Victor added the comment:
Version 9 of my patch:
- Create PYTHONNOHANDLER environment variable: don't install the signal
handler if the variable is set
- Rename "Segfault" by "FaultHandler"
- reverse_string() does nothing if len==0, even if it cannot o
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file19214/segfault_handler-5.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file19227/segfault_handler-6.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file19288/segfault_handler-7.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file19289/segfault_handler-8.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
STINNER Victor added the comment:
Oh, I'm tired...
> Summary of the patch:
> - ...abort the process (call the debugger on Windows)
(the debugger is only called if Python is compiled in debug mode)
> - Add PYTHONNOHANDLER environment variable ...
Oops, the c
STINNER Victor added the comment:
> Why was sys.setsegfaultenabled() omitted?
Just because I forgot your message, sorry.
--
___
Python tracker
<http://bugs.python.org/iss
STINNER Victor added the comment:
Version 10 of my patch:
- the fault handler restores the previous signal handler instead of calling
(DebugBreak() and) abort(): the previous signal handler will be called later to
keep the orignal behaviour
- _testcapi.sigill() and _testcapi.sigbus() send
STINNER Victor added the comment:
Le lundi 20 décembre 2010 07:55:08, vous avez écrit :
> +#define NFAULT_SIGNALS (sizeof(fault_signals) / sizeof(fault_signals[0]))
> +static fault_handler_t fault_handlers[4];
>
> , should use "NFAULT_SIGNALS" instead of "4&quo
STINNER Victor added the comment:
The fault handler is unable to retrieve the thread state if the GIL is
released. I will try to fix that.
--
___
Python tracker
<http://bugs.python.org/issue8
STINNER Victor added the comment:
Version 11 of my patch:
- Disable the fault handler (and displaying the backtrace on a fatal error) by
default
- The fault handle can be enabled by setting the PYTHONFAULTHANDLER
environment variable or using "-X faulthandler" command line optio
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file20102/segfault_handler-9.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
Changes by STINNER Victor :
Removed file: http://bugs.python.org/file20113/segfault_handler-10.patch
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Pytho
Changes by STINNER Victor :
--
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/issue8863>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> Does the latest patch address the GIL/multithreading issues?
Yes.
--
___
Python tracker
<http://bugs.python.org/iss
STINNER Victor added the comment:
Le jeudi 23 décembre 2010 à 02:27 +, Scott Dial a écrit :
> Scott Dial added the comment:
>
> On 12/22/2010 8:52 PM, STINNER Victor wrote:
> > Amaury asked for a sys.setsegfaultenabled() option: I think that the
> > comman
STINNER Victor added the comment:
Le jeudi 23 décembre 2010 à 02:27 +, Scott Dial a écrit :
> Scott Dial added the comment:
>
> On 12/22/2010 8:52 PM, STINNER Victor wrote:
> > Amaury asked for a sys.setsegfaultenabled() option: I think that the
> > comman
STINNER Victor added the comment:
Le jeudi 23 décembre 2010 à 02:45 +, Alexander Belopolsky a écrit :
> As I suggested on python-dev, I also think this belongs to a separate
> module rather than core or sys.
Why do you want to move it outside Python core? It is very dependent of
STINNER Victor added the comment:
Note: To avoid the signal-safe requirement, another solution is to use
sigsetjmp()+siglongjmp().
--
___
Python tracker
<http://bugs.python.org/issue8
New submission from STINNER Victor :
If more than one file (stdin, stdout and stderr) are pipes, Popen.communicate()
uses threads calling _readerthread() on each pipe. But this method doesn't
close the pipes, whereas all other communicate implementations (select, poll
and the optimizati
3201 - 3300 of 35284 matches
Mail list logo