ordereddict 0.4.5 ( fast implementation of ordereddict and sorteddict in C)

2012-06-18 Thread Anthon van der Neut
After a hiatus of several years, I am pleased to announce version 0.4.5 of the ordereddict module. This is primarily a bug fix release and will be the last one for ordereddict in this form. Changes: - fixed a bug in slicing SortedDicts found by Migel Anguel - fixed a bug reinserting last item

Re: How does python bytecode works?

2012-06-18 Thread Kushal Kumaran
On Mon, Jun 18, 2012 at 1:23 AM, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Sun, Jun 17, 2012 at 5:54 AM, gmspro gms...@yahoo.com wrote: We know python is written in C. C is not portable. Badly written C is not portable. But C is probably the most portable language on the planet, by

Re: Academic citation of Python

2012-06-18 Thread Curt
On 2012-06-18, Ben Finney ben+pyt...@benfinney.id.au wrote: Actually it's van Rossum, Guido, not Rossum, Guido van. The van is part of the family name, not a middle name. It's like da Vinci, Leonardo or von Sydow, Max. On one occasion Guido complained that Americans always get his name

Re: lazy evaluation of a variable

2012-06-18 Thread Terry Reedy
On 6/17/2012 5:35 PM, Gelonida N wrote: I'm having a module, which should lazily evaluate one of it's variables. If you literally mean a module object, that is not possible. On the other hand, it is easy to do with class instances, via the __getattr__ special method or via properties. At

post init call

2012-06-18 Thread Prashant
class Shape(object): def __init__(self, shapename): self.shapename = shapename def update(self): print update class ColoredShape(Shape): def __init__(self, color): Shape.__init__(self, color) self.color = color print 1

Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
What is input() supposed to return? u'a' == 'a' True r1 = input(':') :a r2 = input(':') :u'a' r1 == r2 False type(r1), len(r1) (class 'str', 1) type(r2), len(r2) (class 'str', 4) --- sys.argv? jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 1:19 AM, jmfauth wxjmfa...@gmail.com wrote: What is input() supposed to return? u'a' == 'a' True r1 = input(':') :a r2 = input(':') :u'a' r1 == r2 False type(r1), len(r1) (class 'str', 1) type(r2), len(r2) (class 'str', 4) --- sys.argv? jmf Python 3

Re: post init call

