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

2011-09-02 Thread Wong Wah Meng

Wong Wah Meng  added the comment:

Hi there, thanks for the reply. 

I need a bit more clue on what else I can do, other than I have these 3 items 
in my checklist:-

1.) I will have HP-UX ANSI C/C++ Compiler soon. I can recompile using that 
compiler later if this is a gcc related thing.
2.) If I am not using my python to perform any SSL user authentication 
function, can I skip correcting this? 
3.) I am still checking with my Unix admin on the OpenSSL Header and version 
thing. Will revert.

--

___
Python tracker 

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



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

2011-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The setup.py script does not look correct when openssl is not installed:
the _sha256 and _sha512 modules are compiled under this condition::
if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:

By comparison, the _md5 module adds the condition: "or not have_usable_openssl"

--

___
Python tracker 

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



[issue12861] PyOS_Readline uses single lock

2011-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Well, readline is supposed to be used with a console, and there is only one 
usually.  Why would you want to use readline from multiple threads?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue12878] io.StringIO doesn't provide a __dict__ field

2011-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Actually it already fails with 3.1 (I tried "hg up v3.1")
Then I played with "hg bisect", and unsurprisingly it answered:

Traceback (most recent call last):
  File "", line 1, in 
AttributeError: '_io.StringIO' object has no attribute '__dict__'
Changeset 51991:3049ac17e256: bad
The first bad revision is:
changeset:   51991:3049ac17e256
user:Benjamin Peterson 
date:Wed Mar 04 00:14:51 2009 +
summary: merge the io-c branch: C implementation of the io module

--

___
Python tracker 

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



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

2011-09-02 Thread STINNER Victor

STINNER Victor  added the comment:

>> It builds correctly with -pthread or -lpthread, but it fails to build 
>> without these options.
>>
>
> Not on Linux: this is specific to OpenBSD.

Oh, I forgot to specify: yes, I tested on OpenBSD (5.0).

>> sched_get_priority_max() and sched_get_priority_min() come from libpthread 
>> on OpenBSD, whereas Python only checks for "#ifdef HAVE_SCHED_H".
>>
>
> That's exactly what I said in my previous message ;-)
> I'll post a patch later.

Yep, it's just that I have the confirmation with my tests.

--
title: Disable sched_get_priority_min/max if Python is compiled without threads 
-> Disable sched_get_priority_min/max if Python is compiled without threads

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

> I think this is adding excessive complexity.

It really depends on how many incompatible features there are, and how 
difficult it is to turn them on/off.

> I think it is reasonable to pick a *set* of features as a whole

It's probably more practical, but otherwise I'm not sure why you would want to 
activate 2-5 unrelated features that might require you to rewrite your regex 
(assuming you are aware of what the features are, what are their side effects, 
how to fix your regex) just because you need one.

The idea is to make the transition smoother and not having a pre-regex world 
and an incompatible post-regex world, divided by a single flag.

> If you don't want a feature, don't use it.

With only one flag you are forced to enable all the new features, including the 
ones you don't want.

> "Feature flags" leads to a combinational explosion that makes
> comprehensive testing all but impossible.

We already have several flags and the tests are working fine.  If the features 
are orthogonal they can be tested independently.

> The alternative is hard to track down bugs:
> "this regular expression returns the wrong result, but only if you
> have flags A, B and G turned on and C and F turned off."

What about: "X works, Y works, and X|Y works, but when I use NEW flag to enable 
an inline flag X|Y stops to work while X and Y keep working" (hint: the NEW 
also enabled nested set -- see msg14).

I'm not saying that having multiple flag is the best solution (or even a viable 
one), but it should be considered depending on how many incompatible features 
there are and what they are.

--

___
Python tracker 

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



[issue11879] TarFile.chown: should use TarInfo.uid if user lookup fails

2011-09-02 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

Issue #12841 is a duplicate of this one, but I give it precedence because it 
comes with a working patch.

--
resolution:  -> duplicate
status: open -> closed
versions: +Python 2.7, Python 3.3

___
Python tracker 

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



[issue12841] Incorrect tarfile.py extraction

2011-09-02 Thread Lars Gustäbel

Changes by Lars Gustäbel :


--
versions: +Python 2.7, Python 3.3

___
Python tracker 

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



[issue12883] xml.sax.xmlreader.AttributesImpl allows empty string as attribute names

2011-09-02 Thread Michael Sulyaev

New submission from Michael Sulyaev :

I can get not-well-formed XML output (attribute name must not be empty string):




AttributeImpl must ignore dict entries that may not be cast to valid XML 
attributes.

Code:

#!/usr/bin/python

from xml.sax.xmlreader import AttributesImpl as Attrs
from xml.sax.saxutils import XMLGenerator as Gen

g = Gen()
a = Attrs(dict([('k1','v1'),('','v_for_empty_name')]))
g.startDocument()
g.startElement('root',a)
g.endElement('root')
g.endDocument()
print

--
components: XML
messages: 143391
nosy: Michael.Sulyaev
priority: normal
severity: normal
status: open
title: xml.sax.xmlreader.AttributesImpl allows empty string as attribute names
type: behavior
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



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

2011-09-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

