[issue17183] Small enhancements to Lib/_markupbase.py

2013-02-16 Thread Guido Reina

Guido Reina added the comment:

I am attaching a .tgz file with the tests I have performed.

The .tgz file contains also a README.txt file with more detailed information.

I have done the following test:
The script loads the HTML file 'search.html' in 'rawdata' and searches '>' in a 
loop from the position 'i', being i in: range(len(rawdata)).

with the three variants: "in" + "find" (test1.py), "find" (test2.py), "index" 
(test3.py).

Result:
Script  First run   Second run  Third run
-
test1.py2.332.322.33
test2.py0.750.740.76
test3.py0.750.740.74


I don't know if the test is representative and whether it helps.
If you think that the test could be improved/changed, just let me know, I will 
be happy to help.

--
Added file: http://bugs.python.org/file29084/test.tgz

___
Python tracker 

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



[issue17214] urllib.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou

New submission from Mi Zou:

while urllib following the redirection(302):
urllib.client.HTTPConnection.putrequest raise an error:
#--
  File "D:\Program Files\Python32\lib\http\client.py", line 1004, in 
_send_request
self.putrequest(method, url, **skips)
  File "D:\Program Files\Python32\lib\http\client.py", line 868, in putrequest
self._output(request.encode('ascii'))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 108-111: 
ordinal not in range(128)
#--
in the sourcode i found that:
at line 811
def putrequest(self, method, url, skip_host=0,skip_accept_encoding=0)...
the argument url may be a unicode,and it was unquoted..

i think we should replace:
request = '%s %s %s' (method,url,self._http_vsn_str)
with:
import urllib.parse
request = '%s %s %s' (method,urllib.parse.quote(url),self._http_vsn_str)

--
components: Unicode
messages: 182216
nosy: Mi.Zou, ezio.melotti
priority: normal
severity: normal
status: open
title: urllib.client.HTTPConnection.putrequest encode  error
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



[issue16525] wave file module does not support 32bit float format

2013-02-16 Thread Sebastian Kraft

Changes by Sebastian Kraft :


Removed file: http://bugs.python.org/file28122/wave_float_issue16525.patch

___
Python tracker 

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



[issue16525] wave file module does not support 32bit float format

2013-02-16 Thread Sebastian Kraft

Sebastian Kraft added the comment:

Thanks for the hint Harvey!
I have updated my patch to include your changes, but only applied the second 
hunk for the following reasons:

Wave_read should not assume any wave format, as it is expected to open a file 
during initialization. So actually the only missing thing was the assignment of 
the wave format during the reading of the format chunk.

setparams() in Wave_write already sets the wavformat a few lines later together 
with the other parameters. So no need to set it twice...

Can you please check if the updated patch works for you?

--
Added file: http://bugs.python.org/file29085/patch

___
Python tracker 

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



[issue17214] urllib.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou

Changes by Mi Zou :


--
status: open -> closed

___
Python tracker 

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



[issue17214] urllib.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou

Changes by Mi Zou :


--
resolution:  -> invalid

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou

Changes by Mi Zou :


--
title: urllib.client.HTTPConnection.putrequest encode  error -> 
http.client.HTTPConnection.putrequest encode  error

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou

Mi Zou added the comment:

while urllib following the redirection(302):
http.client.HTTPConnection.putrequest raise an error:
#--
...
  File "D:\Program Files\Python32\lib\http\client.py", line 1004, in 
_send_request
self.putrequest(method, url, **skips)
  File "D:\Program Files\Python32\lib\http\client.py", line 868, in putrequest
self._output(request.encode('ascii'))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 108-111: 
ordinal not in range(128)
#--
in the sourcode i found that:
at line 811

def putrequest(self, method, url, skip_host=0,skip_accept_en...)
...

the argument url may be a unicode,and it was unquoted..
note
in my case:
...
purl="http://bbs.dospy.com/258attachdown.php?aid=14361277&bbsid=349";
req=urllib.request.Request(purl,headers=headers)
response=urllib.request.urlopen(req)
...

