[issue6235] \d missing from effects of re.ASCII flag

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks, fixed in r73285.

--
resolution:  - fixed
status: open - closed

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



[issue2947] subprocess (Replacing popen) - add a warning / hint

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Patch looks good, except for strange code indentation in the replaced
example.

--
assignee: georg.brandl - r.david.murray

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



[issue1943] improved allocation of PyUnicode objects

2009-06-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Terry J. Reedy wrote:
 In the interest of possibly improving the imminent 3.1 release,
 I opened #6216
 Raise Unicode KEEPALIVE_SIZE_LIMIT from 9 to 32?

Thanks for opening that ticket.

 I wonder if it is possible to make it generically easier to subclass
 PyVarObjects (but my C knowledge to getting too faded to have any ideas).

Even if we were to add some pointer arithmetic tricks to at least
hide away the complexities, you'd no longer be able to change the
way the data memory allocation works.

The reason is simple: subclassing is about reusing existing method
implementations and only adding/changing a few of them.

If you want to change the way the allocation works, you'd have
to replace all of them.

Furthermore, using your subclasses objects with the existing APIs
would no longer be safe, since these would still assume the
original base class memory allocation scheme.

In summary:

Implementations like the unicoderef type I posted
and most of the other use cases I mentioned are no longer
possible, ie. you will *always* have to copy the data in order
to work with the existing Unicode APIs on it.

The current implementation has no problem with working on referenced
data, since support for this was built in right from the start.

That's what I meant with closing the door on future enhancements
that would make a huge difference if used right, for a mere
10% performance increase.

--

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



[issue6216] Raise Unicode KEEPALIVE_SIZE_LIMIT from 9 to 32?

2009-06-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

I think we should also consider raising the free list limit
of currently 1024 objects.

The keep-alive optimization currently uses at most 1024 * 9 * 2
= 18432 bytes (+ pymalloc overhead) on a UCS2 build of Python in
the worst case.

With a limit of 32 you get 65536 bytes.

Given that Unicode objects are one of the most used object in
Python 3k and looking at todays CPU cache sizes, it would
probably be fair to allocate up to 256kB for such an
optimization, e.g. by allowing up to 4096 objects to reside
in the free list.

--
nosy: +lemburg

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



[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-08 Thread ThurnerRupert

ThurnerRupert rupert.thur...@credit-suisse.com added the comment:

if one installes python for windows with the provided installer, and 
then run this python from mingw/msys or cygwin, python prints 
backslash as path separator instead of forward slash.

it would be nice if python would notice that it was started out of 
bash and this determines the path separator vs output, e.g. print to 
the console.

--

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



[issue4829] confusing error for file(foo, w++)

2009-06-08 Thread John Szakmeister

John Szakmeister j...@szakmeister.net added the comment:

The offending lines in io.py are:
modes = set(mode)
if modes - set(arwb+tU) or len(mode)  len(modes):
raise ValueError(invalid mode: %r % mode)

In particular, the or len(mode)  len(modes) is picking off the fact 
that there is repeated mode characters.  Leaving that off allows 
io.open() to behave exactly like the built-in open() call.

OTOH, someone obviously wanted to make sure that repeat mode characters 
were not allowed.  So I guess someone needs to rule on whether we want 
io.open() and io.FileIO() to behave like the built-in, or to keep things 
more strict.

--

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



[issue6213] Incremental encoder incompatibility between 2.x and py3k

2009-06-08 Thread Walter Dörwald

Walter Dörwald wal...@livinglogic.de added the comment:

This was done because the codec state is part of the return value of
tell(). To have a reasonable return value (i.e. one with just the
position itself) in as many cases as possible it makes sense to design
the codec state in such a way, that the most common state is 0. This is
what was done for py3k: The default state (no BOM read/written yet) is 2
not 0.

--
nosy: +doerwalter

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



[issue6213] Incremental encoder incompatibility between 2.x and py3k

2009-06-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Yes, I agree with py3k's behaviour. But it should be backported to 2.x
as well. I don't know where the changes must be done so if someone else
could do it it would be nice :-)
(I'm backporting the py3k IO lib and I had to disable two tests because
of this)

--

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



[issue6213] Incremental encoder incompatibility between 2.x and py3k

2009-06-08 Thread Walter Dörwald

Walter Dörwald wal...@livinglogic.de added the comment:

AFAICR the difference is: 2.x may return any object in getstate(), but
py3k must return a (buffered input, integer) tuple. Simply moving py3ks
getstate/setstate implementation over to 2.x might do the trick.

--

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



[issue4309] ctypes documentation

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I fixed this, and a few other bytes/string issues, in r73293.

--
resolution:  - fixed
status: open - closed

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Deferring to Martin which one is correct :)

--
assignee: georg.brandl - loewis
nosy: +loewis

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



[issue6099] HTTP/1.1 with keep-alive support for xmlrpclib.ServerProxy

2009-06-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

It turns out we need to deal with exceptions and clear the cached 
HTTPConnection if they happen.
Also, we just deal with a ECONNRESET which can happen if there is a long 
delay between requests, and retry the request once in that case.  New 
patch uploaded.

--
Added file: http://bugs.python.org/file14225/xmlprclib.patch

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



[issue6194] fcntl footnote about O_SHLOCK and O_EXLOCK is misleading

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks, fixed in r73294.

--
resolution:  - fixed
status: open - closed

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



[issue798058] IDLE / PyOS_InputHook

2009-06-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Guilherme, you did not actually close the issue

--
nosy: +amaury.forgeotdarc

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



[issue798058] IDLE / PyOS_InputHook

2009-06-08 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Uh oh, awesome. Thanks ;)

--
status: open - closed

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



[issue798058] IDLE / PyOS_InputHook

2009-06-08 Thread Guilherme Polo

Changes by Guilherme Polo ggp...@gmail.com:


--
resolution:  - rejected

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