> To start with, no code point which when bitwise added with 0xFFFE 
> returns 0xFFFE can never appear in a valid UTF-* stream, but Python
> allow this without any error.

> That means that both 0xNN_FFFE and 0xNN_ are illegal in all 
> planes, where NN is 00 through 10 in hex.  So that's 2 noncharacters
> times 17 planes = 34 code points illegal for interchange that Python 
> is passing through illegally.  

> The remaining 32 nonsurrogate code points illegal for open interchange
> are 0xFDD0 through 0xFDEF.  Those are not allowed either, but Python
> doesn't seem to care.

It's not entirely clear to me what the UTF-8 codec is supposed to do with this.

For example U+FFFE is  in UTF-8, and this is valid according to table 
3-7, Chapter 03[0]:
"""
Code points 1st byte  2nd byte  3rd byte
U+E000..U+  EE..EF80..BF80..BF
"""

Chapter 16, section 16.7 "Noncharacters" says[1]:
"""
Noncharacters are code points that are permanently reserved in the Unicode 
Standard for internal use. They are forbidden for use in open interchange of 
Unicode text data.
"""

and
"""
Applications are free to use any of these noncharacter code points internally 
but should never attempt to exchange them.
"""
seem to suggest that encoding them is forbidden.


"""
If a noncharacter is received in open interchange, an application is not 
required to interpret it in any way. It is good practice, however, to recognize 
it as a noncharacter and to take appropriate action, such as replacing it with 
U+FFFD replacement character, to indicate the problem in the text. It is not 
recommended to simply delete noncharacter code points from such text, because 
of the potential security issues caused by deleting uninterpreted characters.
"""
here decoding seems allowed, possibly with a replacement (that would depend on 
the error handler used though, so the default 'strict' would turn this in an 
error).


Chapter 03, after D14, says:
"""
In general, a conforming process may indicate the presence of a code point 
whose use has not been designated (for example, by showing a missing glyph in 
rendering or by signaling an appropriate error in a streaming protocol), even 
though it is forbidden by the standard from interpreting that code point as an 
abstract character.
"""

and in C7:
"""
If a noncharacter that does not have a specific internal use is unexpectedly 
encountered in processing, an implementation may signal an error or replace the 
noncharacter with U+FFFD replacement character. If the implementation chooses 
to replace, delete or ignore a noncharacter, such an action constitutes a 
modification in the interpretation of the text. In general, a noncharacter 
should be treated as an unassigned code point.
"""

This doesn't mention clearly what the codec is supposed to do.
On one hand, it suggests that an error can be raised, i.e. consider the 
noncharacter invalid like out-of-range codepoints (>U+10) or lone 
surrogates. 
On the other hand it says that they should be treated as an unassigned code 
point, i.e. encoded/decoded normally, and doesn't list them as invalid in table 
3-7.


[0]: http://www.unicode.org/versions/Unicode6.0.0/ch03.pdf
[1]: http://www.unicode.org/versions/Unicode6.0.0/ch16.pdf

--

___
Python tracker 

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



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

2011-09-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> And this command now works:
> 
> $ ./python -c 'import os; print(os.fdlistdir(os.open("/tmp", os.O_RDONLY)))'
> ['.X11-unix', '.ICE-unix', 'orbit-remi', '.X0-lock', 'dbus-WWfX2JhDtb']
> 
> Attached file patch-Modules_posixmodule_c is the patch to do this.

Thank you.
It would be nice if you could find out in which header file fdopendir()
is defined. A recursive grep in /usr/include (?) should do the trick, I
think.

--

___
Python tracker 

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



[issue12841] Incorrect tarfile.py extraction

2011-09-02 Thread Doug Hellmann

Changes by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue12861] PyOS_Readline uses single lock

2011-09-02 Thread Albert Zeyer

Albert Zeyer  added the comment:

You might have opened several via `openpty`.

I am doing that here: https://github.com/albertz/PyTerminal

--

___
Python tracker 

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



[issue12882] mmap crash on Windows

2011-09-02 Thread sbt

sbt  added the comment:

You are not doing anything to stop the file object being garbage collected (and 
therefore closed) before the mmap is created.  Try

import os
import mmap
f = open(,"r+")
size = os.path.getsize())
data = mmap.mmap(f.fileno(), size)

--
nosy: +sbt

___
Python tracker 

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



[issue12882] mmap crash on Windows

2011-09-02 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



[issue12884] Re

2011-09-02 Thread VUIUI

Changes by VUIUI :


--
files: unnamed
nosy: VUIUI
priority: normal
severity: normal
status: open
title: Re
Added file: http://bugs.python.org/file23087/unnamed

___
Python tracker 

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



[issue12884] Re

2011-09-02 Thread VUIUI

New submission from VUIUI :

Botay

--

___
Python tracker 

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



[issue12882] mmap crash on Windows

2011-09-02 Thread VUIUI

VUIUI  added the comment:

Botay

--
nosy: +VUIUI

___
Python tracker 

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



[issue12884] Re

2011-09-02 Thread VUIUI

VUIUI  added the comment:

hj

--
components: +2to3 (2.x to 3.0 conversion tool)
resolution:  -> fixed
type:  -> crash
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