2012-06-18 Thread Ulrich Eckhardt
Am 18.06.2012 09:10, schrieb Prashant: class Shape(object): def __init__(self, shapename): self.shapename = shapename def update(self): print update class ColoredShape(Shape): def __init__(self, color): Shape.__init__(self, color)

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On 18 juin, 10:28, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Mon, Jun 18, 2012 at 1:19 AM, jmfauth wxjmfa...@gmail.com wrote: What is input() supposed to return? u'a' == 'a' True r1 = input(':') :a r2 = input(':') :u'a' r1 == r2 False type(r1), len(r1) (class

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Steven D'Aprano
On Mon, 18 Jun 2012 01:19:32 -0700, jmfauth wrote: What is input() supposed to return? Whatever you type. u'a' == 'a' True This demonstrates that in Python 3.3, u'a' gives a string equal to 'a'. r1 = input(':') :a Since you typed the letter a, r1 is the string a (a single character).

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Steven D'Aprano
On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote: On 18 juin, 10:28, Benjamin Kaplan benjamin.kap...@case.edu wrote: The u prefix is only there to make it easier to port a codebase from Python 2 to Python 3. It doesn't actually do anything. It does. I shew it! Incorrect. You are

Re: post init call

2012-06-18 Thread Thomas Rachel
Am 18.06.2012 09:10 schrieb Prashant: class Shape(object): def __init__(self, shapename): self.shapename = shapename def update(self): print update class ColoredShape(Shape): def __init__(self, color): Shape.__init__(self, color) self.color =

Re: post init call

2012-06-18 Thread Peter Otten
Prashant wrote: class Shape(object): def __init__(self, shapename): self.shapename = shapename def update(self): print update class ColoredShape(Shape): def __init__(self, color): Shape.__init__(self, color) self.color =

Problem with ImapLib and subject in French

2012-06-18 Thread Valentin Mercier
Hi, I'm trying to search some mails with SUBJECT criteria, but the problem is the encoding, I'm trying to search french terms (impalib and python V2.7) I've tried few things, but I think the encoding is the problem, in my mail header I have something like this:

module name vs '.'

2012-06-18 Thread Neal Becker
Am I correct that a module could never come from a file path with a '.' in the name? -- http://mail.python.org/mailman/listinfo/python-list

Re: module name vs '.'

2012-06-18 Thread Dave Angel
On 06/18/2012 09:19 AM, Neal Becker wrote: Am I correct that a module could never come from a file path with a '.' in the name? No. Simple example: Create a directory called src.directory In that directory, create two files ::neal.py:: import becker print becker.__file__ print

Re: module name vs '.'

2012-06-18 Thread Neal Becker
I meant a module src.directory contains __init__.py neal.py becker.py from src.directory import neal On Mon, Jun 18, 2012 at 9:44 AM, Dave Angel d...@davea.name wrote: On 06/18/2012 09:19 AM, Neal Becker wrote: Am I correct that a module could never come from a file path with a '.' in the

Re: module name vs '.'

2012-06-18 Thread Dave Angel
On 06/18/2012 09:47 AM, Neal Becker wrote: I meant a module src.directory contains __init__.py neal.py becker.py from src.directory import neal On Mon, Jun 18, 2012 at 9:44 AM, Dave Angel d...@davea.name wrote: On 06/18/2012 09:19 AM, Neal Becker wrote: Am I correct that a

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On 18 juin, 12:11, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote: On 18 juin, 10:28, Benjamin Kaplan benjamin.kap...@case.edu wrote: The u prefix is only there to make it easier to port a codebase from Python 2 to Python 3. It

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Andrew Berg
Perhaps this will clear things up: Python 3.3.0a4 (v3.3.0a4:7c51388a3aa7, May 31 2012, 20:17:41) [MSC v.1600 64 bit (AMD64)] on win32 Type help, copyright, credits or license for more information. ua = u'a' literal_ua = u'a' ua == literal_ua False input_ua = input() u'a' input_ua u'a'

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Dave Angel
On 06/18/2012 10:00 AM, jmfauth wrote: SNIP A string is a string, a piece of text, period. I do not see why a unicode literal and an (well, I do not know how the call it) a normal class str should behave differently in code source or as an answer to an input(). Wrong. The rules for

Re: Problem with ImapLib and subject in French

2012-06-18 Thread Arnaud Delobelle
On 18 June 2012 12:31, Valentin Mercier merciervs...@gmail.com wrote: Hi, I'm trying to search some mails with SUBJECT criteria, but the problem is the encoding, I'm trying to search french terms (impalib and python V2.7) I've tried few things, but I think the encoding is the problem, in my

Cross-platform mobile application written in Python

2012-06-18 Thread Alex Susu
Hello. I would like to point you to a project that I worked on lately: iCam, a video surveillance cross-platform mobile application (Android, Symbian, iOS, WinCE) written in Python, which uploads normally media to YouTube and Picasa. The project can be found at

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Ulrich Eckhardt
Am 18.06.2012 16:00, schrieb jmfauth: A string is a string, a piece of text, period. No. There are different representations for the same piece of text even in the context of just Python. b'fou', u'fou', 'fou' are three different source code representations, resulting in two different runtime

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows since I know Python (v. 1.5.6). I do not see why the semantic may vary differently in code source or in an interactive interpreter, esp. if Python allow it! If you have to know by advance

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Chris Angelico
On Tue, Jun 19, 2012 at 1:44 AM, jmfauth wxjmfa...@gmail.com wrote: I do not see why the semantic may vary differently in code source or in an interactive interpreter, esp. if Python allow it! When you're asking for input, you usually aren't looking for code. It doesn't matter about string

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Jussi Piitulainen
jmfauth writes: Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows r = input() u'a Traceback (most recent call last): File stdin, line 1, in module SyntaxError: u'a Er, no, not really :-) --

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Andrew Berg
On 6/18/2012 11:32 AM, Jussi Piitulainen wrote: jmfauth writes: Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows r = input() u'a Traceback (most recent call last): File stdin, line 1, in module SyntaxError: u'a Er, no,

