[issue7120] logging depends on multiprocessing

2009-10-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Whatever the value of logMultiprocessing is, I suggest to not import the
multiprocessing module if the application did not import it before:
something like:

if "multiprocessing" in sys.modules:
from multiprocessing import current_process
self.processName = current_process().name
else:
# current_process().name returns this the first time
self.processName = 'MainProcess'

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue7111] core dump when stderr is moved

2009-10-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

> 3.1 exits silently.
Did you use "print"? pythonw.exe 3.1 sets sys.stdout to None.
if you use sys.stdout.write, you get an exception. But print() silently
does nothing if the file is None.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Here is my experimental patch.

--
keywords: +patch
nosy: +ocean-city
Added file: http://bugs.python.org/file15122/samefile.patch

___
Python tracker 

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



[issue7111] core dump when stderr is moved

2009-10-14 Thread Peter Eisentraut

Peter Eisentraut  added the comment:

For what it's worth, the code in question is used here (using "import
distutils" instead of "pass"):

http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/config/python.m4?rev=1.15;content-type=text%2Fx-cvsweb-markup

This is obviously a completely gratuitous variant on 2>/dev/null, but it
has apparently been working since forever.  I'll probably go make the
change anyway.

Nevertheless, I think Python shouldn't core dump.  It may choose to exit
doing nothing (useful) if it doesn't want to deal with this case.

Check this for possible alternative behaviors:

$ ls 1>&-
ls: write error: Bad file descriptor
($? = 2)
$ ls 1>&- 2>&-
($? = 2, no output)

--

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Whatever the value of logMultiprocessing is, I suggest to not import the

> multiprocessing module if the application did not import it before:
> something like:
> 
> if "multiprocessing" in sys.modules:
> from multiprocessing import current_process
> self.processName = current_process().name
> else:
> # current_process().name returns this the first time
> self.processName = 'MainProcess'
> 

I suggested "None" because that was the value used in r70348 when 
logMultipocessing is False. I presume you're only talking about when it's True? 
I'm confused by your "Whatever the value of logMultiprocessing is, ...".

Should the system behaviour really change depending on whether multiprocessing 
was already imported? I can see why you're suggesting it but it makes me a 
little uneasy :-S

--

___
Python tracker 

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



[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Erik Sandberg

Erik Sandberg  added the comment:

An alternative solution which I would have considered, is to extend
stat/fstat on Windows to set st_dev and st_ino to sensible values (based
on dwVolumeSerialNumber and nFileIndexLow/High), and then use the POSIX
implementations of samefile/sameopenfile.

There may be one potential problem with this solution though: It would
require stat to perform a CreateFile in addition to GetFileAttributesEx,
and I don't know if there are situations where one is allowed to call
the latter but not the former on a file. There would be no such problems
with fstat, though.

In your patch, I think the dwShareMode parameter to CreateFile* should
be changed to FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE so
make the operation less intrusive.

--

___
Python tracker 

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



[issue7069] inspect.isabstract to return boolean values only

2009-10-14 Thread chuck

chuck  added the comment:

That's fine with me. Looks like nobody wants to check it in anyways.

--

___
Python tracker 

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



[issue7122] multiprocessing.Pool() problem in windows

2009-10-14 Thread Alex

New submission from Alex :

Maybe I didn't understand how multiprocessing works but when running the
test code below I get 200+ processes in Windows and it never finishes.
It works fine on Linux.

--
components: Library (Lib)
files: prueba.py
messages: 93975
nosy: SirLalala
severity: normal
status: open
title: multiprocessing.Pool() problem in windows
versions: Python 2.6
Added file: http://bugs.python.org/file15123/prueba.py

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

`self.processName` could be a lazily computed property, since it doesn't
seem to be used anywhere by default. Something like:

_processName = None

@property
def processName(self):
n = self._processName
if n is not None:
return n
if 'multiprocessing' not in sys.modules:
n = 'mainProcess'
else:
n = sys.modules['multiprocessing'].current_process().name
self._processName = n
return n


If you don't like the overhead of a property, you could do the caching
dance in a __getattr__ method instead.

NB : if 'multiprocessing' isn't in sys.modules, it means that you can
only be in the main process, as far as I understand. Processes launched
by multiprocessing itself *will* have 'multiprocessing' in sys.modules,
unless it is doing really weird stuff.

--
nosy: +pitrou

___
Python tracker 

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



[issue7122] multiprocessing.Pool() problem in windows

2009-10-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This difference between Unix and Windows is documented there:
http://docs.python.org/library/multiprocessing.html#windows
Please carefully read the paragraph named "Safe importing of main module".

You will certainly need to add a condition like
   if __name__ == '__main__':
so that subprocesses (which start a new Python interpreter from the
start) don't start another Pool themselves.

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

New submission from Peter Saunders :

I have an example code that works fine on Python 2.6.3, but when run in
Python 3.1.1 - after a very short period of time, will go wrong.

Summary:

We have a queue, and when the queue has something in it (a list), we
start a thread to deal with that entry.

The thread then runs a Process for every entry in the list we popped off
the queue. The Process target takes a Pipe, and it sends "True" back
down the pipe, and then exits. However, this Process never goes defunct,
and thus the Thread that started the Process never reaps it. When doing
a truss on the Process, it sits there in:

lwp_park(0x, 0) (sleeping...)

--
files: testing.py
messages: 93978
nosy: p...@fodder.org.uk
severity: normal
status: open
title: Multiprocess Process does not always exit when run from a thread.
versions: Python 3.1
Added file: http://bugs.python.org/file15124/testing.py

___
Python tracker 

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



[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> extend stat/fstat on Windows to set st_dev and st_ino to sensible
> values (based on dwVolumeSerialNumber and nFileIndexLow/High)

Once I considered this approach, but problems was that
nFileIndexLow/High can change every time file handle is opened, so it's
not unique. See remarks in following page.
http://msdn.microsoft.com/en-us/library/aa363788%28VS.85%29.aspx

> I think the dwShareMode parameter to CreateFile* should
> be changed to FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
> so make the operation less intrusive.

Probably you are right. I must admit I'm not familiar with this *shared*
flag, and I was careless about its usage.

--

___
Python tracker 

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



[issue7124] idle.py -n : help() doesn't work in a reopened shell window

2009-10-14 Thread Gregor Lingl

New submission from Gregor Lingl :

The following procedure reveals a problem with help:

1) Start IDLE with -n option (no subprocess)
2) Create a script (e. g. helloworld one-liner
3) Run script
4) Close Shell Window
5) Via Menu: Run | Python Shell reopen Shell window
6) >>> help(print)
Help on ...
...
end:  string appended after the last value, default a newline.
Traceback (most recent call last):
  File "", line 1, in 
help(print)
  File "C:\Python31\lib\site.py", line 429, in __call__
return pydoc.help(*args, **kwds)
  File "C:\Python31\lib\pydoc.py", line 1710, in __call__
self.help(request)
  File "C:\Python31\lib\pydoc.py", line 1758, in help
