[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

The patch issue4204.diff split cases for "FreeBSD/4.8* | Darwin/6* )".
Please look 10-15 lines below in same case statement

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4213] Lower case file system encoding

2008-10-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

Me, too! The solution is elegant and works well.

Barry still has to accept the patch, though.

--
resolution:  -> accepted

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-10-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

In combination with the patch in #4213, "subinterpreter.patch" fixes the
problem.

I'm assigning the bug to Barry for his final decision.

--
assignee:  -> barry
nosy: +barry
type:  -> behavior

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

Martin, can you please review and comment on my patch?

Graham, does the patch solve your problem?

--
assignee:  -> loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-28 Thread Graham Dumpleton

Graham Dumpleton <[EMAIL PROTECTED]> added the comment:

By visual inspection the intent looks correct, but can't actually test it 
until I can checkout Python code from source repository and apply patch as 
patch doesn't apply cleanly to 3.0rc1.

With #3723 and #4213 now also having patches, will need to sit down and 
look at all of them and see if find any new issues. May take me a couple 
of days to get time.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3626] python3.0 interpreter on Cygwin ignores all arguments

2008-10-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I can't reproduce the problem with my installation of Cygwin on Windows
XP. However the patch doesn't cause problems so you might apply it.

--
nosy: +christian.heimes

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2306] Update What's new in 3.0

2008-10-28 Thread Guido van Rossum

Guido van Rossum <[EMAIL PROTECTED]> added the comment:

Yes, I know. I'll spend some time on it this week.

BTW what's the hold-up with the rc2 release?  Or did I just miss it?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1210] imaplib does not run under Python 3

2008-10-28 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Can anyone review my last patch (imaplib_bytes-3.patch)?

--
keywords: +needs review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3727] poplib module broken by str to unicode conversion

2008-10-28 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Can anyone review my last patch (poplib-bytes-2.patch)?

--
keywords: +needs review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3714] nntplib module broken by str to unicode conversion

2008-10-28 Thread STINNER Victor

Changes by STINNER Victor <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11787/nntplib_unicode.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4218] tarfile module fails to correctly parse some .tar.gz archives?!

2008-10-28 Thread gerhard_xXx

New submission from gerhard_xXx <[EMAIL PROTECTED]>:

hi,

seems like tarfile module for python 2.4 is broken.
If I open the attached dir.tar.gz (tried it on different machines) then
tarfile module only displays a part of the contents.

what I did:
>>> import tarfile
>>> f = tarfile.open('dir.tar.gz','r:gz')
>>> f.getnames()

getnames() only returns the files/directories in the dir.tar.gz that
start with letter "a-j" and skips the rest???!!

cheers gerhard

More info (I have debian etch installation):
Python 2.4.4 (#2, Apr 16 2008, 17:58:59)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2

$ tar --version
tar (GNU tar) 1.16
Copyright (C) 2006 Free Software Foundation, Inc.

--
components: Extension Modules
files: dir.tar.gz
messages: 75284
nosy: gerhard_xXx
severity: normal
status: open
title: tarfile module fails to correctly parse some .tar.gz archives?!
type: behavior
versions: Python 2.4
Added file: http://bugs.python.org/file11899/dir.tar.gz

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4218] tarfile module fails to correctly parse some .tar.gz archives?!

2008-10-28 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

The bug is fixed in Python 2.5. Since Python 2.6 was released the 1st 
October, why not upgrading to 2.6 or at least 2.5?

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4219] Problem with regular expression

2008-10-28 Thread Carlos Eduardo Klock

New submission from Carlos Eduardo Klock <[EMAIL PROTECTED]>:

Hello, 

I am having a weird problem with regex. I am trying to get the tokens
that match the pattern below, but it is not working only for a specific
case. I do this for many lines of text, and it works, except for the
string '1214578800'.

Any idea of what is happening? Is it a problem of my code or a bug in
regular expressions?

Thanks for any help,

Carlos.



import re
r =
re.compile(",'([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])'[,|)]")
text =
"('25','2','3','2','0','1','0','0/350','30','21','5','','1211641200','1214578800','0','2','1214662622');"
timestamps = r.findall(text)
print timestamps