Re: Py3.3 unicode literal and input()

2012-06-18 Thread John Roth
On Monday, June 18, 2012 9:44:17 AM UTC-6, jmfauth wrote: Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows since I know Python (v. 1.5.6). I do not see why the semantic may vary differently in code source or in an interactive

Re: Py3.3 unicode literal and input()

2012-06-18 Thread David M Chess
If you (the programmer) want a function that asks the user to enter a literal at the input prompt, you'll have to write a post-processing for it, which looks for prefixes, for quotes, for backslashes, etc., and encodes the result. There very well may be such a decoder in the Python library,

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
We are turning in circles. You are somehow legitimating the reintroduction of unicode literals and I shew, not to say proofed, it may be a source of problems. Typical Python desease. Introduce a problem, then discuss how to solve it, but surely and definitivly do not remove that problem. As far

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Dave Angel
On 06/18/2012 12:55 PM, Andrew Berg wrote: On 6/18/2012 11:32 AM, Jussi Piitulainen wrote: jmfauth writes: Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows r = input() u'a Traceback (most recent call last): File stdin, line 1,

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Andrew Berg
On 6/18/2012 12:03 PM, Dave Angel wrote: And you're missing the context. jmfauth thinks we should re-introduce the input/raw-input distinction so he could parse literal strings. So Jussi demonstrated that the 2.x input did NOT satisfy fmfauth's dreams. You're right. I missed that part of

Re: Academic citation of Python

2012-06-18 Thread Ethan Furman
Ben Finney wrote: Curt cu...@free.fr writes: On 2012-06-16, Christian Heimes li...@cheimes.de wrote: Actually it's van Rossum, Guido, not Rossum, Guido van. The van is part of the family name, not a middle name. It's like da Vinci, Leonardo or von Sydow, Max. On one occasion Guido complained

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Jussi Piitulainen
Andrew Berg writes: On 6/18/2012 11:32 AM, Jussi Piitulainen wrote: jmfauth writes: Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows r = input() u'a Traceback (most recent call last): File stdin, line 1, in module

Re: Problem with ImapLib and subject in French

2012-06-18 Thread Dieter Maurer
Valentin Mercier merciervs...@gmail.com writes: I'm trying to search some mails with SUBJECT criteria, but the problem is the encoding, I'm trying to search french terms (impalib and python V2.7) I've tried few things, but I think the encoding is the problem, in my mail header I have

Re: Hashable object with self references OR how to create a tuple that refers to itself

2012-06-18 Thread Duncan Booth
Dieter Maurer die...@handshake.de wrote: You can create a tuple in C and then put a reference to itself into it, but I am quite convinced that you cannot do it in Python itself. (Of course, you could use cython to generate C code with a source language very similar to Python). I don't think

Tkinter binding question

2012-06-18 Thread Frederic Rentsch
Hi All, For most of an afternoon I've had that stuck-in-a-dead-end feeling probing to no avail all permutations formulating bindings, trying to make sense of manuals and tutorials. Here are my bindings: label_frame.bind ('Enter', self.color_selected) label_frame.bind ('Leave',

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Terry Reedy
On 6/18/2012 12:39 PM, jmfauth wrote: We are turning in circles. You are, not we. Please stop. You are somehow legitimating the reintroduction of unicode literals We are not 'reintroducing' unicode literals. In Python 3, string literals *are* unicode literals. Other developers