then,the http serve redirect me to a file download url...
and the url contains some Chinese word
i have print out the argument url:

/f/1ba1f70606223af2aa5c3aeff6c6a46a/511f7b4c/day_111015/20111015_5949e996881b2e28403d26Ch6dOfj6LZ.rar/p/ÒâÁÖ03-08.part1.rar

--
resolution: invalid -> 
status: closed -> open

___
Python tracker 

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



[issue17215] documentation misprints

2013-02-16 Thread July Tikhonov

New submission from July Tikhonov:

library/io.rst
io.open() signature lacks 'opener' argument.

library/importlib.rst
concreate -> concrete

--
assignee: docs@python
components: Documentation
files: docs-misprint.diff
keywords: patch
messages: 182219
nosy: docs@python, july
priority: normal
severity: normal
status: open
title: documentation misprints
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29086/docs-misprint.diff

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-16 Thread Stefan Krah

Stefan Krah added the comment:

I would be willing to write an (alternative) PEP, but I'm not quite satisfied
with my own proposal yet. Also, I'd need to understand the positional-only
part better, but the _cursesmodule.c example does not seem to compile here. :)

So, *disregarding* the positional-only situation, I've been thinking about
the os.stat example and what I want from the DSL:

1) We already have a partial DSL, namely "O&|$O&p". This is concise,
   unambiguous and well understood.

2) "O&" denotes a custom converter function with a user specified type.
For example, path_converter() has type [string, bytes, int] -> path_t,
where [string, bytes, int] are the alternatives that path_converter()
accepts.

   "p" can be seen as a default converter function with type bool -> int.

3) Specifying the kind (required, etc.) and the default values of arguments
   is most readable in the standard Python form:

 os.stat(path, *, dir_fd=None, follow_symlinks=True) -> stat_result

I've tried to come up with a declaration that merges 2) and 3), while
reusing the existing conversion specifiers. It emphasizes the converter
functions (which ultimately decide the static typing):

/*[preprocessor]
# Declaration
os.stat (
  { path, path_converter : [string, bytes, int] -> path_t },
  *,
  { dir_fd=None, OS_STAT_DIR_FD_CONVERTER : [int, None] -> int },
  { follow_symlinks=True, "p" : bool -> int }
) -> stat_result

# User code
path_t path = PATH_T_INITIALIZE("stat", 0, 1);
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
[preprocessor]*/

The declaration should be read as follows:

Declare os.stat as a function ...

   1) taking the required argument "path", to which the user-supplied function
  path_converter() of type [string, bytes, int] -> path_t will be applied
  for conversion.

   2) taking a keyword-only argument "dir_fd" with the default value None,
  to which the user-supplied function OS_STAT_DIR_FD_CONVERTER() of
  type [int, None] -> int will be applied for conversion.

   3) taking a keyword-only argument "follow_symlinks" with the default
  value True, to which the default converter "p" of type bool -> int
  will be applied for conversion.

... returning stat_result.

The user code section could be type-checked against the declaration.

What are the advantages?

  1) The structure of the Python function is part of the declaration.

  2) AFAICS, using the conversion specifiers directly eliminates the
 need for these flags:

   encoding, length, zeroes, bitwise, nullable, types, keyword-only,
   required, default, converter.

  3) The converter-oriented statically typed spec forces the user to think
 about the types (a good thing IMO).

  4) Due to the rigid structure (better) error messages should be easier
 to produce.

If this sounds like a viable alternative, I can try to write a PEP.

--

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Stefan, that proposal definitely looks like it is worth writing up as a PEP to 
me. One thing that I particularly like about it is that it should be possible 
to pluck out the first element of the {} entries fairly easily in order to get 
the ordinary Python signature to feed to Cython or a "from string" constructor 
for signature objects.

As far as the "positional-only" parameters problem goes, at one point Guido was 
kicking around the idea of allowing "/" as a separator in Python function 
declarations to indicate positional only arguments. So the signature of a 
function that didn't accept keyword arguments at all would look like:

def addch(x, y, ch, attr, /):
...