self.output.write('\n')
  File "C:\Python31\lib\idlelib\PyShell.py", line 1231, in write
self.shell.write(s, self.tags)
  File "C:\Python31\lib\idlelib\PyShell.py", line 1212, in write
self.text.mark_gravity("iomark", "right")
AttributeError: 'NoneType' object has no attribute 'mark_gravity'
>>> 

So in a re-opened Shell-Window in an IDLE in -n mode, help() doesn't
work correctly.

Regards,
Gregor

--
components: IDLE
messages: 93980
nosy: gregorlingl
severity: normal
status: open
title: idle.py -n : help() doesn't work in a reopened shell window
type: behavior
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

Further information: it doesn't fail everytime in Python 3.1 - usually 1
in 4, or 1 in 5 times. It never fails with Python 2.6.3

Example output from the script when its failing (python 3.1):

Starting data1
Starting data2
Started subproc: PID: 20209 : args: data1
poll
Started subproc: PID: 20210 : args: data2
poll
Child has sent:True
poll
Child has sent:True
poll
isalive: False
isalive: True
Reaping PID: 20210
isalive: True
poll
Finishing: data2
isalive: True
poll
isalive: True
poll
isalive: True
poll
isalive: True
poll
:
isalive: True
poll
isalive: True
terminating
Child had to be killed due to a timeout
Finishing: data1
True

Working output (consistantly works on Python 2.6.3):
Starting data1
Starting data2
Started subproc: PID: 20252 : args: data1
poll
Started subproc: PID: 20253 : args: data2
poll
Child has sent:True
Child has sent:True
poll
Child has sent:True
poll
isalive: False
isalive: False
isalive: False
Reaping PID: 20252
Reaping PID: 20253
Finishing: data1
Finishing: data2
True

--

___
Python tracker 

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



[issue7058] Add some test execution environment protection to regrtest

2009-10-14 Thread R. David Murray

Changes by R. David Murray :


Removed file: 
http://bugs.python.org/file15107/refactored_environment_checking.patch

___
Python tracker 

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



[issue7058] Add some test execution environment protection to regrtest

2009-10-14 Thread R. David Murray

R. David Murray  added the comment:

Here is an updated patch that doesn't break -j.

--
Added file: 
http://bugs.python.org/file15125/refactored_environment_checking.patch

___
Python tracker 

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



[issue7058] Add some test execution environment protection to regrtest

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks good to me. Not sure it should be backported though, the patch has
become really sizeable.

--

___
Python tracker 

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



[issue7058] Add some test execution environment protection to regrtest

2009-10-14 Thread R. David Murray

R. David Murray  added the comment:

I agree about not backporting the new patch.

--

___
Python tracker 

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



[issue1104249] configure doesn't set up CFLAGS properly

2009-10-14 Thread M Joonas Pihlaja

M Joonas Pihlaja  added the comment:

Here's a test case:

$ CFLAGS="--haflkhlaiuhfnafkghnaf" ./configure; make
[... configure does its thing... ]
[... make does its thing and completes successfully ...]

Expected result:  The build fails due to an unknown flag in CFLAGS.

Witnessed result:  CFLAGS is completely ignored.

--
nosy: +joonas

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> jnoller
components: +Library (Lib)
nosy: +jnoller
priority:  -> normal
type:  -> behavior
versions: +Python 3.2

___
Python tracker 

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