Re: module name vs '.'

2012-06-18 Thread Terry Reedy
On 6/18/2012 9:54 AM, Dave Angel wrote: On 06/18/2012 09:47 AM, Neal Becker wrote: I meant a module You are correct that using periods in a module name conflicts with periods in import statement syntax. from src.directory import neal that has nothing to do with periods being in a

Checking compatibility of a script across Python versions automatically

2012-06-18 Thread Andrew Berg
Are there any tools out there that will parse a script and tell me if it is compatible with an arbitrary version of Python and highlight any incompatibilities? I need to check a few of my scripts that target 3.2 to see if I can make them compatible with 3.0 and 3.1 if they aren't already. I found

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On Jun 18, 8:45 pm, Terry Reedy tjre...@udel.edu wrote: On 6/18/2012 12:39 PM, jmfauth wrote: We are turning in circles. You are, not we. Please stop. You are somehow legitimating the reintroduction of unicode literals We are not 'reintroducing' unicode literals. In Python 3, string

Re: python 3.3 bz2 decompression testing results

2012-06-18 Thread Nadeem Vawda
Hi Pauli, Thank you for your interest in improving the bz2 module. However, I'm not sure of what you are saying in your email. If you believe you have found a bug in the module, then please provide clear instructions on how to reproduce the error(s), preferably using just one data file that

Conditional decoration

2012-06-18 Thread Roy Smith
Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required(). @login_required() def my_view(request): pass --

Re: Conditional decoration

2012-06-18 Thread Jeremiah Dodds
r...@panix.com (Roy Smith) writes: Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required(). @login_required() def my_view(request): pass You

Re: Conditional decoration

2012-06-18 Thread MRAB
On 18/06/2012 23:16, Roy Smith wrote: Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required(). @login_required() def my_view(request): pass A

Re: Conditional decoration

2012-06-18 Thread Emile van Sebille
On 6/18/2012 3:16 PM Roy Smith said... Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required(). @login_required() def my_view(request): pass class

Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
I tried this: Python 3.2.2 (default, Feb 24 2012, 20:07:04) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. import sys import io fh = io.open(sys.stdin) Traceback (most recent call last): File stdin, line 1, in module TypeError: invalid file:

Re: lazy evaluation of a variable

