[issue10976] json.loads() throws TypeError on bytes object

2012-04-26 Thread Balthazar Rouberol

Balthazar Rouberol  added the comment:

I know this does not fix anything at the core, but it would allow you to use 
json.loads() with python 3.2 (maybe 3.1?):

Replace 
json.loads(raw_data)

by

raw_data = raw_data.decode('utf-8') # Or any other ISO format
json.loads(raw_data)

--
nosy: +Balthazar.Rouberol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() throws TypeError on bytes object

2012-04-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> What if the returned JSON uses a charset other than utf-8 ?

According to RFC 4627: "JSON text SHALL be encoded in Unicode.  The default 
encoding is UTF-8." RFC 4627 also offers a way to autodetect other Unicode 
encodings.

--
nosy: +storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-26 Thread Larry Hastings

Larry Hastings  added the comment:

Anybody else?  I guess I'm gonna jst miss Alpha 3, but if nobody has any 
other objections I'll check this in today (Thursday).

If you want me to hold off just let me know.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-04-26 Thread STINNER Victor

STINNER Victor  added the comment:

I ran tests of utf16_error_handling-3.2_4.patch on Python 3.1. Two tests are 
failing:
 - b'\x00\xd8'.decode('utf-16le', 'replace')='\ufffd\ufffd' != '\ufffd'
 - b'\xd8\x00'.decode('utf-16be', 'replace')='\ufffd\ufffd' != '\ufffd'

I don't think that the test is correct: UTF-16 should resynchronize as early as 
possible (ignore the first invalid byte and restart at the following byte), so 
'\ufffd\ufffd' is the correct answer.