[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

That would mean that python's notion of which OS it was running on
(windows or cygwin) would have to change depending on which shell it was
lanched from. This affects far more than the path seperator, and as far
as I know is not practical with the current python design (you are
welcome to try to work up a patch, though).

If you want cygwin behavior from python, run the cygwin python.

--
resolution:  - invalid
stage:  - committed/rejected

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



[issue6238] string.ljust documentation is missing optional fillchar description

2009-06-08 Thread Jason R. Coombs

New submission from Jason R. Coombs jar...@jaraco.com:

The documentation for string.ljust, string.rjust, and string.center is
missing the optional parameter fillchar.  The str.ljust documentation
appears to be correct.

This was observed in Python 2.6.2 documentation as found on the
docs.python.org site at the time of this report.

--
assignee: georg.brandl
components: Documentation
messages: 89083
nosy: georg.brandl, jaraco
severity: normal
status: open
title: string.ljust documentation is missing optional fillchar description
versions: Python 2.6

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This is definately a bug in 3.1, for the same reason that a C program
uses the C locale until an explicit setlocale is done: otherwise, a
non-locale-aware program can run into bugs resulting from locale issues
when run under a different locale than that of the program author.

I have a memory of this being reported before somewhere and someone
tracking it down to a change in python initialization, but I can't find
a bug report and my google-foo is failing me.

--
nosy: +r.david.murray
priority: normal - release blocker
stage:  - needs patch

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



[issue6238] string.ljust documentation is missing optional fillchar description

2009-06-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Fixed in r73296.  You shouldn't have been looking at those anyway :)

--
resolution:  - fixed
status: open - closed

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



[issue6239] c_char_p return value returns string, not bytes

2009-06-08 Thread Georg Brandl

New submission from Georg Brandl ge...@python.org:

If you assign a function a restype of c_char_p, you get back a Unicode
string, but you should get a bytes object.

 from ctypes import *
 strchr = cdll['libc.so.6'].strchr
 strchr.restype = c_char_p
 strchr.argtypes = [c_char_p, c_char]
 strchr(b'abcde', b'd')
'de'

--
assignee: theller
components: ctypes
messages: 89086
nosy: georg.brandl, theller
priority: critical
severity: normal
stage: needs patch
status: open
title: c_char_p return value returns string, not bytes
type: behavior
versions: Python 3.1

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



[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-08 Thread ThurnerRupert

ThurnerRupert rupert.thur...@credit-suisse.com added the comment:

to give an example case, running mercurial, which we do for a couple 
of years now with success. one install, starting it either from cmd, 
or mingw/msys bash:
$ hg status
M src\com\file.txt
$ hg co -m different path now src/com/file.txt

apart from the backslash in the printed paths, we are very happy on 
how neatly python handles this case. 

it is running on windows, using the standard libraries, .. therefor 
everything else is really windows. it would be quite an exceptional 
case if anything else would be affected. could you come up with an 
example which you were thinking on?

if you point us to some location in the code which would be best to 
start reading i'd be thankful.

--

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

For some reason only LC_CTYPE is affected:

 locale.getlocale(locale.LC_CTYPE)
('fr_FR', 'UTF8')
 locale.getlocale(locale.LC_MESSAGES)
(None, None)
 locale.getlocale(locale.LC_TIME)
(None, None)
 locale.getlocale(locale.LC_NUMERIC)
(None, None)
 locale.getlocale(locale.LC_COLLATE)
(None, None)

--
nosy: +pitrou

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Ah, I can tell you exactly why that is, then.  I noticed this in
pythonrun.c while grepping the source:

#ifdef HAVE_SETLOCALE
/* Set up the LC_CTYPE locale, so we can obtain
   the locale's charset without having to switch
   locales. */
setlocale(LC_CTYPE, );
#endif

SVN blames Martin in r56922, so this case is assigned appropriately. 
Perhaps changing only LC_CTYPE is safe?  I must admit to ignorance as to
what all the LC variables mean/control.

--

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

It would still be better it is was unset afterwards. Third-party
extensions could have LC_CTYPE-dependent behaviour.

--

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

I have a small script that reproduces the problem.  I couldn't 
reproduce it until I added some os.system() calls in the threads that 
were logging.  Here's the output using python 2.6.1:


Traceback (most recent call last):
  File C:\Python26\lib\logging\handlers.py, line 74, in emit
if self.shouldRollover(record):
  File C:\Python26\lib\logging\handlers.py, line 146, in 
shouldRollover
self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
ValueError: I/O operation on closed file


Here is the script - let me know if I'm doing things incorrectly:

import os, threading, logging, logging.handlers

class LoggerThread(threading.Thread):
def __init__(self, numLoops):
threading.Thread.__init__(self)
self.numLoops = numLoops


def run(self):
for x in range(0, self.numLoops):
os.system('cd.blah.txt')
os.system('del blah.txt')
logging.debug('This is log message ' + str(x) + ' from ' + 
self.name + ' and I think this should be a little longer, so I\'ll add 
some more data here because perhaps the size of the individual log 
message is a factor.  Who knows for sure until this simple test fails.')


if __name__==__main__:
logSize = 2048
numberOfLogs = 10

files = logging.handlers.RotatingFileHandler('logthred.log', 'a', 
logSize, numberOfLogs)
console = logging.StreamHandler()

# set a format
fileFormatter = logging.Formatter('%(asctime)s %(levelname)-8s %
(thread)-4s %(message)s')
consoleFormatter = logging.Formatter('%(asctime)s %(levelname)-8s %
(thread)-4s %(message)s')

# tell the handler to use this format
files.setFormatter(fileFormatter)
console.setFormatter(consoleFormatter)

# add the handlers to the root logger
logging.getLogger('').addHandler(files)
logging.getLogger('').addHandler(console)
logging.getLogger('').setLevel(logging.DEBUG)

numThreads = 10
numLoops = 100

# Create and execute threads
for x in range(0, numThreads):
LoggerThread(numLoops).start()

--
Added file: http://bugs.python.org/file14226/logthred.py

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

P.S. The above script and failure is running on winxp sp3.  Also, if 
you comment out the two os.system() calls, it works just fine.  They 
seem like they should be unrelated to the logging though.  You'll also 
see some errors about access to the blah.txt file which makes sense 
since multiple threads are hitting that file at the same time.  I don't 
know if this is about using os.system() itself from multiple threads 
while logging or if it's about having an error condition during the 
os.system() call on top of that.  Anyway, let me know what you think or 
if I've done something wrong, let me know how to fix it and that might 
be good documentation for others running into this problem.  Thanks.

--

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



[issue6135] subprocess seems to use local 8-bit encoding and gives no choice

2009-06-08 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar sridh...@activestate.com:


--
nosy: +srid

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Lowell Alleman

Lowell Alleman lowel...@gmail.com added the comment:

Robert, please provide the Python version and distribution that your are
using.  This should do the trick:

import sys
print sys.version

--
Added file: http://bugs.python.org/file14227/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4749
___Robert, please provide the Python version and distribution that your are 
using.  This should do the trick:brbrimport sysbrprint sys.versionbr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6135] subprocess seems to use local 8-bit encoding and gives no choice

2009-06-08 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar sridh...@activestate.com:


--
versions: +Python 2.6

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



[issue6135] subprocess seems to use local 8-bit encoding and gives no choice

2009-06-08 Thread Sridhar Ratnakumar

Sridhar Ratnakumar sridh...@activestate.com added the comment:

Related discussion thread: https://answers.launchpad.net/bzr/+question/63601

--

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



[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

So is this a cosmetic issue or a functional issue?  Either way, it is a
feature request and I've updated the issue to reflect that.

If you want to look at the code, ntpath.py is probably the relevant module.

--
priority: normal - low
resolution: invalid - 
stage: committed/rejected - 
type: behavior - feature request
versions: +Python 2.7, Python 3.2

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



[issue6240] API to get source encoding as defined by PEP 263

2009-06-08 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar sridh...@activestate.com:

It'd be nice to get the encoding used by a specific Python file.
Considering that 'print' uses sys.stdout.encoding which is always set to
None when the Python process is run by subprocess, knowing the source
encoding is absolutely necessary in decoding the output generated by
that script.

eg: Run 'python setup.py --author' in the python-wifi-0.3.1 source
package as a subprocess.Popen(...) call.. and print the stdout.read()
string; you'll get encoding error.. unless you do
stdout.read().decode('latin1') .. where latin1 is specified as a coding:
line in setup.py.

The following function tries to detect the coding, but this guess work
not necessary when this is integrated with the standard library whose
implementation maps directly to that of PEP 263.

+def get_python_source_encoding(python_file):
+Detect the encoding used in the file ``python_file``
 
+Detection is done as per http://www.python.org/dev/peps/pep-0263/
+
+first_two_lines = open(python_file).readlines()[:2]
+coding_line_regexp = .*coding[:=]\s*([-\w.]+).*
+
+for line in first_two_lines:
+m = re.match(coding_line_regexp, line)
+if m:
+return m.group(1)
+
+# if no encoding is defined, use the default encoding
+return 'ascii'

ref:
subprocess encoding mess: http://bugs.python.org/issue6135

--
components: Interpreter Core, Library (Lib)
messages: 89097
nosy: lemburg, loewis, srid
severity: normal
status: open
title: API to get source encoding as defined by PEP 263
type: feature request
versions: Python 2.7, Python 3.1, Python 3.2

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



[issue6216] Raise Unicode KEEPALIVE_SIZE_LIMIT from 9 to 32?

2009-06-08 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

If you write a patch, you are free to include the additional change.

--

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



[issue6240] API to get source encoding as defined by PEP 263

2009-06-08 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Already done. tokenize.detect_encoding()

--
nosy: +benjamin.peterson
resolution:  - invalid
status: open - closed

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



[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-06-08 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

The patch looks alright. I don't like the documentation for
PyUnicode_FromFormatV, however. Here's my attempt to document it:

.. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format,
va_list vargs)

   Equivalent to the function :cfunc:`PyUnicode_FromFormat`, except that
it takes a va_list instead of variable number of arguments.

--

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 It would still be better it is was unset afterwards. Third-party
 extensions could have LC_CTYPE-dependent behaviour.

In principle, they could, yes - but what specific behavior might that
be? What will change is character classification, which I consider
fairly harmless. Also, multi-byte conversion routines will change, which
is the primary reason for leaving it modified.

--
title: 3.x locale does not default to C, contrary to the documentation and to 
2.x behavior - 3.x locale does not default to C, contrary to the documentation 
and to 2.x behavior

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 In principle, they could, yes - but what specific behavior might that
 be? What will change is character classification, which I consider
 fairly harmless. Also, multi-byte conversion routines will change, which
 is the primary reason for leaving it modified.

Ok, so I suppose we could leave the code as-is.

--
title: 3.x locale does not default to C,contrary to the documentation 
and to 2.x behavior - 3.x locale does not default to C, contrary to the 
documentation and to 2.x behavior

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

 import sys
 print sys.version
2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)]

I have seen this behavior in older versions as well.  Interesting to 
see it fail in linux as well.

--

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



[issue6241] Better type checking for the arguments of io.StringIO

2009-06-08 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti alexan...@peadrop.com:

The included patch makes type checking of the arguments of StringIO
consistent between pyio and io.

 import io
 io.StringIO(bhello)
Traceback (most recent call last):
  ...
ValueError: initial_value must be str or None, not bytes
 io.StringIO(newline=b\n)
_io.StringIO object at 0x7f93d52953d0
 import _pyio as pyio
 pyio.StringIO(newline=b\n)
Traceback (most recent call last):
  ...
TypeError: illegal newline type: class 'bytes'

 io.StringIO([])
Traceback (most recent call last):
  ...
ValueError: initial_value must be str or None, not list
 pyio.StringIO([])
_pyio.StringIO object at 0x7f93d4942610

--
components: IO, Library (Lib)
files: typecheck_init_stringio.diff
keywords: patch
messages: 89104
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: patch review
status: open
title: Better type checking for the arguments of io.StringIO
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14231/typecheck_init_stringio.diff

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



[issue6242] Fix reference leak in io.StringIO

2009-06-08 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti alexan...@peadrop.com:

io.StringIO does not clear its reference to its attributes dictionary
when deleted. This causes a leak when io.StringIO has attributes. 

 def leak():
...for _ in range(100):
...  f = io.StringIO()
...  f.foo = 1
... 
[39348 refs]
 leak()
[39650 refs]
 leak()
[39950 refs]
 leak()
[40250 refs]

--
components: IO, Library (Lib)
files: fix_refleak_stringio.diff
keywords: patch
messages: 89105
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: patch review
status: open
title: Fix reference leak in io.StringIO
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14232/fix_refleak_stringio.diff

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



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-06-08 Thread nestor

nestor nestornis...@gmail.com added the comment:

This quick and dirty fix in pydoc.py makes so it no longer aborts help.

(less behaves somewhat strange for some commands but that is better than
no help at all)

def pipepager(text, cmd):
Page through text by feeding it to another program.
import subprocess
pipe=subprocess.Popen(cmd,stdin=subprocess.PIPE).stdin
#pipe = os.popen(cmd, 'w')
try:
pipe.write(bytes(text,sys.getdefaultencoding()))
#pipe.write(text)
pipe.close()
except IOError:
pass # Ignore broken pipes caused by quitting the pager program.

--

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



[issue6242] Fix reference leak in io.StringIO

2009-06-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

It seems wrong to call PyObject_ClearWeakRefs() in stringio_clear().
Weakrefs should only be notified when the object is deallocated, not
cleared.
Besides, you should add a test for this, so that the leak can be spotted
with regrtest -R.

--
nosy: +pitrou

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



[issue6218] Make io.BytesIO and io.StringIO picklable.

2009-06-08 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

I split the bug fixes in the patch into two separate issues. It looks
like pickling support for io.StringIO and io.BytesIO will have to wait
for 3.2.

--
dependencies: +Better type checking for the arguments of io.StringIO
Added file: http://bugs.python.org/file14233/pickle_support_for_memoryio-2.diff

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Lowell Alleman

Lowell Alleman lowel...@gmail.com added the comment:

I tested this against a number of different python installs that I
have laying around.  Here are the results that I found:

Releases that reproduce this bug:

Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Python 2.4.5 (#2, Jul 31 2008, 18:51:48) [GCC 4.2.3 (Ubuntu
4.2.3-2ubuntu7)] on linux2  (Ubuntu 8.04)
Python 2.4.6 (#2, Mar 19 2009, 10:00:53) [GCC 4.3.3] on linux2 (Ubuntu 9.04)
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32

The following release worked fine:
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu
4.2.3-2ubuntu7)] on linux2 (Ubuntu 8.04)
Python 2.5.4 (r254:67916, Apr  4 2009, 17:55:16) [GCC 4.3.3] on linux2
(Ubuntu 9.04)
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on
linux2 (Ubuntu 9.04)

--

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

P.S.  Frans - It's good to get these other data points from you.  So 
this is reproducible from another person and on different versions of 
python AND on different platforms!  I wasn't expecting that at all.  
Thanks Frans.

Is there a way we can reopen this bug?  I couldn't find a way to change 
its status now that we seem to have a reproducible case.  Perhaps Vinay 
is authorized to do so.

--

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



[issue6243] getkey() can segfault in combination with curses.ungetch()

2009-06-08 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

Snippet to reproduce:

import curses

scr = curses.initscr()
curses.ungetch(1025)
scr.getkey()

This is because `keyname()` in `PyCursesWindow_GetKey()` returns NULL
which is passed to `PyString_FromString()` then.

The attached patch fixes the segfault.

--
components: Library (Lib)
files: python_curses_ungetch_getkey.patch
keywords: patch
messages: 89111
nosy: Trundle
severity: normal
status: open
title: getkey() can segfault in combination with curses.ungetch()
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file14234/python_curses_ungetch_getkey.patch

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2009-06-08 Thread Timothy Farrell

Timothy Farrell tfarr...@swgen.com added the comment:

I've attached unittest.zip.  Simply unzip it to a directory and run it.
 I've included a Python2.x version of the unittest for the sake of
clarity.  The 2.x version was developed on 2.4.  The 3.x version was
developed on 3.0.1 and 3.1rc1 (with identical results).

It seems that there are several issues with cgi.FieldStorage and
multi-part form data.

- Does Formstation read in a Bytes or String?
-- It seems to expect a String but this yields invalid results for
uploading files.
-- A stream of Bytes would make more sense but loses it Pythonic
Batteries included nature if the user has to decode the encoding
manually for each form field.

--
Added file: http://bugs.python.org/file14235/unittest.zip

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

Thanks Lowell - good information.  You have many more versions of 
Python laying around than I do.  ;)