He eventually dropped it because positional only arguments (and the need to 
avoid colliding with arbitrary keyword arguments) are relatively rare in Python 
code, and using an inner function together with *args is a reasonable way to 
get decent error messages. However, as a way of concisely indicating 
positional-only arguments in the signature of *C* functions, the idea may be 
worth reconsidering.

--

___
Python tracker 

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



[issue17215] documentation misprints

2013-02-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

LGTM.

--
nosy: +Ramchandra.Apte

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-16 Thread Stefan Behnel

Changes by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

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



[issue17211] pkgutil.iter_modules and walk_packages should return a namedtuple

2013-02-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Attached is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file29087/issue.patch

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1b3d25882ca by Serhiy Storchaka in branch '2.7':
Issue #13169: The maximal repetition number in a regular expression has been
http://hg.python.org/cpython/rev/c1b3d25882ca

New changeset 472a7c652cbd by Serhiy Storchaka in branch '3.2':
Issue #13169: The maximal repetition number in a regular expression has been
http://hg.python.org/cpython/rev/472a7c652cbd

New changeset b78c321ee9a5 by Serhiy Storchaka in branch '3.3':
Issue #13169: The maximal repetition number in a regular expression has been
http://hg.python.org/cpython/rev/b78c321ee9a5

New changeset ca0307905cd7 by Serhiy Storchaka in branch 'default':
Issue #13169: The maximal repetition number in a regular expression has been
http://hg.python.org/cpython/rev/ca0307905cd7

--
nosy: +python-dev

___
Python tracker 

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



[issue17211] pkgutil.iter_modules and walk_packages should return a namedtuple

2013-02-16 Thread Ezio Melotti

Ezio Melotti added the comment:

Patch needs tests.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have committed simplified patches. They don't change an exception type from 
OverflowError to re.error (but an error message now is more helpful) and don't 
made the code clever enough to not raise an exception when a repetition number 
is exceeded sys.maxsize.

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



[issue17211] pkgutil.iter_modules and walk_packages should return a namedtuple

2013-02-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

I forget about that. Attached is a patch with tests.

--
Added file: http://bugs.python.org/file29088/issue.patch

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1f846a99c85 by Serhiy Storchaka in branch '3.3':
Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units.
http://hg.python.org/cpython/rev/c1f846a99c85

New changeset 73a16d3c066a by Serhiy Storchaka in branch 'default':
Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units.
http://hg.python.org/cpython/rev/73a16d3c066a

--
nosy: +python-dev

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you, Ezio, for your comments.

--
resolution:  -> fixed
stage: commit 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



[issue8745] zipimport is a bit slow

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 088a14031998 by Serhiy Storchaka in branch 'default':
Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.
http://hg.python.org/cpython/rev/088a14031998

--
nosy: +python-dev

___
Python tracker 

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



[issue17016] _sre: avoid relying on pointer overflow

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nickolai, are you want to update your patch with fixes for other possible 
pointer overflows? Note, that the maximal repetition number has been increased 
now.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue17216] Could not find platform dependent libraries

2013-02-16 Thread uservorname usernachname

New submission from uservorname usernachname:

Greetings,

make fails at:
ar rc libpython3.3m.a Objects/abstract.o Objects/accu.o Objects/boolobject.o 
Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o 
Objects/cellobject.o Objects/classobject.o Objects/codeobject.o 
Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o 
Objects/exceptions.o Objects/genobject.o Objects/fileobject.o 
Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o 
Objects/iterobject.o Objects/listobject.o Objects/longobject.o 
Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o 
Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o 
Objects/obmalloc.o Objects/capsule.o Objects/rangeobject.o Objects/setobject.o 
Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o 
Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o 
Objects/weakrefobject.o
ar rc libpython3.3m.a Python/_warnings.o Python/Python-ast.o Python/asdl.o 
Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/dynamic_annotations.o Python/errors.o 
Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o 
Python/getcopyright.o Python/getplatform.o Python/getversion.o 
Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o 
Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o 
Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o 
Python/pystate.o Python/pythonrun.o Python/pytime.o Python/random.o 
Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o 
Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o 
Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o   
Python/thread.o Python/frozen.o
ar rc libpython3.3m.a Modules/config.o Modules/getpath.o Modules/main.o 
Modules/gcmodule.o
ar rc libpython3.3m.a Modules/_threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  
Modules/_functoolsmodule.o  Modules/operator.o  Modules/_collectionsmodule.o  
Modules/itertoolsmodule.o  Modules/_localemodule.o  Modules/_iomodule.o 
Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o 
Modules/textio.o Modules/stringio.o  Modules/zipimport.o  
Modules/faulthandler.o  Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.3m.a
gcc -pthread   -Xlinker -export-dynamic -o python Modules/python.o 
libpython3.3m.a -lpthread -ldl  -lutil   -lm
./python -E -S -m sysconfig --generate-posix-vars
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Could not import runpy module
make: *** [Lib/_sysconfigdata.py] Error 1