[issue12882] mmap crash on Windows

2011-09-02 Thread Charles-François Natali

Changes by Charles-François Natali :


--
Removed message: http://bugs.python.org/msg143397

___
Python tracker 

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



[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2011-09-02 Thread Alexander Dutton

New submission from Alexander Dutton :

If there are any broken symlinks in the same directory as a setup.py when e.g. 
sdist is run, findall() will fall over when attempting to os.stat() the symlink:

Traceback (most recent call last):
  File "setup.py", line 81, in run
_sdist.run(self)
  File "/usr/lib/python2.6/distutils/command/sdist.py", line 144, in run
self.get_file_list()
  File "/usr/lib/python2.6/distutils/command/sdist.py", line 238, in 
get_file_list
self.filelist.findall()
  File "/usr/lib/python2.6/distutils/filelist.py", line 47, in findall
self.allfiles = findall(dir)
  File "/usr/lib/python2.6/distutils/filelist.py", line 297, in findall
stat = os.stat(fullname)
OSError: [Errno 2] No such file or directory: 
'debian/tmp/usr/share/somepath/somesymlink'

Solutions would include replacing the call to os.stat() with one to os.lstat() 
(probably backwards-incompatible), or trying one and then the other.

This bug is present in Pythons 2.6.6 (Debian 6.0.2) and 2.7 (Fedora 14).

When attempting to reproduce in Python 3.1.2 (on Fedora) no error was 
encountered. However, looking at distutils/filelist.py, the same unadulterated 
call to os.stat() is present. I'll presume that for whatever reason distutils 
in Py3.1.2 never has cause to stat my broken symlink.

--
assignee: tarek
components: Distutils
messages: 143399
nosy: Alexander.Dutton, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils.filelist.findall() fails on broken symlink in Py2.x
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1

___
Python tracker 

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



[issue12884] Re

2011-09-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components:  -2to3 (2.x to 3.0 conversion tool)
resolution: fixed -> invalid
stage:  -> committed/rejected
status: open -> closed
type: crash -> 
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



[issue12886] datetime.strptime parses input wrong

2011-09-02 Thread Heiðar Rafn Harðarson

New submission from Heiðar Rafn Harðarson :

When using datetime.strptime or time.strptime to parse string representing 
timestamp with the format string '%Y%m%dT%H%M%S' then a strange behavior 
happens when the input string does not contain the seconds: the minute part is 
split and first digit used as minutes and second digit as seconds !

According to documentation %M shall contain Minute as a decimal number [00,59] 
and %S shall contain Second as a decimal number [00,61]

Here are few examples to show this:
--
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime('20110817T1234','%Y%m%dT%H%M%S')
datetime.datetime(2011, 8, 17, 12, 3, 4)
=>ERROR no seconds in input string: minute=3, second=4
=>I would expect exception ValueError or datetime.datetime(2011, 8, 17, 12, 34, 
00)

>>> datetime.datetime.strptime('20110817T123456','%Y%m%dT%H%M%S')
datetime.datetime(2011, 8, 17, 12, 34, 56)
=>CORRECT

>>> datetime.datetime.strptime('20110817T123456','%Y%m%dT%H%M')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/_strptime.py", line 328, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: 56
=>CORRECT

>>> datetime.datetime.strptime('20110817T1234','%Y%m%dT%H%M')
datetime.datetime(2011, 8, 17, 12, 34)
=> CORRECT

--
I have tested this with python 2.6 and 2.7
This also happens on when playing with %H%M format string and omit minutes from 
the input.

--
components: Library (Lib)
messages: 143400
nosy: heidar.rafn
priority: normal
severity: normal
status: open
title: datetime.strptime parses input wrong
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue12886] datetime.strptime parses input wrong

2011-09-02 Thread STINNER Victor

STINNER Victor  added the comment:

> ERROR no seconds in input string: minute=3, second=4

If you specificy "%S" in the format string, strptime() *requires* seconds. If 
seconds are optional in your format, you should call strptime() twice: first 
without '%S', then with '%S' if the first failed.

I don't consider your examples as bugs.

--
nosy: +haypo

___
Python tracker 

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



[issue12886] datetime.strptime parses input wrong

2011-09-02 Thread STINNER Victor

STINNER Victor  added the comment:

Example:
---
import datetime

def test(text):
try:
d = datetime.datetime.strptime(text, '%Y%m%dT%H%M')
except ValueError:
pass
else:
print("%s without seconds => %s" % (text, d))
return
d = datetime.datetime.strptime(text, '%Y%m%dT%H%M%S')
print("%s with seconds => %s" % (text, d))

test('20110817T1234')
test('20110817T12345')
test('20110817T123456')
---

Output:

20110817T1234 without seconds => 2011-08-17 12:34:00
20110817T12345 with seconds => 2011-08-17 12:34:05
20110817T123456 with seconds => 2011-08-17 12:34:56

--

___
Python tracker 

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



[issue12117] Failures with PYTHONDONTWRITEBYTECODE: test_importlib, test_imp, test_distutils, test_packaging, test_runpy, test_import

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

Is this still relevant?

--

___
Python tracker 

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