--

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



[issue6243] getkey() can segfault in combination with curses.ungetch()

2009-06-08 Thread Sebastian Ramacher

Changes by Sebastian Ramacher sebasti...@users.sourceforge.net:


--
nosy: +sebastinas

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



[issue3816] __newobj__ pickle feature is not documented

2009-06-08 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

Closing as the feature is documented in the section The __newobj__
unpickling function of PEP 307.

--
assignee: georg.brandl - 
resolution:  - invalid
status: open - closed

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



[issue5809] No such file or directory with framework build under MacOS 10.4.11

2009-06-08 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

Fixed in r73305 (trunk), r73306 (2.6) and r73307 (3.1) 

That is, with the above mentioned checkins configure will give a clear 
error message when you specify both --enable-framework and --enable-
shared.

--
resolution:  - fixed
status: open - closed

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

I just upgraded to 2.6.2 windows from python.org and it fails as well:

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

I hope Vinay can track this down in case it's a race condition that's 
just moving around between versions or track it down to something 
concrete that has actually been purposefully fixed somewhere else that 
fixes this too.  I guess we'll see.

Lowell - what's the difference between my 2.6.2 shown above and yours 
(release26-maint, Apr 19 2009)?  Yours is on ubuntu and mine is on 
windows, but I'm not familiar with the two version types (r262:71605 
vs. release26-maint).  Yours is 5 days newer - is it a patch?  What was 
changed in it that might affect this problem?  Just wondering aloud 
until Vinay can help make sense of all of this.  Thanks everyone.