[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Erik Carstensen

Erik Carstensen  added the comment:

> Once I considered this approach, but problems was that
> nFileIndexLow/High can change every time file handle is opened, so
> it's not unique.

Ah, I see, then your approach makes sense.

There's another part of your patch that I don't understand:

+except ImportError: # not running on Windows - mock up something sensible
+from posixpath import samefile # XXX

In what situations will this happen, and are we guaranteed in those
cases that samefile will be found in posixpath?

--

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Acccording to http://blogs.sun.com/chrisg/entry/lwp_park_and_lwp_unpark,
the lwp_park() call could point to a mutex which is waiting to be acquired.

--
nosy: +pitrou

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

Well, if it helps, here is the output of the dtrace script from starting
of a loop with the failure, and stopping during the failure.

--
Added file: http://bugs.python.org/file15126/dtrace.txt

___
Python tracker 

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



[issue7125] typo (English) in threading.py

2009-10-14 Thread Yinon Ehrlich

New submission from Yinon Ehrlich :

threading.py line 122:
"cannot release un-aquired lock" --> "cannot release un-acquired lock"

--
components: Library (Lib)
messages: 93989
nosy: Yinon
severity: normal
status: open
title: typo (English) in threading.py
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 
3.1, Python 3.2

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Does it not happen if you call your checkAlive() function directly from
your main() function?

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

With r75397:

test___all__ leaked [1, 1] references, sum=2
test_asyncore leaked [1, 0] references, sum=1
test_distutils leaked [0, 2] references, sum=2
test_httpservers leaked [-259, 0] references, sum=-259
test_os leaked [-23, 23] references, sum=0
test_pydoc leaked [0, -21] references, sum=-21
test_threaded_import leaked [1, 0] references, sum=1
test_urllib leaked [4, 4] references, sum=8
test_uuid leaked [6, 6] references, sum=12
test_urllib2_localnet leaked [240, -239] references, sum=1

--

___
Python tracker 

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



[issue7125] typo (English) in threading.py

2009-10-14 Thread Yinon Ehrlich

Yinon Ehrlich  added the comment:

just saw now that the word 'un-aquired' is repeated several times in the
threading module...

--

___
Python tracker 

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



[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I'm not sure about this neither. So, XXX is in comment. ;-)

On abspath() above, it also tries to import native method
_getfullpathname(), and when it fails alternative implementation runs.
(probably when someone calls ntpath.abspath from linux or somewhere.
Does it really happen? I don't know)

I was not sure what kind of alternative implementation is appropriate,
so I borrowed posixmodule's one. Probably more appropriate
implementation may exist.

--

___
Python tracker 

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



[issue7126] Contradictory documentation for os.putenv and os.system

2009-10-14 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

The documentation for os.putenv states that "changes to the environment
affect subprocesses started with os.system(), popen() or fork() and
execv()" and "assignments to items in os.environ are automatically
translated into corresponding calls to putenv()".

However, the documentation for os.system() states "Changes to os.environ
... are not reflected in the environment of the executed command."

A simple test confirms that the os.putenv documentation is the correct one:

Python 2.6
>>> import os
>>> os.environ['foo'] = 'bar'
>>> os.system('echo $foo')
bar
0
>>>

--
assignee: georg.brandl
components: Documentation
messages: 93994
nosy: georg.brandl, stutzbach
severity: normal
status: open
title: Contradictory documentation for os.putenv and os.system
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

As for the dtrace output: I'm not a Solaris expert unfortunately, I was
just trying to suggest a possible direction for diagnosing this problem.

--

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

If you mean, in main() instead of doing:

while True:
q.put(["data1", "data2"])
t = Process(target=popJobs, args=(q, ))
t.start()
t.join()

and doing:

while True:
q.put(["data1", "data2"])
popJobs(q)

instead. Then, the bug does indeed occur the same way. It did take more
iterations before it occured however. 

If however, you meant:

while True:
   fail=failureObject()
   for x in ["data1", "data2"]:
   checkAlive(fail, x)
   print(fail.status())

Then the bug never occurs.

--

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

Same thing occurs, as you would expect, when I do:

while True:
fail=failureObject()
tlist = []
for x in ["data1", "data2"]:
t = threading.Thread(target=checkAlive, args = (fail, x), name=x)
t.start()
tlist.append(t)

for x in tlist:
t.join()

--

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

Further oddness:

When running the script (i've reduced its size further now, see attached):

I get the following output:

Reaping PID: 23215
True
Started subproc: PID: 23216 : args: data1
Started subproc: PID: 23216 : args: data1
Started subproc: PID: 23217 : args: data2
poll
isalive: True
isalive: True
poll


Notice the Started subprod of the SAME PID and the Same args twice, yet
this print only occurs once in the code, and I can't see how this should
happen?

--
Added file: http://bugs.python.org/file15127/testing.py

___
Python tracker 

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



[issue7125] typo (English) in threading.py

2009-10-14 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in r75402. Not backporting, since an exception message is changed.

Thanks!

--
nosy: +georg.brandl
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Notice the Started subprod of the SAME PID and the Same args twice, yet
> this print only occurs once in the code, and I can't see how this should
> happen?

This is a thread-safety issue in sys.stdout/stderr, it will be fixed in
3.1.2 (see issue6750).

--

___
Python tracker 

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



[issue7126] Contradictory documentation for os.putenv and os.system

2009-10-14 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r75403.

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

___
Python tracker 

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



[issue7123] Multiprocess Process does not always exit when run from a thread.

2009-10-14 Thread Peter Saunders

Peter Saunders  added the comment:

Sorry for the spam on the updates :) - but, its the same thread printing
this out too. I changed the print line to:

curThread = threading.current_thread()
print("Started subproc: PID: %d : args: %s Thread ID: %s" %(newJob.pid,
str(args), str(curThread.ident)))

and got the output:

Reaping PID: 23707
True
Started subproc: PID: 23709 : args: data1 Thread ID: 12
Started subproc: PID: 23709 : args: data1 Thread ID: 12
poll
isalive: True
Started subproc: PID: 23710 : args: data2 Thread ID: 13
poll
isalive: True

Again, I can't see how this could pring it out twice? Could this be
related to the problem we are having? Altgough I do seem to get the line
twice on 2.6.3 as well - but nothing like as often..

--

___
Python tracker 

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



[issue7127] regrtest -j fails when tests write to stderr

2009-10-14 Thread R. David Murray

New submission from R. David Murray :

If a test writes to stderr, then the -j (multiprocessing) support in
regrtest fails to correctly extract the JSON data from the test output,
resulting in a JSON traceback followed by a failure of the worker
thread.  Antoine has suggested tagging the JSON result string with a
prefix and looking for that prefix, instead of the current method (which
assumes that the JSON result string is at the end of the output from the
test).

--
components: Tests
keywords: easy
messages: 94003
nosy: pitrou, r.david.murray
priority: low
severity: normal
stage: needs patch
status: open
title: regrtest -j fails when tests write to stderr
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue7128] cPickle looking for non-existent package copyreg

2009-10-14 Thread Joseph C Wang

New submission from Joseph C Wang :

When running cPickle in restricted mode, the module tries to import
copyreg which does not appear to exist anywhere.  The problem is in
cPickle.c 

 2980   if (PyEval_GetRestricted()) {
 2981   /* Restricted execution, get private tables */
 2982   PyObject *m = PyImport_Import(copyreg_str);
 2983 
 2984   if (m == NULL)
 2985   goto err;
 2986   self->dispatch_table = PyObject_GetAttr(m, dispatch_table_str);
 2987   Py_DECREF(m);
 2988   if (self->dispatch_table == NULL)
 2989   goto err;
 2990   }
 2991   else {
 2992   self->dispatch_table = dispatch_table;
 2993   Py_INCREF(dispatch_table);
 2994   }

copyreg_str should probably be copy_reg_str

--
components: Interpreter Core
messages: 94004
nosy: joequant
severity: normal
status: open
title: cPickle looking for non-existent package copyreg
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue7091] Distutils build ignores the --compiler command line option

2009-10-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Duplicate of #7068

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> 2.6.3 does not use specified compiler

___
Python tracker 

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



[issue7112] unicodetype_db.h warning: integer constant is too large for 'long'

2009-10-14 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
status: open -> closed

___
Python tracker 

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



[issue7065] bytes.maketrans segfaults

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch committed in r75404 and r75406. Thanks!

--
nosy: +pitrou
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7069] inspect.isabstract to return boolean values only

2009-10-14 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> benjamin.peterson
nosy: +benjamin.peterson

___
Python tracker 

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



[issue7129] 'filling' missing in __all__

2009-10-14 Thread Gregor Lingl

New submission from Gregor Lingl :

By oversight the turtle graphics function filling is missing in the
__all__ list which is composed by several parts, among them
_tg_turtle_functions.

So 'filling' has to be added to _tg_turtle_functions

a path is attached

--
components: Library (Lib)
files: filling-bug.diff
keywords: patch
messages: 94007
nosy: georg.brandl, gregorlingl, loewis
severity: normal
status: open
title: 'filling' missing in __all__
type: resource usage
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15128/filling-bug.diff

___
Python tracker 

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



[issue7129] 'filling' missing in __all__ ot turtle.py

2009-10-14 Thread Gregor Lingl

Changes by Gregor Lingl :


--
title: 'filling' missing in __all__ -> 'filling' missing in __all__ ot turtle.py

___
Python tracker 

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



[issue7129] 'filling' missing in __all__ ot turtle.py

2009-10-14 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in r75416.

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

___
Python tracker 

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



[issue7116] str.join() should be documented as taking an iterable

2009-10-14 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r75418.

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

___
Python tracker 

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



[issue7130] json uses sre_* modules which may not work on alternate implemenations

2009-10-14 Thread Dino Viehland

New submission from Dino Viehland :

Currently the json module is using the sre_* modules to construct it's 
regular expressions instead of just using the re module directly.  

Because of this it's taking a dependency on what would appear to be 
CPython specific implementation details (sre_* appear to be 
undocumented) and a deprecated module.  The end result is that json 
decoding doesn't work on IronPython and may not work on other Python 
implementations.

--
components: Library (Lib)
messages: 94010
nosy: DinoV
severity: normal
status: open
title: json uses sre_* modules which may not work on alternate implemenations
type: behavior

___
Python tracker 

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



[issue4610] Unicode case mappings are incorrect

2009-10-14 Thread Jeff Senn

Jeff Senn  added the comment:

> Feel free to upload it here. I'm fairly skeptical that it is
> possible to implement casing "correctly" in a locale-independent
> way.

