[issue19525] Strict indentation in Python3

2013-11-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Python 3 is intentionally stricter.

Try attached file.

$ python2.7 test
$ python2.7 -t test
test: inconsistent use of tabs and spaces in indentation
$ python2.7 -tt test
  File "test", line 3
2
^
TabError: inconsistent use of tabs and spaces in indentation
$ python3.3 test
  File "test", line 3
2
^
TabError: inconsistent use of tabs and spaces in indentation

--
nosy: +Arfrever
resolution:  -> works for me
status: open -> closed
Added file: http://bugs.python.org/file32539/test

___
Python tracker 

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



[issue19525] Strict indentation in Python3

2013-11-07 Thread Sworddragon

New submission from Sworddragon:

Python 2 provided this command line option:

"-t Issue a warning when a source file mixes tabs and spaces for 
indentation in a way that makes it depend on the worth of a tab expressed in 
spaces.  Issue an error when the option is given twice."


I'm wondering why it doesn't exist anymore in Python 3. I wanted to make some 
tests to figure this out but I'm not able to trigger this behavior in Python 2. 
All my examples will result in throwing an exception with and without -tt or 
never throwing an exception with or without -tt. But I'm also having 
difficulties to understand what the second part of the sentence does mean. Can 
somebody maybe provide an example where "python2 -tt" will fail but "python2" 
not?

--
components: Interpreter Core
messages: 202408
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Strict indentation in Python3
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue1348] httplib closes socket, then tries to read from it

2013-11-07 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue19521] parallel build race condition on AIX since python-3.2

2013-11-07 Thread Michael Haubenwallner

Michael Haubenwallner added the comment:

I'm unsure about the real purpose of _testembed, but given the name it does 
make sense to me to export the same symbols as $(BUILDPYTHON), thus reusing 
python.exp.

--

___
Python tracker 

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



[issue19523] logging.FileHandler - using of delay argument case handle leaks

2013-11-07 Thread DDGG

DDGG added the comment:

If you run this script, and then view the Task Manager for this process's 
handles, it is growing forever.

handlers -> handles. this leak handle is Handler.lock object, because the 
instance was not be garbage-collected.

--

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2013-11-07 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue19523] logging.FileHandler - using of delay argument case handle leaks

2013-11-07 Thread DDGG

Changes by DDGG :


--
title: logging.FileHandler - using of delay argument case handler leaks -> 
logging.FileHandler - using of delay argument case handle leaks

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2013-11-07 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue17823] 2to3 fixers for missing codecs

2013-11-07 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2013-11-07 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue19490] Problem installing matplotlib 1.3.1 with Python 2.7.6rc1 and 3.3.3rc1

2013-11-07 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Downgrading, since this is "fixed" in release branch.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2013-11-07 Thread Martin Panter

New submission from Martin Panter:

The AbstractHTTPHandler.do_open() method creates a HTTPConnection object but 
does not save it anywhere. This means a ResourceWarning is eventually 
triggered, at least when the HTTP server leaves the the connection open.

Demonstration code:

from urllib.request import urlopen
with urlopen("http://localhost";) as response: response.read()

When I used the above code, the warning did not trigger until I forced a 
garbage collection:

import gc; gc.collect()

Output:

__main__:1: ResourceWarning: unclosed 

Alternatively, you can add a line to the bottom of the do_open() method:

r.msg = r.reason
del h; import gc; gc.collect()  # Add this to force warning
return r

When the warning happens without forced garbage collection, it tends to happen 
here:

/usr/lib/python3.3/socket.py:370: ResourceWarning: unclosed 
  self._sock = None

I tested by using the “socat” CLI program and supplying a chunked HTTP 
response, without immediately closing the connection at the server end. Using 
the Content-length header also seems to trigger the issue.

$ sudo socat -d TCP-LISTEN:www,reuseaddr,crnl READLINE
GET / HTTP/1.1
Accept-Encoding: identity
Host: localhost
Connection: close
User-Agent: Python-urllib/3.3


HTTP/1.1 200 OK
Transfer-encoding: chunked

0



If the server leaves the connection open, it only seems to get closed when 
Python garbage-collects the socket and closes it. Perhaps the connection should 
be explicitly closed when the urlopen() response object is closed. But I guess 
that would require wrapping the HTTPResponse object to add to the close 
behaviour.

--
components: Library (Lib)
messages: 202404
nosy: vadmium
priority: normal
severity: normal
status: open
title: ResourceWarning when urlopen() forgets the HTTPConnection object
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue19523] logging.FileHandler - using of delay argument case handler leaks

2013-11-07 Thread DDGG

New submission from DDGG:

Issue File: Python26\Lib\logging\__init__.py

class FileHandler(StreamHandler):
"""
A handler class which writes formatted logging records to disk files.
"""
def __init__(self, filename, mode='a', encoding=None, delay=0):
"""
Open the specified file and use it as the stream for logging.
"""
#keep the absolute path, otherwise derived classes which use this
#may come a cropper when the current directory changes
if codecs is None:
encoding = None
self.baseFilename = os.path.abspath(filename)
self.mode = mode
self.encoding = encoding
if delay:
#We don't open the stream, but we still need to call the
#Handler constructor to set level, formatter, lock etc.
Handler.__init__(self)   ## 1. here will insert instance into 
logging._handlerList
self.stream = None
else:
StreamHandler.__init__(self, self._open())

