STINNER Victor added the comment:
os.popen() is deprecated since Python 2.6 ("Use the subprocess module.") and it
is no more documented in Python 3. The following documentation explains how to
replace os.popen() by subprocess:
http://docs.python.org/py3k/library/subprocess.html#re
STINNER Victor added the comment:
> Hi, haypo, would you mind modify your newly added parse_format_flags()
> function so that it can diff the precision value of '%.0s' and
> '%s'(Currently both of them return precision as 0)?
You should update your patch attach
STINNER Victor added the comment:
I am working with Python since 5 years (and on Python since 3 years): I never
seen any garbage string in error messages. My concern is to not truncate
strings in error messages anymore. I consider that it is more important than
using a hack to workaround
STINNER Victor added the comment:
> Does subprocess work from inside Windows GUI applications?
You mean: Python embedded in another program? I don't know. How can I test that?
I never see any warning in subprocess documentation saying that subprocess
doesn't work on Windows
STINNER Victor added the comment:
History of PyErr_Format():
- r7580 (13 years ago): creation of PyErr_Format() using a buffer of 500 bytes
(fixed size buffer, allocated on the stack)
- r17159 (10 years ago): PyErr_Format() allocates a dynamic buffer on the heap
- r22722 (9 years ago
STINNER Victor added the comment:
> Try to use platform from within IDLE ...
I tried subprocess.call('calc.exec'): it works.
I tried p=subprocess.Popen('echo hello', shell=True, stdout=subprocess.PIPE);
p.communicate(): it works too (I get the output and there is n
Changes by STINNER Victor :
--
title: PyUnicode_FromFormat segfault -> PyUnicode_FromFormat: implement width
and precision for %s, %S, %R, %V, %U, %A
___
Python tracker
<http://bugs.python.org/iss
STINNER Victor added the comment:
New patch deprecating platform.popen() and removing _popen.
Marc-Andre: Do you agree to deprecate platform.popen() in favour of subprocess?
--
Added file: http://bugs.python.org/file20984/platform_popen-2.patch
New submission from STINNER Victor :
os.popen() was deprecated in Python 2.6 but it does still exist in Python 3.3.
The function is no more documented: there is an entry in os documentation, but
the entry is not in the index, and it has a reference to the "file object
creation" sec
Changes by STINNER Victor :
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11384>
___
___
Python-bugs-
STINNER Victor added the comment:
r55334 removed popen2, popen3 and popen4 from the os module from Python 3
(before the 3.0 release), but not os.popen.
Python 3.2 has now convenience functions in subprocess to get the output of a
program:
- check_output()
- getstatusoutput()
- getoutput
STINNER Victor added the comment:
The following documentation should also be updated to use the new convenience
functions:
http://docs.python.org/py3k/library/subprocess.html#replacing-os-popen-os-popen2-os-popen3
--
___
Python tracker
<h
STINNER Victor added the comment:
Commited to 3.3 (r88721).
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
Oh, I forget subprocess.call(b'ls'): command as a byte string => fixed in
Python 3.3 (r88720).
--
___
Python tracker
<http://bugs.pyth
STINNER Victor added the comment:
subprocess_getoutput.patch: patch subprocess.getstatusoutput() to use directly
Popen, instead of os.popen, with stderr=subprocess.STDOUT instead of "2>&1"
shell redirection. It strips also all trailing spaces and newlines, not just
the last
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue8972>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue9723>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue7839>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
> I tried to add a shell argument (to be able to disable the shell) and
> to accept any Popen keyword, but I don't know how to implement
> shell=False if the input is a list of arguments. list2cmdline() is
> unsafe on UNIX (see #8972).
Examp
STINNER Victor added the comment:
I think that it is now too late to change getstatusoutput() output type
(str->bytes). I prefer Unicode and I think that most users will have to decode
bytes to Unicode anyway. So the right solution is to be able to configure
encoding and errors used
STINNER Victor added the comment:
A quick search gives me:
- #1006238
- #1597850
- #3754
- #5404
- #3871
Are they the same patches from Buildroot?
--
___
Python tracker
<http://bugs.python.org/issue11
New submission from STINNER Victor :
<< Fault handler for SIGSEGV, SIGFPE, SIGBUS and SIGILL signals: display the
Python backtrace and restore the previous handler. Allocate an alternate stack
for this handler, if sigaltstack() is available, to be able to allocate memory
on the stack, e
STINNER Victor added the comment:
I tested faulthandler on Linux, FreeBSD and Windows XP: it works well. I
suppose that it works on any operating systems.
You can also try it on know crashers: Lib/test/crashers/ (you have to modify
the files to add: import faulthandler; faulthandler.enable
Changes by STINNER Victor :
--
keywords: +easy
___
Python tracker
<http://bugs.python.org/issue11373>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
Extract of issue #1602:
<< WriteConsoleW has one bug that I know of, which is that it http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1232";>fails when writing
more than 26608 characters at once. That's easy to work around by limiting
the am
STINNER Victor added the comment:
Extract of the WriteConsole Function:
<< The storage for this buffer is allocated from a shared heap for the process
that is 64 KB in size. The maximum size of the buffer will depend on heap
usage. >>
http://msdn.microsoft.com/en-us/library/ms
STINNER Victor added the comment:
> This changed with r87824
Yes, I changed Python to open all files in binary mode. With Python < 3.2, you
can open sys.std* streams in binary mode using -u command line option (u like
unbuffered, not U
STINNER Victor added the comment:
Anyway, use os.write() to write unicode into the Windows console is not the
right thing to do. We should use WriteConsoleW(): #1602 is the correct fix for
this issue.
--
___
Python tracker
<http://bugs.python.
STINNER Victor added the comment:
> And WriteConsole has the same issue.
print() (sys.stdout and sys.stderr) should use WriteConsoleW() and use small
chunks (smaller than 64 KB, I don't know the safest size).
--
___
Python tracke
STINNER Victor added the comment:
r88746: Add PyModule_NewObject() function
r88747: Add PyImport_AddModuleObject() and PyImport_ExecCodeModuleObject()
--
___
Python tracker
<http://bugs.python.org/issue3
STINNER Victor added the comment:
I did some tests: os.write(1, b'X'*length) does always fail with length >=
63842. It does sometimes fail with length > 35000. The maximum looks completly
random: as written in Microsoft documentation, "The maximum size of the buffer
will
STINNER Victor added the comment:
Remarks about test_wconsole_binlarge.patch:
- I don't know if isatty() is cheap or not. Is it a system call? If it might
be slow, it should be only be called once in the constructor. On Windows, I
don't think that isatty(fd) evoles.
- I don't
STINNER Victor added the comment:
Other remarks about test_wconsole_binlarge.patch:
- the patch doesn't apply on Python 3.3
- I would prefer 32767 instead of 32000 for the maximum length
Suggestion for the comment in fileio.c:
* Issue #11395: not enough space error (errno 12) on wr
STINNER Victor added the comment:
The module name is a UTF-8 encoded string yes. It should be documented in
PyModuleDef structure. I already documented the encoding in PyModule_New().
--
___
Python tracker
<http://bugs.python.org/issue1559
STINNER Victor added the comment:
I tried to commit io_write.patch, but I had problems with Mercurial :-) I will
commit it later.
--
Added file: http://bugs.python.org/file21030/io_write.patch
___
Python tracker
<http://bugs.python.org/issue11
STINNER Victor added the comment:
> This last patch looks good, except that the comments "if stdout mode
> is binary (python -u)" are incorrect: since r87824, all files are
> opened in binary mode.
I plan to commit the patch to 3.1 and then forward port to 3.2 and 3.3. Yes
STINNER Victor added the comment:
I created the features/unicode_import repository with a "unicode_import" branch:
http://hg.python.org/features/unicode_import/
It's my huge patch splitted into small and atomic commits.
--
___
Python
STINNER Victor added the comment:
> Is there a specific place for comments?
Yes, but my work is not done. I still have parts to commit.
> _PyImport_GetDynLoadFunc still takes char* arguments.
Oh. This one is not easy because this function has many implementations and all
implement
STINNER Victor added the comment:
I'm working on #3080 which changes the import machinery to use Unicode instead
of byte strings, and so it will be possible to fix this issue correctly.
--
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
See also #9319: when this issue will be fixed, it will be easier to fix #9319.
--
___
Python tracker
<http://bugs.python.org/issue3
STINNER Victor added the comment:
> The patch contains non-ascii chars that should be avoided (they break `make
> pdf`).
What is the error? Can't you fix the PDF generator instead?
--
___
Python tracker
<http://bugs.python.
STINNER Victor added the comment:
I finished to split the huge patch into smaller commits. You can now test the
unicode_import Mercurial branch. Especially, it should be tested on Windows.
I don't know if I should merge the branch as an unique commit or as multiple
commits. Some of the
STINNER Victor added the comment:
@Benjamin: You told me that you don't want two versions of pgen, but I don't
remember why. As my work on #3080 is mostly done, I now plan to patch the
Python parser to store the filename as Unicode. So could you please review the
patch attached to
STINNER Victor added the comment:
In my experience (PYTHONFSENCODING, sys.setfilesystemencoding()): Python should
just use the same encoding than the locale encoding because *all* other
programs on the system use the locale encoding. If none of LANG, LC_ALL or
LC_CTYPE env var is set: Python
STINNER Victor added the comment:
Can you provide a patch?
--
___
Python tracker
<http://bugs.python.org/issue11573>
___
___
Python-bugs-list mailing list
Unsub
STINNER Victor added the comment:
Instead of always calling clearerr(), we can only call it on EOF:
diff -r 88fe1ac48460 Parser/myreadline.c
--- a/Parser/myreadline.c Mon Mar 07 08:31:52 2011 +0100
+++ b/Parser/myreadline.c Fri Mar 18 10:57:23 2011 +0100
@@ -72,6 +72,7
STINNER Victor added the comment:
After reading the related mail thread on python-dev, I realized that you are
talking about TextIOWrapper choice (file content, not file name). My previous
message is about file names.
--
___
Python tracker
<h
STINNER Victor added the comment:
TextIOWrapper is mostly based on locale.getpreferredencoding(), so msg131290 is
still valid: if no env var is set, nl_langinfo() gives 'ASCII' (or something
like that). But it is not easy to detect that env vars are not set.
I would prefer a
STINNER Victor added the comment:
@Senthil Kumaran: Because your patch touchs not only the test, can you document
your change in Misc/NEWS? Sending a new HTTP header should be documented.
Is there an issue to support persistent connections in
AbstractHTTPHandler.do_open
Changes by STINNER Victor :
Added file: http://bugs.python.org/file21296/issue3080.py
___
Python tracker
<http://bugs.python.org/issue3080>
___
___
Python-bugs-list mailin
Changes by STINNER Victor :
--
Removed message: http://bugs.python.org/msg123994
___
Python tracker
<http://bugs.python.org/issue3080>
___
___
Python-bugs-list m
STINNER Victor added the comment:
> Replace open_exclusive() by fopen(name, "wb") on Windows: is it correct?
I reverted this change in my Mercurial branch (unicode_import).
> rename xxxobj => xxx to keep original names and have a short patch
done
> catch encoding err
STINNER Victor added the comment:
> test_runpy fails on Windows on make_legacy_pyc() (of test.support),
> I don't know why.
Gotcha: I replaced mkdir() by CreateDirectoryW(), but the "directory already
exists" error was not ignored.
STINNER Victor added the comment:
http://www.python.org/dev/buildbot/all/builders/PPC%20Tiger%203.x/builds/1599/steps/test/logs/stdio
==
ERROR: testImpWrapper (test.test_importhooks.ImportHooksTestCase
STINNER Victor added the comment:
> mod = imp.load_module(fullname, self.file, self.filename, self.stuff)
> TypeError: 'NoneType' object is not iterable
The problem is that imp.find_module() now returns None as the filename, but
imp.load_module() does
New submission from STINNER Victor :
import __hello__ doesn't print any message!!!
--
messages: 131499
nosy: benjamin.peterson, georg.brandl, haypo
priority: release blocker
severity: normal
status: open
title: import __hello__ is broken in Python 3
versions: Python 3.1, Pytho
STINNER Victor added the comment:
Fixed, thanks Ray.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
STINNER Victor added the comment:
I realized that it was a little more difficult to port the fix on 3.1 because
3.1 doesn't have the fix for Windows 64 bits. So I only fixed Python 3.2 and
3.3, also because nobody reported failure for Python 3.1 on Windows with -u
flag.
I tested my fix
STINNER Victor added the comment:
Another example on x86 OpenIndiana 3.2:
test test_httpservers failed -- Traceback (most recent call last):
File
"/export/home/buildbot/32bits/3.2.cea-indiana-x86/build/Lib/test/test_httpservers.py",
line 210, in test_latin1_header
self.a
STINNER Victor added the comment:
Ok. Python 3.3 does now support non-ASCII characters in module paths and names
on Windows, but only characters encodable to the ANSI code page. To support the
full Unicode range, we should remove all calls to PyUnicode_EncodeFSDefault()
on Windows:
a
STINNER Victor added the comment:
> c) _PyImport_LoadDynamicModule() encodes the filename for
> _PyImport_GetDynLoadFunc(). The prototype should be changed,
> but only on Windows, to accept a filename as a Unicode string.
Hum, the difficult part is to use Unicode in _PyImport_GetDy
New submission from STINNER Victor :
With #3080, Python 3.3 does now manipulate module paths and names as Unicode in
the import machinery. But in 3 remaining places, it does encode filenames (to
the ANSI code page):
a) _PyImport_LoadDynamicModule()
It should pass directly the PyObject
STINNER Victor added the comment:
Ok, I think that the most important part is now implemented in Python 3.3: use
Unicode for module names and paths in the import machinery. Remaing parts are
specific to Windows, and so I opened a new issue: #11619. Let's close this 3
years old
STINNER Victor added the comment:
I closed #3080: Python 3.3 is now able to handle non-ASCII characters in module
names and paths. But it is only able to handle non-ASCII characters encodable
to the ANSI code page. To support all characters, I opened the issue #11619
(see also #10785
STINNER Victor added the comment:
strftime_aix.patch is a little bit too strict: it looks like strftime()
supports large year values (year > ). We may only raise an error if the
year is smaller than 1.
--
___
Python tracker
&l
STINNER Victor added the comment:
By the way, a simpler fix would be just to not fail if the .pyc file cannot be
created (but emit a warning / write an error to stderr).
--
___
Python tracker
<http://bugs.python.org/issue11
STINNER Victor added the comment:
>> Victor asked "Which web page should updated/fixed?"
> Answer: The Python 3.2 download page.
Sorry, but I don't see which page tells that Python 3.2 has a full Unicode
support for import. In http://www.python.org/download/r
STINNER Victor added the comment:
> While it is unlikely that a purely numeric format such as "%Y-%m-%d
> %H:%M:%S" will be locale dependent, it is possible that some pre-C99
> systems would format dates using exotic digits is some locales.
Ok, I rewrote my patch to avoid st
Changes by STINNER Victor :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue5537>
___
___
Python-bugs-list
STINNER Victor added the comment:
Ok, I backported the fix to 3.1.
Reopen the issue if you would like a port to 2.7 (I am too lazy to do it).
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/
STINNER Victor added the comment:
> This only addresses the compress() and decompress() functions,
> but e.g. crc32() and adler32() are also touched by this issue.
crc32() and adler32() were fixed by #10276.
PyZlib_objcompress() and PyZlib_objdecompress() should be
STINNER Victor added the comment:
> As I see Victor has dropped OS/2 support from Python/import.c
> Perhaps file Python/dynload_os2.c should be removed also.
> Not sure about other dynload_* files.
340f76a6a792 just removes few lines in import.c: they can easily be rewritten.
And th
STINNER Victor added the comment:
f9763c363cc3 didn't close this issue whereas its message contains "Closes
#11579. Closes #11421.". This commit closed #11579.
--
nosy: +haypo
___
Python tracker
<http://bugs.pyt
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue11397>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
open_exclusive() was created by:
changeset: 14708:89b2aee43e0b
branch: legacy-trunk
user:Guido van Rossum
date:Wed Sep 20 20:31:38 2000 +
files: Python/import.c
description:
On Unix, use O_EXCL when creating the .pyc/.pyo
STINNER Victor added the comment:
dynload_win.patch: Fix part (a), _PyImport_LoadDynamicModule().
--
keywords: +patch
Added file: http://bugs.python.org/file21321/dynload_win.patch
___
Python tracker
<http://bugs.python.org/issue11
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue10694>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
Ray Allen: Your patch doesn't touch the documentation. At least, you should
mention (using .. versionchanged:: 3.3) that PyUnicode_FromFormat() does now
support width and precision. It is important to specify the unit of the sizes:
number of bytes or n
Changes by STINNER Victor :
--
nosy: -haypo
___
Python tracker
<http://bugs.python.org/issue11082>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
I did some tests with WriteConsoleW():
- with raster fonts, U+00E9 is displayed as é, U+0141 as L and U+042D as ? =>
good (work as expected)
- with TrueType font (Lucida), U+00E9 is displayed as é, U+0141 as Ł and
U+042D as Э => perfect! (all characte
STINNER Victor added the comment:
Le lundi 21 mars 2011 à 15:59 +, Dave Malcolm a écrit :
> Various thoughts/nitpicking:
> - is it possible to indicate with a coding convention (e.g.
> comments) which parts of the code are intended to be called from a
> signal handler? It
STINNER Victor added the comment:
> Ok, good idea, I will do that. I think that I will write it in the
> function comment, something like: "This function is signal safe".
Done in 6685691dfcbd3644feffcb197491bce3168ff5de (git SHA-1)
While checking the usage of signal safe func
STINNER Victor added the comment:
I renamed some functions to conform to the PEP 8 (and have more readable
function names). I prefer to do it today instead having to keep ugly names for
years :-)
Functions are now:
* enable(file=sys.stderr, all_threads=False)
* disable()
* is_enabled
STINNER Victor added the comment:
> It would be nice if it were enabled by default for fatal errors
> (and asserts perhaps?).
That would mean that the module should be a builtin module, or that it is
always loaded in memory.
I am maybe ok to enable it by default for debug builds, but n
STINNER Victor added the comment:
Le mardi 22 mars 2011 à 09:01 +, Marc-Andre Lemburg a écrit :
> Perhaps you could consider adding a similar approach (raising
> an exception instead of writing a traceback) to the module.
> We could then port our code to use your module, which
Changes by STINNER Victor :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11630>
___
___
Python-bugs-list
STINNER Victor added the comment:
printtest2.py displays directly "Processing.. " on Windows, but not on Linux.
It looks like stdout is not buffered on Windows, which looks like a bug to bug
:-) I think that it is safer to always call sys.stdout.flush() to ensure that
your
STINNER Victor added the comment:
> From my perspective it is a regression on Windows and a bug in Linux
> version of Python 2.x, which unfortunately can not be fixed,
> because of 2.x release process.
Line buffering is used by default on most operating systems (ok, maybe not
Windo
STINNER Victor added the comment:
> How about making print() user-friendly with flushing after every call,
> and if you want explicitly want speed - use buffered
> sys.stdout.write/flush()?
This is exactly the -u option of Python 2: use it if you would like a completly
unbuffered s
STINNER Victor added the comment:
Could you write a patch to fix this comment?
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue11634>
___
___
STINNER Victor added the comment:
PyObject *
PyBytes_FromString(const char *str)
{
register size_t size;
...
size = strlen(str);
...
}
PyBytes_FromString() does compute the input string size using strlen().
--
___
Python tracker
STINNER Victor added the comment:
amaury> When python is run from a console, sys.stdout is line buffered.
amaury> sys.stdout.write() flushes if there is a carriage return.
amaury> No need to change anything here.
Anatoly would like a flush after all calls to print().
> print(
STINNER Victor added the comment:
I don't have this behaviour on Linux. Is it specific to Mac OS X?
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/is
STINNER Victor added the comment:
test the fixed nosy list
--
___
Python tracker
<http://bugs.python.org/issue3080>
___
___
Python-bugs-list mailing list
Unsub
STINNER Victor added the comment:
Sorry to ask that, but would it be possible to write an automated test for this
issue?
--
___
Python tracker
<http://bugs.python.org/issue11
STINNER Victor added the comment:
I patched import.c to use repr() instead of str() (%R instead of %U) to format
module names because they might contain surrogate characters. Surrogate
characters are not encodable to any encoding, except UTF-16 and UTF-32. And so
print an exception to stdout
STINNER Victor added the comment:
(-1)**.5 is the same than complex(-1,0)**.5, but it is computed differently
than cmath.sqrt(-1).
-1.**0.5 computes:
vabs = math.hypot(-1, 0)
len = pow(vabs, 0.5)
at = math.atan2(0, -1)
phase = at * 0.5
return complex(len*math.cos(phase), len
STINNER Victor added the comment:
There are 4 patches "issue 7030" attached to this issue. Some of them have a
version number in their name, some doesn't. You did the same on other issues.
It is more easy to follow a patch if it has a version number, for example:
issue_7330.d
STINNER Victor added the comment:
Link to the commit: f09f7ab40ce6
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue11661>
___
___
Python-bug
Changes by STINNER Victor :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue11455>
___
___
Python-bugs-list mailing list
Unsubscribe:
2601 - 2700 of 35284 matches
Mail list logo