[issue10454] Clarify compileall command-line options

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 755a57f987ca by Éric Araujo in branch '3.2':
#10454: a few edits to compileall help messages
http://hg.python.org/cpython/rev/755a57f987ca

New changeset 892e0ee4ca32 by Éric Araujo in branch 'default':
Merge doc changes from 3.2 (#10454, #12298)
http://hg.python.org/cpython/rev/892e0ee4ca32

--
nosy: +python-dev

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7a05cb3beddf by Éric Araujo in branch '3.2':
Fix a few links in the table of built-in functions (#12298)
http://hg.python.org/cpython/rev/7a05cb3beddf

New changeset 58dd7addef3a by Éric Araujo in branch '3.2':
Add links from library/functions to other docs.
http://hg.python.org/cpython/rev/58dd7addef3a

--
nosy: +python-dev

___
Python tracker 

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



[issue10454] Clarify compileall command-line options

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4ae85348e3e8 by Éric Araujo in branch '2.7':
Clarify compileall command-line options (#10454).
http://hg.python.org/cpython/rev/4ae85348e3e8

--

___
Python tracker 

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



[issue10191] scripts files are not RECORDed.

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

I have added tests for scripts in RECORD and they pass.  Closing, please reopen 
if you can reproduce the bug.

--
resolution:  -> invalid
stage:  -> 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



[issue12882] mmap crash on Windows

2011-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Is it a crash, or do you get a exception with a nice message?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue8754] quote bad module name in ImportError-like messages

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

Victor changed ImportError some time ago for #3080, so my patch now only 
touches a few stdlib modules.

--
components: +Library (Lib) -Interpreter Core
title: ImportError: quote bad module name in message -> quote bad module name 
in ImportError-like messages
Added file: http://bugs.python.org/file23088/import-repr-lib.diff

___
Python tracker 

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



[issue12840] "maintainer" value clear the "author" value when register

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

This was already explained in #962772.

--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
superseder:  -> when both maintainer and author provided, author discarded

___
Python tracker 

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



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

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

I have added 'chown' in shutil.__all__.

--

___
Python tracker 

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



[issue12884] Re

2011-09-02 Thread Éric Araujo

Changes by Éric Araujo :


Removed file: http://bugs.python.org/file23087/unnamed

___
Python tracker 

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



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

2011-09-02 Thread Bill Janssen

Bill Janssen  added the comment:

I'll take a look at this next week, when I'm more on-line again.

Bill

2011/8/25 Charles-François Natali :
>
> Charles-François Natali  added the comment:
>
>> The OS X buildbots show some failures:
>
> It seems to fail consistently on every OS X version.
> I've had another look both at the code and the test, and couldn't find 
> anything wrong with it.
> Since there are a number of known bugs pertaining to FD passing on OS X - 
> even on recent versions - I'd suggest to skip those tests on this platform.
> As for sendto/sendmsg not being interrupted by the signal, I'd be curious to 
> see if running test_socket alone solves the problem (just to make sure no 
> other thread is running, which might receive the signal).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

Symlinks are barely supported by distutils; the only mention you can find in 
the doc is that the MANIFEST file can contain symlinks.  In the light of that, 
one could argue that broken symlinks are not supported nor ignored, and that 
you just should not have them.  Is there a valid use case for having broken 
symlinks in a Python project?

(About versions: I’m removing 2.6 which only gets security fixes, and adding 
3.x to add regression tests to them, even if the bug isn’t there now.)

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

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

> I agree that all table entries should link to the entry in the same file.
This is fixed in 3.2 and 3.3, with a bit of reST kludgery.  I’ll backport to 
2.7 if there is no negative feedback.

> range() definitely needs a forward reference to 4.6 sequence types 
> bool() lacks forward references; it could have one to 4.2 Bool ops and 4.11.9 
> Bool values
I have added links in a subsequent commit.

> object() -- no where to go.
> type(n,b,d) has no forward references as there is no where to go exactly
I think this deserves another report.

> slice() only has a reference to the glossary; it has no entry in Ch.4. "Slice 
> objects have
> read-only data attributes start, stop and step which merely return the 
> argument values (or
> their default). They have no other explicit functionality" is slightly wrong 
> since there
> is the .indices method.
Ditto.

--

___
Python tracker 

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



[issue12862] ConfigParser does not implement "comments need to be preceded by a whitespace character" correctly

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

(Adding 3.x versions because we’ll want to add tests to them.)

--
nosy: +eric.araujo, lukasz.langa
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



[issue12860] http client attempts to send a readable object twice

2011-09-02 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +orsenthil

___
Python tracker 

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



[issue12863] py32 > Lib > xml.minidom > usage feedback > overrides

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

For general discussion or questions about usage, you are welcome to use mailing 
lists such as python-list and xml-sig.  This tracker is dedicated to bug 
reports and feature requests, and unless I’m misreading your report contains 
neither, so I’m closing it.  Have fun with Python and XML!

--
nosy: +eric.araujo
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
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



[issue12864] 2to3 creates illegal code on import a.b inside a package

2011-09-02 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +benjamin.peterson
stage:  -> needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue12866] Want to submit our Audioop.c patch for 24bit audio

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

Welcome and thanks for your contribution!  If I understand correctly, support 
for 24-bit files would be a new feature for audioop, so our development policy 
excludes 2.7, a stable release which only gets bug fixes.  If you would like to 
turn your code into a patch (see guidelines in the devguide), it could be 
considered for inclusion in the next version.

If you think your improvements would be useful for 2.7 users, you could rename 
your module to audioop2 and publish it on PyPI (pay attention to proper 
attribution and licensing).

Feel free to ask any question! :)