OUTPUT:
Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on Trabalho15, Standard
>>> ['1211641200', '1214662622']

--
components: Regular Expressions
messages: 75286
nosy: carlosklock
severity: normal
status: open
title: Problem with regular expression
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4219] Problem with regular expression

2008-10-28 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

It's not a Python bug: your regex is invalid. When the regex 
finds '1211641200', it reads >,'1211641200',< includind the last 
comma. So the cursor will be at the apostrophe before 1214578800:
...200','121457...
^

You have to change your regex to not check the comma or use a 
non-matching group like (?<=,) and (?=[,)]).

Note: you're using [,|)] which matchs >,<, >|<, and >)<. I guess that 
you wanted [,)].

--
nosy: +haypo
resolution:  -> invalid

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4219] Problem with regular expression

2008-10-28 Thread Carlos Eduardo Klock

Carlos Eduardo Klock <[EMAIL PROTECTED]> added the comment:

Sorry, it is really a problem with the comma.

Thanks for helping! :)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4220] Builtins treated as free variables?

2008-10-28 Thread David Fugate

New submission from David Fugate <[EMAIL PROTECTED]>:

#--
VERSION AFFECTED: 2.5 and 2.6
BUILD TYPE: x86
FLAGS PASSED TO PYTHON.EXE: None
OPERATING SYSTEM: 32-bit Windows Vista SP1

#--
BRIEF DESCRIPTION:
According to 
http://docs.python.org/dev/reference/executionmodel.html#interaction-
with-dynamic-features, a free variable is a variable used from some 
local scope that is not defined there.  The behavior of Python 2.5/2.6 
is that it treats certain Python keywords and builtin types/functions 
used in nested scopes as free variables as well.  This seems a little 
odd.

Could the documentation be clarified to state: usage of certain Python 
keywords are considered to be free variables.  I.e., a line simply 
containing "int" triggers the free variable behavior.  Alternatively, 
usage of builtin types/functions could be allowed from nested functions 
with calls to "exec"…

Thanks,

Dave

#--
REPRODUCTION SNIPPET:
def a():
def b():
x = long(3) #Replace me with "x = 3L" and this works
int #This must be commented out
exec ""


emits the following:
  File "garbage.py", line 4
exec ""
 SyntaxError: unqualified exec is not allowed in function 'b' it is 
a nested function
unless the "x = long(3)" and "int" lines are commented out.

--
assignee: georg.brandl
components: Documentation, Interpreter Core
files: garbage.py
messages: 75289
nosy: dfugate, georg.brandl
severity: normal
status: open
title: Builtins treated as free variables?
type: compile error
versions: Python 2.5.3, Python 2.6
Added file: http://bugs.python.org/file11900/garbage.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4219] Problem with regular expression

2008-10-28 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4221] inconsistent exception from int is confusing

2008-10-28 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>:

[EMAIL PROTECTED]:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> int('\0', 256)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: invalid literal for int() with base 256: '\x00'
>>> int('x', 256)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: int() base must be >= 2 and <= 36
>>> 

The former is misleading.  \x00 is a perfectly valid byte if the base is
256.  The real problem, that base 256 isn't supported, is obscured.  It
would be much better for the latter case's message to be used in the
former case.

--
components: Interpreter Core
messages: 75290
nosy: exarkun
severity: normal
status: open
title: inconsistent exception from int is confusing
type: behavior
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Akira Kitada

Changes by Akira Kitada <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11890/configure.in.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Akira Kitada

Changes by Akira Kitada <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11892/Modules_readline.c.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Akira Kitada

Changes by Akira Kitada <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11897/issue4204.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4222] dis.findlinestarts is missing from dis.__all__ and from the online documentation

2008-10-28 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>:

There aren't many high-ish level APIs for dealing with lnotab. 
dis.findlinestarts is one, but it's not clear if it's private or public.
 If it's public, it'd be great to make it clear that it is and document
