[issue19984] Add new format of fixed length string for PyErr_Format

2013-12-15 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: -- title: Add new format of fix length string for PyErr_Format - Add new format of fixed length string for PyErr_Format ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19984

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: And here is the patch to better error message in Python 2.7. -- Added file: http://bugs.python.org/file33144/better_error_message_struct_python_27.patch ___ Python tracker rep...@bugs.python.org

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
New submission from Vajrasky Kok: Python 3.4 (3.3 is also afflicted: import struct struct.Struct(3) Traceback (most recent call last): File stdin, line 1, in module TypeError: Struct() argument 1 must be a bytes object, not int struct.Struct('b') Struct object at 0x7fec04763180 Python

[issue19099] struct.pack fails first time with unicode fmt

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Nevermind, I already created this issue. http://bugs.python.org/issue19985 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19099 ___

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Final patch that reflects the version I'm about to commit. It includes appropriate docs updates, and ensures __main__.__spec__ is None in the cases where the import system isn't involved in initialising main. -- Added file:

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 51dddfead80a by Nick Coghlan in branch 'default': Issue #19700: set __spec__ appropriately in runpy http://hg.python.org/cpython/rev/51dddfead80a -- nosy: +python-dev ___ Python tracker

[issue19700] Update runpy for PEP 451

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Final review of the patch showed it *wasn't* quite done, it's still missing the both __name__ and __spec__.name are configured in sys.modules change that is needed to get more pickle friendly behaviour from __main__. However, I wanted to commit this version to

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 19700 isn't quite finished, but I believe it is finished enough to let me get this working properly. -- dependencies: -Update runpy for PEP 451 resolution: fixed - ___ Python tracker rep...@bugs.python.org

[issue19766] test_venv: test_with_pip() failed on AMD64 Fedora without threads 3.x buildbot: urllib3 dependency requires the threading module

2013-12-15 Thread Vinay Sajip
Vinay Sajip added the comment: I've released distlib 0.1.5 on PyPI. This release uses dummy_threading when threading isn't available. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue19913] TR/Crypt.XPACK.Gen-4 in easy_install.exe

2013-12-15 Thread Vinay Sajip
Vinay Sajip added the comment: I've released distlib 0.1.5 on PyPI. This release uses uncompressed launchers which (at the time of writing) pass the checks on virustotal.com. -- resolution: - fixed status: open - closed ___ Python tracker

[issue19766] test_venv: test_with_pip() failed on AMD64 Fedora without threads 3.x buildbot: urllib3 dependency requires the threading module

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Not quite fixed yet - Donald, I think all the vendored dependencies have been updated now, would it be possible to spin and incorporate a pip 1.5rc2 somewhat soonish so we know what's still left to be addressed on the ensurepip side? -- assignee: -

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Richard Oudkerk
Richard Oudkerk added the comment: So there are really two situations: 1) The __main__ module *should not* be imported. This is the case if you use __main__.py in a package or if you use nose to call test_main(). This should really be detected in get_preparation_data() in the parent process

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Bumping the priority on this, as multiprocessing is currently creating invalid child processes by failing to set __main__.__spec__ appropriately. The attached patch is designed to get us started down that path. It's currently broken, but I need feedback from

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: With the restructuring in my patch, it would be easy enough to move the early return cases from the _fixup_main_* functions to instead be don't set the variable cases in get_preparation_data. -- ___ Python tracker

[issue19167] sqlite3 cursor.description varies across Linux (3.3.1), Win32 (3.3.2), when selecting from a view.

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Upgrading sqlite3 in Windows maybe easy but Python 2.7.6 and 3.3.3 on Windows were built with defected sqlite3. Maybe at least we can provide the correct sqlite3 version next time we release Windows version of Python 2.7 and 3.3? Python 3.3 comes with sqlite3

[issue19984] Add new format of fixed length string for PyErr_Format

2013-12-15 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19984 ___ ___ Python-bugs-list mailing

