[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor added the comment: >> It is mostly to test FreeBSD major version, and it looks like Python is >> build on the same FreeBSD major version that it is running on. Maybe because >> on FreeBSD, most programs are compiled instead of using prebuild packages >

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor added the comment: > But in general you are right: if you use system provided Python > packages, chances are that your runtime OS version will be > identical or very close to the build time OS version. I asked on #freebsd-fr: even with pkg_add, the installed Python is

[issue12819] PEP 393 - Flexible Unicode String Representation

2011-08-22 Thread STINNER Victor
Changes by STINNER Victor : -- hgrepos: +62 ___ Python tracker <http://bugs.python.org/issue12819> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9200] Make the str.is* methods work with non-BMP chars on narrow builds

2011-08-22 Thread STINNER Victor
STINNER Victor added the comment: > This issue and #5127 should not be backported to 2.7: > narrow builds don't even accept unichar(0x1). I agee. -- ___ Python tracker <http://bugs.python

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-22 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12729> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12191] Add shutil.chown to allow to use user and group name (and not only uid/gid)

2011-08-22 Thread STINNER Victor
STINNER Victor added the comment: > New changeset d1fd0f0f8e68 by Sandro Tosi in branch 'default' You may add shutil.chmod to the "What's New in Python 3.3?" document. -- ___ Python tracker <ht

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-22 Thread STINNER Victor
STINNER Victor added the comment: Something like: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -699,20 +699,21 @@ always available. This string contains a platform identifier that can be used to append platform-specific

[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2011-08-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12822> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: See also #10278. -- ___ Python tracker <http://bugs.python.org/issue12822> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10278] add time.wallclock() method

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: See also #12822. -- ___ Python tracker <http://bugs.python.org/issue10278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12808] Coverage of codecs.py

2011-08-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12808> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12826] module _socket failed to build on OpenBSD

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: It's surprising that it works on FreeBSD but not on OpenBSD. Thanks for your patch. -- nosy: +haypo ___ Python tracker <http://bugs.python.org/is

[issue12827] OS-specific location in Lib/tempfile.py for OpenBSD

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: Because it's not exactly a bug, can you only apply the patch to Python 3.3? -- nosy: +haypo ___ Python tracker <http://bugs.python.org/is

[issue12827] OS-specific location in Lib/tempfile.py for OpenBSD

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: > can you only apply the patch ... Hum, I mean can *we* only apply ... -- ___ Python tracker <http://bugs.python.org/issu

[issue9993] shutil.move fails on symlink source

2011-08-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo, pitrou ___ Python tracker <http://bugs.python.org/issue9993> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11657] multiprocessing_{send,recv}fd fail with fds > 256

2011-08-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue11657> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12821] test_fcntl failed on OpenBSD 5.x

2011-08-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12821> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12819] PEP 393 - Flexible Unicode String Representation

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: utf8_fast.patch: fast path for pure ASCII string in the UTF-8 decoder. -- Added file: http://bugs.python.org/file23022/utf8_fast.patch ___ Python tracker <http://bugs.python.org/issue12