def close(self):
"""
Closes the stream.
"""
if self.stream:   ## 2. when delay=1, here should call 
Handler.close(self), or the instance still store in logging._handlerList, lead 
to leak (instance's owner's __del__ will not be called).
self.flush()
if hasattr(self.stream, "close"):
self.stream.close()
StreamHandler.close(self)
self.stream = None


leak demo:

import logging
import time

def using_handler():
filename = "test.log"
handler = logging.FileHandler(filename, mode="w", delay=1)
handler.close()

def test():
while True:
using_handler()
time.sleep(.01)

if __name__ == "__main__":
test()


If you run this script, and then view the Task Manager for this process's 
handlers, it is growing forever.


Solution: very easy

Fix the method FileHandler.close:

def close(self):
"""
Closes the stream.
"""
if self.stream:
self.flush()
if hasattr(self.stream, "close"):
self.stream.close()
StreamHandler.close(self)
self.stream = None
else:   
Handler.close(self) 


regards
DDGG

--
components: Library (Lib)
messages: 202403
nosy: DDGG
priority: normal
severity: normal
status: open
title: logging.FileHandler - using of delay argument case handler leaks
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue3158] Doctest fails to find doctests in extension modules

2013-11-07 Thread R. David Murray

R. David Murray added the comment:

Added some review comments.

Because it could cause possibly buggy doctest fragments to run that previously 
did not run, I don't think it should be backported as a bug fix.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue19522] A suggestion: python 3.* is not as convenient as python 2.*

2013-11-07 Thread Eric Snow

Eric Snow added the comment:

A lot of thought went into Python 3 changes, including making print a function 
(see PEP 3105).  While typing efficiency may be appealing, keep in mind that 
generally code will be read more than written.  There are other programming 
languages that highly value terseness.  Personally I find such languages 
(A.K.A. write-only languages) harder to read.  In contrast, I find the API for 
Python 3's print to be easier to remember, to use, and to read.

Keep in mind that the bug tracker probably isn't the best place for this 
discussion.  I'd recommend taking it to the general Python mailing list 
(https://mail.python.org/mailman/listinfo/python-list).  If you have a concrete 
proposal you should consider posting to the python-ideas mailing list.

--
nosy: +eric.snow
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19522] A suggestion: python 3.* is not as convenient as python 2.*

2013-11-07 Thread wang xuancong

New submission from wang xuancong:

Hi python developers,

I notice that one major change in python 3 is that you make 'print' as a 
standard function, and it will require typing (). As you know, reading from and 
writing to IO is a high frequency operation. By entropy coding theorem, you 
should make your language having shortest code for doing that job. Typing a '(' 
requires holding SHIFT and pressing 9, the input effort is much higher. Also, 
specifying IO has changed from >>* to file=*, which becomes more inconvenient.

I hope you can take a look at user's code and see what are the most commonly 
used functions and try to shorten language codes for those functions. Assigning 
shortest language codes to most frequently used functions will make python the 
best programming language in the world.

Another suggestion is that 'enumerate' is also frequently used, hopefully you 
can shorten the command.

Wang Xuancong
National University of Singapore

--
components: Interpreter Core
messages: 202400
nosy: xuancong84
priority: normal
severity: normal
status: open
title: A suggestion: python 3.* is not as convenient as python 2.*
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread Eric Snow

Eric Snow added the comment:

PEP 432 is all about the PyRun_* API and especially relates to refactoring it 
with the goal of improving extensibility and maintainability.  I'm sure Nick 
could expound, but the PEP is a response to the cruft that has accumulated over 
the years in Python/pythonrun.c.  The result of that organic growth makes it 
harder than necessary to do things like adding new commandline options.  While 
I haven't looked closely at the new function you added, I expect PEP 432 would 
have simplified things or even removed the need for a new function.

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> PEP 432 relates pretty closely here.

What is the relation between this issue and the PEP 432?

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread Eric Snow

Eric Snow added the comment:

PEP 432 relates pretty closely here.

--
nosy: +eric.snow, ncoghlan

___
Python tracker 

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



[issue19437] More failures found by pyfailmalloc

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f2cd38795931 by Victor Stinner in branch 'default':
Issue #19437: Fix fsconvert_strdup(), raise a MemoryError on PyMem_Malloc()
http://hg.python.org/cpython/rev/f2cd38795931

New changeset f88c6417b9f6 by Victor Stinner in branch 'default':
Issue #19437: Fix _io._IOBase.close(), handle _PyObject_SetAttrId() failure
http://hg.python.org/cpython/rev/f88c6417b9f6

New changeset 0f48843652b1 by Victor Stinner in branch 'default':
Issue #19437: Fix datetime_subtract(), handle new_delta() failure
http://hg.python.org/cpython/rev/0f48843652b1

--

___
Python tracker 

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



[issue17762] platform.linux_distribution() should honor /etc/os-release

2013-11-07 Thread Matthias Klose

Matthias Klose added the comment:

my concern here is that platform.linux_distribution returns different values 
for the tuple, wether os-release is found or the lsb config file is found.  I 
don't know about a good solution, however if the return value has different 
values, that has to be clearly documented, or maybe unified in some form.

--

___
Python tracker 

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



[issue17762] platform.linux_distribution() should honor /etc/os-release

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

Comments on add_os_release_support_2.patch:

- You should not write a huge try/except OSError block. I would prefer 
something like:

try:
   f = open(...)
except OSError:
   return None
with f:
   ...

- I'm not sure about that, but you might use errors='surrogateescape', just in 
case if the file is not correctly encoded. Surrogate characters are maybe less 
annoying than a huge UnicodeDecodeError

- You use /etc/os-release even if the file is empty. Do you know if there is a 
standard, or something like that explaining if some keys are mandatory? For 
example, we can ignore os-release if 'ID' or 'VERSION_ID' key is missing

- For the unit test, you should write at least a test on linux_distribution() 
to check that your private function is used correctly

- You add unit tests for all escaped characters (', ", \), for comments, and 
maybe also for maformated lines (to have a well defined behaviour, ignore them 
or raise an error)

- _UNIXCONFDIR looks to be dedicated to unit tests, can't you patch builtin 
open() instead? It would avoid the need of a temporary directory

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> Updated patch addressing some remarks of Serhiy and adding documentation.

Oh, and it adds also an unit test. I didn't run the unit test on Windows yet.

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch addressing some remarks of Serhiy and adding documentation.

--
Added file: http://bugs.python.org/file32538/pyrun_object-2.patch

___
Python tracker 

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



[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01c4a0af73cf by Victor Stinner in branch 'default':
Issue #19512, #19515: remove shared identifiers, move identifiers where they
http://hg.python.org/cpython/rev/01c4a0af73cf

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 01c4a0af73cf by Victor Stinner in branch 'default':
> Issue #19512, #19515: remove shared identifiers, move identifiers where they
> http://hg.python.org/cpython/rev/01c4a0af73cf

This changeset removes some identifiers duplicated in the same file.

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01c4a0af73cf by Victor Stinner in branch 'default':
Issue #19512, #19515: remove shared identifiers, move identifiers where they
http://hg.python.org/cpython/rev/01c4a0af73cf

--
nosy: +python-dev

___
Python tracker 

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



[issue16261] Fix bare excepts in various places in std lib

2013-11-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Andrei Dorian Duma

Andrei Dorian Duma added the comment:

> @Andrei: Are you interested to work on a patch to remove identifiers 
> duplicated in the same file?

Yes, I will provide a patch in a day or two.

--

___
Python tracker 

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

c_api_frame.patch: document some C functions of the frame object in the C API.

--
keywords: +patch
Added file: http://bugs.python.org/file32537/c_api_frame.patch

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> Well, then IMHO it's not worth it.

Ok, you are probably right :-)

@Andrei: Are you interested to work on a patch to remove identifiers duplicated 
in the same file?

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

>> If you don't tell us what it brings (numbers?), I'm against it.
>
> For performances, it's probably very close to zero speed up. For
> the memory, it's a few bytes per duplicated identifier.

Well, then IMHO it's not worth it.

--

___
Python tracker 

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



[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined

2013-11-07 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Same problem here. I'm currently uploading .exe files for psutil by hand.
Interestingly the problem occurs with certain versions of python only (2.4, 
2.5, 2.7, 3.2).

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> If you don't tell us what it brings (numbers?), I'm against it.

For performances, it's probably very close to zero speed up. For the memory, 
it's a few bytes per duplicated identifier.

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Antoine, Martin: So, what do you think? Is it worth to move most common 
> identifiers
> to a single place to not duplicate them?

Well, worth what? :)
If you don't tell us what it brings (numbers?), I'm against it.

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

Antoine, Martin: So, what do you think? Is it worth to move most common 
identifiers to a single place to not duplicate them?

If identifiers are already cleared at exit, the advantage would be to 
initialize duplicated identifiers more quickly, and don't initialize duplicated 
identifiers multiple times (once per copy).

If we choose to not share common identifiers, _PyId_xxx identifiers from 
pythonrun.c must be removed. There are also some identifiers duplicated in the 
same file which can be moved at the top to remove at least duplicates in a 
single file, as it was done for other identifiers in issue #19514.

--

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cb4c964800af by Victor Stinner in branch 'default':
Issue #19514: Add Andrei Dorian Duma to Misc/ACKS for changeset 4a09cc62419b
http://hg.python.org/cpython/rev/cb4c964800af

--

___
Python tracker 

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



[issue1534607] IndexError: Add bad index to msg

2013-11-07 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue1534607] IndexError: Add bad index to msg

2013-11-07 Thread Brett Cannon

Changes by Brett Cannon :


--
superseder:  -> Add index attribute to IndexError

___
Python tracker 

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



[issue19521] parallel build race condition on AIX since python-3.2

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Wouldn't it be better if linking _testembed generated _testembed.exp instead of 
generating python.exp? I hope using $@.exp somehow could help. Hard-coding the 
name of the export file sounds like a flaw in the first place.

--
nosy: +loewis

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Nov 07, 2013, at 04:56 PM, Matthias Klose wrote:

>I disagree about sys.implementation. It's useless and wrong for cross builds.
>Please use sysconfig instead. What sysconfig is maybe missing is a set of
>variables which you can rely on.

Agreed that sysconfig is a better place for more general values.  My point was
that if OpenSUSE wants to carry deltas that are specific only to its platform,
then sys.implementation._ is the standard place to put it.

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Well, that was one of the motivations of introducing this Py_IDENTIFIER 
machinery: to be able to cleanup at the end (unlike the static variables that 
were used before, which couldn't be cleaned up).

--

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Thanks for the patch.

Note: moving all identifiers would not have made a difference. They are static 
variables, so from a run-time point of view, there is no difference whether 
they are inside or outside of functions.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4a09cc62419b by Martin v. Löwis in branch 'default':
Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.
http://hg.python.org/cpython/rev/4a09cc62419b

--
nosy: +python-dev

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> Victor: There already *is* a cleanup function that clears all allocated 
> identifier memory at interpreter shutdown. Please read the source.

Oh, great! I never noticed _PyUnicode_ClearStaticStrings().

Call trace: Py_Finalize() -> _PyUnicode_ClearStaticStrings() ->
_PyUnicode_Fini().

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2013-11-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch uses large overallocation factor (1/2 instead 1/8), it may 
increase the speed on Windows. Fixed implementation of __sizeof__() and some 
minor bugs.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file32536/bytesio_resized_bytes-3.patch

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Victor: There already *is* a cleanup function that clears all allocated 
identifier memory at interpreter shutdown. Please read the source.

--

___
Python tracker 

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



[issue17080] A better error message for float()

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a73c47c1d374 by Ezio Melotti in branch 'default':
#17080: improve error message of float/complex when the wrong type is passed.
http://hg.python.org/cpython/rev/a73c47c1d374

--
nosy: +python-dev

___
Python tracker 

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



[issue17080] A better error message for float()

2013-11-07 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the review.

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

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-07 Thread Guido van Rossum

Guido van Rossum added the comment:

Fixed by revision 9c976f1b17e9.

--
assignee:  -> gvanrossum
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

configure.ac should accept an option, which allows to set any custom libdir.

Examples (architecture: libdir) in Gentoo:
x32:   libx32
mips o32:  lib
mips n32:  lib32
mips n64:  lib64

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Matthias Klose

Matthias Klose added the comment:

I disagree about sys.implementation. It's useless and wrong for cross builds.  
Please use sysconfig instead. What sysconfig is maybe missing is a set of 
variables which you can rely on.

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Nov 07, 2013, at 03:40 PM, jan matejek wrote:

>To reiterate, our current solution is to introduce "sys.lib" (and "sys.arch",
>but that is never used anymore) that is either "lib" or "lib64", and use this
>in place of the string "lib" wherever appropriate. We find the value for
>sys.lib through configure magic.

PEP 421 added sys.implementation, which contains provisions for
implementation-specific additions.  So a better place to put these
non-standard values is sys.implementation._lib and sys.implementation._arch,
either instead of or in addition to sysconfig variables.

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Nov 07, 2013, at 04:05 PM, jan matejek wrote:

>> - I would like to see any new OS-dependent locations in the sysconfig
>> module, not the sys module.
>
>how would you propose to put the value into sysconfig in the first place? It
>seems to rely heavily on existing attributes from sys.

Actually, I think it mostly parses these values from the installed Makefile.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.15 (GNU/Linux)

iQIcBAEBCAAGBQJSe8T6AAoJEBJutWOnSwa/6oAQAJM3IksGydXk9CEp7rbSrHea
DvYUccmyon1xrmu5RjWnz6ZbJdWlFwx8ouFpbzmZvfAF8E2m0HliNzW+/w28sik5
F37p5/7hScQ2x/AcmdnVrzDotMkvcvMILsCDIhSy/nPIWkI4hAuRGLdPJmgiE3HE
b3hjQDCgsVDrp8arJioepx6xWSMpE1dQ/KsL6DDuNl3rUNVR1E1jTYEqY12+fOjc
Mcgz6lVndyZreY958iQE/UR7MKoW5lcLnin44PtMYrizwWv82kgwhkqU5tubnTBD
m9tD16uCz7xvATM5XI8nmXeLcLMSMfUdaG+4ny//cIjDKYIC6XXoZvCgE7iSEws1
pEIQCmrs6mpk6d83Yz/XDXc4OqjqC+tUPY1TGNqAI/nm416uoKUuO/f1eU397EV+
2RqJqev8Ho8Sgk7skFJGwcCfTO4yDR40+0wm3u2BiM9bTcnGiJaC7z2TAp9eb4Qs
jo/cmYi3BbqPu9Xx3P4oX11NHmjTPBUcZjqsJa8w8q3lf9r5haE5EqlLaNgDnGtL
efu7OMom2yQHXdwIJ2efmefjoby812uNFSbTiMvDxZTVCCUyBczBT/Q7gu/4S9Ks
Mv3oY1bkq6qAXKKOwzKoblzHJ6VW+A3Rn15Lh6Tb2kj1pTbdS9fFJASWr6CprjWi
XbCdez4dMhd+PGwgxHs6
=/r/D
-END PGP SIGNATURE-

--

___
Python tracker 

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



[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-07 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2013-11-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

IMHO '*' could be used as a separator, since relation between indexable fields 
and named, unindexable fields is similar to relation between 
positional-or-keyword parameters and keyword-only parameters.

$./python -c "import os; print(os.stat('LICENSE'))"
os.stat_result(st_mode=33188, st_ino=577299, st_dev=64512, st_nlink=1, 
st_uid=33616, st_gid=600, st_size=12749, st_atime=1382696747, 
st_mtime=1382361968, st_ctime=1382361968, *, st_atime=1382696747.0, 
st_mtime=1382361968.0, st_ctime=1382361968.0, st_atime_ns=13826967470, 
st_mtime_ns=13823619680, st_ctime_ns=13823619680, 
st_blksize=4096, st_blocks=32, st_rdev=0)

--

___
Python tracker 

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



[issue15114] Deprecate strict mode of HTMLParser

2013-11-07 Thread Ezio Melotti

Ezio Melotti added the comment:

3.4 is done.

3.5
strict arg removed and strict code removed
HTMLParseError removed
HTMLParser.error and calls to HTMLParser.error removed

--
Added file: http://bugs.python.org/file32535/issue15114-3.diff

___
Python tracker 

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



[issue19480] HTMLParser fails to handle some characters in the starttag

2013-11-07 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the feedback!

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

___
Python tracker 

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



[issue19480] HTMLParser fails to handle some characters in the starttag

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 695f988824bb by Ezio Melotti in branch '2.7':
#19480: HTMLParser now accepts all valid start-tag names as defined by the 
HTML5 standard.
http://hg.python.org/cpython/rev/695f988824bb

New changeset 9b9d188ed549 by Ezio Melotti in branch '3.3':
#19480: HTMLParser now accepts all valid start-tag names as defined by the 
HTML5 standard.
http://hg.python.org/cpython/rev/9b9d188ed549

New changeset 7d8a37020db9 by Ezio Melotti in branch 'default':
#19480: merge with 3.3.
http://hg.python.org/cpython/rev/7d8a37020db9

--
nosy: +python-dev

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What are you trying to achieve exactly? I don't think "sharing" identifier 
structs will gain anything significant. Please don't make the source code less 
readable in search for some mythical "efficiency".

--
nosy: +pitrou

___
Python tracker 

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



[issue19521] parallel build race condition on AIX since python-3.2

2013-11-07 Thread Michael Haubenwallner

New submission from Michael Haubenwallner:

Since python-3.2, there is a race condition building in parallel on AIX:

Consider these Makefile(.pre.in) rules:

$(BUILDPYTHON): ...
  $(LINKCC) ... $(LINKFORSHARED) ...

Modules/_testembed: ...
  $(LINKCC) ... $(LINKFORSHARED) ...

Modules/_freeze_importlib: ...
  $(LINKCC) ...

On AIX, the variables get these values:

LINKCC = $(srcdir)/Modules/makexp_aix Modules/python.exp ...
LINKFORSHARED = -Wl,-bE:Modules/python.exp ...

Now $(BUILDPYTHON) and Modules/_testembed may run in parallel, causing 
Modules/python.exp to be created by two instances of makexp_aix eventually 
running at the same time.

Attached patch fixes this problem for cpython tip (doubt supporting AIX 4.1 and 
earlier still is necessary).

Thank you!

--
components: Build
files: python-tip-aix-parallel.patch
keywords: patch
messages: 202357
nosy: haubi
priority: normal
severity: normal
status: open
title: parallel build race condition on AIX since python-3.2
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file32534/python-tip-aix-parallel.patch

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

merge_py_identifiers_sorted.patch looks good to me.

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread jan matejek

jan matejek added the comment:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dne 7.11.2013 16:56, Matthias Klose napsal(a):
> 
> Matthias Klose added the comment:
> 
> the patch in msg202343 is wrong, hardcoding lib64 on Debian/Ubuntu.

This patch is provided for reference only - it works for us at SUSE. I'll be
happy to spend some time improving it for general usage, if this has any
chance of being commited.

> At least the configure check should check for lib64 as a directory and not
> a symlink, and only then default to lib64.

Maybe this should be detected differently altogether. Perhaps by working with
LIBDIR, which is known to configure?

> 
> two other issues with the patch:
> 
> - I would like to see any new OS-dependent locations in the sysconfig
> module, not the sys module.

how would you propose to put the value into sysconfig in the first place? It
seems to rely heavily on existing attributes from sys.

> 
> - Please don't depend on uname for the autoconf check, but on the gnu host
> triplet.
> 
> - Please don't add another `arch' attribute to sys. We already have enough
> of these in sysconfig.

We don't use this one anymore, and i'm not entirely sure that we ever did. I
am happy to drop it.

> 
> --
> 
> ___ Python tracker
>   
> ___
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSe7pdAAoJEIskb84DCy7LvwcP/2n74K2XDsRu7K6OV9S4SzDa
v7vpDVhAgTBQlHglY+wavUQU2WLBlGyVEk2xHDV8WdI4zU7rAbn7XAW5URxznctq
t/Ptvt0IsDAqONrF8ezg8/eTUkcP3nV2Hk90RNe0gliDH6uc0wekKUZzVaTObO1L
3vM8XfEtTQstmK1VxQVpYolUPZm8n7Fe8NEPA6A8bu8CU736cg+wWdbDrr6Mjowo
OuO4b56J1P3BIQkBcOLe3mH20Bv8O03P9iNADwYHUOayvgthFWCmoDzh0Y1dQa9/
ynT+G9BuYyXOli6Yr15W0L8OFU+nwxByK81lEClz6UonCvoStnEWnXIN3JYW15Yb
rNwb5HKNmKB16yx/RuV3WCvlKbg6ziMlfWGW6qTA1g0P0ivU+sRVQXv5gI8NHcQ9
/4jmaUh7Dr1T4KHujI57Z99kLQHvSlHEM3v4aT96IZNaPghkA+e7TjhMdHmvYtQz
YoY75FIy0xVStdXzw8zbM2LVlKp8vxncrjYbuzJYgG1jiYwmF6gDoztXRVP/zwei
PypIiui4QaQc32V5dCwpQYpAvpgCVHm6sGSO0HbLWSUK71M8f1YU2BPwvglHb6jh
N9tmYfmahvQSyIFOZdb4C6HLlzEezENdYYIf7oMW07z8SOOLU+8eKP13dp6NWINP
HCSU34LLYTfwnQ+27aMk
=raBO
-END PGP SIGNATURE-

--

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Andrei Dorian Duma

Andrei Dorian Duma added the comment:

I added a new patch with sorted _Py_IDENTIFIERs.

Regarding all identifiers at the top, I guess it might be more stylish, but it 
might affect performance. I'm not sure, though.

--
Added file: http://bugs.python.org/file32533/merge_py_identifiers_sorted.patch

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

If most identifiers are stored in the same place, it would become possible to 
have a "cleanup" function to clear all identifiers. Such function could be 
called at Python shutdown to release as much memory as possible.

--

___
Python tracker 

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +andrei.duma, loewis

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Matthias Klose

Matthias Klose added the comment:

the patch in msg202343 is wrong, hardcoding lib64 on Debian/Ubuntu. At least 
the configure check should check for lib64 as a directory and not a symlink, 
and only then default to lib64.

two other issues with the patch:

 - I would like to see any new OS-dependent locations in the sysconfig module, 
not the sys module.

 - Please don't depend on uname for the autoconf check, but on the gnu host 
triplet.

 - Please don't add another `arch' attribute to sys. We already have enough of 
these in sysconfig.

--

___
Python tracker 

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



[issue18985] Improve the documentation in fcntl module

2013-11-07 Thread R. David Murray

R. David Murray added the comment:

Thanks, Vajrasky (and Victor :)

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

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Andrei Dorian Duma

Andrei Dorian Duma added the comment:

The patch I promised above.

--
Added file: http://bugs.python.org/file32532/merge_py_identifiers.patch

___
Python tracker 

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



[issue18985] Improve the documentation in fcntl module

2013-11-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0e0dded5d616 by R David Murray in branch '3.3':
#18985: Improve fcntl documentation.
http://hg.python.org/cpython/rev/0e0dded5d616

New changeset ddf6da99b3cd by R David Murray in branch 'default':
Merge #18985: Improve fcntl documentation.
http://hg.python.org/cpython/rev/ddf6da99b3cd

New changeset 645aa4f44aa4 by R David Murray in branch '2.7':
backport #18985: Improve fcntl documentation.
http://hg.python.org/cpython/rev/645aa4f44aa4

--
nosy: +python-dev

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Another matter of style: I suggest alphabetical order for the identifiers, at 
least when the list gets long.

--

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

As a matter of style, I suggest that all identifiers are moved to the top of a 
file if some of them live there. IOW, it's (IMO) unstylish to have some at the 
top, and some in the middle (although this works perfectly fine, of course).

--
nosy: +loewis

___
Python tracker 

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



[issue19520] Win32 compiler warning in _sha3

2013-11-07 Thread Christian Heimes

Christian Heimes added the comment:

Thanks! I'll look into it.

I'd rather not change the reference implementation but in this case 
practicality beats purity. :)

--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread fhahn

fhahn added the comment:

I've merged the _Py_IDENTIFIER identifiers mentioned above.

I stumbled over anohter instance where _Py_IDENTIFIER is used more than once: 

_Py_IDENTIFIER(__setitem__) : Objects/typeobject.c#l5133
_Py_IDENTIFIER(__setitem__) : Objects/typeobject.c#l5184

--
keywords: +patch
nosy: +fhahn
Added file: http://bugs.python.org/file32531/patch_19514.diff

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread Martin v . Löwis

Martin v. Löwis added the comment:

tok->enc and tok->encoding should always have the same value, except that 
tok->enc gets set earlier.

tok->enc is used when parsing from strings, to remember what codec to use. For 
file based parsing, the codec object created knows what encoding to use; for 
string-based parsing, tok->enc stores the encoding.

If the code is to be simplified, unifying the cases of string-based parsing and 
file-based parsing might be a worthwhile goal.

--
nosy: +loewis

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2013-11-07 Thread R. David Murray

R. David Murray added the comment:

Hmm.  Looking at this again, it appears as though there's no way to interrupt 
IDLE if you want to, say, send an email.  If you are actually using this in 
code, how are you handling that situation?

--

___
Python tracker 

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



[issue19520] Win32 compiler warning in _sha3

2013-11-07 Thread Zachary Ware

New submission from Zachary Ware:

There is only one remaining compiler warning on 32-bit Windows, see [1] 
(buildbot doubles warning counts on the Windows bots).

The warning is coming from Modules/_sha3/keccak/KeccakF-1600-opt32.c#l497, 
which uses extractLanes as defined on line 213.

The attached patch fixes the compiler warning, doesn't add any new ones, 
compiles, and doesn't break anything obvious.  I don't know enough about it to 
be confident in whether this is the right fix, so I'll leave it up to you, 
Christian :)