What is wrong here? Do you need any other information?

best regards

--
components: Build
files: config.log
messages: 182232
nosy: uservorname.usernachname
priority: normal
severity: normal
status: open
title: Could not find platform dependent libraries 
type: compile error
versions: Python 3.3
Added file: http://bugs.python.org/file29089/config.log

___
Python tracker 

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



[issue15730] Silence unused value warnings under Mac OS X 10.8/clang

2013-02-16 Thread Ed Campbell

Changes by Ed Campbell :


--
nosy: +esc24

___
Python tracker 

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



[issue15438] document that math.pow is inappropriate for integers

2013-02-16 Thread Ezio Melotti

Ezio Melotti added the comment:

LGTM.
(Maybe build the doc and double check that all the links are correct before 
committing.)

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-16 Thread Stefan Krah

Stefan Krah added the comment:

OK, I'll have a go at the PEP then. In addition to the proposed syntax
in my previous mail, I'm going to suggest this alternative:

/*[preprocessor]
# Declaration
os.stat [PyOs_Stat] (
  { path: [string, bytes, int] => path_converter => path_t },
  *,
  { dir_fd: [int, None] = None => OS_STAT_DIR_FD_CONVERTER => int },
  { follow_symlinks: bool = True => "p" => int }
) -> stat_result

# User code
path_t path = PATH_T_INITIALIZE("stat", 0, 1);
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
[preprocessor]*/

It's a slight abuse of notation, since it looks like function composition.
The advantage is that the LHS of the first arrow is a complete legal Python
argument spec together with the type annotation.

The construct should be viewed like a Unix pipe and be read somewhat like:

Pass argument dir_fd of type [int, None], initialized to the default value
None to function OS_STAT_DIR_FD_CONVERTER, which yields a C int.

Both versions carry precisely the same amount of information. I have no strong
preference for either version, but perhaps other people do.

Regarding the positional arguments with groups, I'm suggesting this construct
for window.addch():

/*[preprocessor]
# Declaration
window.addch [addch] (
  { y: int => "i" => int },
  { x: int => "i" => int },
  { ch: int => "O" => PyObject * },
  { attr: int => "l" => long }
) -> None

WHERE groups = { [ch], [ch, attr], [y, x, ch], [y, x, ch, attr] }
[preprocessor]*/

The top part is largely the same as in the os.stat() example, the WHERE
clause means:

  - If you pass a single argument, it will be interpreted as "ch"

  - If you pass two arguments, they will be interpreted as "ch, attr"

  [and so forth ...]

--

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-02-16 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Patch looks ok. Just add the new exception class to all_errors list.

--

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-02-16 Thread Michał Jastrzębski

Michał Jastrzębski added the comment:

Thank you Giampaolo,

I'm attaching patch changed according to your suggestion.

--
Added file: http://bugs.python.org/file29090/ftplib_maxline.patch

___
Python tracker 

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



[issue9669] regexp: zero-width matches in MIN_UNTIL

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc8a11c16021 by Serhiy Storchaka in branch '2.7':
Issue #9669: Protect re against infinite loops on zero-width matching in
http://hg.python.org/cpython/rev/dc8a11c16021