Another examples:
 - b'\xd8\x00\x41'.decode('utf-16be', 'replace') should return '�A' (\ufffdA')
 - with UTF-8 decoder: (b'\xC3' + '\xe9'.encode('utf-8')).decode('utf-8', 
'replace') returns '\ufffd\xe9'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I ran tests of utf16_error_handling-3.2_4.patch on Python 3.1. Two tests are 
> failing:
>  - b'\x00\xd8'.decode('utf-16le', 'replace')='\ufffd\ufffd' != '\ufffd'
>  - b'\xd8\x00'.decode('utf-16be', 'replace')='\ufffd\ufffd' != '\ufffd'
> 
> I don't think that the test is correct: UTF-16 should resynchronize as
> early as possible (ignore the first invalid byte and restart at the
> following byte), so '\ufffd\ufffd' is the correct answer.

UTF-16 units are 16-bit words, not bytes, so '\ud' sounds correct to
me. You resynchronize on the word boundary: the invalid word is skipped.

>  - with UTF-8 decoder: (b'\xC3' +
> '\xe9'.encode('utf-8')).decode('utf-8', 'replace') returns '\ufffd
> \xe9'

That's because UTF-8 operates on bytes: the invalid byte is skipped.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() throws TypeError on bytes object

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, adding support for bytes objects using the spec from RFC 4627 (or at 
least with utf-8 as a default) may be an enhancement for 3.3.

--
assignee: docs@python -> 
components: +Library (Lib) -Documentation
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.3 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

If it can contain a variable number of fields, I think it should be a dict 
rather than a tuple.

--
nosy: +ncoghlan, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() throws TypeError on bytes object

2012-04-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Things are a little more complicated. '123' is not a valid JSON according to 
RFC 4627 (the top-level element can only be an object or an array). This means 
that the autodetection algorithm will not always work for such non-standard 
data.

If we can parse binary data, then there must be a way to generate binary data 
in at least one of the Unicode encodings.

By the way, the documentation should give a link to RFC 4627 and explain the 
current implementation is different from it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-04-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The json module documentation should give a link to RFC 4627 and explain the 
current implementation is different from it. For example, according to RFC 4627 
only an object or an array can be top-level JSON element.

--
assignee: docs@python
components: Documentation
messages: 159367
nosy: docs@python, storchaka
priority: normal
severity: normal
status: open
title: Add link to RFC 4627 from json documentation
type: enhancement
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() throws TypeError on bytes object

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Things are a little more complicated. '123' is not a valid JSON
> according to RFC 4627 (the top-level element can only be an object or
> an array). This means that the autodetection algorithm will not always
> work for such non-standard data.

The autodetection algorithm needn't examine all 4 first bytes. If the 2
first bytes are non-zero, you have UTF-8 data. Otherwise, the JSON text
will be at least 4 bytes long (since it's either UTF-16 or UTF-32).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-04-26 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
assignee:  -> eric.araujo
components: +Distutils
nosy: +eric.araujo, tarek
versions: +Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-04-26 Thread Ramchandra Apte

New submission from Ramchandra Apte :

Make distutils.ccompiler.CCompiler an abstract class by making it inherit from 
abc.ABCMeta.
Thanks

--
messages: 159369
nosy: ramchandra.apte
priority: normal
severity: normal
status: open
title: make distutils.ccompiler.CCompiler an abstract class

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 86dc014cdd74 by Jesus Cea in branch 'default':
Close #10142: Support for SEEK_HOLE/SEEK_DATA
http://hg.python.org/cpython/rev/86dc014cdd74

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-04-26 Thread Ramchandra Apte

Ramchandra Apte  added the comment:

Sorry, distutils.ccompiler.CCompiler should have abc.ABCMeta as the metaclass.
(for example like this)
class CCompiler(metaclass = abc.ABCMeta):
   ...
Thanks

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

You broke test_io

www.python.org/dev/buildbot/all/builders/x86 Gentoo Non-Debug 
3.x/builds/2143/steps/test/logs/stdio

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

> the errno codes (EAGAIN etc) are provided only as a compatibility for 
> posix apps that test "errno".  On windows, we use the WSA return values 
> from the api functions and WsaGetLastError().
> ...
> So, the proposed patch is not a change, it is merely reinforcing the 
> previous practice of prefering the native error codes over the 'errno' 
> emulation.

Except that Microsoft's C library also uses some of the non-WSA versions.  For 
instance read() (or _read()) is documented to set errno to EBADF or EINVAL on 
error.  So EBADF and EINVAL are just as "native" as WSAEBADF and WSAEINVAL.

It is also quite common for python's C code to do stuff like

errno = EINVAL;
PyErr_SetFromErrno(PyExc_OSError);

errnomap in Objects/exceptions.c is used to convert some OSError exceptions to 
subclasses like PermissionError.  It shouldn't be hard to use it to also 
convert WSAEINVAL to EINVAL etc.

--
nosy: +sbt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

I recently added what you just mentioned in the vs2010port branch for WSA and 
non-WSA to work together. I still need to figure out some distutils/packaging 
failures, but the port is nearly ready*.

* I've only focused on 32-bit debug builds, but updating the project files and 
whatnot for other configurations is easy.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Yes, backing out changeset.

Never suppose anything...

--
resolution: fixed -> 
stage: committed/rejected -> patch review
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() raises TypeError on bytes object

2012-04-26 Thread Éric Araujo

Changes by Éric Araujo :


--
title: json.loads() throws TypeError on bytes object -> json.loads() raises 
TypeError on bytes object

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8767] Configure: Cannot disable unicode

2012-04-26 Thread Stefano Taschini

Changes by Stefano Taschini :


--
nosy: +taschini

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-04-26 Thread Éric Araujo

Éric Araujo  added the comment:

distutils is closed to improvements, it only gets bugfixes.  
distutils2/packaging can get new features.  Can you tell more about the use 
case or motivation for this request?

--
components: +Distutils2 -Distutils
nosy: +alexis
versions: +3rd party, Python 3.3 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Éric Araujo

Éric Araujo  added the comment:

*version* is a version tuple, in the format of :data:`sys.version_info`,
   which represents the version of the Python implementation, **not** the
   version of the Python specification it implements.

If that version number is specific to each VM, then I’m not sure we should 
mandate a specific format.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

> Except that Microsoft's C library also uses some of the non-WSA
> versions.  For instance read() (or _read()) is documented to set
> errno to EBADF or EINVAL on error.  So EBADF and EINVAL are just as
> "native" as WSAEBADF and WSAEINVAL.
read() is a posix function, so of course they set errno for it.  You'll 
probably find that GetLastError() will some native error codes.


> It is also quite common for python's C code to do stuff like
>errno = EINVAL;
>PyErr_SetFromErrno(PyExc_OSError);
This doesn't change that, and as far as I know, this has worked and continues 
to work.  "errno" is supported.

> errnomap in Objects/exceptions.c is used to convert some OSError
> exceptions to subclasses like PermissionError.  It shouldn't be hard
> to use it to also convert WSAEINVAL to EINVAL etc.
Why would we get different errors codes for e.g. connection reset events 
because we build with a different compiler?
Python has always used the native error codes for socket io on windows, why 
change that?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Brian, I posted a suggested port five weeks ago.  What kind of problems are you 
having?  It's really a very straightforward thing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Also, I'm not sure distutils and all that is really necessary.  As I understood 
it, the goal is to make it so that the casual hacker can compile and run python 
using visual studio 2010.  3.3 continues to be "officially" distributed with 
2008.  Surely it is possible to do this in smaller steps, rather than one fell 
swoop?
For instance, the sxs patch and the errnomodule patch could go in now without 
disturbing anything whatsoever.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


Added file: http://bugs.python.org/file25370/6447a9323b11.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

New patch proposed, with testsuite fixed.

Please, review. Last chance :-).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-26 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

New patch which adds timeout to ResourceSharer.stop() which defaults to 0.

When stop() fails it now uses the logger.