it.  If it's not, perhaps it should be renamed _findlinestarts.

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 75291
nosy: exarkun, georg.brandl
severity: normal
status: open
title: dis.findlinestarts is missing from dis.__all__ and from the online 
documentation
versions: Python 2.4, Python 2.5, Python 2.5.3, Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>:

It'd be better if it did.

--
components: Library (Lib)
messages: 75292
nosy: exarkun
severity: normal
status: open
title: inspect.getsource doesn't work on functions imported from a zipfile
type: behavior
versions: Python 2.5, Python 2.5.3, Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Akira Kitada

Akira Kitada <[EMAIL PROTECTED]> added the comment:

Thank you for pointing that out, Roumen!
I didn't realize that.
I updated the patch again.

Added file: http://bugs.python.org/file11901/issue4204.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4221] inconsistent exception from int is confusing

2008-10-28 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Since it is not defined which bytes are used as digits for bases > 36,
\x00 is not a "valid byte".

In any case, the problem here is that the base check is done after the
"no NULL" check. Perhaps the error should explicitly mention that no
null bytes are allowed.

--
nosy: +georg.brandl
priority:  -> low

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Guilherme Polo

Guilherme Polo <[EMAIL PROTECTED]> added the comment:

doesn't it ? it works here

--
nosy: +gpolo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Guilherme Polo

Guilherme Polo <[EMAIL PROTECTED]> added the comment:

Well anyway, some sample code:

import zipfile

z = zipfile.ZipFile('aaa.zip', mode='w')
z.writestr('aa.py', 'def x(): print "hi there"\n\ndef y(): print "hi"')
z.close()


and then:


import sys
import inspect

sys.path.append('aaa.zip')
import aa

inspect.getsource(aa.x)
inspect.getsource(aa.y)


Doesn't that work for you ?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4177] Crash in MIMEText on FreeBSD

2008-10-28 Thread Sérgio Surkamp

Sérgio Surkamp <[EMAIL PROTECTED]> added the comment:

Ok. Something is very wrong with our code too. I have dumped the text
that's cousing the "freeze" and run it using the test case scripts. It
worked slow, but worked. It seems that our application is eating too
many memory from server (about 60Mbytes for a 2.4Mbytes message), so its
obviously a application bug/leak.

Unfortunately I cant submit the files for performance test, becose they
may contain confidential information.

As long as I can see on GDB, the python process is in a loop inside this
functions:

#0  0x2825798e in memcpy () from /lib/libc.so.7
#1  0x080a4607 in PyUnicodeUCS4_Concat ()
#2  0x080aec8d in PyEval_EvalFrameEx ()
#3  0x080b2c49 in PyEval_EvalCodeEx ()
#4  0x080b111a in PyEval_EvalFrameEx ()
#5  0x080b2c49 in PyEval_EvalCodeEx ()
#6  0x080b111a in PyEval_EvalFrameEx ()
#7  0x080b1f65 in PyEval_EvalFrameEx ()
#8  0x080b2c49 in PyEval_EvalCodeEx ()
#9  0x080b111a in PyEval_EvalFrameEx ()
#10 0x080b2c49 in PyEval_EvalCodeEx ()
#11 0x080eebd6 in PyClassMethod_New ()
#12 0x08059ef7 in PyObject_Call ()
#13 0x0805f341 in PyClass_IsSubclass ()
#14 0x08059ef7 in PyObject_Call ()
#15 0x080ac86c in PyEval_CallObjectWithKeywords ()
#16 0x080629d6 in PyInstance_New ()
#17 0x08059ef7 in PyObject_Call ()
#18 0x080af2bb in PyEval_EvalFrameEx ()
#19 0x080b2c49 in PyEval_EvalCodeEx ()
#20 0x080b111a in PyEval_EvalFrameEx ()
#21 0x080b1f65 in PyEval_EvalFrameEx ()
#22 0x080b1f65 in PyEval_EvalFrameEx ()
#23 0x080b1f65 in PyEval_EvalFrameEx ()
#24 0x080b2c49 in PyEval_EvalCodeEx ()
#25 0x080eec4e in PyClassMethod_New ()
#26 0x08059ef7 in PyObject_Call ()
#27 0x0805f341 in PyClass_IsSubclass ()
#28 0x08059ef7 in PyObject_Call ()
#29 0x080ac86c in PyEval_CallObjectWithKeywords ()
#30 0x080d4b58 in initthread ()
#31 0x28175acf in pthread_getprio () from /lib/libthr.so.3
#32 0x in ?? ()