Ok. I will try to find time to complete it enough to be readable.

Unicode (see sec 3.13) specifies the casing of unicode strings pretty 
completely -- i.e. it gives "Default Casing" rules to be used when no 
locale specific "tailoring" is available.  The only dependencies on 
locale for the special casing rules are for Turkish, Azeri, and 
Lithuanian.  And you only need to know that that is the language, no 
other details.  So I'm sure that a complete implementation is possible 
without resort to a lot of locale munging -- at least for .lower() 
.upper() and .title().

.swapcase() is just ...err... dumb^h^h^h^h questionably useful. 

However .capitalize() is a bit weird; and I'm not sure it isn't 
incorrectly implemented now:

It UPPERCASES the first character, rather than TITLECASING, which is 
probably wrong in the very few cases where it makes a difference:
e.g. (using Croatian ligatures)

>>> u'\u01c5amonjna'.title()
u'\u01c4amonjna'
>>> u'\u01c5amonjna'.capitalize()
u'\u01c5amonjna'

"Capitalization" is not precisely defined (by the Unicode standard) -- 
the currently python implementation doesn't even do what the docs say: 
"makes the first character have upper case" (it also lower-cases all 
other characters!), however I might argue that a more useful 
implementation "makes the first character have titlecase..."

--

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've fixed a bunch of them: aifc (r75407), test_atexit (r75408), bsddb
(r75409), test_calendar (r75410), StringIO (r75411), socket (r75412),
sndhdr (r75413), test_memoryio (r75415), test_profilehooks (r75417),
test_random (r75419), httplib (r75420), uuid (r75421).

--

___
Python tracker 

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



[issue1754094] Tighter co_stacksize computation in stackdepth_walk

2009-10-14 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Committed to the Python 2.x and 3.x trunks.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue7131] Extension module build fails for MinGW: missing vcvarsall.bat

2009-10-14 Thread Dieter Verfaillie

New submission from Dieter Verfaillie :

Using Python 2.6.3 on Windows XP, distutils fails building an extension
module when mingw32 is specified as the compiler. Distutils fails with
the error message "Unable to find vcvarsall.bat".

Looking back in the subversion history for the distutils build_ext
command
(http://svn.python.org/view/python/tags/r263/Lib/distutils/command/build_ext.py?view=log)
I've found that line 306 has been changed in revision 72594 to read:
self.compiler = new_compiler(compiler=None,

reverting back to revision 72586, so the code reads:
self.compiler = new_compiler(compiler=self.compiler,

seems to fix the problem.

--
assignee: tarek
components: Distutils, Windows
messages: 94014
nosy: dieterv, tarek
severity: normal
status: open
title: Extension module build fails for MinGW: missing vcvarsall.bat
type: compile error
versions: Python 2.6

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a record of stderr after a new regrtest run.

--
Added file: http://bugs.python.org/file15129/stderr.log

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

(interestingly, one of the culprits for py3k warnings is lib2to3)

--

___
Python tracker 

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



[issue7110] Output test failures on stderr in regrtest.py

2009-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue4610] Unicode case mappings are incorrect

2009-10-14 Thread Jeff Senn

Jeff Senn  added the comment:

Yikes! I just noticed that u''.title() is really broken! 

It doesn't really pay attention to word breaks -- 
only characters that "have case".  
Therefore when there are (caseless)
combining characters in a word it's really broken e.g.

>>> u'n\u0303on\u0303e'.title()
u'N\u0303On\u0303E'

That is (where '~' is combining-tilde-over)
n~on~e -title-cases-to-> N~On~E

--

___
Python tracker 

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



[issue6855] ihooks support for relative imports

2009-10-14 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

I've been using this version of ihooks for some time and it seems to
work fine. Committing the patch.

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

___
Python tracker 

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



[issue4152] ihooks module cannot handle absolute imports

2009-10-14 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Fixed in SVN rev 75423.

--
nosy: +nascheme
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue1101399] dict subclass breaks cPickle noload()

2009-10-14 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Applied to 2.x trunk. The 3.x version _pickle.c doesn't have the noload
 method.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

Fix checked into release26-maint (r75425). Please verify in GAE
environment, will make same fix in trunk and py3k once verified.

Fixed based on Antoine's message, though not identical to his posted code.

--
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

New submission from Philippe Verdy :

For now, when capturing groups are used within repetitions, it is impossible to 
capure what they match 
individually within the list of matched repetitions.

E.g. the following regular expression:

(0|1[0-9]{0,2}|2(?:[0-4][0-9]?|5[0-5]?)?)(?:\.(0|1[0-9]{0,2}|2(?:[0-4][0-9]?|5[0-5]?)?)){3}

is a regexp that contains two capturing groups (\1 and \2), but whose the 
second one is repeated (3 times) to 
match an IPv4 address in dotted decimal format. We'd like to be able to get the 
individual multiple matchs 
for the second group.

For now, capturing groups don't record the full list of matches, but just 
override the last occurence of the 
capturing group (or just the first if the repetition is not greedy, which is 
not the case here because the 
repetition "{3}" is not followed by a "?"). So \1 will effectively return the 
first decimal component of the 
IPv4 address, but \2 will just return the last (fourth) decimal component.


I'd like to have the possibility to have a compilation flag "R" that would 
indicate that capturing groups 
will not just return a single occurence, but all occurences of the same group. 
If this "R" flag is enabled, 
then:

- the Match.group(index) will not just return a single string but a list of 
strings, with as many occurences 
as the number of effective repetitions of the same capturing group. The last 
element in that list will be the 
one equal to the current behavior

- the Match.start(index) and Match.end(index) will also both return a list of 
positions, those lists having 
the same length as the list returned by Match.group(index).

- for consistency, the returned values as lists of strings (instead of just 
single strings) will apply to all 
capturing groups, even if they are not repeated.


Effectively, with the same regexp above, we will be able to retreive (and 
possibily substitute):

- the first decimal component of the IPv4 address with "{\1:1}" (or "{\1:}" or 
"{\1}" or "\1" as before), 
i.e. the 1st (and last) occurence of capturing group 1, or in 
Match.group(1)[1], or between string positions Match.start(1)[1] and 
Match.end(1)[1] ;

- the second decimal component of the IPv4 address with "{\2:1}", i.e. the 1st 
occurence of capturing group 
2, or in Match.group(2)[1], or between string positions Match.start(2)[1] and 
Match.end(2)[1] ;

- the third decimal component of the IPv4 address with "{\2:2}", i.e. the 2nd 
occurence of capturing group 2, 
or in Match.group(2)[2], or between string positions Match.start(2)[2] and 
Match.end(2)[2] ;

- the fourth decimal component of the IPv4 address with "{\2:3}" (or "{\2:}" or 
"{\2}" or "\2"), i.e. the 3rd 
(and last) occurence of capturing group 2, or in Match.group(2)[2], or between 
string positions 
Match.start(2)[3] and Match.end(2)[3] ;


This should work with all repetition patterns (both greedy and not greedy, 
atomic or not, or possessive), in 
which the repeated pattern contains any capturing group.


This idea should also be submitted to the developers of the PCRE library (and 
Perl from which they originate, 
and PHP where PCRE is also used), so that they adopt a similar behavior in 
their regular expressions.

If there's already a candidate syntax or compilation flag in those libraries, 
this syntax should be used for 
repeated capturing groups.

--
components: Library (Lib)
messages: 94022
nosy: verdy_p
severity: normal
status: open
title: Regexp: capturing groups in repetitions
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue4610] Unicode case mappings are incorrect