--

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



[issue6244] Support for tcl 8.6

2009-06-08 Thread Michael Scherer

New submission from Michael Scherer m...@mandriva.org:

It seems that python do not compile with tcl 8.6. Here is a patch, done
by Adam Williamson, to add this version in the supported list. We are
using on mandriva since 6 months without trouble, so I think this is
safe to include. The patch is against version 2.6.3, but I can rediff if
needed.

--
components: Installation
files: python-2.5-tcl86.patch
keywords: patch
messages: 89117
nosy: misc
severity: normal
status: open
title: Support for tcl 8.6
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file14236/python-2.5-tcl86.patch

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



[issue6245] Add intel universal architecture on OSX

2009-06-08 Thread Ronald Oussoren

New submission from Ronald Oussoren ronaldousso...@mac.com:

Apple just announced that MacOSX 10.6 (Snow Leopard) will be released 
in September, and will only support intel systems.

This means that the --with-universal-archs option is not 100% usable if 
you want to build a version of Python that specifically targets this 
release of the OS.

The attached patch adds the option '--with-universal-archs=intel', which 
will build a 32-bit/64-bit framework for intel systemsn (that is i386 
and x86_64). 

Note: the patch is for the trunk, I'll port it to 3.x after review.

--
assignee: ronaldoussoren
components: Build, Macintosh
files: arch-intel.patch
keywords: needs review, patch
messages: 89118
nosy: ronaldoussoren
severity: normal
status: open
title: Add intel universal architecture on OSX
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14237/arch-intel.patch

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