Every memcpy call take a lot to complete, but it seems a problem with
GDB debugging as it eats 80% to 95% of the CPU and python just 1% or 2%.

How python charset conversion works from inside? It duplicates the
original string every character substitution?
If this is the case, shouldn't be better to count the substituitions,
calculate the amount of needed memory and make just one allocation for
the new string? Then copy the unmodified characters from the original to
the new string and change other chars as needed?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Jean-Paul Calderone

Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment:

It seems to depend on working directory:

[EMAIL PROTECTED]:/tmp$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/home/exarkun/foobar.zip')
>>> import foobar, inspect
>>> inspect.getsource(foobar.foo)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/inspect.py", line 629, in getsource
lines, lnum = getsourcelines(object)
  File "/usr/lib/python2.5/inspect.py", line 618, in getsourcelines
lines, lnum = findsource(object)
  File "/usr/lib/python2.5/inspect.py", line 468, in findsource
raise IOError('could not get source code')
IOError: could not get source code
>>> 

versus:

[EMAIL PROTECTED]:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/home/exarkun/foobar.zip')
>>> import foobar, inspect
>>> inspect.getsource(foobar.foo)
'def foo():\npass\n'
>>>

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

The patch looks fine to me.

--
assignee:  -> barry
resolution:  -> accepted

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4218] tarfile module fails to correctly parse some .tar.gz archives?!

2008-10-28 Thread Lars Gustäbel

Lars Gustäbel <[EMAIL PROTECTED]> added the comment:

This is a known bug in Python 2.4's tarfile version (cp. issue1509889
and issue1719898). It was fixed in Python 2.5. Thank you anyway for your
report.

--
nosy: +lars.gustaebel
resolution:  -> duplicate
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

This must be very similar to #4197 and #4201 that I reported a few days 
ago.  I'll see if a similar patch would work in this case.

--
nosy: +belopolsky

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

Hmm, apparently inspect was made to work with zipped modules back in r45248 .

I cannot reproduce the problem either.

Jean-Paul, can you attach your foobar.zip?  What else do you have in your 
/tmp directory?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

In any case, it's clearly not a candidate for 2.5.3, due to the lack of
a clear problem description, and a working patch. That essentially means
that associating the version 2.5 is also fairly pointless, but I'll
leave that in, anyway.

--
nosy: +loewis
versions:  -Python 2.5.3

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4224] ** operating incorrectly for negative bases?

2008-10-28 Thread Martin Green

New submission from Martin Green <[EMAIL PROTECTED]>:

I suspect that the following behavior is incorrect:

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
>>> -1**2
-1
>>> -2**2
-4
>>> -1**0.5
-1.0

The same happens when the base is a float.
I have not checked out the functionality of other versions of python

The function pow (which claims to be equivalent to **) works as I would
expect:

>>> pow(-1, 2)
1
>>> pow(-2, 2)
4
>>> pow(-1, 0.5)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: negative number cannot be raised to a fractional power

I was not sure which components to select, please change them if I got
it wrong.

--
assignee: theller
components: Tests, ctypes
messages: 75304
nosy: martin.speleo, theller
severity: normal
status: open
title: ** operating incorrectly for negative bases?
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4224] ** operating incorrectly for negative bases?

2008-10-28 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

This is because the negative sign is evaluated after the power. (-1)**2
works correctly.

--
components: +Interpreter Core -Tests, ctypes
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Jean-Paul Calderone

Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment:

Here is a transcript for a complete, self-contained, minimal reproduction:

[EMAIL PROTECTED]:~$ cd /tmp
[EMAIL PROTECTED]:/tmp$ mkdir zipimportbugexample
[EMAIL PROTECTED]:/tmp$ cd zipimportbugexample/
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ mkdir foobar
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ echo "def foo(): pass" >
foobar/__init__.py
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ zip foobar.zip foobar
  adding: foobar/ (stored 0%)
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ zip foobar.zip foobar/__init__.py 
  adding: foobar/__init__.py (stored 0%)
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ rm -r foobar
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ mkdir workingdirectory
[EMAIL PROTECTED]:/tmp/zipimportbugexample$ cd workingdirectory/
[EMAIL PROTECTED]:/tmp/zipimportbugexample/workingdirectory$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/tmp/zipimportbugexample/foobar.zip')
>>> import foobar, inspect
>>> inspect.getsource(foobar.foo)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/inspect.py", line 629, in getsource
lines, lnum = getsourcelines(object)
  File "/usr/lib/python2.5/inspect.py", line 618, in getsourcelines
lines, lnum = findsource(object)
  File "/usr/lib/python2.5/inspect.py", line 468, in findsource
raise IOError('could not get source code')
IOError: could not get source code
>>>

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4225] unicode_literals doesn't work in exec

2008-10-28 Thread Benjamin Peterson

New submission from Benjamin Peterson <[EMAIL PROTECTED]>:

exec "from __future__ import unicode_literals; print type('')"

gives  in 2.6/2.7. It's the result of flags not being passed
from the parser to AST.

--
components: Interpreter Core
files: fix_exec_literals.patch
keywords: needs review, patch
messages: 75307
nosy: benjamin.peterson, georg.brandl
priority: high
severity: normal
status: open
title: unicode_literals doesn't work in exec
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file11902/fix_exec_literals.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4225] unicode_literals doesn't work in exec

2008-10-28 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11902/fix_exec_literals.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4225] unicode_literals doesn't work in exec

2008-10-28 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file11903/fix_exec_literals.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

Thanks, Jean-Paul, I can now reproduce your problem and I think I found 
the culprit.

I believe the file name check in linecache.updatecache is unnecessary 
and is responsible for this problem.  With the following patch:

--- Lib/linecache.py(revision 67040)
+++ Lib/linecache.py(working copy)
@@ -88,7 +88,7 @@
 get_source = getattr(loader, 'get_source', None)
 
 if name and get_source:
-if basename.startswith(name.split('.')[-1]+'.'):
+#if basename.startswith(name.split('.')[-1]+'.'):
 try:
 data = get_source(name)
 except (ImportError, IOError):


and Jean-Paul's foobar:

$ PYTHONPATH=/tmp/foobar.zip ./python.exe  -c "import inspect,foobar; 
print inspect.getsource(foobar)"
def foo(): pass


Martin, is there a chance for this issue and  #4197, #4201  to make it 
to 2.5.3?  If so, I'll prepare a combined patch with tests for your 
consideration shortly.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-28 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

This patch looks fine.

--
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-10-28 Thread Alexander Belopolsky

Changes by Alexander Belopolsky <[EMAIL PROTECTED]>:


--
nosy: +belopolsky

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4220] Builtins treated as free variables?

2008-10-28 Thread Alexander Belopolsky

Changes by Alexander Belopolsky <[EMAIL PROTECTED]>:


--
nosy: +belopolsky

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4226] Should 2to3 know that file type is gone?

2008-10-28 Thread David W. Lambert

New submission from David W. Lambert <[EMAIL PROTECTED]>:

class c(file):
pass


2to3 says no changes required.
Might it possibly suggest a replacement for file class?

Thanks, Dave.

--
messages: 75310
nosy: LambertDW
severity: normal
status: open
title: Should 2to3 know that file type is gone?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4226] Should 2to3 know that file type is gone?

2008-10-28 Thread David W. Lambert

Changes by David W. Lambert <[EMAIL PROTECTED]>:


--
components: +2to3 (2.x to 3.0 conversion tool)
type:  -> feature request
versions: +Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4226] Should 2to3 know that file type is gone?

2008-10-28 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

python3k and I are having difficulty with File class, which in a version 
2 python release extended the file type with methods to read through a 
file until some condition is found.

--
type: feature request -> crash
Added file: http://bugs.python.org/file11904/coredump.tar.Z

___
Python tracker <[EMAIL PROTECTED]>

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