[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Colin Hawkett

Colin Hawkett  added the comment:

Agreed, this is the same issue. I'll make my argument that this is a bug 
(intentional or otherwise) on that issue.

--

___
Python tracker 

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



[issue7150] datetime operations spanning MINYEAR give bad results

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'll take a look at this patch later today.

--
assignee: belopolsky -> mark.dickinson

___
Python tracker 

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



[issue4810] timeit needs "official" '--' flag

2010-05-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This "--" trick is implemented by the getopt module.
OTOH on my system, 'grep' also recognizes this, and I could not find any 
documentation about it, neither with "grep --help" nor "man grep".

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Colin Hawkett

Colin Hawkett  added the comment:

#8819 was closed as duplicate. That issue linked a description of the problem 
on stack overflow 
http://stackoverflow.com/questions/2904274/globals-and-locals-in-python-exec. I 
would like to argue that this is a bug, and should be fixed in 2.6+. The 
definition of bug here is that python does not behave as documented - that 
variable name resolution does *not* check the locals() of the enclosing scope. 
The fact that the code mistakenly assumes locals and globals would be the same 
thing in this situation does not mean it is not a bug.

The statement in the previous comment - 'if you want exec to mimc the top level 
environment, you need to pass it a single dictionary' is true, but it hides 
that fact that this is the *only* thing you can do - if you *don't* want exec 
to mimic the top level environment, what's the approach? Doing anything else 
just creates a unique, undocumented, oddly behaving scope that doesn't apply 
closures correctly.

What are the use cases for passing in locals? Doing so means your code behaves 
abnormally, unless you think carefully about how you write it, and that's not 
good - 'Write python code like this, except for this situation where it doesn't 
work, and you have to write your python like this, avoiding certain closure 
scenarios that would otherwise work.' What's the exec() API with locals for?

If you don't pass in locals, or make globals and locals the same dictionary, 
then its an absolute pain to retrieve the definitions created in the exec'd 
code - they're mixed in with all the globals python adds, and if you don't know 
in advance what is being defined in the code block, it's close to impossible. 
To me, this is the primary use case for locals being passed in, and was surely 
the intention when the API was constructed.  This bug prevents this use case.

I'm guessing that somewhere in the python source there is some code that  goes 
(pseudo)

if scope == module: check_globals()
else:
  check_locals()
  check_globals()

and that this is done for performance reasons, but surely the check could be 
different without giving up much, and fix the problem?

if locals() is globals(): check_globals()
else:
  check_locals()
  check_globals()

--
nosy: +hawkett

___
Python tracker 

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



[issue8817] Expose round-to-nearest division algorithm in Objects/longobject.c

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ah, good point.  I knew there was a reason I didn't like Py_XDECREF.
I'll fix this and then apply this patch tonight.

--

___
Python tracker 

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



[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Colin Hawkett

Colin Hawkett  added the comment:

Apologies for raising it in the tracker against your advice. My thinking was 
that you were suggesting discussions about 3.x content shouldn't be in the 
tracker, and I wanted to argue that it is a bug and should be fixed in 2.6+

--

___
Python tracker 

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



[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Hmm.  To get this changed in 2.x you'd have to convince people that it really 
is a bug.  You probably also need to do that very soon for there to be any hope 
of 2.7 having changed behaviour.

I'd suggest bringing this up on the python-dev mailing list;  it'll get better 
visibility there.  If you can describe exactly what should change (and even 
better, how that change might be implemented) that would be a bonus.

--

___
Python tracker 

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



[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> If the underlying library is LGPL, it would
> require us to distribute its sources along with the Windows binaries,
> which I'm not willing to do.

Martin, this is wrong, you don't have to bundle the source *in* the object code 
package. Making it available on some HTTP or FTP site is sufficient.
(actually, if we don't modify the library source, we can even point at the 
original download site)

--
nosy: +pitrou

___
Python tracker 

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



[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The second is whether we should take this opportunity to fix datetime
> being a C extension module exclusively. I know PyPy has their own pure
> Python version of datetime that they plan to eventually contribute. We 
> might as well use this as the chance to create Lib/datetime.py and have 
> that conditionally import _datetimemodule.c (see the heapq module on 
> how to handle this kind of situation).

Of we could let PyPy contribute their own version when they want, after all.
I think additions to the datetime API are good in themselves, and we shouldn't 
make them depend on some mythical refactoring of the code into a separate pure 
Python module ;)

--

___
Python tracker 

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



[issue1731717] race condition in subprocess module

2010-05-26 Thread Stefan

Stefan  added the comment:

I have exactly the same problem. Is there a thread-safe alternative to execute 
subprocesses in threads?

--
nosy: +santoni

___
Python tracker 

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



[issue6312] httplib fails with HEAD requests to pages with "transfer-encoding: chunked"

2010-05-26 Thread Dirkjan Ochtman

Dirkjan Ochtman  added the comment:

The fix in r80583 is bad. It fails to close() the response (which previously 
worked as expected), meaning that the connection can't be re-used.

(I ran into this because Gentoo has backported the 2.6-maint fixes to their 
2.6.5 distribution.)

Shall I open a new issue, or re-open this one?

--
nosy: +djc

___
Python tracker 

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



[issue6312] httplib fails with HEAD requests to pages with "transfer-encoding: chunked"

2010-05-26 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I am just reopening this, as per dcj's comment.

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

___
Python tracker 

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



[issue8781] 32-bit wchar_t doesn't need to be unsigned to be usable (I think)

2010-05-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Antoine Pitrou wrote:
> 
> Antoine Pitrou  added the comment:
> 
> The problem with a signed Py_UNICODE is implicit sign extension (rather than 
> zero extension) in some conversions, for example from "char" or "unsigned 
> char" to "Py_UNICODE". The effects could go anywhere from incorrect results 
> to plain crashes. Not only in our code, but in C extensions relying on the 
> unsignedness of Py_UNICODE.

Right.

The Unicode code was written with an unsigned data type in mind (range
checks, conversions, etc.). We'd have to do some serious code review to
allow switching to a signed data type.

> Is there a way to enable those optimizations while keeping an unsigned 
> Py_UNICODE type? It seems Py_UNICODE doesn't have to be typedef'ed to 
> wchar_t, it can be defined to be an unsigned integer of the same width. Or 
> would it break some part of the C standard?

The memcpy optimizations don't rely on the unsignedness of
wchar_t, so they would work just as well.

--
title: 32-bit wchar_t doesn't need to be unsigned to be usable (I think) -> 
32-bit wchar_t doesn't need to be unsigned to be usable (I think)

___
Python tracker 

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



[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I'm guessing that somewhere in the python source there is some code that goes 
> [...]

Unfortunately it's not nearly that simple.  As I mentioned in my message on 
python-dev, the problem is that 'y' gets bound with a 'STORE_NAME' opcode, 
which puts 'y' into the locals dict, and then retrieved from within the 
function with a 'LOAD_GLOBAL' opcode, which looks in the globals dict;  hence 
the NameError.

So should the compiler be generating a 'LOAD_NAME' instead of a 'LOAD_GLOBAL' 
for this code?  I'm not really familiar with the compilation process, so I've 
no idea whether this makes sense, or what impact it might have on existing code.

--

___
Python tracker 

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2010-05-26 Thread anatoly techtonik

New submission from anatoly techtonik :

'naive' and 'aware' are key datetime types - they need a proper definition and 
anchor for crossrefences. If you take a look at 
http://docs.python.org/library/datetime.html - the definition of distinction 
between them is too vague and this seeds of uncertainty grow through the rest 
of the doc. It is not said how to make non-naive object, how to detect if 
object of naive or aware. All this stuff is very important for troubleshooting 
datetims issues in Python projects. It needs a proper documentation.

--
assignee: d...@python
components: Documentation
messages: 106524
nosy: d...@python, techtonik
priority: normal
severity: normal
status: open
title: datetime naive and aware types should have a well-defined definition 
that can be cross-referenced

___
Python tracker 

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



[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

Committed to trunk in r81517 and release26-maint in r81540.

I'll cover the 3.x stuff today and then close it out.

--
assignee: stutzbach -> brian.curtin
resolution:  -> fixed
stage: patch review -> committed/rejected

___
Python tracker 

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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread AdamN

New submission from AdamN :

When running urllib2 and getting a BadStatus from an http server, this error is 
raised:

  File "/var/www/pinax-env/pline/apps/page/models.py", line 303, in render
content = urllib2.urlopen(self.url,timeout=10).read()
  File "/usr/lib/python2.6/urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 389, in open
response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 407, in _open
'_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain
result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1119, in do_open
r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 974, in getresponse
response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine

Because urllib2 doesn't catch it with this:

lines 1116-1120

try:
h.request(req.get_method(), req.get_selector(), req.data, headers)
r = h.getresponse()
except socket.error, err: # XXX what error?
raise URLError(err)

It is not caught anywhere else and the call blows up unless I make a special 
exception for all httplib exceptions.  The specific url that blew this up is:

http://phoenix.untd.com/oasx/rqst/type=sx/rdb=8203014d74555355533a415a2d2d2d2d2d2d2d2d2d2d011d494a0901/version=3/origin=uol/isp=et_cau

--
messages: 106526
nosy: adamnelson
priority: normal
severity: normal
status: open
title: urllib2 does not catch httplib.BadStatusLine
type: behavior

___
Python tracker 

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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread AdamN

Changes by AdamN :


--
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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread AdamN

Changes by AdamN :


--
components: +Library (Lib)

___
Python tracker 

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



[issue6312] httplib fails with HEAD requests to pages with "transfer-encoding: chunked"

2010-05-26 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-05-26 Thread anatoly techtonik

anatoly techtonik  added the comment:

1. David, as an original reporter who needed this for Trac 
(http://trac.edgewall.org/ticket/8662) and couple of other projects I strongly 
for 'Z' ending by default, unless you are going to explain the full difference 
in documentation. Expect to answer the question "Why the timestamp is not 
'Z'-ended like in Atom?"

2. "-00:00" is not semantically correct as a default either. Quoting RFC again 
- "If the time in UTC is known, but the offset to local time is unknown, this 
can be represented with an offset of "-00:00". It is not true for naive 
datetime stamps that represent the fact that "the time in UTC is unknown, and 
the offset to UTC is unknown".

3. Daniel, thanks for yet another patch contribution for this issue. 
default_utcoffset seems confusing to me. If I see call like 
datetime.rfcformat(default_utcoffset="-00:00") - I somehow expect that 
default_utcoffset is used if it is impossible to determine the offset. If it is 
only about format of zero offset then 'zerozone' param seems more logical. If 
it is about substitution for unknown zone, then the proper way in datetime API 
would be to convert object to 'aware datetime' type with proper zone prior to 
calling this function. Datetime API is definitely on of the worst items in 
Python from the user point of view.

--

___
Python tracker 

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



[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

test_dynamic_key fails on py3k, but not because of these changes.

RegQueryValueExW doesn't appear to work with NULL for the second parameter 
(valueName), although it is documented to and the ANSI version on 2.x works 
fine. The empty string is also documented as an acceptable parameter, so while 
testing it out, I hardcoded "" in PyQueryValueEx and the calls worked. With 
NULL, it raises "WindowsError: [Error 87] The parameter is incorrect".

Thoughts? The current py3k patch is attached.

--
Added file: http://bugs.python.org/file17467/issue2810_py3k.diff

___
Python tracker 

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



[issue7150] datetime operations spanning MINYEAR give bad results

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

The patch looks good to me.  Please apply!

--
assignee: mark.dickinson -> belopolsky
resolution:  -> accepted

___
Python tracker 

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



[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-05-26 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I wrote a short C program to test a few different variations.  It looks to me 
like a bug in the operating system's implementation of HKEY_PERFORMANCE_DATA 
(which is a virtual registry key).  If I pass NULL as the second parameter to a 
more conventional key that has a default value, everything works fine.

I suggest changing the test to pass "" instead of None.

--

___
Python tracker 

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



[issue7150] datetime operations spanning MINYEAR give bad results

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

As an aside, I dislike the fact that the datetime module uses a C 'int' for 
date ordinals, and clearly assumes that it'll be at least 32 bits.  int could 
be as small as 16 bits on some systems (small embedded systems?).  But that's 
another issue.

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

This looks fine to me.  Alexander?

--
nosy: +belopolsky, mark.dickinson

___
Python tracker 

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



[issue6608] asctime causing python to crash

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I have untabified James' patch, ran the tests on the result, but did not 
otherwise review it.

There is a not-so-easy-to-find thread on python-dev discussing this issue under 
subject "Python 2.6.5".

Here is a relevant quote from  Martin v. Löwis:

"""
That would require that Barry actually *can* judge the issue at hand. In
the specific case, I would expect that Barry would defer the specifics
of the Windows issue to Windows experts, and then listen to what they
say.

I'm personally split whether the proposed patch is correct (i.e. whether
asctime really *can* be implemented in a cross-platform manner; any
definite ruling on that would be welcome). In the past, we had rather
taken approaches like disabling runtime assertions "locally"; not sure
whether such approaches would work for asctime as well.

In any case, I feel that the issue is not security-critical at all.
People just don't pass out-of-range values to asctime, but instead
typically pass the result of gmtime/localtime, which will not cause any
problems.
"""

--
assignee:  -> belopolsky
components: +Distutils -Extension Modules, Windows
nosy: +belopolsky

___
Python tracker 

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



[issue6608] asctime causing python to crash

2010-05-26 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file17468/issue6608.diff

___
Python tracker 

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



[issue8254] write a configure command

2010-05-26 Thread Éric Araujo

Éric Araujo  added the comment:

Distutils2 already has a config command used to configure some aspects of C 
compilation. Not sure if I should expand that or write an unrelated configure 
command.

--

___
Python tracker 

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



[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Matthias Klose

Matthias Klose  added the comment:

Per, on 2010-03-17, I asked you via email:

"I was looking at

  http://bugs.python.org/issue5689
  http://bugs.python.org/issue6715

and Martin's comments about the licensing of the bindings; is there a special 
reason for the lgpl3 license of the bindings, given that both python and 
xz-utils are not gpl'ed?"

Does pyliblzma need to be licensed under the lgpl3?

--

___
Python tracker 

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



[issue8254] write a configure command

2010-05-26 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

start a new command from scratch. The configure command is not dealing but with 
generating a configuration file.

config is implementing a whole compilation chain.

--

___
Python tracker 

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



[issue8254] write a configure command

2010-05-26 Thread Jeremy Kloth

Changes by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue8335] distutils test_build_ext's test_get_outputs fails in bootstrap environment

2010-05-26 Thread jan matejek

jan matejek  added the comment:

Tarek,
the error output is this:
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: 
cannot find -lpython2.6

the chdir is the problem - because in an environment where you don't have an 
existing Python installation, you will not find -lpython2.6.

the linker from unixccompiler.py:link() is this:
['gcc', '-pthread', '-shared', 
'/tmp/pythontest_eosQ1d/tempt/tmp/tmphIMDH2/foo.o', '-L.', '-lpython2.6', '-o', 
'/tmp/tmppAsk00/foo.so']

and since you're in new temporary directory, -L. does not include libpython2.6 
(unless you copy it in that directory or change -L. to the right place)

--

___
Python tracker 

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



[issue6608] asctime causing python to crash

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

The patch as written causes buffer overflow for year >= 10,000:

>>> len(time.asctime( (1, 1, 1, 0, 0, 0, 0, 1, -1)))
26
>>> len(time.asctime( (10, 1, 1, 0, 0, 0, 0, 1, -1)))
27

while the buffer is only 26 characters:

+   static char result[26];
+
+   sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",

This can be fixed in multiple ways: changing the year format to %.4d, using 
PyString_Format, or restricting the year to 4 decimal digits in check_bounds.

A nit pick: you can save some static storage by making wday_name and mon_name 
and possibly increase performance of asctime 2d arrays instead of arrays of 
pointers to null-terminated strings.  See 
http://www.opengroup.org/onlinepubs/009695399/functions/asctime.html .

Just as Martin, I am split on whether the patch is correct.  The fact that it 
is almost a copy of POSIX reference implementation gives some confidence, but 
that confidence is taken away by the reference implementation having a buffer 
overflow bug.

I am also not sure that all systems produce the same end of line character.  I 
would like to hear from Windows experts.

--
components: +Extension Modules, Windows -Distutils
stage: needs patch -> patch review

___
Python tracker 

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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

urllib2 is currently catching the socket.error exceptions and presenting the 
reason as custom URLError exception. To address this issue, the module should 
catch the httplib raised exceptions also and present it.

--
assignee:  -> orsenthil
nosy: +orsenthil
resolution:  -> accepted

___
Python tracker 

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



[issue8817] Expose round-to-nearest division algorithm in Objects/longobject.c

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Committed (with the DECREF(one) fix) in r81541.

--
components: +Interpreter Core
resolution:  -> accepted
stage:  -> 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



[issue8254] write a configure command

2010-05-26 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee:  -> belopolsky
stage:  -> commit review

___
Python tracker 

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



[issue8190] Add a PyPI XML-RPC client module

2010-05-26 Thread Alexis Metaireau

Changes by Alexis Metaireau :


--
nosy: +alexis

___
Python tracker 

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



[issue4908] Implement PEP 376

2010-05-26 Thread Alexis Metaireau

Changes by Alexis Metaireau :


--
nosy: +alexis

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> (I know, the "context" attribute isn't documented, I'm going to fix
> this)

Now documented at:
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLSocket.context

--

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-26 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

If you're fine with the current patch I can go on and commit it (including the 
context attribute test).

--

___
Python tracker 

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



[issue8775] Use locale encoding to decode sys.argv, not the file system encoding

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

@loewis: You restored the original (wrong) title "Use locale encoding to decode 
sys.argv, not the file system encoding", instead of the new (good) title "Use 
locale encoding to encode command line arguments (subprocess, os.exec*(), 
etc.)". Is it wanted or not?

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Mark,

I have zero experience with Windows and don't even have a win32 machine to test 
the patch.

On the other hand the patch is so simple that I think it can be reviewed based 
on theoretical considerations.

This is probably bikesheding, but I have a slight preference for  os.name in 
("nt", "ce").  The reason is that sys.platform is fixed when python is built 
while os.name is (in theory) determined at run-time.

Also, sys.platform == "win32", appears to be false on 64 bit Windows, but I 
think it is actually true.

Finally, explicit better than implicit.  A change from if os.name == "nt" to  
os.name in ("nt", "ce") gives obviously a strictly wider check. On the other 
hand it is not obvious to me how the current patch will affect Cygwin platform.

--

___
Python tracker 

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



[issue8402] glob returns empty list with "[" character in the folder name

2010-05-26 Thread Dan Gawarecki

Dan Gawarecki  added the comment:

Shouldn't the title be updated to indicate the fnmatch is the true source of 
the behavior (I'm basing this on http://docs.python.org/library/glob.html 
indicating the fnmatch is invoked by glob).  I'm not using glob, but fnmatch in 
my attempt to find filenames that look like "Ajax_[version2].txt".  

If nothing else, it would have helped me if the documentation would state 
whether or not the brackets could be escaped.  It doesn't appear from my tests 
(trying "Ajax_\[version2\].txt" and "Ajax_\\[version2\\].txt") that 'escaping' 
is possible, but if the filter pattern gets turned into a regular expression, I 
think escaping *would* be possible.  Is that a reasonable assumption?

I'm running 2.5.1 under Windows, and this is my first ever post to the bugs 
list.

--
nosy: +Aquinas

___
Python tracker 

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



[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

I wrote a patch for base64.b64encode() to accept str (str is encoded to utf-8): 
patch attached to #4768. It should fix this issue, but we can add the tests of 
email_base64_bytes.patch.

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

sys.platform will be "win32" for both 32 and 64-bit Windows.

As for Cygwin, os.name is "posix" there, and sys.platform is "cygwin", so it 
should be unaffected.

The patch looks fine to me, and we do typically use sys.platform more often 
than the os.name check.

--
nosy: +brian.curtin

___
Python tracker 

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



[issue8402] glob returns empty list with "[" character in the folder name

2010-05-26 Thread Dan Gawarecki

Dan Gawarecki  added the comment:

Following up...
I saw Eric Smith's 2nd note (2010-04-15 @1:27) about fnmatch.translate 
documentation stating that
   "There is no way to quote meta-characters."

When I looked at:
http://docs.python.org/library/fnmatch.html#module-fnmatch

did not see this statement appear anywhere.  Would this absence be because 
someone is working on making this enhancement?

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

OK, I'll commit it then.

--
resolution:  -> accepted

___
Python tracker 

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



[issue8402] glob returns empty list with "[" character in the folder name

2010-05-26 Thread Eric Smith

Eric Smith  added the comment:

I don't think so. That quote came from the docstring for fnmatch.translate.

>>> help(fnmatch.translate)
Help on function translate in module fnmatch:

translate(pat)
Translate a shell PATTERN to a regular expression.

There is no way to quote meta-characters.

--

___
Python tracker 

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



[issue7449] A number tests "crash" if python is compiled --without-threads

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

> I think one more skip is required in test_socketserver.

Fixed: 2.7 (r81543), 3.2 (r81545), 3.1 (r81546). Blocked in 2.6 (r81544).

--
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



[issue8824] Improve documentation of exec

2010-05-26 Thread Terry J. Reedy

New submission from Terry J. Reedy :

This doc improvement suggestion is inspired by #991196 (and subsequent 
duplicates) and the current discussion on py-dev in the thread
  'variable name resolution in exec is incorrect'
(which is not a correct claim). I believe there is consensus that the doc for 
exec needs improving.

My suggestion (which others may amend) is that the following paragraph (from 
the 3.x builtin functions exec entry)

"In all cases, if the optional parts are omitted, the code is executed in the 
current scope. If only globals is provided, it must be a dictionary, which will 
be used for both the global and the local variables. If globals  and locals are 
given, they are used for the global and local variables, respectively. If 
provided, locals can be any mapping object."

have these two sentences added:

"If only globals is provided or if onedict is provided as both globals and 
locals, the code is executed in a new top-level scope. If different objects are 
given as globals and locals, the code is executed as if it were in a class 
statement in a new top-level scope."

--
assignee: d...@python
components: Documentation
messages: 106552
nosy: d...@python, tjreedy
priority: normal
severity: normal
status: open
title: Improve documentation of exec
versions: Python 2.6, Python 2.7, 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



[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Am 26.05.2010 10:51, schrieb Antoine Pitrou:
>
> Antoine Pitrou  added the comment:
>
>> If the underlying library is LGPL, it would
>> require us to distribute its sources along with the Windows binaries,
>> which I'm not willing to do.
>
> Martin, this is wrong, you don't have to bundle the source *in* the object 
> code package.

That's why I said "along". I'm still not willing to do that: making the 
source available is still inconvenient. More importantly, anybody 
redistributing Python binaries would have to comply also (e.g. on 
CD-ROMs or py2exe binaries); this is a burden I don't want to impose
on our users. Fortunately, we don't have to, as the LZMA compression 
itself is in the public domain. For the Python wrapper, I hope that 
somebody contributes such a module under a PSF contributor agreement.
If nobody else does, I may write one from scratch one day.

--

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread C Moss

New submission from C Moss :

The expression int("0",0) throws an exception, though the expectation would be 
to return 0 (zero).

int("0x0",0) == 0
int("00",0) = 0

--
components: None
messages: 106554
nosy: cmoss60
priority: normal
severity: normal
status: open
title: int("0",0) throws exception
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



[issue8824] Improve documentation of exec

2010-05-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

To be super-clear, consider adding one more sentence, something like

"The result for code with def statements or lambda expressions may be different 
than it would be if the implied context were a function rather than a class."

--

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Hmm.  It works for me:

Python 2.6.5 (r265:79063, May 18 2010, 17:12:15) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int("0", 0)
0

What version of Python are you using, and on what platform.  Also, please could 
you show the exact code you used and the full exception traceback?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue8826] Invalid expires date in cookiejar

2010-05-26 Thread Tomas Zulberti

New submission from Tomas Zulberti :

This happens when creating a SimpleCookie from an string. The value in the 
cookie is: "expires=Fri, 31-Dec-2010 23:59:59 GMT"

But in the cookiejar, the value if only "Fri,". 

As far as I know, the error is in the regular expresion _LegalCharsPatt, that 
doesn't allows whitespaces. The format of the expires date was taken from the 
wikipedia: http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes

--
components: None
messages: 106557
nosy: tzulberti
priority: normal
severity: normal
status: open
title: Invalid expires date in cookiejar
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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

Works fine on 2.6 and 3.1 on Windows.

--
nosy: +brian.curtin

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread C Moss

C Moss  added the comment:

I'm using MS IronPython 2.6 which is using CPython 2.6.1.

Regards,

Clark

--

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Ezio Melotti

Ezio Melotti  added the comment:

FWIW it works fine on 2.6/2.7/3.1/3.2 on Linux too.

--
nosy: +ezio.melotti, michael.foord

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

That's an IronPython bug, and I see the same thing as you when I run on IP 2.6. 
You could submit a bug report to them here: 
http://ironpython.codeplex.com/workitem/list/basic

--

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-26 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Committed in r81548.

--
components: +Library (Lib)
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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

We ought to add a test case for this so that other implementations can detect 
an error.

--
nosy: +rhettinger

___
Python tracker 

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



[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-05-26 Thread Brian Curtin

Brian Curtin  added the comment:

Committed to py3k in r81547 and release31-maint in r81546.

Thanks for the patch!

--
status: open -> closed

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-26 Thread Brett Cannon

Brett Cannon  added the comment:

PyPy has said over the years they plan to commit their version of datetime, 
they just need to get around to it. I just figured that we could use this 
opportunity to prepare for it. But if people want to do the C version first, 
that's fine as they will be the ones writing the patch. I just thought that if 
someone would rather write a patch to create datetime.py now along with a pure 
Python version of the proposed class they could.

--

___
Python tracker 

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



[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Per Øyvind Karlsen

Per Øyvind Karlsen  added the comment:

if you're already looking at issue6715, then I don't get why you're asking.. ;)

quoting from msg106433:
"For my code, feel free to use your own/any other license you'd like or even 
public domain (if the license of bz2module.c that much of it's derived from 
permits of course)!"

The reason why I picked LGPLv3 in the past was simply just because liblzma at 
the time was licensed under it, so I just picked the same for simplicity.
I've actually already dual-licensed it under the python license in addition on 
the project page though, but I just forgot updating the module's metadata as 
well before I released 0.5.3 last month..

Martin: For LGPL (or even GPL for that matter, disregarding linking 
restrictions) libraries you don't have to distribute the sources of those 
libraries at all (they're already made available by others, so that would be 
quite overly redundant, uh?;). LGPL actually doesn't even care at all about the 
license of your software as long as you only dynamically link against it.

I don't really get what the issue would be even if liblzma were still LGPL, it 
doesn't prohibit you from distributing a dynamically linked library along with 
python either if necessary (which of course would be of convenience on 
win32..)..

tsktsk, discussions about python module for xz compression should anyways be 
kept at issue6715 as this one is about the tarfile module ;p

--

___
Python tracker 

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



[issue6715] xz compressor support

2010-05-26 Thread Per Øyvind Karlsen

Per Øyvind Karlsen  added the comment:

Yeah, I guess I anyways can just break the current API right away to make it 
compatible with future changes, I've already figured since long ago how it 
should look like. It's not like I have to implement the actual functionality to 
ensure compatibility, no-op works like charm. ;)

--

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Added some test cases in r81551 (trunk) and r81552 (release26-maint).

I'll merge these to py3k.  But I notice that the rules for py3k are a little 
odd:

>>> int('', 0)
0
>>> int('0001', 0)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: invalid literal for int() with base 0: '0001'

I expected the prohibition on leading zeros to apply to the first example, as 
well as the second.

--

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Tests merged to 3.x in r81553, r81554.  Closing.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue8825] int("0",0) throws exception

2010-05-26 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +dino.viehland

___
Python tracker 

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



[issue8827] poplib.POP3_SSL doesn't have an actual test suite

2010-05-26 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

As done for ftplib.FTP_TLS the tests executed in TestPOP3Class should be 
replicated to use poplib.POP3_SSL instead of poplib.POP3.

asyncore-based SSL test server used in test_ftplib.py can be used as an example 
on how to do this.

--
assignee: giampaolo.rodola
components: Tests
messages: 106570
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: poplib.POP3_SSL doesn't have an actual test suite
versions: Python 2.6, Python 2.7, 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



[issue8827] poplib.POP3_SSL doesn't have an actual test suite

2010-05-26 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I'm sorry, it seems I'm wrong.
Ignore this.

--
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



[issue6715] xz compressor support

2010-05-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

[Replying to msg106566]

> if you're already looking at issue6715, then I don't get why you're
> asking.. ;)

Can you please submit a contributor form?


> Martin: For LGPL (or even GPL for that matter, disregarding linking
> restrictions) libraries you don't have to distribute the sources of
> those libraries at all (they're already made available by others, so
> that would be quite overly redundant, uh?;). LGPL actually doesn't
> even care at all about the license of your software as long as you
> only dynamically link against it.

Of course you do. Quoting from the LGPL

"You may convey a Combined Work ... if you also do each of the following:
 ...
 d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this 
   License, and the Corresponding Application Code in a form 
   suitable for, and under terms that permit, the user to recombine 
   or relink the Application with a modified version of the Linked 
   Version to produce a modified Combined Work, in the manner 
   specified by section 6 of the GNU GPL for conveying 
   Corresponding Source.
1) [not applicable to Windows]
"

> I don't really get what the issue would be even if liblzma were still
> LGPL, it doesn't prohibit you from distributing a dynamically linked
> library along with python either if necessary (which of course would
> be of convenience on win32..)..

Of course I can distribute a copy of an lzma DLL. However, I would have to 
provide ("convey") a copy of the source code of that DLL as well.

--
nosy: +loewis

___
Python tracker 

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



[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> tsktsk, discussions about python module for xz compression should
> anyways be kept at issue6715 as this one is about the tarfile module
> ;p

Ok, following up there.

--

___
Python tracker 

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



[issue8807] poplib should support SSL contexts

2010-05-26 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Patch in attachment.
The same approach adopted for ftplib (issue 8806) was used.

--
keywords: +patch
Added file: http://bugs.python.org/file17469/poplib.patch

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed in r81555 (trunk) and r81556 (py3k).  Is this a 2.6 backport 
candidate?  I don't think so.

Leaving this open to consider using newer unittest.skipIf mechanism.  See 
attached patch, issue7879.diff.

--
Added file: http://bugs.python.org/file17470/issue7879.diff

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

The skipIf patch looks good to me (though I haven't tested it).

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

>From IRC:

Taggnostr: imho tests and doc updates can be backported

--
keywords: +26backport

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
versions: +Python 2.6, 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



[issue6715] xz compressor support

2010-05-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Of course I can distribute a copy of an lzma DLL. However, I would
> have to provide ("convey") a copy of the source code of that DLL as
> well.

Can you tell me where you are currently providing the source code for
the readline library, or the gdbm library?

Oh, and by the way, you should probably shut down PyPI, since there are
certainly Python wrappers for LGPL'ed libraries there (or even GPL'ed
one), and you aren't offering a link to download those libraries' source
code either.

You seem to have no problem "conveying" copies for the source code of
non-LGPL libraries such as OpenSSL. Why is that?

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

SkipIf patch committed in r81559 (trunk) and r81560 (py3k).

--

___
Python tracker 

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



[issue6715] xz compressor support

2010-05-26 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Can you tell me where you are currently providing the source code for
> the readline library, or the gdbm library?

We don't, as they aren't included in the Windows distribution. The 
readline library doesn't work on Windows, anyway, and instead of gdbm, 
we had traditionally been distributing bsddb instead on Windows.

> Oh, and by the way, you should probably shut down PyPI, since there are
> certainly Python wrappers for LGPL'ed libraries there (or even GPL'ed
> one), and you aren't offering a link to download those libraries' source
> code either.

This is off-topic for this bug tracker. Please remain objective and 
professional if you can manage to.

> You seem to have no problem "conveying" copies for the source code of
> non-LGPL libraries such as OpenSSL. Why is that?

Not sure what you are referring to. We don't provide the sources for the 
OpenSSL libraries along with the Windows installer, because the license 
of OpenSSL doesn't require us to. This is very convenient for our users.

--

___
Python tracker 

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



[issue6715] xz compressor support

2010-05-26 Thread Matthias Klose

Changes by Matthias Klose :


--
nosy: +doko

___
Python tracker 

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



[issue6715] xz compressor support

2010-05-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > Oh, and by the way, you should probably shut down PyPI, since there are
> > certainly Python wrappers for LGPL'ed libraries there (or even GPL'ed
> > one), and you aren't offering a link to download those libraries' source
> > code either.
> 
> This is off-topic for this bug tracker. Please remain objective and 
> professional if you can manage to.

This whole subthread was already off-topic (since it was pointed out,
before your previous message, that the underlying lib is in the public
domain).

Actually, I would argue that the whole idea of promoting a rigorous
interpretation of a license has no place on the bug tracker. It makes no
sense to do this on an ad hoc fashion, especially if you want lawyers to
be involved (they are certainly not reading this).

(of course, you will also have understood that I disagree with such a
rigorous interpretation)

> Not sure what you are referring to. We don't provide the sources for the 
> OpenSSL libraries along with the Windows installer, because the license 
> of OpenSSL doesn't require us to. This is very convenient for our users.

This was not about providing the sources together with the installer
(which even the GPL or the LGPL don't require to do), but providing them
as a separate bundle on the download site.
We do have a copy of the OpenSSL source tree somewhere, it is used by
the Windows build process.

--

___
Python tracker 

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



[issue8651] "s#" and friends can silently truncate buffer length

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

getarg.patch fixes STORE_SIZE macro used in convertsimple(). If the input size 
is bigger than INT_MAX, it raises an OverflowError("size does not fit in an 
int") and calls converterr() which expected="".

The value of expected is useless because converterr() is only used to notice 
that an error occured. I think that return msgbuf instead of calling 
converterr() would be enough, but I don't know this code very well and so i 
copied the code used to raise an OverflowError for the 'b' format.

--
keywords: +patch
Added file: http://bugs.python.org/file17471/getarg.patch

___
Python tracker 

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



[issue8651] "s#" and friends can silently truncate buffer length

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

Another test (only requires ~2 GB of memory, not 4 GB or more) for the patch:

import _elementtree
def test():
parser=_elementtree.XMLParser()
text='s' * (2**31 + 10)
try:
parser.feed(text)
except OverflowError as err:
print("ok: %s" % err)
return
except:
pass
print("error: OverflowError not raised")
test()

--

___
Python tracker 

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



[issue8650] zlibmodule.c isn't 64-bit clean

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

See also a related issue: #8651.

--

___
Python tracker 

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



[issue8811] fixing sqlite3 docs for py3k

2010-05-26 Thread Shashwat Anand

Changes by Shashwat Anand :


--
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



[issue8604] Adding an atomic FS write API

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

> This sounds silly to me. You can write a file in two lines:
>
> with open("foo", "wb") as f:
>f.write(contents)

If the disk is full, write fails and the new file only contains a part of 
'contents'. If the file does already exist and the write fails, the original 
content is lost.

The correct pattern is something like:

@contextlib.contextmanager
def atomic_write(filename):
  tempname = filename + ".tmp"
  out = open(tempname, "w")
  try:
 yield out
 if hasattr('os', 'fsync'):
os.fsync(out.fileno())
 out.close()
 if os.name in ('nt', 'ce'):
os.unlink(filename)
# ... hope that it doesn't fail here ...
 os.rename(tempname, filename)
  except:
 out.close()
 os.unlink(tempname)
 raise

Remarks:
 - call fsync() to ensure that the new file content is written on disk. it does 
nothing on Mac OS X
 - on Windows, it's not possible to rename a to b if b does already exist. New 
Windows versions has an atomic function: MoveFileTransacted(). Older versions 
have MoveFileEx(MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH) and 
ReplaceFile()

This context manager is *not* atomic on any OS. It's only atomic on some OS, 
and it may depends on the kernel version (see recent discussions about 
ext3/ext4, fsync and write barrier).

--
nosy: +haypo

___
Python tracker 

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



[issue8604] Adding an atomic FS write API

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

An article about ext3 and fsync: "Solving the ext3 latency problem"
http://lwn.net/Articles/328363/

Another good article, written by the maintainer of ext4 (Theodore Ts'o): "Don’t 
fear the fsync!"
http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/

--

___
Python tracker 

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



[issue8828] Atomic function to rename a file

2010-05-26 Thread STINNER Victor

New submission from STINNER Victor :

os.rename() is atomic on Linux, but on Windows it raises an error if the 
destination does already exist.

Not atomic pseudo-code for Windows:
  if exists(b):
 unlink(b)
  rename(a, b)

Windows offers different functions depending on the version:
 - MoveFileTransacted(): atomic! version >= (Windows Vista, Windows Server 2008)
 - ReplaceFile(): version >= Windows 2000
 - MoveFileEx() with MOVEFILE_REPLACE_EXISTING and MOVEFILE_WRITE_THROUGH 
flags: not atomic (eg. "If the file is to be moved to a different volume, the 
function simulates the move by using the CopyFile and DeleteFile functions."), 
version >= Windows 2000

I don't think that it's possible to write an atomic rename (file) function for 
any OS, so it's only a "best effort" atomic function. The documentation will 
give a list of OS on which the operation *is* atomic (eg. Linux).

Note: os.rename() uses MoveFileW() on Windows.

--
components: Library (Lib), Windows
messages: 106587
nosy: haypo
priority: normal
severity: normal
status: open
title: Atomic function to rename a file
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



[issue8604] Adding an atomic FS write API

2010-05-26 Thread STINNER Victor

STINNER Victor  added the comment:

We need an atomic rename function to implement atomic_write(): I opened a new 
issue, #8828.

--
dependencies: +Atomic function to rename a file

___
Python tracker 

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



[issue8824] Improve documentation of exec

2010-05-26 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue8829] IDLE editior not opening

2010-05-26 Thread Celia Horne

New submission from Celia Horne :

Hey there!

I'm very new to Python, but I've been getting along fairly well. However, last 
night I tried to open the IDLE editor (on its own and with a .py file)but 
nothing would open. It just sat there acting like it was going to load, but 
still nothing occurred.

Originally I was using version 2.6.5, but I started experiencing these same 
problems with it. I looked online but could find no help or suggestions. I 
tried uninstalling/reinstalling, I made sure I am already set as the Admin, (as 
I am the only user on this computer, and there is only my account, not even a 
guest account) and I looked to see if there was a Windows Vista patch or 
Vista-only issue, but to no avail. At this point, I am completely lost and I 
really need some assistance.

I installed the newer version (3.1.2) and I'm still having the same issues. The 
CMD prompt works just fine, as it did with the older version, but nothing I do 
can bring up the IDLE editor.

Any help would be VERY appreciated, because I was really looking forward to 
using and learning python, but now I'm feeling very defeated.

Thanks

--
components: IDLE, Windows
messages: 106589
nosy: Celia.Horne
priority: normal
severity: normal
status: open
title: IDLE editior not opening
type: performance
versions: Python 3.1

___
Python tracker 

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



[issue8830] Add nondestructive selection to sets

2010-05-26 Thread ipatrol

New submission from ipatrol :

I see in a lot of references for computer programming a function that returns 
an arbitrary value from a standard or frozen set. 
http://en.wikipedia.org/wiki/Set_%28computer_science%29 describes it as pick. 
It surprised me when I discovered that Python sets don't have this method. I 
would suggest the returned value be somewhat random to prevent repeated calls 
from returning repeated results. Perhaps a small C-level counter could control 
that, which can then roll over uneventfully if enough calls are made.

--
components: None
messages: 106590
nosy: ipatrol
priority: normal
severity: normal
status: open
title: Add nondestructive selection to sets
type: feature request
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



[issue8830] Add nondestructive selection to sets

2010-05-26 Thread Eric Smith

Eric Smith  added the comment:

This is a dupe of issue 7212.

--
nosy: +eric.smith
resolution:  -> duplicate
status: open -> closed
superseder:  -> Retrieve an arbitrary element from a set without removing it

___
Python tracker 

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



[issue7212] Retrieve an arbitrary element from a set without removing it

2010-05-26 Thread ipatrol

ipatrol  added the comment:

I still see a use in this. I like to use sets for lists of servers or mirrors. 
There is no compelling reason *not* to add a get() or pick() method, as 
described in http://en.wikipedia.org/wiki/Set_%28computer_science%29. Sets 
could be used for many things that lists are currently used for. I request for 
this to be reopened given the lapse since any action on this.

--
components: +Interpreter Core -Library (Lib)
nosy: +ipatrol

___
Python tracker 

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



[issue7212] Retrieve an arbitrary element from a set without removing it

2010-05-26 Thread ipatrol

ipatrol  added the comment:

I support http://bugs.python.org/msg94599 with a check to see if the length is 
0, and rename it pick (based on the generic programming and mathematical 
literature).

--

___
Python tracker 

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



  1   2   >