[issue19984] Add new format of fixed length string for PyErr_Format

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Originally Antoine had proposed [1] `%T, obj` as replacement for `%.400s, Py_TYPE(obj)-tp_name`. [1] http://permalink.gmane.org/gmane.comp.python.devel/143925 -- nosy: +pitrou, serhiy.storchaka ___ Python tracker

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that error message in 2.7 is correct. String means both str and unicode. As for 3.x, agree, it should be corrected. But I prefer str or bytes or string or bytes object. -- nosy: +serhiy.storchaka versions: -Python 2.7

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +mark.dickinson, meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19985 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch that works both on Windows and Linux. -- Added file: http://bugs.python.org/file33147/fix_tarfile_overwrites_symlink_v2.patch ___ Python tracker rep...@bugs.python.org

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch to address Serhiy's request. Hmmm, if string means both string and unicode in Python 2.7, should we fix these behaviours? import _csv _csv.register_dialect(2) Traceback (most recent call last): File stdin, line 1, in module TypeError:

[issue19986] ‘mpd_del’ discards qualifiers from pointer target type

2013-12-15 Thread Christian Heimes
New submission from Christian Heimes: One buildbot is emitting a warning: Modules/_decimal/libmpdec/mpdecimal.c:4438: warning: passing argument 1 of ‘mpd_del’ discards qualifiers from pointer target type

[issue19987] Winsound: test_alias_fallback fails on WS 2008

2013-12-15 Thread Christian Heimes
New submission from Christian Heimes: == FAIL: test_alias_fallback (test.test_winsound.PlaySoundTest) -- Traceback (most recent call last): File

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Ethan Furman
New submission from Ethan Furman: In Py3k __hex__ and __oct__ were removed, and hex() and oct() switched to use __index__. hex() and oct() should be using __int__ instead. Having read through PEP 357 [1] I see that __index__ is /primarily/ concerned with allowing arbitrary objects to be used

[issue19989] Error while sending function code over queue (multiprocessing)

2013-12-15 Thread Filip Malczak
New submission from Filip Malczak: Ive been using YAPSY to load plugins in one process. In this process I tried to put them in queue, and in another process I read them from queue. There was a problem with non-existing type of plugin in consumer process, so I tried to serialize plugin

[issue19986] ‘mpd_del’ discards qualifiers from pointer target type

2013-12-15 Thread Stefan Krah
Stefan Krah added the comment: I agree that warnings are annoying, but I'm not sure what to do with this one: It's wrong and only occurs with fairly old gcc versions. My feeling was that pragmas are overkill for relatively old compilers. -- nosy: +skrah

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __index__() is used because float has __int__ but not __index__. (42.0).__int__() 42 (42.0).__index__() Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'float' object has no attribute '__index__' -- nosy:

[issue19987] Winsound: test_alias_fallback fails on WS 2008

2013-12-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: -serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___

[issue19987] Winsound: test_alias_fallback fails on WS 2008

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This test was re-enabled in issue19595. -- nosy: +zach.ware versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___

[issue19167] sqlite3 cursor.description varies across Linux (3.3.1), Win32 (3.3.2), when selecting from a view.

2013-12-15 Thread R. David Murray
R. David Murray added the comment: That sqlite checkin is well before 3.7.12 was released, and 3.3.3 shipped with that version. Was the bug present in 3.6? If so I don't think we can do anything, since I believe we stay with the same minor version (ie: 3.6) of sqlite for the life of a minor

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-15 Thread Larry Hastings
Larry Hastings added the comment: Here's a first attempt at a patch. The Visual Studio pragma disables for the rest of the file, which is undesirable. Maybe we could turn it on and off inline, but it's not clear to me that that would have the desired effect of turning off the warning for

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed, the definition and use of __index__ has derived since PEP 357. Nowadays, __index__ means can be converted to an int without loss. In any case, I find the behaviour of your logical type a bit dubious. If it's like bool but ternary, it *should* convert

[issue19983] Ctrl-C causes startup crashes on Windows

2013-12-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, tim.golden, tim.peters versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___