[issue6244] Support for tcl 8.6

2009-06-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue6245] Add intel universal architecture on OSX

2009-06-08 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

What do you mean by not 100% usable? I would hope that a four-way
binary still works just fine, no? So what are the restrictions?

--
nosy: +loewis

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Since it controls what is considered to be whitespace, it is possible
this will lead to subtle bugs, but I agree that it seems relatively
benign, especially considering 3.x's unicode orientation.  So, this
becomes a doc bug...

--
components:  -Library (Lib)
priority: release blocker - high

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



[issue6244] Support for tcl 8.6

2009-06-08 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

This is a bit misleading. Python supports compiling with Tcl 8.6 and
Tkinter (and _tkinter) will work (or at least should work) with it, what
is not supported are tcl/tk versions below 8.3.1.

I'm ok with with patching setup.py to add this support for everyone
else, I have compiled python with tcl 8.6 before but didn't bother
suggesting this change in setup.py. Anyway, just came here to try to
clear this up and say there is nothing in python saying it doesn't
support tcl 8.6 (hope this helps anyone that got confused and thought
tcl 8.6 wasn't really supported by python).

--
nosy: +gpolo
versions: +Python 2.7, Python 3.1 -Python 2.6

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
priority:  - normal
status: closed - open
type: crash - behavior
versions:  -Python 2.4, Python 2.5

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I did some tests on the zip files which Frans attached to this post. The
reason you are getting errors is at least partly that you are not
following best practices in the test scripts. Specifically, the threads
are making system calls to update and delete blah.txt without handling
contention between them. Also, you are not joining on the created
threads before exiting the main thread, which means that the atexit code
will be invoked while the threads are still running. This is nothing
specifically to do with logging, except that logging registers an atexit
handler to close open files etc. So, you need to join the created threads.

I also found some mixture of tabs and spaces in the scripts Frans attached.

So, you need to test with the modified script which I am attaching here.
This script runs without problems on Ubuntu (Hardy/Python 2.5.2 built
Jul 31 2008 17:28:52 and Jaunty 2.6.2 built on Apr 19 2009 01:56:41).
There is still a problem on Windows, which appears to be related to an
error in os.rename. I am investigating this further to see if it is a
logging bug.

--
resolution: works for me - 
status: open - pending
Added file: http://bugs.python.org/file14238/revised-logthred.py

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



[issue4254] _cursesmodule.c callable update_lines_cols()

2009-06-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy:  -haypo

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



[issue6246] Python bebugger ignores exception if instructed to return from generator

2009-06-08 Thread Andreas Kloeckner

New submission from Andreas Kloeckner inf...@tiker.net:

I get this debugger session with the attached file. Note that even
though a NameError occurs, no indication of that error is visible on the
debugger conosle.
8 -
$ python -m pdb pdb_bug.py
 /home/andreas/tmp/pdb_bug.py(1)module()
- def f():
(Pdb) n
 /home/andreas/tmp/pdb_bug.py(6)module()
- list(f())
(Pdb) s
--Call--
 /home/andreas/tmp/pdb_bug.py(1)f()
- def f():
(Pdb) n
 /home/andreas/tmp/pdb_bug.py(2)f()
- print BLAH
(Pdb) r
BLAH
--Return--
 /home/andreas/tmp/pdb_bug.py(3)f()-None
- bogus
(Pdb)

--
components: Library (Lib)
files: pdb_bug.py
messages: 89123
nosy: inducer
severity: normal
status: open
title: Python bebugger ignores exception if instructed to return from generator
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file14239/pdb_bug.py

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Robert Cronk

Robert Cronk cron...@gmail.com added the comment:

I didn't care about the os.system() call contention because that's what 
caused the logging problem and that blah.txt file contention should not 
cause logging to fail.

I also had the join calls originally but took them out to simplify the 
code since it seemed to run correctly either way - if this were 
production code, I'd have left them in.

The revised script works for me on windows 2.6.2 (the version I 
upgraded to) but I think it just puts locks around the problem and 
masks the true problem out.  It appears something in os.system() is 
crashing logging and that shouldn't happen.  If locks need to be 
placed, they should be placed around the problem within os.system() or 
within logging, if needed.

Please take the locks off the os.system() calls and see why logging is 
failing when those calls are made.  Remember, this is a test script I 
wrote from scratch with the express purpose of making logging fail from 
multiple threads so you could catch it in a debugger or something.  
Changing the script to make it work misses the point.

--
status: pending - open

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


Removed file: http://bugs.python.org/file14238/revised-logthred.py

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



[issue5377] Strange behavior when performing int on a Decimal made from -sys.maxint-1

2009-06-08 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Thanks, Victor

You're welcome :-)

 - I'm getting a test failure in test_class

fixed

 - you should probably be using sys.maxint rather than sys.maxsize

done

 This still doesn't fix the case of int(Fraction(2L))

fixed: Fraction uses __trunc__ rather than __int__.

See updated patch: force_int-4.patch

--
Added file: http://bugs.python.org/file14240/force_int-4.patch

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



[issue5377] Strange behavior when performing int on a Decimal made from -sys.maxint-1

2009-06-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file13456/force_int-3.patch

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

Whoops, my revised test script still had some tabs. Replacing. Further
information on Windows - you sometimes get error 32 (cannot rename file
because owned by another process) because of anti-virus or Windows
indexing software having the file open. Can you please retry on Windows
but with anti-virus software and Windows indexing temporarily turned off
during the test? (On Windows you'll have to rename rm to del in the
os.system() call.

--
status: open - pending
Added file: http://bugs.python.org/file14241/revised-logthred.py

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



[issue6246] Python debugger ignores exception if instructed to return from generator

2009-06-08 Thread Andreas Kloeckner

Changes by Andreas Kloeckner inf...@tiker.net:


--
title: Python bebugger ignores exception if instructed to return from generator 
- Python debugger ignores exception if instructed to return from generator

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

On Ubuntu, without the locks around the os.system calls, I was not
getting any errors other than file-not-found errors on blah.txt - which
you would expect if another thread had just deleted the file. You didn't
post the errors which your test script was generating - and I assumed
you may have been referring to the file-not-founds on blah.txt.

You definitely need the join calls, as without them atexit processing in
the main thread will close the handlers when the threads are still
running. This will lead to errors like the ones you saw (I/O operation
on closed file), but this is not a bug - you definitely need to join on
all created threads before exiting the main thread - whether test or
production.

Please post the exact errors you are getting, after removing the locks
around the os.system calls. Delete all logthred.log files before the
test run, and please post the console output as Frans did. As I said in
my earlier comment - ensure that anti-virus, Windows indexing and any
other software which may open files at non-deterministic times is
disabled. If you are seeing a WindowsError with an error code of 32
(this might get lost in all the other output, but it's the first error I
found - the other messages look like they are a consequence of that
initial error).

--
status: pending - open

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

The last sentence in my last comment got truncated  - it's getting late
here ;-)

I meant to say: If you are seeing a WindowsError with an error code of 32
(this might get lost in all the other output, but it's the first error I
found - the other messages look like they are a consequence of that
initial error), then it looks as if *something* is definitely holding
the file open and that's why logging is failing. We just need to find
out what it is, maybe you can use the Sysinternals tools from Microsoft
(e.g. procexp, handle) to see what's holding the file open.

--

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



[issue6245] Add intel universal architecture on OSX

2009-06-08 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

The details of snow leopard are under NDA, but based on public 
information :

* Snow Leopard will only support Intel-based systems

* Apple's rosetta dynamaic translation subsystem for running PPC code 
on an intel system only supports 32-bit PPC code.

There is therefore no reason to include 64-bit PPC code in builds for 
Snow Leopard, and I wouldn't be surprised if SL would ship without 64-
bit PPC code in system frameworks.

--

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



[issue4309] ctypes documentation

2009-06-08 Thread Michael Newman

Michael Newman michael.b.new...@gmail.com added the comment:

Watch out on Line 247 of r73293:
bytes objcet
should be:
bytes object

--

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



[issue2947] subprocess (Replacing popen) - add a warning / hint

2009-06-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Applied (with spacing fix) in r73313.

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

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



[issue6245] Add intel universal architecture on OSX

2009-06-08 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 The details of snow leopard are under NDA, but based on public 
 information :

This is all fine, and really not surprising. My question is:
Why is that causing limited usability? I would expect that
Snow Leopard just ignores the PPC bits in the universal binaries,
and just accesses the x86 bits. The binaries might be larger
than necessary; people bothered by that could easily strip them
using ditto (IIUC).

I'm fine with an option of not building the PPC bits - I'm
just puzzled by the claim that, without the patch, it will
not be 100% usable.

--

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