--
nosy: +eric.araujo
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue12873] 2to3 incorrectly handles multi-line imports from __future__

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

I don’t understand what the bug is.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12875] backport re.compile flags default value documentation

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

+1 to backporting [flags=0].

--
nosy: +eric.araujo

___
Python tracker 

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



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

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

> 1.) I will have HP-UX ANSI C/C++ Compiler soon. I can recompile using
> that compiler later if this is a gcc related thing.
On the contrary, Gregory said that gcc should work (it’s what most of us use, I 
think).

> 2.) If I am not using my python to perform any SSL user authentication 
> function,
> can I skip correcting this?
This bug is about hashlib (http://docs.python.org/2.7/library/hashlib), a 
module providing checksum functions.  It is not related to SSL, but merely uses 
code from the OpenSSL project.


> The setup.py script does not look correct when openssl is not installed:
The full openssl or only headers?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue4153] Unicode HOWTO up to date?

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

> something about Unicode supports in the re module (this probably can
> wait after the 'regex' inclusion).
I’d prefer documentation for the re module now.

--

___
Python tracker 

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



[issue4153] Unicode HOWTO up to date?

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

> it also removes the usage of 'byte string'.
I see you’ve replaced it with “byte object”.  I’m -0, as “byte[s] string” is 
not ambiguous IMO.

--

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2011-09-02 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Documentation -Library (Lib), Unicode
keywords: +easy
stage: test needed -> needs patch
versions: +Python 2.7 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Matthew Barnett

Matthew Barnett  added the comment:

The least disruptive change would be to have a NEW flag for the new behaviour, 
as at present, and an OLD flag for the old behaviour.

Currently the default is old behaviour, but in the future it will be new 
behaviour.

The differences would be:

Old behaviour   : New behaviour
- -
Global inline flags : Positional inline flags
Can't split on zero-width match : Can split on zero-width match
Simple sets : Nested sets and set operations

The only change would be that nested sets wouldn't be supported in the old 
behaviour.

There are also additional escape sequences, eg \X is no longer treated as "X", 
but as they look like escape sequences you really shouldn't be relying on that. 
(It's similar to writing Windows paths in non-raw string literals: "\T" == 
"\\T", but "\t" == chr(9).)

--

___
Python tracker 

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



[issue4256] argparse: provide a simple way to get a programmatically useful list of options

2011-09-02 Thread Éric Araujo

Changes by Éric Araujo :


--
title: optparse/argparse: provide a simple way to get a programmatically useful 
list of options -> argparse: provide a simple way to get a programmatically 
useful list of options
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



[issue4153] Unicode HOWTO up to date?

2011-09-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

There was some discussion a while ago on python-dev about it.  AFAIR the 
outcome was that using "bytes *strings*" should be avoided because bytes are 
bytes, and not strings (until they get decoded at least).  Using 'string' for 
both might lead people to think that there are two kinds of strings, bytes and 
Unicode (like in python 2) while they should think that there are only Unicode 
strings and they can be converted to a bytes object (or simply to 'bytes').

--

___
Python tracker 

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



[issue12873] 2to3 incorrectly handles multi-line imports from __future__

2011-09-02 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

If import from __future__ is written in multiple lines, then a parser 
internally used by 2to3 recognizes only the first line. (However Python 
interpreter properly supports multi-line imports from __future__.)

test1.py contains multi-line import from __future__.
test2.py contains single-line import from __future__.
2to3 properly handles test2.py and improperly handles test1.py.

--

___
Python tracker 

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



[issue4153] Unicode HOWTO up to date?

2011-09-02 Thread Éric Araujo

Éric Araujo  added the comment:

Ah, I see: you’re equating “string” with “text string” or “character string”, 
whereas I read “bytes string” as “finite sequence of bytes”.  With this 
definition, there *are* two string types in Python 3, it’s just that they’re 
much more divorced than in 2.x.

> they should think that there are only Unicode strings
I’d say they should think that text processing should only happen with the one 
type dedicated to text, i.e. str.

> they can be converted to a bytes object (or simply to 'bytes')
Okay, +0 to use only “bytes object” (or “bytes” when it sounds better).

--

___
Python tracker 

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



[issue12781] Mention SO_REUSEADDR near socket doc examples

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fe60689d6a2e by Sandro Tosi in branch '2.7':
#12781: Mention SO_REUSEADDR flag near socket examples
http://hg.python.org/cpython/rev/fe60689d6a2e

New changeset c4588cd2d59a by Sandro Tosi in branch '3.2':
#12781: Mention SO_REUSEADDR flag near socket examples
http://hg.python.org/cpython/rev/c4588cd2d59a