Thanks,

Zach


[1] 
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%203.x/builds/1682/steps/compile/logs/warnings%20%282%29

--
components: Build, Windows
files: sha3_compile_warning.diff
keywords: patch
messages: 202344
nosy: christian.heimes, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Win32 compiler warning in _sha3
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32530/sha3_compile_warning.diff

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread jan matejek

jan matejek added the comment:

Yes. We still have a patch for two things:
1. fix setup.py script to look for libraries in correct (lib64) prefixes, and
2. fix values returned from sysconfig, to reflect that python resides in lib64

"$prefix/lib" is hardcoded in many places. Lib64 is probably not going away 
anytime soon, so it would be nice if this was solved once and for all ;)
The good thing is that with sysconfig, we don't have to do much beyond teaching 
sysconfig about the right values.

To reiterate, our current solution is to introduce "sys.lib" (and "sys.arch", 
but that is never used anymore) that is either "lib" or "lib64", and use this 
in place of the string "lib" wherever appropriate. We find the value for 
sys.lib through configure magic.

--
Added file: http://bugs.python.org/file32529/Python-3.3.0b2-multilib.patch

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2013-11-07 Thread R. David Murray

R. David Murray added the comment:

What do you mean by the whole test routine failing?  The test suite is 
currently passing on the buildbots, so are you speaking of the new test you are 
trying to write?

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2013-11-07 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Is this issue still relevant?