2009-10-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Jeff Senn wrote:
> 
> Jeff Senn  added the comment:
> 
> Yikes! I just noticed that u''.title() is really broken! 
> 
> It doesn't really pay attention to word breaks -- 
> only characters that "have case".  
> Therefore when there are (caseless)
> combining characters in a word it's really broken e.g.
> 
 u'n\u0303on\u0303e'.title()
> u'N\u0303On\u0303E'
> 
> That is (where '~' is combining-tilde-over)
> n~on~e -title-cases-to-> N~On~E

Please have a look at http://bugs.python.org/issue6412 - that patch
addresses many casing issues, at least up the extent that we can
actually fix them without breaking code relying on:

len(s.upper()) == len(s)

for upper/lower/title.

If we add support for 1-n code point mappings, then we can only
enable this support by using an option to the casing methods (perhaps
not a bad idea: the parameter could be used to signal the local
to assume).

--

___
Python tracker 

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



[issue4610] Unicode case mappings are incorrect

2009-10-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Jeff Senn wrote:
> However .capitalize() is a bit weird; and I'm not sure it isn't 
> incorrectly implemented now:
> 
> It UPPERCASES the first character, rather than TITLECASING, which is 
> probably wrong in the very few cases where it makes a difference:
> e.g. (using Croatian ligatures)
> 
 u'\u01c5amonjna'.title()
> u'\u01c4amonjna'
 u'\u01c5amonjna'.capitalize()
> u'\u01c5amonjna'
> 
> "Capitalization" is not precisely defined (by the Unicode standard) -- 
> the currently python implementation doesn't even do what the docs say: 
> "makes the first character have upper case" (it also lower-cases all 
> other characters!), however I might argue that a more useful 
> implementation "makes the first character have titlecase..."

You don't have to worry about .capitalize() and .swapcase() :-)

Those methods are defined by their implementation and don't resemble
anything defined in Unicode.

I agree that they are, well, not that useful.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

I'd like to add that the same behavior should also affect the span(index) 
method of MatchObject, that should also not just return a single (start, 
end) pair, but that should in this case return a list of pairs, one for 
each occurence, when the "R" compilation flag is specified.

This also means that the regular expression compilation flag R should be 
supported as these constants:
Regexp.R, or Regexp.REPETITIONS

--

___
Python tracker 

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



[issue4610] Unicode case mappings are incorrect

2009-10-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> .swapcase() is just ...err... dumb^h^h^h^h questionably useful. 

FWIW, it appears that the original use case (as an Emacs macro) was to
correct blocks of text where touch typists had accidentally left the
CapsLocks key turned on:  tHE qUICK bROWN fOX jUMPED oVER tHE lAZY dOG.

I agree with the rest of you that Python would be better-off without
swapcase().

--
nosy: +rhettinger

___
Python tracker 

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



[issue812369] module shutdown procedure based on GC

2009-10-14 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Does this patch fix issue1545463 by any chance?  I am away from a 
development box ATM and cannot test the patch myself.

--
nosy: +belopolsky

___
Python tracker 

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



[issue812369] module shutdown procedure based on GC

2009-10-14 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

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



[issue6855] ihooks support for relative imports

2009-10-14 Thread Brett Cannon

Brett Cannon  added the comment:

Sorry I didn't get to this, Neil.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

Rationale for the compilation flag:

You could think that the compilation flag should not be needed. However, 
not using it would mean that a LOT of existing regular expressions that 
already contain capturing groups in repetitions, and for which the 
caputiring group is effectively not used and should have been better 
encoded as a non-capuring group like (?:X) instead of (X), will suffer a 
negative performance impact and a higher memory usage.

The reason is that the MatchObject will have to store lists of 
(start,end) pairs instead of just a single pair: using a list will not 
be the default, so MatchObject.group(groupIndex), 
MatchObject.start(groupIndex), MatchObject.end(groupIndex), and 
MatchObject.span(groupIndex) will continue to return a single value or 
single pair, when the R compilation flag is not set (these values will 
continue to return only the last occurence, that will be overriden after 
each matched occurence of the capturing group.

The MatchObject.groups() will also continue to return a list of single 
strings without that flag set (i.e. a list of the last occurence of each 
capturing group). But when the R flag will be specified, it will return, 
instead, a list of lists, each element being for the group with the same 
index and being itself a list of strings, one for each occurence of the 
capturing group.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

Implementation details:

Currently, the capturing groups behave quite randomly in the values returned by 
MachedObject, when backtracking occurs in a repetition. This 
proposal will help fix the behavior, because it will also be much easier 
to backtrack cleanly, occurence by occurence, by just dropping the last 
element in the list of (start,end) pairs stored in the MatchedObject for 
all capturing groups specified WITHIN the repeated sub-expression.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
priority:  -> low

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

Confirmed, the stack limit error is gone now. Thanks!!

(There's another error, the import of _scproxy from urllib, but that's 
easily added to the App Engine SDK's whitelist. I am still concerned 
about the amount of change in the 2.6 branch, but the cat is out of the 
bag.)

--
status: pending -> open

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

(I don't know why the tracker reopened the issue when I added a comment. 
Anyway, is the fix going into 2.6.4 or will it have to wait for 2.6.5?)

--

___
Python tracker 

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



[issue812369] module shutdown procedure based on GC

2009-10-14 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

It should fix issue1545463 and running a quick test seems to show that
it does.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

I'm skeptical about what you are proposing for the following reasons:
1) it doesn't exist in any other implementation that I know;
2) if implemented as default behavior:
   * it won't be backward-compatible;
   * it will increase the complexity;
3) it will be a proprietary extension and it will reduce the
compatibility with other implementations;
4) I can't think to any real word situation where this would be really
useful.

Using a flag like re.R to change the behavior might solve the issue 2),
but I'll explain why I don't think this is useful.

Let's take a simpler ipv4 address as example: you may want to use
'^(\d{1,3})(?:\.(\d{1,3})){3}$' to capture the digits (without checking
if they are in range(256)).
This currently only returns:
>>> re.match('^(\d{1,3})(?:\.(\d{1,3})){3}$', '192.168.0.1').groups()
('192', '1')

If I understood correctly what you are proposing, you would like it to
return (['192'], ['168', '0', '1']) instead. This will also require an
additional step to join the two lists to get the list with the 4 values.