2012-06-18 Thread Gelonida N
On 06/17/2012 11:35 PM, Gelonida N wrote: Hi, I'm not sure whether what I ask for is impossible, but would know how others handle such situations. I'm having a module, which should lazily evaluate one of it's variables. Meaning that it is evaluated only if anybody tries to use this variable.

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 4:13 PM, Jason Friedman ja...@powerpull.net wrote: I tried this: Python 3.2.2 (default, Feb 24 2012, 20:07:04) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. import sys import io fh = io.open(sys.stdin) Traceback (most recent

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Christian Heimes
Am 19.06.2012 01:13, schrieb Jason Friedman: I tried this: sys.stdin wraps a buffered reader which itself wraps a raw file reader. sys.stdin _io.TextIOWrapper name='stdin' mode='r' encoding='UTF-8' sys.stdin.buffer _io.BufferedReader name='stdin' sys.stdin.buffer.raw _io.FileIO name='stdin'

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
sys.stdin wraps a buffered reader which itself wraps a raw file reader. sys.stdin _io.TextIOWrapper name='stdin' mode='r' encoding='UTF-8' sys.stdin.buffer _io.BufferedReader name='stdin' sys.stdin.buffer.raw _io.FileIO name='stdin' mode='rb' You should read from sys.stdin.buffer unless

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
Which leads me to another question ... how can I debug these things? $ echo 'hello' | python3 -m pdb ~/my-input.py /home/jason/my-input.py(2)module() - import sys (Pdb) *** NameError: name 'hello' is not defined -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional decoration

2012-06-18 Thread Devin Jeanpierre
On Mon, Jun 18, 2012 at 6:49 PM, Emile van Sebille em...@fenx.com wrote: On 6/18/2012 3:16 PM Roy Smith said... class myDecorator(object):    def __init__(self, f):        self.f = f    def __call__(self):        print Entering, self.f.__name__        self.f()        print Exited,

Re: Conditional decoration

2012-06-18 Thread Rob Williscroft
Roy Smith wrote in news:jro9cj$b44$1...@panix2.panix.com in gmane.comp.python.general: Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required().

Re: Checking compatibility of a script across Python versions automatically

2012-06-18 Thread Terry Reedy
On 6/18/2012 3:24 PM, Andrew Berg wrote: Are there any tools out there that will parse a script and tell me if it is compatible with an arbitrary version of Python and highlight any Not that I know of. incompatibilities? I need to check a few of my scripts that target 3.2 to see if I can

constant sharing works differently in REPL than in script ?

2012-06-18 Thread shearichard
Listening to 'Radio Free Python' episode 8 (http://radiofreepython.com/episodes/8/ - around about the 30 minute mark) I heard that Python pre creates some integer constants to avoid a proliferation of objects with the same value. I was interested in this and so I decided to try it out. First

Re: Tkinter binding question

2012-06-18 Thread rantingrickjohnson
On Monday, June 18, 2012 1:21:02 PM UTC-5, Frederic Rentsch wrote: Hi All, For most of an afternoon I've had that stuck-in-a-dead-end feeling probing to no avail all permutations formulating bindings, trying to make sense of manuals and tutorials. Here are my bindings:

Re: lazy evaluation of a variable

2012-06-18 Thread rantingrickjohnson
On Sunday, June 17, 2012 6:01:03 PM UTC-5, Steven D#39;Aprano wrote: One day, in my Copious Spare Time, I intend to write a proper feature request and/or PEP for such a feature. Obviously the absolute earliest such a feature could be introduced is Python 3.4, about 18 months from now.

Re: constant sharing works differently in REPL than in script ?

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 7:52 PM, shearich...@gmail.com wrote: Listening to 'Radio Free Python' episode 8 (http://radiofreepython.com/episodes/8/ - around about the 30 minute mark) I heard that Python pre creates some integer constants to avoid a proliferation of objects with the same

Pymongo Error

2012-06-18 Thread Ranjith Kumar
Hi all, I tried Django with Mongodb while running manage.py syncdb I endup with this error note : it works fine with sqlite and mysql db (django-1.3)ranjith@ranjith:~/ sandbox/python-box/hukkster-core-site/hukk$ ./manage.py syncdb

Re: [chennaipy 1376] Pymongo Error

2012-06-18 Thread Ramesh Seshadri
Are you using django-nonrel or basic django version? Check out http://www.allbuttonspressed.com/projects/django-nonrel cheers Ramesh On Tue, Jun 19, 2012 at 10:52 AM, Ranjith Kumar ranjitht...@gmail.comwrote: Hi all, I tried Django with Mongodb while running manage.py syncdb I endup with

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-18 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: the interfaces of the v4 and v6 variants are deliberately very similar I am hoping that means 'identical, once the obvious translations are made': v4 to v6, xxx.xxx.xxx.xxx to whatever the v6 notation is, and anything else? documenting

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-18 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: My current thoughts are to avoid the usual approach of embedding the method and property definitions in the class definitions, and instead have separate sections under [1] for IP Addresses IP Interfaces IP Networks Inside each of those

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-06-18 Thread Hynek Schlawack
Hynek Schlawack h...@ox.cx added the comment: Martin, what exactly is the intended proceeding now? Are you going to fix your patch and tests as soon as you have time or was that just a PoC and expect me/us to bring it into shape? (- troll-free question, I have no idea what to do next here and

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 8b38a81ba3bf by Petri Lehtinen in branch '2.7': Fix NEWS entry for #15036 http://hg.python.org/cpython/rev/8b38a81ba3bf New changeset 38e2a87c9051 by Petri Lehtinen in branch '3.2': Fix NEWS entry for #15036

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Perfect, fixed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15036 ___ ___ Python-bugs-list

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-06-18 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Martin, what exactly is the intended proceeding now? Are you going to fix your patch and tests as soon as you have time or was that just a PoC and expect me/us to bring it into shape? (- troll-free question, I have no idea what to do next

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This is actually not true. When calling add(), mbox (and MMDF and Babyl) append the message to the file without rewriting it. It's the following flush() call that rewrites the whole mailbox contents. I think this could be changed to work

[issue3665] Support \u and \U escapes in regexes

2012-06-18 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: I forgot about byte patterns. Here is an updated patch. -- Added file: http://bugs.python.org/file26040/re_unicode_escapes-3.patch ___ Python tracker rep...@bugs.python.org

[issue1590744] mail message parsing glitch

2012-06-18 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1590744 ___ ___ Python-bugs-list

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
New submission from John Firestone jo...@freenet.de: exec(source, Dict()) doesn't call Dict().__getitem__ or Dict().__missing__ if the source string contains a function and the function references an undefined global. class Dict1(dict): def __getitem__(self, key): print '

[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-06-18 Thread Radoslaw A. Zarzynski
New submission from Radoslaw A. Zarzynski radoslaw.zarzyn...@student.put.poznan.pl: shutil.copy and shutil.copy2 first copy a file content and afterwards change permissions of a destination file. Unfortunately, the sequence isn't atomical and may lead to disclosure of matter of any file that

[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-06-18 Thread Radoslaw A. Zarzynski
Changes by Radoslaw A. Zarzynski radoslaw.zarzyn...@student.put.poznan.pl: Added file: http://bugs.python.org/file26043/python_shutil_copy_with_umask.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15100

[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-06-18 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- components: +IO nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15100 ___ ___

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: This looks like a documentation issue: it's well documented that in the exec statement, the globals dictionary must be a dict. What's not so clear from the documentation (AFAICT) is that it must actually have *type* dict, rather than

[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-06-18 Thread Hynek Schlawack
Changes by Hynek Schlawack h...@ox.cx: -- nosy: +hynek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15100 ___ ___ Python-bugs-list mailing list

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
John Firestone jo...@freenet.de added the comment: I find the behavior inconsistent. As you can see from this example, the exec'uted code *does* call the instance's overloaded __getitem__ and __missing__ methods when outside a function, but doesn't when inside. --

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: As you can see from this example, the exec'uted code *does* call the instance's overloaded __getitem__ and __missing__ methods when outside a function, but doesn't when inside. Yep; that's because the 's' and 'f' lookups at top level

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: With Python3 though, __getitem__ seems called though. OTOH the 'print' symbol is not found, even though the Dict1 got a '__builtins__' entry added. -- nosy: +amaury.forgeotdarc ___ Python

[issue15101] multiprocessing pool finalizer can fail if triggered in background pool thread

2012-06-18 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: Multiprocessing's process pool originally used a finalizer to shutdown the pool when the pool object is garbage collected. Since the maxtasksperchild feature was added, the worker_handler thread holds a reference to the pool, preventing

[issue15102] Fix 64-bit building for buildbot scripts

2012-06-18 Thread Jeremy Kloth
New submission from Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: The buildbot scripts do not work for the 64-bit targets. Firstly, the /p:UseEnv=True parameter to msbuild causes the 32-bit only projects (make_buildinfo and make_versioninfo) to fail due to architecture mismatch. The

[issue15052] Outdated comments in build_ssl.py

2012-06-18 Thread Jeremy Kloth
Jeremy Kloth jeremy.kloth+python-trac...@gmail.com added the comment: In addition to the fixes from issue15102, the only way I could get the ssl project to build successfully was to add the Perl installation (C:\Perl\bin) to my PATH. -- ___ Python

[issue15040] stdlib compatibility with pypy: mailbox module

2012-06-18 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- title: stdlib compatability with pypy: mailbox.py - stdlib compatibility with pypy: mailbox module ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15040

[issue15052] Outdated comments in build_ssl.py

2012-06-18 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Again: installing Perl should not be necessary. That it is currently necessary is a bug in the sources. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15052

[issue15052] Outdated comments in build_ssl.py

2012-06-18 Thread Jeremy Kloth
Jeremy Kloth jeremy.kl...@gmail.com added the comment: Should I then open another issue just to track that bug? Have you even tried using build_ssl.py *without* Perl? The changes required to get that to work seem fairly extensive. -- ___ Python

[issue15101] multiprocessing pool finalizer can fail if triggered in background pool thread

2012-06-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4c07b9c49b75 by Richard Oudkerk in branch '2.7': Issue #15101: Make pool finalizer avoid joining current thread http://hg.python.org/cpython/rev/4c07b9c49b75 New changeset e1cd1f430ff1 by Richard Oudkerk in branch

[issue15064] multiprocessing should use more context manager

2012-06-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6d2a773d8e00 by Richard Oudkerk in branch 'default': Issue #15064: Implement context manager protocol for multiprocessing types http://hg.python.org/cpython/rev/6d2a773d8e00 -- nosy: +python-dev

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-18 Thread pmoody
pmoody pyt...@hda3.com added the comment: I'm not sure if this is still an issue, but returning the address in a packed format was an early issue (http://code.google.com/p/ipaddr-py/issues/detail?id=14). No objections from me for removing it from the network objects or for removing the packed

[issue7360] [mailbox] race: mbox may lose data with concurrent access

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Can this be closed? -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7360 ___

[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2012-06-18 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5346 ___ ___ Python-bugs-list

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
John Firestone jo...@freenet.de added the comment: Thank you all for the quick and interesting responses! Here is another example, this time showing a simple s sometimes behaves like globals()['s'] and sometimes doesn't. class Dict(dict): def __getitem__(self, key): if key

[issue7360] [mailbox] race: mbox may lose data with concurrent access

2012-06-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Probably. Unless I'm mistaken, the issue with concurrent rewrite (as opposed to append) exists for single-file-mailboxes in the general case, not just in Python. And as far as I know failure is never noisy, the last writer wins.

[issue7359] mailbox cannot modify mailboxes in system mail spool

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Every program that accesses mailboxes in the system-wide mail spool directory needs to have write access to it. This is because dot-locking is achieved by creating additional files to that directory, and it must be used (in addition to fcntl()

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Yes, this is definitely a dark corner of Python, and one that it seems worth trying to illuminate a bit in the documentation. -- ___ Python tracker rep...@bugs.python.org

[issue15052] Outdated comments in build_ssl.py

2012-06-18 Thread Jeremy Kloth
Jeremy Kloth jeremy.kloth+python-trac...@gmail.com added the comment: OK, I have discovered my issue(s) building OpenSSL. When I first downloaded the openssl-1.0.1c external, the timestamps for the .asm files ended up being older than their corresponding .pl sources therefore triggering the

[issue15042] Implemented PyState_AddModule, PyState_RemoveModule

2012-06-18 Thread Robin Schreiber
Robin Schreiber robin.schrei...@me.com added the comment: Added missing documentation. Also added documentation of PyState_FindModule() which still happened to be missing. -- Added file: http://bugs.python.org/file26046/PyState_add-remove_module_v2.patch

[issue15052] Outdated comments in build_ssl.py

2012-06-18 Thread Jeremy Kloth
Jeremy Kloth jeremy.kloth+python-trac...@gmail.com added the comment: I forgot to add that with the patch the comment wrt Perl is truly correct. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15052

[issue15096] Drop support for the ur string prefix

2012-06-18 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15096 ___

[issue15102] Fix 64-bit building for buildbot scripts

2012-06-18 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- keywords: +patch Added file: http://bugs.python.org/file26047/2a20cee18add.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15102 ___

  1   2   >