--

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> The parser should check that the input is actually valid UTF-8 data.

Ah yes, correct. It looks like input data is still checked for valid
UTF-8 data. I suppose that the byte strings should be decoded from
UTF-8 because Python 3 manipulates Unicode strings, not byte strings.

The patch only skips calls to translate_into_utf8(str, tok->encoding),
calls to translate_into_utf8(str, tok->enc) are unchanged (notice:
encoding != enc :-)).

But it looks like translate_into_utf8(str, tok->enc) is not called if
tok->enc is NULL.

If tok->encoding is "utf-8" and tok->enc is NULL, maybe the input
string is not decoded from UTF-8. But it sounds strange, because
Python uses Unicode strings.

Don't trust me, I would prefer an explanation of Benjamin who knows
better than me the parser internals :-)

--

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The parser should check that the input is actually valid UTF-8 data.

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I added some comments on Rietveld.

Please do not commit without documentation and tests.

--

___
Python tracker 

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



[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

>> Errors become more unlikely because objects are only initialized once, near 
>> startup. So it put also less pressure on code handling errors :) (it is 
>> usually the least tested part of the code)

> If there are bugs in code handling errors, they should be fixed in 
> maintenance releases too.

Well, using identifiers doesn't solve directly all issues. For example, 
_PyDict_GetItemId() should be replaced with _PyDict_GetItemIdWithError() to be 
complelty safe. It just reduces the probability of bugs.