pthread_sigmask() only stops this background thread from receiving signals.  
Signals will still be delivered to other threads, so it should not have any 
effect on the handling of Ctrl-C.

--
Added file: http://bugs.python.org/file25371/mp_resource_sharer_stop.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

No, this is the real thing. Python 3.3 distributed on VS2010.

In order to ship a fully built Python 3.3 MSI for users, I've found it's not 
just as easy as updating errno. I'll strip out all of the project file changes 
and whatnot and post a patch of the actual C and Python code changes to see 
that this is in line with what people think is usable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14443] Distutils test_bdist_rpm failure

2012-04-26 Thread Dave Malcolm

Dave Malcolm  added the comment:

As a post-processing step, rpmbuild will attempt to byte-compile any .py files 
it encounters, and the results must be listed in the %files manifest. [1]

This is done by the script brp-python-bytecompile, which uses the compileall 
module.  However, my guess is that it's not using the correct version of python 
when invoking "compileall", which would explain why it's using the pre-PEP3147 
location for the .pyc/.pyo files.

Can you run "file" on the .pyc files and confirm which version of Python 
they're bytecode for?  My guess is that it's bytecompiled them with 
/usr/bin/python, rather than your local build of python.

Some notes: In older versions of RPM, brp-python-bytecompile took a single 
optional argument: the python interpreter to use, defaulting to 
/usr/bin/python.  I generalized this to support multiple defaults when adding 
Python 3 support to Fedora: see 
https://bugzilla.redhat.com/show_bug.cgi?id=531117  That patch could be 
generalized to support /usr/local/lib.

[1] In Fedora we do this using "__os_install_post", which is defined
in /usr/lib/rpm/redhat/macros (from the redhat-rpm-config package),
which has the invocation of /usr/lib/rpm/brp-python-bytecompile   So it could 
be possible to override the python interpreter to use by redefining 
__os_install_post

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

Also, I personally don't care about distutils, but I need all of the tests to 
pass before I can consider merging this. Distutils and packaging need a few 
changes to be able to compile extensions and create setups and whatever with 
VS2010.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Éric Araujo

Éric Araujo  added the comment:

Could you attach a file with the distutils/packaging test output?  I don’t 
really know the packaging.compiler module, but I may be able to make sense of 
the error messages and work with you to fix them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-26 Thread Vinay Sajip

Vinay Sajip  added the comment:

Buildbots seem not to be complaining, so closing.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() raises TypeError on bytes object

2012-04-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I mean a string that starts with '\u'. b'"\x00...'.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8767] Configure: Cannot disable unicode

2012-04-26 Thread R. David Murray

R. David Murray  added the comment:

Reopening per this python-dev thread where MvL said that not being able to 
build 2.7 without unicode is a bug (but someone would need to care enough to 
contribute a patch to fix it).

--
nosy: +r.david.murray
priority: normal -> low
stage:  -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Eric Snow

Eric Snow  added the comment:

@antoine - I wondered about that.  In the end I got something up to start with.

The list of fields in sys.implementation may change over time, unlike 
sys.version_info, et al.  However, during interpreter execution, I would expect 
that neither that list nor the contents would change.  The variability would 
only be between implementations and between versions of those implementations.

A dict would imply to me that it might vary during interpreter execution.  An 
immutable type makes it clear to me that it won't be changing.  I'm fine with a 
dict, though, if you think that's better.  Perhaps a dictproxy?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() raises TypeError on bytes object

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le jeudi 26 avril 2012 à 15:48 +, Serhiy Storchaka a écrit :
> 
> I mean a string that starts with '\u'. b'"\x00...'.

According to the RFC, that should be escaped:

   All Unicode characters may be placed within the
   quotation marks except for the characters that must be escaped:
   quotation mark, reverse solidus, and the control characters (U+
   through U+001F).

And indeed:

>>> json.loads('"\u"')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/opt/lib/python3.2/json/__init__.py", line 307, in loads
return _default_decoder.decode(s)
  File "/home/antoine/opt/lib/python3.2/json/decoder.py", line 351, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/antoine/opt/lib/python3.2/json/decoder.py", line 367, in 
raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Invalid control character at: line 1 column 1 (char 1)
>>> json.loads('"\\u"')
'\x00'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

> This doesn't change that, and as far as I know, this has worked and 
> continues to work.  "errno" is supported.

Using your patch, does the following throw an AssertionError?

>>> import os, errno
>>> try:
...   os.read(-1, 10)
... except OSError as e:
...   assert e.errno == errno.EBADF
...
>>>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Eric Snow

Eric Snow  added the comment:

@Éric - that's a good point.  I considered it for a little bit, but went with 
the quick and easy think to get it rolling.

There is a real benefit to mandating an API sys.implementation.version.  
importlib would use that version to calculate the tag to use for cached 
modules.  Without a specified/uniform data structure, that job is trickier.