In these situations where some part is repeating, it's usually easier to
use re.findall() or re.split() (or just a plain str.split for simple
cases like this):
>>> addr = '192.168.0.1'
>>> re.findall('(?:^|\.)(\d{1,3})', addr)
['192', '168', '0', '1']
>>> re.split('\.', addr) # no need to use re.split here
['192', '168', '0', '1']

In both the examples a single step is enough to get what you want
without changing the existing behavior.

'^(\d{1,3})(?:\.(\d{1,3})){3}$' can still be used to check if the string
has the right "format", before using the other methods to extract the data.

So I'm -1 about the whole idea and -0.8 about an additional flag.
Maybe you should discuss about this on the python-ideas ML.

--
resolution:  -> rejected
status: open -> pending

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Guido van Rossum  added the comment:

> 
> (I don't know why the tracker reopened the issue when I added a comment. 
> Anyway, is the fix going into 2.6.4 or will it have to wait for 2.6.5?)

That's OK, I'll close it once I've made the same changes in trunk and py3k.

In terms of when the fix goes in, I guess it's Barry's call.

--

___
Python tracker 

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



[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2009-10-14 Thread Jeff Senn

Jeff Senn  added the comment:

Referred to this from issue 4610... anyone following this might want to 
look there as well.

--
nosy: +senn

___
Python tracker 

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



[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2009-10-14 Thread Jeff Senn

Jeff Senn  added the comment:

So, is it not considered a bug that:

>>> "This isn't right".title()
"This Isn'T Right"

!?!?!?

--

___
Python tracker 

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



[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2009-10-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Jeff Senn wrote:
> 
> Jeff Senn  added the comment:
> 
> So, is it not considered a bug that:
> 
 "This isn't right".title()
> "This Isn'T Right"
> 
> !?!?!?

That's http://bugs.python.org/issue7008 and is fixed as part of
http://bugs.python.org/issue6412

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

Note that I used the IPv4 address format only as an example. There are 
plenty of other more complex cases for which we really need to capture the 
multiple occurences of a capturing group within a repetition.

I'm NOT asking you how to parse it using MULTIPLE regexps and functions. 
Of course you can, but this is a distinct problem, but certinaly NOT a 
general solution (your solution using split() will NOT work with really A 
LOT of other regular expressions).

--

___
Python tracker 

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



[issue7130] json uses sre_* modules which may not work on alternate implemenations

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This doesn't seem true on trunk/py3k (2.7, 3.2) anymore. Please reopen
if I'm wrong.

--
nosy: +bob.ippolito, pitrou
resolution:  -> out of date
status: open -> closed
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue7128] cPickle looking for non-existent package copyreg

2009-10-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +easy
priority:  -> high
stage:  -> needs patch
versions: +Python 2.7

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread R. David Murray

R. David Murray  added the comment:

On Wed, 14 Oct 2009 at 21:46, Vinay Sajip wrote:
> Vinay Sajip  added the comment:
>> Guido van Rossum  added the comment:
>>
>> (I don't know why the tracker reopened the issue when I added a comment.
>> Anyway, is the fix going into 2.6.4 or will it have to wait for 2.6.5?)

If a ticket is set to pending, any comment addition changes it back
to open.  The idea is that you set a ticket to 'pending feedback',
and if there is no feedback for time X, the ticket gets closed.
(An auto-close-pending feature has been proposed, but I don't think it
has been implemented yet.)

> In terms of when the fix goes in, I guess it's Barry's call.

Well, your commit to the 2.6 branch puts it into the next RC unless
someone (eg Barry) reverts it.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

In addition, your suggested regexp for IPv4:

'^(\d{1,3})(?:\.(\d{1,3})){3}$'

is completely WRONG ! It will match INVALID IPv4 address formats like 
"000.000.000.000". Reread the RFCs... because "000.000.000.000" is 
CERTAINLY NOT an IPv4 address (if it is found in an URL) but a domain name 
that must be resolved into an IP address using domain name resolution 
requests.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

You're wrong, it WILL be compatible, because it is only conditioned by a 
FLAG. The flag is there specifically for instructing the parser to 
generate lists of values rather than single values.

Without the regular compilation flag set, as I said, there will be NO 
change.

Reopening the proposal, which is perfectly valid !

--
status: pending -> open

___
Python tracker 

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



[issue7133] test_ssl failure

2009-10-14 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is due to r75412 (yes, mine). The proper fix would be to add
support for the new buffer API to the _ssl module.


testSocketServer (test.test_ssl.ThreadedTests) ... 
 server (('127.0.0.1', 52011):52011 ('AES256-SHA', 'TLSv1/SSLv3', 256)):
   [15/Oct/2009 00:42:18] "GET /keycert.pem HTTP/1.0" 200 -

Exception happened during processing of request from ('127.0.0.1', 48099)
Traceback (most recent call last):
  File "/home/antoine/cpython/__svn__/Lib/SocketServer.py", line 282, in
_handle_request_noblock
self.process_request(request, client_address)
  File "/home/antoine/cpython/__svn__/Lib/SocketServer.py", line 308, in
process_request
self.finish_request(request, client_address)
  File "/home/antoine/cpython/__svn__/Lib/SocketServer.py", line 321, in
finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/home/antoine/cpython/__svn__/Lib/SocketServer.py", line 639, in
__init__
self.finish()
  File "/home/antoine/cpython/__svn__/Lib/SocketServer.py", line 692, in
finish
self.wfile.flush()
  File "/home/antoine/cpython/__svn__/Lib/socket.py", line 300, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
  File "/home/antoine/cpython/__svn__/Lib/ssl.py", line 203, in sendall
v = self.send(data[count:])
  File "/home/antoine/cpython/__svn__/Lib/ssl.py", line 94, in 
self.send = lambda data, flags=0: SSLSocket.send(self, data, flags)
  File "/home/antoine/cpython/__svn__/Lib/ssl.py", line 174, in send
v = self._sslobj.write(data)
TypeError: must be string or read-only buffer, not memoryview


Traceback (most recent call last):
  File "/home/antoine/cpython/__svn__/Lib/test/test_ssl.py", line 972,
in testSocketServer
f = urllib.urlopen(url)
  File "/home/antoine/cpython/__svn__/Lib/urllib.py", line 87, in urlopen
return opener.open(url)
  File "/home/antoine/cpython/__svn__/Lib/urllib.py", line 206, in open
return getattr(self, name)(url)
  File "/home/antoine/cpython/__svn__/Lib/urllib.py", line 445, in
open_https
'got a bad status line', None)
IOError: ('http protocol error', 0, 'got a bad status line', None)
ERROR

--
assignee: pitrou
components: Extension Modules, Tests
messages: 94044
nosy: janssen, pitrou
severity: normal
stage: needs patch
status: open
title: test_ssl failure
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

Summary of your points with my responses :


> 1) it doesn't exist in any other implementation that I know;

That's exactly why I proposed to discuss it with the developers of other 
implementations (I cited PCRE, Perl and PHP developers, there are 
others).


> 2) if implemented as default behavior:
>   * it won't be backward-compatible;