Using identifiers might add regressions for a minor gain (handling MemoryError 
better). As I did for issues #18048 and #19437 (related to issues found by 
failmalloc), I prefer to not backport such minor bugfixes to not risk a 
regression.

> You changed hundreds lines of code for speed up interactive mode by perhaps 
> several microseconds.

Again, performance is not the main motivation, please read again msg202293. Or 
maybe you disagree with this message?

Sorry, I didn't explain my changes in first messages of this issue. I created 
the issue to group my changesets to an issue, to explain why I did them. I 
didn't expect any discussion :-) But thank you for all your remarks.

--

___
Python tracker 

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



[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

> Serhiy is right. You have to be responsible with the Py* namespace, and keep 
> new functions private unless they are useful enough to the outside and you 
> document them.

I created the issue #19518 to discuss this part (but also to propose other 
enhancements related to Unicode).

--

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue1175] .readline() has bug WRT nonblocking files

2013-11-07 Thread Yuri Bochkarev

Changes by Yuri Bochkarev :


--
nosy: +Yuri.Bochkarev

___
Python tracker 

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

2013/11/7 Serhiy Storchaka :
>> On Windows, these changes should allow to pass an unencodable filename on 
>> the command line (ex: japanese script name on an english setup).
>
> Doesn't the surrogateescape error handler solve this issue?

surrogateescape is very specific to UNIX, or more generally systems
using bytes filenames. Windows native type for filename is Unicode. To
support any Unicode filename on Windows, you must never encode a
filename.

surrogateescape avoids decoding errors, here is the problem is an
encoding error.

For example, "abé" cannot be encoded to ASCII. "abé".encode("ascii",
"surrogateescape") doesn't help here.

--

___
Python tracker 

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