Having an explicit sys.implementation.cache_tag field would solve that, and the 
importlib code would check for that field first.  However, I didn't want to 
start off with that as a "required" field, considering that only CPython would 
take advantage of module caches (as far as I know).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Eric Snow

Eric Snow  added the comment:

I'm going to write a PEP for this, after all.  I want to make sure that it's 
easy to access, in one place, these points that are coming up and their 
resolutions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10976] json.loads() raises TypeError on bytes object

2012-04-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

According to current implementation this is acceptable.

>>> json.loads('"\u"', strict=False)
'\x00'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14443] Distutils test_bdist_rpm failure

2012-04-26 Thread Dave Malcolm

Dave Malcolm  added the comment:

__os_install_post is defined within /usr/lib/rpm/redhat/macros and contains 
this fragment:
/usr/lib/rpm/brp-python-bytecompile %{__python} 
%{?_python_bytecompile_errors_terminate_build} \

Hence it will use %{__python} as the default when byte-compiling.

%__python has the default definition of /usr/bin/python, but this can be 
overridden, either in the spec file using:
  %global __python some_path_to_the_python_to_use
or in the command-line invocation of rpmbuild:
  rpmbuild --define="__python some_path_to_the_python_to_use"

You can use the --showrc option to rpmbuild to see all of the macro expansions 
it's using (lots of output).

So if it is indeed using the wrong python executable to do the bytecompiling, 
the above ought to fix it.  The simplest fix would probably be for bdist_rpm to 
add:
  --define="__python %s" % sys.executable
to the rpmbuild invocation, I think.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14669] test_multiprocessing failure on OS X Tiger

2012-04-26 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

I can't work out what is wrong here.

The code does not to account for a partial read of the message from the socket. 
 The attached patch fixes that, but it does not address the cause of this 
failure.

--
keywords: +patch
Added file: http://bugs.python.org/file25372/partial_message.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14676] DeprecationWarning missing in default warning filters documentation

2012-04-26 Thread Peter Eisentraut

New submission from Peter Eisentraut :

DeprecationWarning was disabled by default in Python 2.7, but the documentation 
section "Default Warning Filters" does not list it as ignored.  In the 3.x 
branches, this was already fixed.  Trivial patch attached.

--
assignee: docs@python
components: Documentation
files: py27-default-warning-filters-doc.patch
keywords: patch
messages: 159398
nosy: docs@python, petere
priority: normal
severity: normal
status: open
title: DeprecationWarning missing in default warning filters documentation
versions: Python 2.7
Added file: 
http://bugs.python.org/file25373/py27-default-warning-filters-doc.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1065986] Fix pydoc crashing on unicode strings

2012-04-26 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14672] Windows installer: add desktop shortcut(s)

2012-04-26 Thread Daniel Swanson

Daniel Swanson  added the comment:

I am using windows and as I recall, it installed a desktop shortcut for me. but 
I could be wrong.

--
nosy: +weirdink13

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

> Using your patch, does the following throw an AssertionError?
Yes, it looks as though it will.  It seems I was too agressive, since 
errnomodule has different entries for EBADF and WSAEBADF.

This is the kind of feedback I'd like to have had earlier. It means that there 
are some cases were we want to keep the winsock error codes there separately 
from the others.  Annoying as that may be.

Brian, do I understand you correctly that 2010 is to the official compiler for 
3.3?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

Yes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Super, I must have missed that memo.  At PyCon there wasn't much enthusiasm for 
it, and this was considered a toy project :)

You may be interested in my patch to see what I did with the project files, 
then.  Otherwise, I'll be happy to review yours.  In particular, I removed a 
bunch of redundant settings, and fixed the .props files.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14677] Python 2.6 Printing Error

2012-04-26 Thread mesheb82

New submission from mesheb82 :

I’m running:
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on 
win32

I was testing out some print functionality and I made an error in typing (I 
meant to use %8.8f), but is this behavior intentional or is it an error?
>> print '%8.8s' %(101.)
>> '1000'


I would expect this to return a TypeError.

I also tested this on Python 2.4 and Python 2.5 on linux and had the same 
behavior.

Steve

--
components: IO
messages: 159403
nosy: mesheb82
priority: normal
severity: normal
status: open
title: Python 2.6 Printing Error
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14678] Update zipimport to support importlib.invalidate_caches()

2012-04-26 Thread Brett Cannon

New submission from Brett Cannon :

zipimport's finders that get cached in sys.path_importer_cache should probably 
be updated to support importlib.invalidate_caches() (else the module should get 
re-implemented in pure Python in importlib and then be tossed).

--
components: Library (Lib)
messages: 159404
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Update zipimport to support importlib.invalidate_caches()
type: behavior
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Fabian Groffen

Fabian Groffen  added the comment:

% echo "test" > /var/tmp/testfile
% python
Python 2.7.3 (default, Apr 26 2012, 19:06:37) 
[GCC 4.2.1 (Gentoo 4.2.1_p5666, Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.move("/var/tmp/testfile", "./testfile");
Traceback (most recent call last):
  File "", line 1, in 
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 299, in move
copy2(src, real_dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 129, in copy2
copystat(src, dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 45] Operation not supported: './testfile'
>>> 
% vi /Library/Gentoo/usr/lib/python2.7/shutil.py
% python
Python 2.7.3 (default, Apr 26 2012, 19:06:37) 
[GCC 4.2.1 (Gentoo 4.2.1_p5666, Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.move("/var/tmp/testfile", "./testfile");
45
Traceback (most recent call last):
  File "", line 1, in 
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 300, in move
copy2(src, real_dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 130, in copy2
copystat(src, dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 45] Operation not supported: './testfile'
>>> 
% grep 45 /usr/include/sys/errno.h
#define ENOTSUP 45  /* Operation not supported */

I tried with a FAT16 formatted USB-disk, but there it doesn't fail, so I did 
some further digging.  MS-DOS FS (under OSX) just seems to support setting 
flags (I tried with stat.UF_HIDDEN, Finder no longer displays the file).

NFS, however, does NOT support any chflags call.

% python
Python 2.7.3 (default, Apr 26 2012, 19:06:37) 
[GCC 4.2.1 (Gentoo 4.2.1_p5666, Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> print hasattr(errno, 'EOPNOTSUPP')
True
>>> print errno.EOPNOTSUPP
102
>>> 

102 obviously != 45

% grep 102 /usr/include/sys/errno.h
#define EOPNOTSUPP  102 /* Operation not supported on socket */

I believe Python got it mixed up here, we're looking for ENOTSUP, but that one 
doesn't exist, at least not here.

>>> print hasattr(errno, 'ENOTSUP')
False

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14678] Update zipimport to support importlib.invalidate_caches()

2012-04-26 Thread Éric Araujo

Éric Araujo  added the comment:

zipimport in Python sounds good to me.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Fabian Groffen

Fabian Groffen  added the comment:

it seems errnomodule.c has no idea of ENOTSUP, and that's not the only missing 
one.

OSX 10.7:
$ grep "^#define\sE" /usr/include/sys/errno.h | awk '{print $2}' | while read 
line ; do grep -q ${line} Modules/errnomodule.c || echo "missing: $line" ; done
missing: ENOTSUP
missing: EBADRPC
missing: ERPCMISMATCH
missing: EPROGUNAVAIL
missing: EPROGMISMATCH
missing: EPROCUNAVAIL
missing: EFTYPE
missing: EAUTH
missing: ENEEDAUTH
missing: EPWROFF
missing: EDEVERR
missing: EBADEXEC
missing: EBADARCH
missing: ESHLIBVERS
missing: EBADMACHO
missing: ECANCELED
missing: ENOATTR
missing: ENOPOLICY
missing: ENOTRECOVERABLE
missing: EOWNERDEAD
missing: ELAST

Solaris 10:
$ grep "^#define\sE" /usr/include/sys/errno.h | awk '{print $2}' | while read 
line ; do grep -q ${line} Modules/errnomodule.c || echo "missing: $line" ; done
missing: ECANCELED
missing: ENOTSUP
missing: EOWNERDEAD
missing: ENOTRECOVERABLE
missing: ELOCKUNMAPPED
missing: ENOTACTIVE

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


Added file: http://bugs.python.org/file25374/c7abfb4d4260.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10142] Support for SEEK_HOLE/SEEK_DATA

2012-04-26 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

New patch, after neolo...@free.fr review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14677] Python 2.6 Printing Error

2012-04-26 Thread Eric V. Smith

Eric V. Smith  added the comment:

The "s" causes the argument to be converted to a string, then the formatting is 
applied. So it's working as designed.

This is the logical equivalent of:
'%8.8s' % str(101.)

--
nosy: +eric.smith
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14678] Update zipimport to support importlib.invalidate_caches()

2012-04-26 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Somehow patch #2 doesn't show up in Rietveld. :-(

It's because it's a git-style diff, so it includes no base revision,
and it didn't apply cleanly to the default head (which is tried as
a fall-back in case of a missing base revision).

--
title: add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), 
os.*utimens*() expects a number of nanoseconds -> add st_*time_ns fileds to 
os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of 
nanoseconds

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> UTF-16 units are 16-bit words, not bytes, so '\ud' sounds correct to
> me. You resynchronize on the word boundary: the invalid word is skipped.

I agree. The only odd case is when the number of bytes is not even
(pun intended). In that case, anybody can guess which of the bytes is
extra. The most natural (IMO) assumption is that the data is truncated,
so it would be the last byte which is extra.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> For instance, the sxs patch and the errnomodule patch could go in now
> without disturbing anything whatsoever.

I'm not convinced that the errno change is actually correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Brian, do I understand you correctly that 2010 is to the official compiler 
> for 3.3?

Unless we switch to VS 2012, yes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-26 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
title: add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), 
os.*utimens*() expects a number of nanoseconds -> add st_*time_ns fields to 
os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of 
nanoseconds

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

I don't have a link handy, but from what I've read we could go from VS2010 to 
VS2012 with relative ease since it's supposed to be able to work with 2010 
solutions/project files. I haven't tried this with the beta, but I'll take a 
look.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

If the main motivation for this is that importlib can use it, I fail to see the 
point to make it cross-implementation. Other implementations of Python may not 
use byte code files at all, or use different byte code syntaxes, or not use the 
marshal module to load byte code. So the part of importlib that deals with 
cached .pyc files will be specific to CPython, anyway - why make it a 
cross-implementation attribute?

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-26 Thread Larry Hastings

Larry Hastings  added the comment:

FYI, Martin was replying to Guido's comment from more than a month ago, when I 
posted revision #2 of my first patch series.  By sheer coincidence  I posted 
revision #2 of a new patch series yesterday.  But Reitveld worked fine for that!

Anyway--no comments?  Normally I find the patch review process akin to getting 
pecked to death by ducks.  It's hard to believe this one might go in after only 
one revision.  Somebody pinch me!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the analysis.  Yes, it looks like there's a difference between OS X 
and current FreeBSDs, for example.  chflags(2) on the latter is documented as 
returning EOPNOTSUPP and on the former ENOTSUP. shutil should check for both.  
A quick search of the source tree did not find any other users of chflags in 
the standard library. As far as adding other missing errnos, that could be 
handled as a separate issue as it more of an enhancement.  Anyone interested in 
contributing a patch for either or both?

https://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man2/chflags.2.html

http://www.freebsd.org/cgi/man.cgi?query=chflags&apropos=0&sektion=2&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html

--
nosy: +ned.deily
stage:  -> needs patch
versions: +Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6818] remove/delete method for zipfile/tarfile objects

2012-04-26 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

I'm not sure I understand how http://bugs.python.org/review/6818/show works. 
I've looked all over and only found remarks for "zipfile.remove.patch" and not 
for "zipfile.remove.2.patch" which addressed all the aforementioned issues.

Also, I don't understand how to add myself to the CC of this issue's review 
page.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

I had this text ready before ned chimed in, I’ll post it anyway because it was 
a lot of work ;):