[issue19983] Ctrl-C at startup can end in a Py_FatalError call

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, ok. So it's a controlled crash: Python fails initializing the standard streams and so it decides to bail out (by using Py_FatalError, since Py_Initialize doesn't return an error code). What we could do is call initsigs() after initstdio() (but still

[issue19855] uuid._find_mac fails if an executable not in /sbin or /usr/sbin

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This check was added in r50954 (changeset 654c380cf8b9). Here is better (but larger) patch for 3.3+. -- assignee: - serhiy.storchaka nosy: +nnorwitz Added file: http://bugs.python.org/file33151/uuid_find_mac_which_2.patch

[issue19855] uuid._find_mac fails if an executable not in /sbin or /usr/sbin

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And here is a patch for 2.7. It uses backported from 3.3 and simplified variant of shutil.which(). -- Added file: http://bugs.python.org/file33152/uuid_find_mac_which-2.7.patch ___ Python tracker

[issue19537] Fix misalignment in fastsearch_memchr_1char

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Antoine, if sizeof(PyUnicodeObject) is 38, the start of UCS4 unicode string is not aligned. This should be fixed. -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org

[issue19537] Fix misalignment in fastsearch_memchr_1char

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine, if sizeof(PyUnicodeObject) is 38, the start of UCS4 unicode string is not aligned. This should be fixed. Probably. Does anyone want to propose a patch? -- ___ Python tracker rep...@bugs.python.org

[issue19986] ‘mpd_del’ discards qualifiers from pointer target type

2013-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 274b293435fb by Stefan Krah in branch '3.3': Issue #19986: Avoid an incorrect warning of older gcc versions. http://hg.python.org/cpython/rev/274b293435fb -- nosy: +python-dev ___ Python tracker

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Richard Oudkerk
Richard Oudkerk added the comment: I appear to be somehow getting child processes where __main__.__file__ is set, but __main__.__spec__ is not. That seems to be true for the __main__ module even when multiprocessing is not involved. Running a file /tmp/foo.py containing import sys

[issue19537] Fix misalignment in fastsearch_memchr_1char

2013-12-15 Thread Andreas Schwab
Andreas Schwab added the comment: How about adding explicit padding to the bitfield in PyASCIIObject? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19537 ___

[issue19537] Fix misalignment in fastsearch_memchr_1char

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: How about adding explicit padding to the bitfield in PyASCIIObject? That sounds ok to me, but it must be explicitly for 68k (or use a sufficiently smart scheme not to affect already aligned architectures). -- ___

[issue19986] ‘mpd_del’ discards qualifiers from pointer target type

2013-12-15 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: compile error - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19986

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Mark Dickinson
Mark Dickinson added the comment: hex() and oct() should be using __int__ instead. Strong -1 from me. I wouldn't want `hex(45.3)` to work, and `hex(45.0)` working isn't much better. -- ___ Python tracker rep...@bugs.python.org

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Stefan Krah
Stefan Krah added the comment: -1 from me as well. I would not want to audit a large program for accidentally converted floats. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19988

[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Jakub's patch has a bug: import tempfile f = tempfile.NamedTemporaryFile(dir=.,delete=False) write = f.write write function BufferedRandom.write at 0xb716b4f4 write2 = f.write write2 built-in method write of _io.BufferedRandom object at 0xb721deac del

[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is fixed Jakub's patch. -- assignee: - serhiy.storchaka Added file: http://bugs.python.org/file33153/tempfile_wrap_methods.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18879

[issue19648] Empty tests in pickletester need to be implemented or removed

2013-12-15 Thread Gennadiy Zlobin
Gennadiy Zlobin added the comment: Hi, I created 2 simple tests for test_getinitargs and test_reduce. -- keywords: +patch nosy: +gennad Added file: http://bugs.python.org/file33154/19648.patch ___ Python tracker rep...@bugs.python.org

[issue19946] Handle a non-importable __main__ in multiprocessing

2013-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Scripts (whether in source form or precompiled) work via direct execution, but all the other execution paths (directories, zipfiles, -m) rely on the import system (via runpy). multiprocessing has been broken for years in that regard, hence my old comment about the

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, I believe that __index__ was your initiative. Do you care to opine on this one? -- assignee: - gvanrossum nosy: +gvanrossum, rhettinger ___ Python tracker rep...@bugs.python.org

[issue19990] Add unittests for imghdr module

2013-12-15 Thread Claudiu.Popa
New submission from Claudiu.Popa: Hello! The following patch adds unit tests for the previously untested `imghdr` module. -- components: Tests files: test_imghdr.patch keywords: patch messages: 206262 nosy: Claudiu.Popa priority: normal severity: normal status: open title: Add

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: I agree with Mark and Stafan. Hex/oct/bin are only defined for integers. __int__ is ambiguous -- it has the same problem as (int) in C in that it applies to floats and then loses the fraction. I think the problem with Ethan's ternary logic is that it

[issue17919] AIX POLLNVAL definition causes problems

2013-12-15 Thread Stefan Krah
Stefan Krah added the comment: Hi, this happens on the OpenIndiana bot: http://buildbot.python.org/all/builders/x86%20OpenIndiana%203.3/builds/1259/steps/test/logs/stdio test_devpoll1 (test.test_devpoll.DevPollTests) ... ok test_events_mask_overflow (test.test_devpoll.DevPollTests) ... ERROR

[issue17919] AIX POLLNVAL definition causes problems

2013-12-15 Thread Christian Heimes
Christian Heimes added the comment: I have fixed the issue in http://hg.python.org/cpython/rev/039306b45230 -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17919 ___

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-15 Thread David Watson
David Watson added the comment: On Fri 13 Dec 2013, Brett Cannon wrote: Two things. First, I'm sorry David but my mind is not working fully enough at the moment to see how msg_controllen is compared to cmsg_len_end without relying on external value coming in through the parameters of the

[issue19991] configparser instances cannot be pretty printed

2013-12-15 Thread Andrei Kucharavy
New submission from Andrei Kucharavy: ConfigParser seems to share a lot of behavior with a dict, but cannot be pretty printed. -- messages: 206267 nosy: Andrei.Kucharavy priority: normal severity: normal status: open title: configparser instances cannot be pretty printed type:

[issue19887] Path.resolve() fails on complex symlinks

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch with unrolled loops. I suppose that was some kind of joke, but what I meant was that we don't need to test with 100 levels of symlinks. 2 or 3 are enough... -- ___ Python tracker

[issue19887] Path.resolve() fails on complex symlinks

2013-12-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch with refactored tests. Vajrasky, do you want to test under Windows? -- Added file: http://bugs.python.org/file33156/pathlib_resolve_4.patch ___ Python tracker rep...@bugs.python.org

[issue19991] configparser instances cannot be pretty printed

2013-12-15 Thread R. David Murray
R. David Murray added the comment: Without looking at the details, I would guess that doing anything about this should have issue 7434 as a prereq. But Łukasz will have a more informed opinion. -- nosy: +lukasz.langa, r.david.murray versions: +Python 3.5 -Python 3.3

[issue19104] pprint produces invalid output for long strings

2013-12-15 Thread Mark Lawrence
Mark Lawrence added the comment: Would it pay to have a meta issue for all the outstanding pprint issues, or possibly make issue 7434 the meta issue? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19104

[issue19992] subprocess documentation not explicit about fileno()

2013-12-15 Thread Thayne McCombs
New submission from Thayne McCombs: The subprocess documentation for stdout/stderr/stdin states: Valid values are PIPE, an existing file descriptor (a positive integer), an existing file object, and None. PIPE indicates that a new pipe to the child should be created. However, file-like

[issue19532] compileall -f doesn't force to write bytecode files

2013-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6afad4f29249 by R David Murray in branch '3.3': #19532: make compileall with no file/dir args respect -f and -q. http://hg.python.org/cpython/rev/6afad4f29249 New changeset 0e07ab605e0b by R David Murray in branch 'default': Merge: #19532: make

[issue19532] compileall -f doesn't force to write bytecode files

2013-12-15 Thread R. David Murray
R. David Murray added the comment: Thanks, Vajrasky. I did not backport this to 2.7 because the code is different and we don't have proper tests there, so the chance of breaking something is higher than the benefit of fixing it. -- resolution: - fixed stage: needs patch -

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Ethan Furman
Ethan Furman added the comment: For the record, the true/false values of my Logical type do convert to int, just not the unknown value. I agree using __int__ is dubious because of float (and Decimal, etc.), which means really the only clean way to solve the issue (definitely for me, and for

[issue19990] Add unittests for imghdr module

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Beside my review, I think we need one more test that tests the invalid image file, for example file with header b'cutecat'. -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org

[issue19988] hex() and oct() use __index__ instead of __int__

2013-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: I still think the problem is with your class design. You shouldn't want a hex representation for a value that's not an integer. For the difference between %x and hex() please open another issue (you might want to track down the cause in the source first so

[issue19990] Add unittests for imghdr module

2013-12-15 Thread Claudiu.Popa
Claudiu.Popa added the comment: Thanks for the review, Vajrasky! Here's the updated version. -- Added file: http://bugs.python.org/file33157/test_imghdr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990