Wrong. This does not even change the syntax of regualr expressions 
themselves.

>   * it will increase the complexity;

Wrong. All the mechanic is already implemented: when the parser will 
store string index positions for a matched group it will just have to 
append a pair in the list stored in MatchObject.group(index) (it will 
create the list if it is not ealready there, but it should be already 
initialized to an empty list by the compiler) when the flag.R is set, 
instead of overwriting the existing pair without wondering if there was 
already another occurence of the same capturing group.


> 3) it will be a proprietary extension and it will reduce the
compatibility with other implementations;

Already suggested above. This will hovever NOT affect the compatibility 
of existing implementation that don't have the R flag.


> 4) I can't think to any real word situation where this would be really
useful.

There are really a lot ! Using multiple split operations and multiple 
parsing on partly parsed regular expressions will not be a solution in 
many situations (think about how you would perform matches and using 
them that in 'vi' or 'ed' with a single "s/regexp/replacement/flag" 
instruction, if there's no extension with a flag and a syntax for 
accesing the individual elements the replacement string).

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

And anyway, my suggestion is certainly much more useful than atomic groups 
and possessive groups that have much lower use, and which are already 
being tested in Perl but that Python (or PCRE, PHP, and most 
implementations of 'vi'/'ed', or 'sed') still does not support.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread R. David Murray

R. David Murray  added the comment:

If you read what Ezio wrote carefully you will see that he addressed
both of your points: he acknowledged that a flag would solve (2) (but
disagreed that it was worth it), and he said you could use the first
expression to validate the string before using the split to obtain the
data.  Doing it all in one regex might seem more efficient, but at least
in the single use case you have presented it would lead to more
complicated code.

Simple. obvious feature requests can be opened and acted upon directly
in the tracker, but more complicated requests should be made as
proposals on the python-ideas list, and if they are well received there
then an issue can be opened (or in this case you could reopen this one)
in the tracker with a pointer to the python-ideas thread.  In most
cases, such an issue would need to include a proposed patch.

Note that we don't really have a resolution that says 'sent to
python-ideas', thus the use of the 'rejected' status.

--
nosy: +r.david.murray
stage:  -> committed/rejected

___
Python tracker 

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



[issue7133] test_ssl failure

2009-10-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a possible patch.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file15130/ssl_newbuf.patch

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread R. David Murray

R. David Murray  added the comment:

Just to clarify, when I said "in most cases such an issue would need to
include a proposed patch", I mean that even if everyone agrees it is a
good idea it isn't likely to happen unless there is a proposed patch :)

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

I had read carefully ALL what ezio said, this is clear in the fact that 
I have summarized my responses to ALL the 4 points given by ezio.

Capturing groups is a VERY useful feature of regular expressions, but 
they currently DON'T work as expected (in a useful way) when they are 
used within repetitions (unless you don't need any captures at all, for 
example when just using find(), and not performing substitutions on the 
groups.

My proposal woul have absolutely NO performance impact when capturing 
groups are not used (find only, without replacement, so there the R flag 
can be safely ignored).

It would also not affect the case where capturing groups are used in the 
regexp, but these groups are not referenced in the substitution or in 
the code using MatchObject.group(index) : these indexes are already not 
used (or should not, because this is most of the time a bug when it just 
returns the last occurence).

Using multiple parsing operations with multiple regexps is really 
tricky, when all could be done directly from the original regexp, 
without modifying it. In addition, using split() or similar will not 
work as expected, when the splitting operations will not correctly parse 
the context in which the multiple occurences are safely separated (this 
context is only correctly specified in the original regexp where the 
groups, capturing or not, are specified).

This extension will also NOT affect the non-capturing groups like:
 (?:X){m,n}
 (?:X)*
 (?:X)+
It will ONLY affect the CAPTURING groups like:
 (X){m,n}
 (X)*
 (X)+
and only if the R flag is set (in which case this will NOT affect the 
backtracking behavior, or which strings that will be effectively 
matched, but only the values of the returned "\n" indexed group.

If my suggestion to keep the existing MatchObject.function(index) API 
looks too dangerous for you, because it would change the type of the 
returned values when the R flag is set, you can as well rename them to 
get a specific occurence of a group. Such as:

 MatchObject.groupOccurences(index)
 MatchObject.startOccurences(index)
 MatchObject.endOccurences(index)
 MatchObject.spanOccurences(index)
 MatchObject.groupsOccurences(index)

But I don't think this is necessary; it will be already expected that 
they will return lists of values (or lists of pairs), instead of just 
single values (or single pairs) for each group: Python (as well as PHP 
or Perl) can already manage return values with varying datatypes.

May be only PCRE (written for C/C++) would need a new API name to return 
lists of values instead of single values for each group, due to existing 
datatype restrictions.

My proposal is not inconsistant: it returns consistant datatypes when 
the R flag is set, for ALL capturing groups (not just those that are 
repeated.

Anyway I'll submit my idea to other groups, if I can find where to post 
them. Note that I've already implemented it in my own local 
implementation of PCRE, and this works perfectly with effectively very 
few changes (currently I have had to change the datatypes for matching 
objects so that they can return varying types), and I have used it to 
create a modified version of 'sed' to perform massive filtering of data:

It really reduces the number of transformation steps needed to process 
such data correctly, because a single regexp (exactly the same that is 
already used in the first step used to match the substrings we are 
interested in, when using existing 'sed' implementations) can be used to 
perform the substitutions using indexes within captured groups. And I 
would like to have it incoporated in Python (and also Perl or PHP) as 
well.

--

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

> You're wrong, it WILL be compatible, because it is only conditioned
> by a FLAG.

Sorry, I missed that you mentioned the flag already in the first
message, but what I said in 1), 3) and 4) is still valid.

> There are plenty of other more complex cases for which we really
> need to capture the multiple occurences of a capturing group within
> a repetition.

Can you provide some example where your solution is better than the
other available way of doing it? During the years lot of extensions have
been added to the regex engines, if no one added this is probably
because these problems can be already solved in other ways.

> I'm NOT asking you how to parse it using MULTIPLE regexps and
> functions. 
> Of course you can, but this is a distinct problem, but certinaly NOT
> a general solution (your solution using split() will NOT work with
> really A LOT of other regular expressions).

Even with your solution, in most of the cases you will need additional
steps to assemble the results (at least in the cases with some kind of
separator, where you have to join the first element with the followings).

I can see a very limited set of hypothetical corner cases where your
proposal may save a few line of codes but I don't think it's worth
implementing all this just for them.
An example could be:
>>> re.match('^([0-9A-F]{2}){4} ([a-z]\d){5}$', '3FB52A0C a2c4g3k9d3',
re.R).groups()
(['3F', 'B5', '2A', '0C'], ['a2', 'c4', 'g3', 'k9', 'd3'])
but it's not really a real-world case, if you have some real-world
example I'd like to see it.

> In addition, your suggested regexp for IPv4:
> '^(\d{1,3})(?:\.(\d{1,3})){3}$'
> is completely WRONG !