You're right, 2.7’s errnos are incomplete compared to 3.2. Antoine added 
ENOTSUP in c370866f30a7 and it runs as “Solaris-specific”.

So it’s currently in 3.2 and later. Shouldn’t hurt to back port it?

EOPNOTSUP is obviously wrong in your case and it doesn’t really sound right at 
all by the description. However, maybe on some other architecture (FreeBSD?) 
it’s the way to go? The commit (2e0d58adadbe) states it’s because of ZFS on OS 
X.

As the code is unchanged in 3.2+, this bug also applies to them.


Suggestion:

For 3.2+3.3: I’d extend the catch to also catch ENOTSUP
For 2.7: I’d also backport the err code.

NB I’m fine if Fabian wants to do it himself, it’s his issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Brian Curtin

Brian Curtin  added the comment:

VS11 opened the VS2010 project fine without doing conversion. Note that this 
just uses VS11 to work with the project in VS2010 mode with the 2010 compiler.

Doing the conversion to VS11's compiler is another thing to consider, although 
probably not until it goes RTM. I just ran the conversion from VS2010 to VS11 
and it just sets "PlatformToolset" to "v110" in all vcxproj files. It didn't 
compile cleanly, having 25 projects succeed and 4 fail, but it was more than 
enough to get python_d.exe to run. A few tests failed, but they're the same as 
the failures on VS2010, so we're not far off from VS11 easily working.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14679] Changes to html.parser break third-party code

2012-04-26 Thread Vinay Sajip

New submission from Vinay Sajip :

The change to html.parser.tagfind in ba4baaddac8d is causing third-party code 
(Django) to fail. See

http://mail.python.org/pipermail/python-dev/2012-April/119074.html

for more information.

Other patterns which changed (e.g. attrfind_tolerant) might also lead to 
problems. As suggested in the python-dev thread, private versions of these 
patterns should be used and the existing public ones deprecated, where 
appropriate.

--
keywords: 3.2regression
messages: 159421
nosy: ezio.melotti, vinay.sajip
priority: normal
severity: normal
status: open
title: Changes to html.parser break third-party code
type: behavior
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14679] Changes to html.parser break third-party code

2012-04-26 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Fabian Groffen

Fabian Groffen  added the comment:

I don't want to go through the paperwork nonsense just for a trivial patch, 
hence I didn't supply one, but instead provided all the information for you 
guys to make the correct fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Éric Araujo

Éric Araujo  added the comment:

Trivial patches don’t require paperwork; non-trivial patches require a simple 
contributor agreement (print, sign, scan, email).  We don’t like that either 
but it is required.  If you have any suggestion to make the process simpler, 
please share them on python-dev.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

MVL wrote:
> I'm not convinced that the errno change is actually correct.

You are right, as SBT pointed out.  There are cases where we have had 
errno.EFOO and errno.WSAEFOO point to different values, because one was used by 
sockets and other by regular stuff.  My patch was too heavy handed and nerfed 
at least EBADF.  Perhaps others.  (Getting a concrete example from SBT was 
helpful, btw)

For socket-specific errors, it is an easy choice, however, but for socket error 
codes that also have to do with file IO it is less clear and probably full of 
special cases.  This is nothing new, however.  For writing portable socket code 
that needs to deal with the EBADF code, you would have to check for WSAEBADF on 
windows and EBADF on linux.  Probably both to be portable.

Since my patch was aimed at making 3.3. merely compilable for VS2010 I wanted 
to maintain the same value semantics as were it compiled for 2008.  If we are 
changing the compiler version however, we might just as well take the plunge 
and translate the windows codes where they have corresponding posix codes.  I'm 
eager to see Brian's patch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Eric Snow

Eric Snow  added the comment:

Thanks for bringing this up, Martin.

sys.implementation is about having an implementation-specific location (hence 
sys) to consolidate explicit values concerning the implementation.  It's partly 
about clarifying the run-time distinction between Python-the-language and 
Python-the-implementation.

'name' and 'version' are the initial fields in sys.implementation because they 
are the most obvious choices, and a good starting point.  If sys.implementation 
were available now we'd use it in importlib.  That's what has motivated me to 
pursue this.

You are correct that we can hard-code "cpython" in the bootstrap code to 
generate the cache tag.  And perhaps that would be a better use of time.  We 
can't just use platform.python_implementation(), however, since the frozen 
importlib can only use builtin modules.

I expect you're right that some of the importlib code (particularly w.r.t. 
cached modules) is CPython-specific.  However, I'm sure Brett has tried to 
minimize that subset of the module.  Maybe he knows if the other 
implementations have plans for using importlib or how it affects them.  If not, 
I'll ask around.

Regardless, importlib is not the only motivator here.  Right now 
platform.python_implementation() has to guess the implementation name.  Having 
the different implementations specify the name explicitly in the sys module 
would be an improvement without a lot of work.  Nick Coghlan has indicated that 
it would be useful for the test suite.

Ultimately, sys.implementation would become the source for information about a 
specific Python implementation.  Others could expound the point better, but as 
time goes by this will be more important.  This current effort would get the 
ball rolling.  Consequent to the concerns so far, I'll try to get a PEP out in 
the next couple days.

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13210] Support Visual Studio 2010

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

[the Soney PS3 sdk also has weird error codes for its otherwise posix 
compatible api.  I did write a translation layer to convert those codes into 
posix codes where appropriate.  I could show you what I did, but I'd proably 
set me up to be lynched by Soney's lawyers.]

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11618] Locks broken wrt timeouts on Windows

2012-04-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

So, what do you think, should this go in?  Any qualms about the thread_nt_cv.h 
header?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11618] Locks broken wrt timeouts on Windows

2012-04-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So, what do you think, should this go in?  Any qualms about the 
> thread_nt_cv.h header?

On the principle it's ok, but I'd like to do a review before it goes
in :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14680] pydoc with -w option does not work for a lot of help topics

2012-04-26 Thread Gregor

New submission from Gregor :

pydoc with pydoc with -w option (to write html files) does not work for a lot 
of help topics (e.g. EXPRESSIONS, FORMATTING, TUPLELITERALS, def, if, else...)
If you look at the source you can see that when using the switch '-w' 
(http://hg.python.org/cpython/file/2.7/Lib/pydoc.py#l2311) pydoc uses the 
function writedoc, otherwise to the class Helper 
(http://hg.python.org/cpython/file/2.7/Lib/pydoc.py#l2325). In the Helper-class 
EXPRESSIONS is defined under line 1666 
(http://hg.python.org/cpython/file/2.7/Lib/pydoc.py#l1666). The function 
writedoc does not utilize this nor does it use the Helper class.

For dicussion see: http://stackoverflow.com/a/10333615/1318686

Example:
pydoc EXPRESSIONS 
works perfectly fine but 
pydoc -w EXPRESSIONS 
does not.

--
assignee: docs@python
components: Documentation
messages: 159428
nosy: docs@python, gregor.hoch
priority: normal
severity: normal
status: open
title: pydoc with -w option does not work for a lot of help topics
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14621] Hash function is not randomized properly

2012-04-26 Thread STINNER Victor

STINNER Victor  added the comment:

> One possible fix: ...
> Main loop looks like this: ..

Well, it was decided to not impact performances to workaround one specific 
class of attack, whereas there are many other ways to DoS Python. So we chose 
to keep the main loop unchanged. Randomizing the hash is not a fix for the hash 
DoS, it only makes the attacker harder.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14621] Hash function is not randomized properly

2012-04-26 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file25282/hash.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14621] Hash function is not randomized properly