[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12834> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: i12801.patch is not correct: on Windows, you should never encode a filename to bytes. Use PyUnicode_Decode() + _Py_wrealpath(), or a #ifdef (as many other posixmodule functions). I prefer to reuse _Py_wrealpath because we will have to add special cases

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: Patch to get #ifdef REALPATH_SUPPORT_NULL: diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -1539,6 +1539,17 @@ if test "$have_pthread_t" = yes ; then #endif ]) fi + +AC_MSG_CHECKING(for realpath

[issue1298813] sysmodule.c: realpath() is unsafe

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: See issue #12801: it has a more recent patch. -- ___ Python tracker <http://bugs.python.org/issue1298813> ___ ___ Python-bug

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: > I prefer to reuse _Py_wrealpath because we will have > to add special cases: realpath(NULL) and also maybe > canonicalize_file_name(). I read that canonicalize_file_name(name) just calls realpath(name, NULL), so we can maybe avoid this GNU exce

[issue12760] Add create mode to open()

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: >open(filename, 'w', > fd_opener=lambda path, mode: os.open(path, mode|os.O_CREAT) I prefer open(name, "c"). > it doesn't fill a use case: actually, avoiding race conditions > is an important use case, ... I

[issue12786] subprocess wait() hangs when stdin is closed

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: subprocess_cloexec-1.diff: I'm too tired too review the test. The subprocess.py part looks correct, except the pipe2 name. Python 3 uses "_create_pipe = _posixsubprocess.cloexec_pipe". Pi

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: It's surprising to raise a SkipTest *at the end* of the test. Here is another patch. -- Added file: http://bugs.python.org/file23037/chown_hpux-2.diff ___ Python tracker <http://bugs.python.org/i

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file23038/chown_hpux-3.diff ___ Python tracker <http://bugs.python.org/issue5113> ___ ___ Python-bugs-list m

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file23037/chown_hpux-2.diff ___ Python tracker <http://bugs.python.org/issue5113> ___ ___ Python-bug

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file23039/chown_hpux-4.diff ___ Python tracker <http://bugs.python.org/issue5113> ___ ___ Python-bugs-list m

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: Using chown_hpux-4.diff, we don't skip anything on HP-UX. -- ___ Python tracker <http://bugs.python.org/issue5113> ___ ___

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: Le mercredi 24 août 2011 23:45:00, vous avez écrit : > Charles-François Natali added the comment: > > Patch to get #ifdef REALPATH_SUPPORT_NULL: > I'm not really familiar with autotools, but I have the impression that > this will only check

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file23039/chown_hpux-4.diff ___ Python tracker <http://bugs.python.org/issue5113> ___ ___ Python-bug

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: > if we try chown()ing a file to root, then this will fail on HP-UX Oooh, I'm confused. I removed this stupid patch. -- ___ Python tracker <http://bugs.python.or

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: # HP-UX and Solaris allow a non-root user to chown to root I didn't see failure on our Solaris / OpenIndiana buildbot. Should we really skip the test on Solaris? -- ___ Python tracker <http://bugs.py

[issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: You might replace "#if defined(_MSC_VER)" with "#if defined(MS_WINDOWS)", but in another commit. -- ___ Python tracker <http://bug

[issue12841] Incorrect tarfile.py extraction

2011-08-25 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12841> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE

2011-08-28 Thread STINNER Victor
STINNER Victor added the comment: The _socket module doesn't compile anymore on Windows: Build started: Project: _socket, Configuration: Debug|Win32 Compiling... socketmodule.c 29>..\Modules\socketmodule.c(1649) : warning C4013: '_PyIsSelectable_fd' undefined; assuming ex

[issue12841] Incorrect tarfile.py extraction

2011-08-28 Thread STINNER Victor
STINNER Victor added the comment: Should this bug be fixed in 3.3, or 2.7+3.2+3.3? -- ___ Python tracker <http://bugs.python.org/issue12841> ___ ___ Python-bug

[issue12841] Incorrect tarfile.py extraction

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: The patch looks ok. Can you push it Lars? -- ___ Python tracker <http://bugs.python.org/issue12841> ___ ___ Python-bugs-list m

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: It looks like a kernel bug !? Are you able to write a C script reproducing the problem? If not, I can try to write it. -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12

[issue12841] Incorrect tarfile.py extraction

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: You can get a lot of information on this guide: http://docs.python.org/devguide/setup.html#getting-set-up You can also ask on IRC (#python-dev on Freenode), or by email on the python-dev mailing list. It was really hard for me to switch from Subversion to

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: > It looks like a kernel bug !? And you know what? fdopendir() function has been introducted in OpenBSD 5.0! -- ___ Python tracker <http://bugs.python.org/issu

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: I think that the problem is that fdopendir() is not defined. If a function is not defined, C uses int as the result type. An int is not enough to store a 64-bit pointer. See in gdb output: dirp is 0x0afb0e80 whereas other pointers look like 0x20973fc30. You

[issue12855] open() and codecs.open() treat form-feed differently

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: U+000C (Form feed) is considered as a line boundary in Unicode (unicode type), but no for a byte string (str type). Example: >>> u'line \x0cone\nline two\n'.splitlines(True) [u'line \x0c', u'one\n', u'line two\n

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: > what information do you need to advance on this bug? It would be easier to debug if I had access to OpenBSD on a PowerPC host. -- ___ Python tracker <http://bugs.python.org/issu

[issue12855] open() and codecs.open() treat form-feed differently

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: > It would be nice if it fit in the docs somewhere, > but I'm not sure where. See: http://docs.python.org/library/codecs.html#codecs.StreamReader.readline Can you suggest a patch for the documentation? Source code of this document: http://hg

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: >> I tried "AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features >> from IEEE Stds 1003.1-2008)" but it doesn't work. > > You mean that the patch you attached doesn't work, correct? I ran autoconf, re-ran confi

[issue12855] linebreak sequences should be better documented

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: > Would it be better to put this note in a different place? You may just say that StreamReader.readline() uses unicode.splitlines(), and so point to unicode.splitlines() doc (use :meth:`unicode.splitlines` syntax). unicode.splitlines() is now well documen

[issue12855] linebreak sequences should be better documented

2011-08-30 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Unicode versions: +Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue12855> ___ ___ Python-bug

[issue10278] add time.wallclock() method

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: I think that we should process in two steps: * Expose low level C functions * Write a high level reusing the best low level function depending on the OS Low level functions: * Expose clock_gettime() into the time module, with CLOCK_MONOTONIC and

[issue10278] add time.wallclock() method

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: Note: it would be very pratical if time.monotonic() has always the same unit on all platforms. clock_gettime() uses seconds (and nanoseconds), time.clock() uses also seconds. -- ___ Python tracker <h

[issue12858] crypt.mksalt: use ssl.RAND_pseudo_bytes() if available

2011-08-30 Thread STINNER Victor
New submission from STINNER Victor : A salt doesn't need to be strong random bits, but I'm not sure that Mersenne Twister is a best candidate to generate salt. It would be nice to use ssl.RAND_pseudo_bytes() if available. Problem: implement random.choice() from a generator genera

[issue12754] Add alternative random number generators

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: Before trying to find the best (CS)PRNG, can't we start with ssl.RAND_bytes() and ssl.RAND_pseudo_bytes()? I would be nice to use ssl.RAND_pseudo_bytes() to generate crypt.mksalt(): see issue #12858 -- ___ P

[issue12855] linebreak sequences should be better documented

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: > 1. On the howto/unicode.html > 2. Somewhere in the stdtypes.html#typesseq description (maybe with other > notes at the bottom) > 3. As a note to the stdtypes.html#str.splitlines method description (where it > is in the previous patch.)

[issue1215] documentation doesn't say that you can't handle C segfaults from python

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: > def handler(signal, stackframe): > print "OUCH" > stdout.flush() > _exit(1) What do you want to do on a SIGSEGV? On a real fault, you cannot rely on Python internal state, you cannot use any Python object. To handle a re

[issue1215] documentation doesn't say that you can't handle C segfaults from python

2011-08-31 Thread STINNER Victor
STINNER Victor added the comment: Le mercredi 31 août 2011 02:52:01, vous avez écrit : > > What do you want to do on a SIGSEGV? On a real fault, you cannot rely on > > Python internal state, you cannot use any Python object. To handle a > > real SIGSEGV fault, you have to

[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-08-31 Thread STINNER Victor
New submission from STINNER Victor : If Pyton is configured without thread support (--without-threads), the compilation fails on OpenBSD : $ make [...] ./Modules/posixmodule.c:4582: undefined reference to `sched_get_priority_min' libpython3.3m.a(posixmodule.o)(.text+0x430b): In fun

[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-08-31 Thread STINNER Victor
STINNER Victor added the comment: > I have a problem if I add --without-threads Yeah, it's a recent regression: I opened the issue #12871. I don't think that it's specific to OpenBSD. -- ___ Python tracker <http://bugs.

[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > @Victor: can I commit the patch? I don't like the skip message. It doesn't tell that the problem comes from sigaltstack() and it doesn't contain the issue number. I would expect something like: "Issue #12868: sigaltstack() does

[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > The second patch looks good. Tests? Ok, I will try to write a new patch with tests. > But, it *probably* shouldn't be applied to 2.7& 3.2 given that it is a > behaviour change. I consider that this issue is a bug, so it should be fixed

[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > OpenBSD does support 1:1 threads via the RThread library > since 2005, thanks to tedu@ and more fantastic guys! > It about to be super-stable (one commit in 2011, last "real > fix" in april 2010). > (There is a techtalk from tedu@

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: stdout is a PIPE. You cannot seek in a PIPE. Write stdout into a file, or use maybe BytesIO or StringIO? -- nosy: +haypo resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.p

[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: Do you have OpenSSL headers? -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12876> ___ ___ Python-bugs-list m

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > Why does it have a 'seek' method then? Python doesn't remove a method if the operation is forbidden. For example, Python doesn't remove write() method if the file is read only, and it doesn't remove most methods after close().

[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > Great! I didn't know that! It's a new feature of Python 3.3. I added it to skip a test on old FreeBDB, see test_threadsignal.py: USING_PTHREAD_COND = (sys.thread_info.name == 'pthread' a

[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > As for rthreads support, a quick search seems to indicate that its API is > exactly the same as pthreads, and it's even binary compatible. Python will > automatically use it when run on a OpenBSD system with rthreads enabled. Well... not exact

[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > The second patch looks good. Tests? I don't see how to test that the pipes are closed, because the Popen object (and its stdout and stderr attributes) are not visible outside the patched functions. > I consider that this issue is a bug, so i

[issue6560] socket sendmsg(), recvmsg() methods

2011-09-01 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker <http://bugs.python.org/issue6560> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > For example, the following snippet builds correctly on Linux It builds correctly with -pthread or -lpthread, but it fails to build without these options. sched_get_priority_max() and sched_get_priority_min() come from libpthread on OpenBSD, whereas Pyt

[issue12871] Disable sched_get_priority_min/max on OpenBSD if Python is compiled without threads

2011-09-01 Thread STINNER Victor
Changes by STINNER Victor : -- title: Disable sched_get_priority_min/max if Python is compiled without threads -> Disable sched_get_priority_min/max on OpenBSD if Python is compiled without threads ___ Python tracker <http://bugs.pyth

[issue12636] IDLE ignores -*- coding -*- with -r option

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: Fixed, thanks for the report. Python 2.7 is not affected by this bug. -- versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/issue12

[issue12636] IDLE ignores -*- coding -*- with -r option

2011-09-01 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: works for me -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue12636> ___ ___ Pyth

[issue10278] add time.wallclock() method

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: clock_gettime.patch: add time.clock_gettime() function and time.CLOCK_xxx constants. The patch requires to rerun "autoconf". For the documentation, I don't know the availability of this function. Is it available on Windows? CLOCK_REALTI

[issue12852] POSIX level issues in posixmodule.c on OpenBSD 5.0

2011-09-01 Thread STINNER Victor
Changes by STINNER Victor : -- title: test_posix.test_fdlistdir() segfault on OpenBSD -> POSIX level issues in posixmodule.c on OpenBSD 5.0 ___ Python tracker <http://bugs.python.org/issu

[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-02 Thread STINNER Victor
STINNER Victor added the comment: >> It builds correctly with -pthread or -lpthread, but it fails to build >> without these options. >> > > Not on Linux: this is specific to OpenBSD. Oh, I forgot to specify: yes, I tested on OpenBSD (5.0). >>

[issue12882] mmap crash on Windows

2011-09-02 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12882> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12886] datetime.strptime parses input wrong

2011-09-02 Thread STINNER Victor
STINNER Victor added the comment: > ERROR no seconds in input string: minute=3, second=4 If you specificy "%S" in the format string, strptime() *requires* seconds. If seconds are optional in your format, you should call strptime() twice: first without '%S', then with &

[issue12886] datetime.strptime parses input wrong

2011-09-02 Thread STINNER Victor
STINNER Victor added the comment: Example: --- import datetime def test(text): try: d = datetime.datetime.strptime(text, '%Y%m%dT%H%M') except ValueError: pass else: print("%s without seconds => %s" % (text, d

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> works for me status: open -> closed ___ Python tracker <http://bugs.python.org/issue12898> ___ ___ Pyth

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: > At the time I created this ticket I didn't realize you could > just call open() on a directory. Yes, os.open or os.openat. -- nosy: +haypo ___ Python tracker <http://bugs.python.

[issue5876] __repr__ returning unicode doesn't work when called implicitly

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: I think that this issue is a duplicate of #4947 which has been fixed in Python 2.7.1. Can you retry with Python 2.7.2 (or 2.7.1)? -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue5

[issue5876] __repr__ returning unicode doesn't work when called implicitly

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: > Debian SID. No, it wasn't. Oh ok, gotcha: repr() always returns a str string. If obj.__repr__() returns a Unicode string, the string is encoded to the default encoding. By default, the default encoding is ASCII. $ ./python -S Python 2.7

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: I removed Lib/plat-linux3 from Python 2.7 and 3.2, and updated doc of Python 2.7. I close this issue (again). -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue9561] distutils: set encoding to utf-8 for input and output files

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: I applied pkginfo_utf8.patch to Python 3.2 and 3.3. Python 2.7 is not affected, it does already encode Unicode to UTF-8. -- ___ Python tracker <http://bugs.python.org/issue9

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: I hope that this issue is not related to threads+signals. We got many threads+signals issues on FreeBSD 6. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: I'm not sure that it is correct to call nl_langinfo(CODESET) to get the locale encoding. The LC_CTYPE locale should maybe be set temporary to the current locale (""), as does locale.getpreferredencoding(). Or maybe better, locale.getpr

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: > The LC_CTYPE locale should maybe be set temporary to > the current locale (""), as does locale.getpreferredencoding(). See also issue #6203. -- ___ Python tracker <http://bugs.py

[issue12903] test_io.test_interrupte[r]d* blocks on OpenBSD

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: It looks similar to issue #12905: yet another threads+signals issue? -- ___ Python tracker <http://bugs.python.org/issue12

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-05 Thread STINNER Victor
STINNER Victor added the comment: Issue #12903 is similar to this one. -- ___ Python tracker <http://bugs.python.org/issue12905> ___ ___ Python-bugs-list mailin

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread STINNER Victor
STINNER Victor added the comment: Windows provides a _get_osfhandle() function. There is not the opposite function? :-) Anyway, O_CLOEXEC is not available on all platforms. Even on FreeBSD and Linux, it depends on the OS/kernel version

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-06 Thread STINNER Victor
STINNER Victor added the comment: I tried the following script on OpenBSD 5 with Python 3.3: --- import signal import sys s = signal.SIGALRM signal.signal(s, lambda x,y: 1/0

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-06 Thread STINNER Victor
STINNER Victor added the comment: > I tried the following script on OpenBSD 5 with Python 3.3: ... Bad news: the script doesn't hang if Python is build without threads. Short C program to test interrupted

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-06 Thread STINNER Victor
STINNER Victor added the comment: Oh, siginterrupt(SIGALRM, 0) doesn't work in a program linked to pthread. Example: #include #include void handler(int signum) { printf("HANDLER!\n"); } int main() { int s = SIGALRM; char buffer[1024]; int n; signal(s, handler); si

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-06 Thread STINNER Victor
STINNER Victor added the comment: > > read() is interrupted after 1 second, it works. > Does it still work if you don't a create thread beforehand? Yes, the read() is also interrupted as expected if no thread is created. > one difference is that Python uses sigaction to

[issue12927] test_ctypes: segfault with suncc

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: Code of the test: from ctypes import * def test_ignore_retval(self): # Test if the return value of a callback is ignored # if restype is None proto = CFUNCTYPE(None) def func(): return (1, "abc&q

[issue12929] faulthandler: void pointer used in arithmetic

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: Does my commit fixed the warning? -- ___ Python tracker <http://bugs.python.org/issue12929> ___ ___ Python-bugs-list mailin

[issue12931] xmlrpclib confuses unicode and string

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: > (thus failing, as #7093 tells, which I personally wouldn't have > closed wontfix). I don't know the right encoding to encode a HTTP header. In Python 3, http.client.HTTPConnection.putheader() encodes header name to ASCII and header valu

[issue12931] xmlrpclib confuses unicode and string

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: New patch using ISO-8859-1 instead of the default encoding (ASCII). -- keywords: +patch Added file: http://bugs.python.org/file23114/xmlrpclib_unicode_host-2.patch ___ Python tracker <http://bugs.python.

[issue12929] faulthandler: void pointer used in arithmetic

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: Ok, thanks for the report. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue12931] xmlrpclib confuses unicode and string

2011-09-07 Thread STINNER Victor
STINNER Victor added the comment: "I guess it should use the configured encoding[1] (which is utf-8 by default) to do that, shouldn't it? Since that's the encoding that is used for the message body, too." The URI is only used in HTTP head

<    16   17   18   19   20   21   22   23   24   25   >