New changeset d40afd489b6a by Serhiy Storchaka in branch '3.2':
Issue #9669: Protect re against infinite loops on zero-width matching in
http://hg.python.org/cpython/rev/d40afd489b6a

New changeset 8f9b628593db by Serhiy Storchaka in branch '3.3':
Issue #9669: Protect re against infinite loops on zero-width matching in
http://hg.python.org/cpython/rev/8f9b628593db

New changeset aa17a0dab86a by Serhiy Storchaka in branch 'default':
Issue #9669: Protect re against infinite loops on zero-width matching in
http://hg.python.org/cpython/rev/aa17a0dab86a

--
nosy: +python-dev

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>  { path: [string, bytes, int] => path_converter => path_t },
>  *,
>  { dir_fd: [int, None] = None => OS_STAT_DIR_FD_CONVERTER => int },
>  { follow_symlinks: bool = True => "p" => int }

Why not just:

  path: path_t
  *
  dir_fd: dir_fd_t = None => DEFAULT_DIR_FD
  follow_symlinks: bool = True => 1

?

And register types somewhere:

clinic.register('path_t', restype='path_t', converter='path_converter', 
signature='[string, bytes, int]')
clinic.register('dir_fd_t', restype='int', 
converter='OS_STAT_DIR_FD_CONVERTER', signature='[int, None]')
clinic.register('bool', restype='int', converter='_PyBool_Converter', 
signature='bool')
...
clinic.register('string', restype='PyObject *', 
converter='_PyUnicode_Converter', signature='string')
clinic.register('buffer', restype='PyBuffer', converter='_PyBuffer_Converter', 
signature='buffer')
...
clinic.register('int', restype='int', converter='_Py_int_Converter', 
signature='int')
clinic.register('unsigned long', restype='unsigned long', 
converter='_Py_long_Converter', signature='int')

If you use path_converter, then definitely input types are [string, bytes, int] 
and an output C type is path_t. You need only name all converters and register 
them.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue10965] dev task of documenting undocumented APIs

2013-02-16 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue16276] OrderedDict constructor do not keep items order

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

FWIW, I'm working toward making **kwargs an OrderedDict.  First step: issue 
#16991

--
nosy: +eric.snow

___
Python tracker 

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



[issue15003] make PyNamespace_New() public

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

At present, I don't see a need to make the C API public.

--
status: open -> closed

___
Python tracker 

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



[issue8745] zipimport is a bit slow

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for contribution.

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



[issue17216] sparc linux build fails with "could not import runpy module"

2013-02-16 Thread Ned Deily

Ned Deily added the comment:

For some reason in your build, the first bootstrap use of the compiler (to 
generate the sysconfig data) is failing because the runpy module can't be 
found.  Python should be able to find it in the source directory; the "Could 
not find platform dependent libraries " is normal at this point 
and can be ignored.  I see from your config.log that you do have a lot of 
configure options set, including some invalid ones (configure:16344: WARNING: 
unrecognized options: --enable-clocale, --enable-debug).  I suggest you try 
rebuilding from a freshly untarred source directory with as simple a 
./configure as possible and as few environment variables set as possible and 
see what happens when you run make, something like:

./configure && make

If that fails similarly, please include that whole output from configure 
through make and the config.log output.

--
nosy: +ned.deily
title: Could not find platform dependent libraries  -> sparc linux 
build fails with "could not import runpy module"
type: compile error -> 

___
Python tracker 

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



[issue9669] regexp: zero-width matches in MIN_UNTIL

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed with a test. Thank you, Matthew.

--

___
Python tracker 

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



[issue9669] regexp: zero-width matches in MIN_UNTIL

2013-02-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
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



[issue4972] context management support in imaplib, smtplib, ftplib

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch. Updated documentation, added checks that logout 
executed after a with statement, now logout() can be called inside a with 
statement.

--
Added file: http://bugs.python.org/file29091/imaplib_with_3.patch

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-02-16 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon, ncoghlan
versions: +Python 3.4

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-02-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This can significant slowdown zipimport. I think we shouldn't support such 
broken zip files in zipimport.