That's why I wrote 'without checking if they are in range(256)'; the
fact that this regex matches invalid digits was not relevant in my
example (and it's usually easier to convert the digits to int and check
if 0 <= digits <= 255). :)


>> 1) it doesn't exist in any other implementation that I know;
>
> That's exactly why I proposed to discuss it with the developers of
> other implementations (I cited PCRE, Perl and PHP developers, there
> are others).

So maybe this is not the right place to ask.

>> 3) it will be a proprietary extension and it will reduce the
>> compatibility with other implementations;
>
> Already suggested above. This will hovever NOT affect the
> compatibility of existing implementation that don't have the R flag.

What I meant is that a regex that uses the re.R flag in Python won't
work in other languages/implementations because they don't have it, and
a "general" regex (e.g. for an ipv6 address) will have to be
adapted/rewritten in order to take advantage of re.R.

>> 4) I can't think to any real word situation where this would be 
>> really useful.
>
> There are really a lot ! Using multiple split operations and multiple 
> parsing on partly parsed regular expressions will not be a solution 
> in many situations (think about how you would perform matches and 
> using  them that in 'vi' or 'ed' with a single
> "s/regexp/replacement/flag" instruction, if there's no extension
> with a flag and a syntax for accesing the individual elements the 
> replacement string).

Usually when the text to be parsed starts to be too complex is better to
use another approach, e.g. using a real parser or dividing the text in
smaller units and work on them independently. Even if re.R could make
this easier I would still prefer to have a few more line of code that do
different things that a single big regex that does everything.

> And anyway, my suggestion is certainly much more useful than atomic 
> groups and possessive groups that have much lower use [...]

Then why no one implemented it yet? :)

--

___
Python tracker 

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



[issue7134] Add looping capability to regrtest

2009-10-14 Thread Jesse Noller

New submission from Jesse Noller :

We should add "loop this test" capabilities to regrtest - running tests in 
a tight loop can help debug issues which don't appear with a one-off run.

See:
http://mail.python.org/pipermail/python-dev/2009-June/090238.html

--
assignee: jnoller
components: Tests
messages: 94052
nosy: jnoller
priority: normal
severity: normal
status: open
title: Add looping capability to regrtest
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue7134] Add looping capability to regrtest

2009-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

ezio said:
>>> re.match('^(\d{1,3})(?:\.(\d{1,3})){3}$', '192.168.0.1').groups()
('192', '1')
> If I understood correctly what you are proposing, you would like it to
return (['192'], ['168', '0', '1']) instead.

Yes, exactly ! That's the correct answer that should be returned, when 
the R flag is set.

> This will also require an additional step to join the two lists to get 
the list with the 4 values.

Yes, but this is necessary for full consistency of the group indexes. 
The current return value is clearly inconsistant (generally it returns 
the last occurence of the capturing group, but I've discovered that this 
is not always the case, because of matches that are returned after 
backtracking...)

It is then assumed that when the R flag is set, ALL occurences of 
repeated groups will be returned individually, instead of just a 
'random' one. Note that for full generalization of the concept, there 
should even be lists of lists if a capturing group contains itself 
another inner capturing group (with its own index), in order to 
associate them correctly with each occurence of the outer capturing 
group (however I've still not experimented this in my local 
experimentation, so all occurences are grouped in the same returned 
list, independantly of the occurence of the outer capturing group in 
which they were found).

--

___
Python tracker 

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



[issue7120] logging depends on multiprocessing

2009-10-14 Thread Jesse Noller

Jesse Noller  added the comment:

>The addition of multiprocessing support to logging seems to have 
happened 
> in 2.6.2; bad timing for a feature. :-(

Just in minor self-defense, this wasn't a feature, it was a bug fix. The 
original multiprocessing code base relied on some unfortunate monkey-
patching of the logging module to insert itself into the logging module. 
That code was broken in the merge into 2.6, and I didn't catch it. So, I 
felt this was a bug fix, and not a feature-add.

I apologize for this.

--
nosy: +jnoller

___
Python tracker 

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



[issue7135] AttributeError: 'module' object has no attribute 'HTTPSConnection'

2009-10-14 Thread Andi Welch

New submission from Andi Welch :

I received a working script created with Active Python 2.6.2 for 
Windows 32 bit.  I downloaded the Active Python 64 bit Windows version 
for my 64 bit Windows Vista OS and have attempted to run the script.  I 
get the following error:

Traceback (most recent call last):
File "ofx-ba-tfb-auto.py", line 212, in
client.doQuery(query, argv[1]+"_acct.ofx")
File "ofx-ba-tfb-auto.py", line 178, in doQuery
h = httplib.HTTPSConnection(host)
AttributeError: 'module' object has no attribute 'HTTPSConnection'

I see a few references (not on this site) to the error, but none seem 
to fit exactly and being a Python novice I wasn't sure what direction 
to turn.  Most suggest that my Python installation is missing a needed 
library to support SSL.  I also tried using the 2.6.3.7 version of 
Active Python for WIN 64 and get the same exact error. 

Would appreciate any and all assistance.  Thank you.

--
components: Library (Lib)
messages: 94055
nosy: awelch
severity: normal
status: open
title: AttributeError: 'module' object has no attribute 'HTTPSConnection'
versions: Python 2.6

___
Python tracker 

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



[issue7132] Regexp: capturing groups in repetitions

2009-10-14 Thread Philippe Verdy

Philippe Verdy  added the comment:

> That's why I wrote 'without checking if they are in range(256)'; the
fact that this regex matches invalid digits was not relevant in my
example (and it's usually easier to convert the digits to int and check
if 0 <= digits <= 255). :)

NO ! You have to check also the number of digits for values below 100 (2 
digits only) or below 10 (1 digit only)

And when processing web log files for example, or when parsing Wiki 
pages or emails in which you want to autodetect the presence of ONLY 
valid IP addresses within some contexts, where you want to transform 
them to another form (for example when converting them to links or to 
differentiate 'anonymous' users in wiki pages from registered named 
users, you need to correctly match these IP addresses. In addition, 
these files will often contain many other occurences that you don't want 
to transform, but just some of them in specific contexts given by the 
regexp. for this reason, your suggestion will often not work as 
expected.

The real need is to match things exactly, within their context, and 
capturing all occurences of capturing groups.

I gave the IPv4 regexp only as a simple example to show the need, but 
there are of course much more complex cases, and that's exactly for 
those cases that I would like the extension: using alternate code with 
partial matches and extra split() operations give a code that becomes 
tricky, and most often bogous. Only the original regexp is precise 
enough to parse the content correctly, find only the matches we want, 
and capturing all the groups that we really want, in a single operation, 
and with a near-zero cost (and without complication in the rest of the 
code using it).

--

___
Python tracker 

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



[issue7135] AttributeError: 'module' object has no attribute 'HTTPSConnection'

2009-10-14 Thread A Welch

Changes by A Welch :


--
type:  -> behavior

___
Python tracker 

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



  1   2   >