Florian Dold | 28 Jul 23:58 2014

[issue22098] Behavior of Structure inconsistent with BigEndianStructure when using __slots__


New submission from Florian Dold:

Habimg __slots__ = [] on a class inheriting from ctypes.Structure prevents undefined fields from being
set, as expected.

When inheriting from ctypes.BigEndianStructure, however, it is possible to set undefined fields.

See the attached file for small test case for the behavior.

----------
components: ctypes
files: bug-ctypes-slots.py
messages: 224195
nosy: Florian.Dold
priority: normal
severity: normal
status: open
title: Behavior of Structure inconsistent with BigEndianStructure when using __slots__
versions: Python 3.4
Added file: http://bugs.python.org/file36146/bug-ctypes-slots.py

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22098>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

(Continue reading)

Antoine Pitrou | 28 Jul 23:30 2014

[issue22097] Linked list API for ordereddict


New submission from Antoine Pitrou:

Right now Python doesn't have an ordered container which allows O(1) insertion at any place. It would be
nice to have such an API on ordered dicts (e.g. insert_after() / insert_before()).

----------
messages: 224191
nosy: pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Linked list API for ordereddict
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22097>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Zachary Ware | 28 Jul 23:02 2014

[issue22096] Argument Clinic: add ability to specify an existing impl function


Changes by Zachary Ware <zachary.ware <at> gmail.com>:

----------
components: Demos and Tools
nosy: larry, zach.ware
priority: normal
severity: normal
status: open
title: Argument Clinic: add ability to specify an existing impl function
type: enhancement
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22096>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Demian Brecht | 28 Jul 20:09 2014

[issue22095] Use of set_tunnel with default port results in incorrect post value in host header


New submission from Demian Brecht:

Creating this bug for clarity, but was encountered while investigating 22041 (now set as not a bug).

When using set_tunnel with default port, the port value in the host header is set to "None":

"send: b'POST [PATH] HTTP/1.1\r\nHost: [HOST]:None\r\nAccept-Encoding:
identity\r\nContent-Length: 41\r\nAccept: text/plain\r\nContent-type: application/x-www-form-urlencoded\r\n\r\n[FORM_DATA]'"

This issue seems to have been introduced in 3.4 when _tunnel_host and _tunnel_port were introduced to
decouple the destination host and port from the proxy host and port.

----------
components: Library (Lib)
messages: 224175
nosy: demian.brecht
priority: normal
severity: normal
status: open
title: Use of set_tunnel with default port results in incorrect post value in host header
type: behavior
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22095>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
(Continue reading)

Akira Li | 28 Jul 12:29 2014

[issue22094] test_ossaudiodev fails unnecessarily


New submission from Akira Li:

$ ./python -mtest -uaudio test_ossaudiodev
[1/1] test_ossaudiodev
test test_ossaudiodev failed -- Traceback (most recent call last):
  File "./Lib/test/test_ossaudiodev.py", line 148, in test_playback
    self.play_sound_file(*sound_info)
  File "./Lib/test/test_ossaudiodev.py", line 89, in play_sound_file
    (elapsed_time, expected_time))
AssertionError: False is not true : elapsed time (0.0590214729309082) > 10% off of expected time (3.5127309036445333)

1 test failed:
    test_ossaudiodev

The failure is caused by dsp.write(data) that doesn't write all data
on my machine.  If it is replaced with dsp.writeall(data) then the test
passes.

The docs [1] say that dsp.write() should write all data by default:

  oss_audio_device.write(data)
  Write the Python string data to the audio device and return the
  number of bytes written. If the audio device is in blocking mode
  (the default), the entire string is always written

[1] https://docs.python.org/3.4/library/ossaudiodev.html

The comments in Modules/ossaudiodev.c suggest that dsp.write(data) should
write *all* data unless dsp.nonblock() is called:
(Continue reading)

Vajrasky Kok | 28 Jul 06:35 2014

[issue22093] Compiling python on OS X gives warning about compact unwind


New submission from Vajrasky Kok:

OS X version 10.9.4.

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

This is the warning:

...
gcc -bundle -undefined dynamic_lookup
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/_ctypes.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/callbacks.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/callproc.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/stgdict.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/cfield.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/malloc_closure.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/darwin/dlfcn_simple.o build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Cod
 e/python/cpython/Modules/_ctypes/libffi_osx/ffi.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/x86/darwin64.o build/temp.macosx-10.9-x86_64-3.5-
 pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/x86/x86-darwin.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/x86/x86-ffi_darwin.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/x86/x86-ffi64.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/powerpc/ppc-darwin.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/powerpc/ppc-darwin_closure.o
build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.o build/temp.macosx-10.9-x86_64-3.5-pydebug/Users/sky/Code/python/cpython/Modules/_ctypes/libffi_osx/powerpc/ppc
(Continue reading)

Andrew Barnert | 28 Jul 04:14 2014

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack


Andrew Barnert added the comment:

Akira, your patch does this:

-        self._writetranslate = newline != ''
-        self._writenl = newline or os.linesep
+        self._writetranslate = newline in (None, '\r', '\r\n')
+        self._writenl = newline if newline is not None else os.linesep

Any reason you made the second change? Why change the value assigned to _writenl for newline='\n' when you
don't want to actually change the behavior for those cases? Just so you can double-check at write time that
_writetranslate is never set unless _writenl is '\r', '\r\n', or os.linesep?

----------
versions: +Python 3.4 -Python 3.5

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue1152248>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Terry J. Reedy | 28 Jul 00:45 2014

[issue7949] IDLE: problems with dark GTK or KDE color schemes


Changes by Terry J. Reedy <tjreedy <at> udel.edu>:

----------
versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue7949>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Vajrasky Kok | 27 Jul 16:50 2014

[issue22092] Executing some tests inside Lib/unittest/test individually throws Error


New submission from Vajrasky Kok:

For examples:

$ ./python Lib/unittest/test/test_runner.py 
Traceback (most recent call last):
  File "Lib/unittest/test/test_runner.py", line 10, in <module>
    from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
SystemError: Parent module '' not loaded, cannot perform relative import

$ ./python Lib/unittest/test/test_program.py 
..................E
======================================================================
ERROR: test_discovery_from_dotted_path (__main__.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/unittest/test/test_program.py", line 15, in test_discovery_from_dotted_path
    expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
AttributeError: module 'unittest' has no attribute 'test'

----------------------------------------------------------------------
Ran 19 tests in 0.331s

FAILED (errors=1)

Here is the patch.

----------
components: Tests
(Continue reading)

Steven Barker | 27 Jul 15:22 2014

[issue1234674] filecmp.cmp's "shallow" option


Steven Barker added the comment:

I think that your test patch misses the confusing/possibly wrong case. That case is when two files have the
same contents, but different mtimes. If you attempt a shallow comparison, you'll actually get a deep
comparison (reading the whole files) and a result of True rather than the expected (though incorrect) False.

Try the test part of my patch (without the behavior change), and you'll see the failure of
"test_shallow_false_negative". In your first assertion (that "filecmp.cmp(self.name,
self.name_uppercase)" is False), you get the expected result, but for the wrong reason (you get it
because the file contents differ, not because they have different mtimes).

Now, it might be that the "bad" case is actually working as we want it to (or at least, the behavior is
established enough that we don't want to change it, for risk of breaking running code). If so, we should
instead change the documentation (and especially the docstring) to explicit state that even if you
request a shallow comparison, you might get a deep comparison instead.

----------

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue1234674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

Armin Rigo | 27 Jul 13:32 2014

[issue22091] __debug__ in compile(optimize=1)


New submission from Armin Rigo:

The documentation of the built-in compile() function is not 100% clear but I think it says that giving the
"optimize=1" argument turns "__debug__" to false in the compiled code (
https://docs.python.org/3.5/library/functions.html?highlight=compile#compile ).  It doesn't
work this way in practice, though:

    python3.5
    >>> exec(compile("print(__debug__)", "exec", "exec", optimize=1))
    True

I'd recommend to fix either the documentation or the source code.

----------
messages: 224119
nosy: arigo
priority: normal
severity: normal
status: open
title: __debug__ in compile(optimize=1)

_______________________________________
Python tracker <report <at> bugs.python.org>
<http://bugs.python.org/issue22091>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-python-bugs-list%40m.gmane.org

(Continue reading)


Gmane