--
nosy: +serhiy.storchaka

___
Python tracker 

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




[issue17203] add long option names to unittest discovery docs

2013-02-16 Thread Gennadiy Zlobin

Gennadiy Zlobin added the comment:

Hi, here's the patch. Should I provide patches for other branches?

--
keywords: +patch
nosy: +gennad
Added file: http://bugs.python.org/file29092/17203.patch

___
Python tracker 

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



[issue17203] add long option names to unittest discovery docs

2013-02-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, one patch should be fine, though the change should be applied to all 
branches.

--

___
Python tracker 

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



[issue17217] Fix test discovery for test_format.py on Windows

2013-02-16 Thread Zachary Ware

New submission from Zachary Ware:

test_format is an interesting case in the ongoing test discovery conversion.  
It already uses unittest.main(), but still has test_main(), and discovery seems 
to work fine on Linux.  On Windows, however, test_format and test_non_ascii 
both fail with a UnicodeEncodeError.  Running under regrtest, this doesn't 
happen because of regrtest's replace_stdout() function.  Thus, running python 
-m test.test_format with the following patch works:

diff -r 168efd87e051 Lib/test/test_format.py
--- a/Lib/test/test_format.py   Fri Feb 15 23:38:23 2013 +0200
+++ b/Lib/test/test_format.py   Sat Feb 16 15:14:52 2013 -0600
@@ -325,9 +325,7 @@
 self.assertIs("{0:5s}".format(text), text)


-def test_main():
-support.run_unittest(FormatTest)
-
-
 if __name__ == "__main__":
+from test.regrtest import replace_stdout
+replace_stdout()
 unittest.main()


Doing the same in a setUpModule function would work for both running the module 
and for a unittest discover command, but it would also cause replace_stdout() 
to be called twice when running under regrtest, which I don't think would be 
especially good.

The attached patch is one possible solution that I've come up with.  It moves 
replace_stdout from regrtest to support, and adds a "running_under_regrtest" 
flag to support that regrtest sets to True.  test_format then checks 
support.running_under_regrtest in setUpModule to determine whether to run 
support.replace_stdout.

--
components: Tests
files: test_format_discovery.diff
keywords: patch
messages: 182248
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Fix test discovery for test_format.py on Windows
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29093/test_format_discovery.diff

___
Python tracker 

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



[issue15022] types.SimpleNamespace needs to be picklable

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3b93ab8c9c20 by Eric Snow in branch 'default':
Issue #15022: Add pickle and comparison support to types.SimpleNamespace.
http://hg.python.org/cpython/rev/3b93ab8c9c20

--
nosy: +python-dev

___
Python tracker 

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



[issue15022] types.SimpleNamespace needs to be picklable

2013-02-16 Thread Eric Snow

Changes by Eric Snow :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue17170] string method lookup is too slow

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e985a96a612 by Antoine Pitrou in branch 'default':
Issue #17170: speed up PyArg_ParseTuple[AndKeywords] a bit.
http://hg.python.org/cpython/rev/4e985a96a612

--
nosy: +python-dev

___
Python tracker 

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



[issue17218] support title and description in argparse add_mutually_exclusive_group

2013-02-16 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to add to argparse's add_mutually_exclusive_group() method 
support for passing a title and description.  From the argparse docs:

"Note that currently mutually exclusive argument groups do not support the 
title and description arguments of add_argument_group()."

(from 
http://docs.python.org/dev/library/argparse.html#argparse.add_mutually_exclusive_group
 )

--
components: Library (Lib)
messages: 182251
nosy: bethard, chris.jerdonek
priority: normal
severity: normal
stage: test needed
status: open
title: support title and description in argparse add_mutually_exclusive_group
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue15022] types.SimpleNamespace needs to be picklable

2013-02-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4c065b2db49 by Eric Snow in branch 'default':
Issue #15022: Ensure all pickle protocols are supported.
http://hg.python.org/cpython/rev/e4c065b2db49

--

___
Python tracker 

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



[issue15004] add weakref support to types.SimpleNamespace

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