[issue9634] Add timeout parameter to Queue.join()

2013-11-07 Thread Yuri Bochkarev

Changes by Yuri Bochkarev :


--
nosy: +Yuri.Bochkarev

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2013-11-07 Thread Yuri Bochkarev

Changes by Yuri Bochkarev :


--
nosy: +Yuri.Bochkarev

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread STINNER Victor

STINNER Victor added the comment:

The patch has an issue, importing test.bad_coding2 (UTF-8 with a BOM) does not 
raise a SyntaxError anymore.

--
Added file: http://bugs.python.org/file32528/input_is_utf8.patch

___
Python tracker 

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-11-07 Thread Sunny K

Sunny K added the comment:

Oops, the correct issue for improving the repr is issue11698.

--

___
Python tracker 

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



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2013-11-07 Thread Sunny K

Sunny K added the comment:

The previous patch had a wrong mapping between keys and values. The 
current implementation of repr means that duplicated keys will be
present when invisible fields are included. See points 2 and 3 in
http://bugs.python.org/issue1820#msg202330 for more explanation.

I have sidestepped that issue by placing invisible fields under the dict 
argument. This also plays well with the current code in 
structseq_new and eval(repr(obj)) works.

The output with the patch is:

$./python -c "import os; print(os.stat('LICENSE'))"
os.stat_result(st_mode=33188, st_ino=577299, st_dev=64512, st_nlink=1, 
st_uid=33616, st_gid=600, st_size=12749, st_atime=1382696747, 
st_mtime=1382361968, st_ctime=1382361968,
dict={'st_atime':1382696747.0, 'st_mtime':1382361968.0,
'st_ctime':1382361968.0, 'st_atime_ns':13826967470, 
'st_mtime_ns':13823619680, 'st_ctime_ns':13823619680, 
'st_blksize':4096, 'st_blocks':32, 'st_rdev':0})

--
Added file: http://bugs.python.org/file32527/structseq_2.patch

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file32526/input_is_utf8.patch

___
Python tracker 

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



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2013-11-07 Thread Sunny K

Changes by Sunny K :


Removed file: http://bugs.python.org/file32265/structseq.patch

___
Python tracker 

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



[issue19519] Parser: don't transcode input string to UTF-8 if it is already encoded to UTF-8

2013-11-07 Thread STINNER Victor

New submission from STINNER Victor:

Python parser (Parser/tokenizer.c) has a translate_into_utf8() function to 
decode a string from the input encoding and encode it to UTF-8.

This function is unnecessary if the input string is already encoded to UTF-8, 
which is something common nowadays. Linux, Mac OS X and many other operating 
systems are now using UTF-8 as the default locale encoding, UTF-8 is the 
default encoding for Python scripts, etc. compile(), eval() and exec() 
functions pass UTF-8 encoded strings to the parser.

Attached patch adds an input_is_utf8 flag to the tokenizer to skip 
translate_into_utf8() if the input string is already encoded to UTF-8.

--
files: input_is_utf8.patch
keywords: patch
messages: 202331
nosy: benjamin.peterson, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Parser: don't transcode input string to UTF-8 if it is already encoded 
to UTF-8
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file32526/input_is_utf8.patch

___
Python tracker 

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-11-07 Thread Sunny K

Sunny K added the comment:

New patch for 3.4 adds the following:

1. _fields
2. _replace()
3. _asdict()
4. eval(repr(s)) == s

Now the issues:

1. _asdict() returns a normal dictionary. I don't know if this is what
   is required.

2. Both _asdict() and _replace() assume that unnamed visible fields are
   at the end of the visible sequence.  A comment at the beginning says
   they are allowed for indices < n_visible_fields.
   
   Is there another way to map members to values? Because tp->members
   is (visible named fields + invisible named fields) whereas values
   array is (visible named fields + visible unnamed fields + invisible
   named fields)

3. The mismatch mentioned above is present in the current
   implementation of repr:

   In os.stat_result, the last three visible fields are unnamed
   (i.e integer a_time, m_time and c_time). However they are present 
   in the repr output with keys which are the first three keys from the
   invisible part(float a_time, m_time and c_time).
   Was this intentional?

   Also, the above logic causes duplicate keys when invisible fields 
   are included in the repr output as per issue11629.
  
   In my patch for that issue, i put invisible fields under the 'dict'
   keyword argument. This output format utilises code already present 
   in structseq_new and makes eval work as expected when invisible 
   fields are present in repr. Also, it sidesteps the question of
   duplicated keys because they are present inside a dict.

4. Raymond stated that _fields should contain only the visible 
   positional fields. So _fields of os.stat_result contains only 7
   fields because of the three unnamed fields. Is this the expected 
   implementation?

5. Is there a way to declare a member function in C that accepts only 
   keyword arguments(like _replace())? I could not find one.

This is my first real C patch. So some of the issues might just be a
lack of understanding. Apologies.

--
keywords: +patch
nosy: +sunfinite
Added file: http://bugs.python.org/file32525/structseq_1.patch

___
Python tracker 

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



[issue17823] 2to3 fixers for missing codecs

2013-11-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-07 Thread Ian Cordasco

Changes by Ian Cordasco :


--
nosy: +icordasc

___
Python tracker 

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



  1   2   >