New changeset eb9a9a043f13 by Sandro Tosi in branch 'default':
#12781: merge with 3.2
http://hg.python.org/cpython/rev/eb9a9a043f13

--
nosy: +python-dev

___
Python tracker 

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



[issue12781] Mention SO_REUSEADDR near socket doc examples

2011-09-02 Thread Sandro Tosi

Changes by Sandro Tosi :


--
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



[issue12887] Documenting all SO_* constants in socket module

2011-09-02 Thread Sandro Tosi

New submission from Sandro Tosi :

spinning off msg142613 - it would be interesting to have in the socket module 
documentation also an explanation of all the several SO_ flags available; even 
a compact table could be ok; or even a link to a remote reference for them.

--
assignee: docs@python
components: Documentation
messages: 143428
nosy: docs@python, eric.araujo, ezio.melotti, sandro.tosi
priority: normal
severity: normal
stage: needs patch
status: open
title: Documenting all SO_* constants in socket module
versions: Python 2.7, 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



[issue12873] 2to3 incorrectly handles multi-line imports from __future__

2011-09-02 Thread Sebastian Wiesner

Sebastian Wiesner  added the comment:

More precisely, the bug is, that 2to3 refactors the "print()" invocation in 
"test1.py" though it shouldn't because a "print_function" future import is 
present at the beginning of "test1.py".  The cross-check with "test2.py" shows 
that this is due to the multi-line future import in "test1.py" because the 
line-break in the import statement is the only difference between both files.

--

___
Python tracker 

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