I've yanked the __weakref__ attr--apparently builtins don't have them.  I've 
also update the test.  Is the updated test sufficient?  I expect that if 
weakref.ref(ns) works, the rest of the weakref functionality works as well.

--
Added file: http://bugs.python.org/file29094/simplenamespace-weakref.diff

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-02-16 Thread Nick Coghlan

Nick Coghlan added the comment:

How common are such broken zip files? Like Serhiy, I'm concerned about the 
possible negative impact on the interpreter startup time as we try to second 
guess the contents of the zip file manifest.

It seems better to be explicit that we consider such zipfiles broken and they 
need to be regenerated with full manifests (perhaps providing a script in Tools 
that fixes them).

--

___
Python tracker 

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-02-16 Thread Nick Coghlan

Nick Coghlan added the comment:

OTOH, the scan time should be short relative to the time needed to read the 
manifest in the first place - an appropriate microbenchmark may also be 
adequate to address my concerns.

--

___
Python tracker 

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



[issue16042] smtplib: unlimited readline() from connection

2013-02-16 Thread R. David Murray

R. David Murray added the comment:

I doubt that 2048 is safer than 1024 for any meaningful value of safer.  Either 
the sever respects the rfc limits or it does not.  If it does not,  it is 
likely to send very long text lines if the sending mua generates them, which I 
suspect happens.  However, there is no real reason not to arbitrarily pick 2048.

--

___
Python tracker 

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



[issue13124] Add "Running a Build Slave" page to the devguide

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

Looking this over, it seems like there were outstanding objections to adding 
this to the devguide and to the content.  I still think the devguide is the 
right place and that something like my second patch would be appropriate.

Before I take any time to update the patch, does anyone object to the location 
or intent of the changes?

Also, I'm fine with adapting/incorporating or linking to Stefan's script.  The 
whole point is to make it as easy as possible to spin up and run a build slave. 
:)

--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue16251] pickle special methods are looked up on the instance rather than the type

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

I've posted to python-dev about this:

http://mail.python.org/pipermail/python-dev/2013-February/124114.html

At the very least the pickle docs deserve some mention of the behavior.  That 
way people won't need to spend as much time trying to figure out why things 
aren't working the way they expect.

However, my preference is to fix pickle, though I readily concede that might 
not be possible.  And just to reiterate, I agree we shouldn't do anything here 
without a clear picture of the impact.

--

___
Python tracker 

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



[issue12633] sys.modules doc entry should reflect restrictions

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

One proposal would lead to the sys module growing descriptors:

http://mail.python.org/pipermail/python-ideas/2013-January/019075.html

In that case, sys.modules could update the underlying interp->modules.

--

___
Python tracker 

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



[issue15767] add ModuleNotFoundError

2013-02-16 Thread Eric Snow

Eric Snow added the comment:

+1 on just getting it done with ModuleNotFoundError.  FWIW, I'd be glad to do 
it.  I'm taking a self-imposed break from the nearly finished C-OrderedDict!

--

___
Python tracker 

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



[issue16954] Add docstrings for ElementTree module

2013-02-16 Thread David Lam

David Lam added the comment:

Here's a patch which converts all the Doxygen comments in ElementTree.py to 
docstrings!

Something I noticed was that the 

  from _elementtree import *

...at the bottom of ElementTree.py sort of overwrites the docstrings of the 
Python module.  So if you did...  `from xml.etree import ElementTree;  
help(ElementTree)` from the interpreter, you'll see blank spots for a bunch of 
classes/methods like Element, ParseError, SubElement etc etc

maybe docstrings should be also added in Modules/_elementtree.c?  perhaps that 
would be too much copy and pastage, hmmm

--
keywords: +patch
Added file: http://bugs.python.org/file29095/issue16954.patch

___
Python tracker 

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



[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-16 Thread Stefan Behnel

Stefan Behnel added the comment:

Updated patch to also fix a little typo in the docstring (lower case "python").

--
Added file: http://bugs.python.org/file29096/inspect_sig_3.patch

___
Python tracker 

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