2012-04-26 Thread STINNER Victor

STINNER Victor  added the comment:

Oops, I attached the wrong "hash.py" file.

--
Added file: http://bugs.python.org/file25375/hash.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11618] Locks broken wrt timeouts on Windows

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

-1. Choice of operating system must be a run-time decision, not a compile-time 
decision. We will have to support XP for quite some time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14621] Hash function is not randomized properly

2012-04-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

We should see if more security can be gained without sacrificing speed.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14621] Hash function is not randomized properly

2012-04-26 Thread STINNER Victor

STINNER Victor  added the comment:

> Problem with current randomization of hash function
> is following: Suffix does not influence whether two keys
> have some hash or not (it is xor-ed after everything).

Yes, the suffix is used to "protect" the secret. Without the suffix, it would 
be too simple to compute the prefix: getting a single hash value of a known 
string would leak the prefix.

> Suffix does not influence whether two keys have some hash
> or not (...). Everything except last 8 bits in prefix does
> not influence it also.

I don't know if we can do better and/or if it is a critical issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14673] add sys.implementation

2012-04-26 Thread Brett Cannon

Brett Cannon  added the comment:

So I'm w/ Antoine that a dict would be better so that the other VMs can add 
whatever they want into that object (e.g. Jython could specify what JVM they 
are running against) without causing confusion as to what some index means to 
each VM. The mutability of it is not important IMO.

As for the other implementations using importlib, they all plan to with 
(hopefully) no direct modification, but whether they support bytecode I don't 
know (I think Jython has talked about it, but who knows).

And pertaining to whether this is useful outside of importlib, I suspect it is. 
We already have 'jython' as an "OS" type to work around some differences. 
Adding this attribute would more clearly delineate when another VM is being 
used that might require working around some difference without overloading 
os.name (e.g. PyPy implementing something differently in their 1.7 release of 
Python 2.7 but is subsequently fixed in their 1.8 release).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14610] configure script hangs on pthread verification and PTHREAD_SCOPE_SYSTEM verification on Ubuntu

2012-04-26 Thread Raphael Cruzeiro

Raphael Cruzeiro  added the comment:

Yes, this code is hanging in my system. I'm posting the strace output.

If there's any other information that may be helpful I'll happily provide it.

--
Added file: http://bugs.python.org/file25376/pthread_strace.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14443] Distutils test_bdist_rpm failure

2012-04-26 Thread Nick Coghlan

Nick Coghlan  added the comment:

I tried the simple fix a couple of different ways on the RHEL6 buildbot. First 
by changing line 315 of Lib/distutils/command/bdist_rpm.py" to be:

rpm_cmd = ['rpmbuild', '--define', '__python %s' % sys.executable]

And then a second time by adding the new "--define" after the "-ba" option. 
(changing the spawn command to show the full command on error indicating the 
new arguments *were* being passed in, though)

Neither worked - I still got the same error. Since I'm seeing the same fault on 
my Fedora system, I'll start poking around there instead (not sure when I'll 
get to it though).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-26 Thread Q

Q  added the comment:

I do not mean to reopen the bug (there are supposedly much more important 
things to work on in Python). 

But just for the record, let me state that I feel like there is some misleading 
inconsistency here:

- by definition, a new style class is "Any class which inherits from object" ( 
see http://docs.python.org/glossary.html#term-new-style-class ) ;

- to support this statement, new classes are indeed explicitly defined in the 
form "NewClass(object)" ;

- now isinstance(), that is supposed to "return whether an object is an 
instance of a class or of a subclass thereof" (see help(isinstance)), returns 
True for old-style objects.

It also seems reasonable if the descendants of a class will inherit its powers, 
which -- in the case of the old-style classes -- they obviously don't.

Furthermore, I personally see no /point/ in returning True for 
isinstance(Old(), object): as it is quite misleading, one could easily have 
made it returning e.g. None as well.

As I completely accept the fact it's a feature -- ( may be slightly confusing, 
and probably also useless -- but ... hey, nobody's perfect ) -- should I take 
then calling

issubclass(obj.__class__, object) 

to be the official way to distinguish between the new-style and the old-style 
classes?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2012/4/26 Q :
> issubclass(obj.__class__, object)
>
> to be the official way to distinguish between the new-style and the old-style 
> classes?

Just do type(cls) is types.ClassType.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-04-26 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14339] Optimizing bin, oct and hex

2012-04-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Serhiy: what's the status of your contributor form? Note that you can also fax 
it, or scan it and send it by email.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com