[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b8acee08283c by Amaury Forgeot d'Arc in branch '3.2':
Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
http://hg.python.org/cpython/rev/b8acee08283c

New changeset 1ed1ea0f4cd8 by Amaury Forgeot d'Arc in branch 'default':
Merge from 3.2: Issue #12764: Fix a crash in ctypes when the name of a
http://hg.python.org/cpython/rev/1ed1ea0f4cd8

--
nosy: +python-dev

___
Python tracker 

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



[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 73827c23cdde by Amaury Forgeot d'Arc in branch '2.7':
Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
http://hg.python.org/cpython/rev/73827c23cdde

--

___
Python tracker 

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



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

2011-09-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Ezio, that is a lot of nice work to track down those pieces of the standard. I 
think the operative phrase in many of those quotes is 'open interchange'. 
Codecs are also used for private storage. If I use the unassigned or 
private-use code points in a private project, I would use utf-8 to save the 
work between active sessions. That is quite fine under the standard. But I 
should not put files with such codings on the net for 'open interchange'. And 
if I receive them, the one thing I should not do is interpret them as 
meaningful abstract characters.

So the codec should allow for both public and private use. I have the 
impression that is does so now. A Python programmer should know whether the 
codec is being used for private (or local group) files or random stuff from the 
net, and therefore, what the appropriate error handling is. If they do not now, 
the docs could suggest that public text should normally be decoded with 
'strict' or 'replace' and that 'ignore' should normally be reserved for local 
text that is known to intentionally have 'errors'.

I am pretty sure that the intent of prohibiting non-standard interpretation of 
code points as abstract characters is to prevent 'organic' evolution of the 
code point -- abstract character mapping in which anyone (or any company) who 
wants to do so creates a new pairing and promotes its wide recognition around 
the world. Conforming implementations are strict in both what they produce 
(publicly) *and* in what they accept (from public sources). Many now think that 
liberal acceptance of sloppy html promoted sloppy production of html.

--

___
Python tracker 

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



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

2011-09-02 Thread Guido van Rossum

Guido van Rossum  added the comment:

> So the codec should allow for both public and private use.

IIUC we have (or are planning) codecs that support the private use.
They are not called "utf-8" though.

--

___
Python tracker 

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



[issue12888] html.parser.HTMLParser.unescape works only with the first 128 entities

2011-09-02 Thread Yves Dorfsman

New submission from Yves Dorfsman :

html.parser.HTMLParser.unescape works only with the first 128 entities, it 
leaves the other ones as they are.

--
components: None
messages: 143434
nosy: y...@zioup.com
priority: normal
severity: normal
status: open
title: html.parser.HTMLParser.unescape works only with the first 128 entities
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



[issue12117] Failures with PYTHONDONTWRITEBYTECODE: test_importlib, test_imp, test_distutils, test_packaging, test_runpy, test_import

2011-09-02 Thread Brett Cannon

Brett Cannon  added the comment:

Unless someone cares enough to decorate the tests that should not write the 
bytecode (I think I have one such decorator in the importlib tests, but I think 
it is more for other VMs than for this situation) then I wouldn't worry about 
this.

--

___
Python tracker 

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



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

2011-09-02 Thread Remi Pointel

Remi Pointel  added the comment:

> It would be nice if you could find out in which header file fdopendir() is 
> defined.

Hi,

fdopendir() is in /usr/include/dirent.h:

#if __POSIX_VISIBLE >= 200809
DIR *fdopendir(int);
#endif

You could find the file dirent.h here: 
http://www.openbsd.org/cgi-bin/cvsweb/src/include/dirent.h.

Thanks,

Remi.

--

___
Python tracker 

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



[issue12862] ConfigParser does not implement "comments need to be preceded by a whitespace character" correctly

2011-09-02 Thread Łukasz Langa

Łukasz Langa  added the comment:

Daniel, thank you for your report. Indeed, 3.2+ has an updated configparser 
where we turned off support for inline comments (e.g. comments after option 
values). This was decided after we discovered how inconsistent it is. Your 
report shows this decision was the right one.

As for 2.7 unfortunately it's long in maintenance mode now so no functional 
changes are possible.

I've prepared a backport of the 3.2+ configparser for 2.6+. It is available on 
PyPI: http://pypi.python.org/pypi/configparser. Have a look, might solve your 
problem (and quite a bunch of others I suppose).

Éric, the docs clearly state that currently only full-line comments are enabled 
by default.

--
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed
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



[issue12881] ctypes: segfault with large structure field names

2011-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Certainly the effect of some "alloca" call with a large value, then the stack 
overflows.

--

___
Python tracker 

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



[issue12850] [PATCH] stm.atomic

2011-09-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Semi-seriously, _PyEval_ForArminRigoOnly_
/* This function does whatever Armin Rigo wants it to do.
He may change it at any time. Do not use it. */

This would let you experiment with the boundary as you will (with review, of 
course) and relieve us of any obligation to anyone else who uses it.

CPython got the Don Beaudry metaclass hook sometime before 1.5. (I have no idea 
of its internal name or implementation.) It was also used, at his own risk, by 
Jim Fulton. Much later, in 2.2, it because the basis for new-style classes, 
which are now simply Python 3 classes.
http://www.python.org/doc/essays/metaclasses/

--
nosy: +terry.reedy

___
Python tracker 

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



[issue12844] Support more than 255 arguments

2011-09-02 Thread Andreas Stührk

Andreas Stührk  added the comment:

Attached is a patch that removes the limit and that allows passing an arbitrary 
number of positional and keyword arguments. Lacks tests for now.

--
keywords: +patch
nosy: +Trundle
Added file: http://bugs.python.org/file23089/issue12844_arbitrary_arguments.diff

___
Python tracker 

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



[issue12881] ctypes: segfault with large structure field names

2011-09-02 Thread Meador Inge

Meador Inge  added the comment:

On Fri, Sep 2, 2011 at 4:26 PM, Amaury Forgeot d'Arc
 wrote:
>
> Amaury Forgeot d'Arc  added the comment:
>
> Certainly the effect of some "alloca" call with a large value, then the stack 
> overflows.

Yeah, I noticed that too.  I was actually pretty surprised to see
"alloca" in there :-)

--

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Vlastimil Brom

Vlastimil Brom  added the comment:

I'd agree with Steven ( msg143377 ) and others, that there probably shouldn't 
be a large library-specific set of new tags just for "housekeeping" purposes 
between re and regex. I would personally prefer, that these tags also be 
settable in the pattern (?...), which would probably be problematic with 
versioned flags.

Although I am trying to take advantage of the new additions, if applicable, I 
agree, that there should be a possibility to use regex in an unreflected way 
with the same behaviour like re (maybe except for the fixes of what will be 
agreed on to be a bug (enough)).
On the other hand, it seems to me, that the enhancements/additions can be 
enabled at once, as an user upgrading the regexes for the new library 
consciously (or a new user not knowing re) can be supposed to know the new 
features and their implications. I guess, it is mostly trivially possible to 
fix/disambiguate the problematic patterns, e.g. by escaping.

As for setting the new/old behaviour, would there be a possibility to 
distinguish it just by importing (possibly through some magic, without the need 
to duplicate the code?), 
import re_in_compat_mode as re
vs:
import re_with_all_the_new_features as re

Unfortunately, i have no idea, whether this is possible or viable...
with this option, the (user) code update could be just the change of the 
imports instead of adding the flags to all relevant places (and to take them 
away as redundant, as the defaults evolve with the versions...).

However, it is not clear, how this "aliasing" would work out with regard to the 
transition, maybe the long differenciated "module" names could be kept and the 
meaning of "import re" would  change, allong with the previous warnings, in 
some future version.

just a few thoughts...
   vbr

--

___
Python tracker 

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



[issue12889] struct.pack('d'... problem

2011-09-02 Thread Dr . Georg Ströhlein

New submission from Dr. Georg Ströhlein :

Hi all,

I think there is a long-standing bug (it has made it into books on Google...) 
in the struct.pack() function, at least if the 'd' format string is selected. 
On both Win and Ubuntu the string returned for pack('!d',1.2345) is 
'?\xf3\xc0\x83\x12n\x97\x8d', whereas the correct 8 (!!) bytes are 3F F3 C0 83 
12 6E 97 8D.

Link to a published VBA UDF for Excel is in the file; that UDF reproduces the 
examples given in wikipedia on the IEEE 754 / DP pages correctly. 

Regards, Schorsch

--
files: python-error.txt
messages: 143443
nosy: SchorschMCMLX
priority: normal
severity: normal
status: open
title: struct.pack('d'... problem
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file23090/python-error.txt

___
Python tracker 

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



[issue12889] struct.pack('d'... problem

2011-09-02 Thread Dr . Georg Ströhlein

Dr. Georg Ströhlein  added the comment:

link is here:
http://carolomeetsbarolo.files.wordpress.com/2011/08/double_2_hex.pdf

--

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Being able to set which behavior you want in a (?XXX) flag at the start of the 
regex is valuable so that applications that take a regex can support the new 
syntax automatically when the python version they are running on is updated.  
The (?XXX) should override whatever re.XXX flag was provided to re.compile().

Notice I said XXX.  I'm not interested in a naming bikeshed other than agreeing 
with the fact that NEW will seem quaint 10 years from now so its best to use 
non-temporal names.  COMPAT, VERSION2, VERSION3, WITH_GOATS, PONY, etc. are all 
non-temporal and do allow us to change the default away from "old" behavior at 
a future date beyond 3.3.

--

___
Python tracker 

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



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

2011-09-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Or they are still called UTF-8 but used in combination with different error 
handlers, like surrogateescape and surrogatepass.  The "plain" UTF-* codecs 
should produce data that can be used for "open interchange", rejecting all the 
invalid data, both during encoding and decoding.

Chapter 03, D79 also says:
"""
To ensure that the mapping for a Unicode encoding form is one-to-one, all 
Unicode scalar values, including those corresponding to noncharacter code 
points and unassigned code points, must be mapped to unique code unit 
sequences. Note that this requirement does not extend to high-surrogate and 
low-surrogate code points, which are excluded by definition from the set of 
Unicode scalar values.
"""

and this seems to imply that the only unencodable codepoint are the non-scalar 
values, i.e. surrogates and codepoints >U+10.  Noncharacters shouldn't thus 
receive any special treatment (at least during encoding).

Tom, do you agree with this?  What does Perl do with them?

--

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Matthew Barnett

Matthew Barnett  added the comment:

So, VERSION0 and VERSION1, with "(?V0)" and "(?V1)" in the pattern?

--

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

If these are the only 3 non-backward compatible features and the nested set one 
is moved under the NEW flag, I guess the approach might work without having 
per-feature flags.

The "NEW" could be kept for compatibility for regex (if necessary), possibly 
aliasing it with VERSION1 or whatever name wins the bikeshed.

If you want to control that at import time, maybe a from __future__ import 
new_re_semantics could be used instead of a flag, but I'm not sure about that.

--

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-09-02 Thread Jeff McNeil

New submission from Jeff McNeil :

If cgitb.enable is ran with a logdir set and a format='text' argument, then a 
trailing message is printed that includes  tags.  This should only happen if 
the format requested is HTML.

The following tiny script shows the problem:

import cgitb
cgitb.enable(format='text', logdir='/tmp')
1/0

Attaching a small patch which addresses. This is against tip on the default 
branch.

mcjeff@macbook:~/cpython$ ./python.exe --version
Python 3.3.0a0

--
components: Library (Lib)
files: head-cgitb-display.patch
keywords: patch
messages: 143449
nosy: mcjeff
priority: normal
severity: normal
status: open
title: cgitb displays  tags when executed in text mode
versions: Python 3.3
Added file: http://bugs.python.org/file23091/head-cgitb-display.patch

___
Python tracker 

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



[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-02 Thread Meador Inge

Meador Inge  added the comment:

This has been fixed.  I verified tip and 2.7.

--
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



[issue12844] Support more than 255 arguments

2011-09-02 Thread David Benjamin

David Benjamin  added the comment:

I don't think that patch works. Consider a dict subclass which has overridden 
update. Or perhaps a list subclass which has overridden addition. It would be 
quite poor if Python's behavior here w.r.t. which overrides are followed 
switched as you added more arguments.

--
nosy: +davidben

___
Python tracker 

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



[issue5149] syntactic sugar: type coercion on pointer assignment

2011-09-02 Thread Meador Inge

Meador Inge  added the comment:

This is busted for plain old assignment too:

Python 3.3.0a0 (default:6374b4ffe00c, Sep  2 2011, 23:50:39) 
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> buff = create_string_buffer(b'foo')
>>> p = c_char_p()
>>> p.value = addressof(buff)
>>> print(p.value)
b'foo'
>>> p.value = buff.value
>>> print(p.value)
b'foo'
>>> p.value = buff
Traceback (most recent call last):
  File "", line 1, in 
TypeError: string or integer address expected instead of c_char_Array_4 instance

I think having the conversion is an entirely reasonable request.  It is the 
equivalent of:

char buff[128] = "foo";
char *p = buff;

in C.  I imagine a lot of C programmers would expect this behavior.

Also, 'ctypes' already does this type of conversion for function parameters.  
Consider a function exported from a shared library 'libfoo' called 
'print_string':

void print_string (char *str)
{
  printf ("%s\n", str);
}

The following all work fine:

>>> libfoo = CDLL("./libfoo.so.1.0")
>>> buff = create_string_buffer("foo")
>>> libfoo.print_string(buff)
foo
>>> libfoo.print_string("foo")
foo
>>> libfoo.print_string(addressof(buff))
foo

I am working on a patch for this.  I will post it soon.

--
assignee: theller -> 
nosy: +amaury.forgeotdarc, belopolsky, meadori -theller
stage: test needed -> needs patch

___
Python tracker 

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