[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Note that PyTokenizer_FromString is not an API function: it's not marked
with PyAPI_FUNC, and not exported from the windows DLL.

___
Python tracker 

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



[issue4474] PyUnicode_FromWideChar incorrect for characters outside the BMP (unix only)

2009-01-27 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 2009-01-26 17:56, STINNER Victor wrote:
> STINNER Victor  added the comment:
> 
> @marketdickinson, @lemburg: ping! I updated the patch, does it look 
> better?

Yes, but there are a few things that still need fixing:

 * SIZEOF_WCHAR_T is not defined for Windows builds, so needs
   to be added to PC/pyconfig.h (OTOH wchar_t is 2 bytes on Windows)
 * USE_WCHAR_SURROGATE should be #defined just before the
   function and #undef'ed right after it; I'd also use a more
   accurate name
 * please use pre-processor indents, e.g.
   #ifdef ...
   # define ...
   #endif

I'd write

#if (Py_UNICODE_SIZE == 2) && defined((SIZEOF_WCHAR_T) && (SIZEOF_WCHAR_T > 2)
# define CONVERT_WCHAR_TO_SURROGATES
#endif

...

#undef CONVERT_WCHAR_TO_SURROGATES

Thanks.

___
Python tracker 

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



[issue5076] bdist_wininst fails on py3k

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

> Is it really useful to be have the same stub for 2.x and 3.x? 
> I think it would be better if they mutually ignore each 
> other, and be different.

Good question!  I'm not really aware of the complexities involved in
merging between the various branches, but given the fairly trivial
nature of the patch I figured there were potential advantages in both
identical source and stubs.  I'm happy to work the patch into either
#ifdef based (ie, identical source, different stubs), or "unconditional"
(both source and stubs different) if you prefer - and if so, which of
those 2 do you prefer?

On a related note, its obviously true that the same final installer will
not be able to be shared between 2.x and 3.x, as is currently possible
between pure-python installers between the 2.x series.  However, this
could be addressed in .py code at a later time while still allowing the
same stub to be shared if that is desirable.

___
Python tracker 

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



[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-27 Thread Takeshi Matsuyama

Takeshi Matsuyama  added the comment:

>From msg80438
>You should reset it by self.data = '' at end_element().

It seems that we should reset it at start_element() like this,

def start_element(self, name, attrs):
  ...abbr...
  if name == 'link':
self.data = ''
=
or unwanted \s, \t, and \n mix in "self.data".
That's all, thanks.

___
Python tracker 

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



[issue5021] doctest.testfile should set __name__, can't use namedtuple

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

r69014 and r69015.

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



[issue5075] bdist_wininst should not depend on the vc runtime?

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

Ironically I just received personal mail:

"""I have downloaded pywin32_212 [2.6] three times today. the download
completes successfully. but on running the pywin installer i repeatedly
get an error."""

Attached is a screen-shot of the error dialog
"pywin32-212-win32-py2.6.exe...has failed to start because the
application configuration is incorrect..."""

My apologies for not being more on top of this, but I couldn't find the
answer in the developer FAQ.  This question applies to issue 4566 and
will partially apply to issue 5076.  The patches are against the trunk -
after checking in, what action should I take to ensure it is merged to
2.6 and 3.x?  I'm happy to manually merge and checkin to those branches
if appropriate; if so, should I check it into branches/release30-maint
as well as branches/py3k?

Thanks

___
Python tracker 

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



[issue5021] doctest.testfile should set __name__, can't use namedtuple

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Also r69016 and r69017.

___
Python tracker 

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



[issue1242657] list(obj) can swallow KeyboardInterrupt

2009-01-27 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue5078] Avoid redundant call to FormatError()

2009-01-27 Thread Ulrich Eckhardt

New submission from Ulrich Eckhardt :

For a background, see the developers' mailing list from 2009-01-26,
subject "FormatError() in callproc.c under win32". The attached patch
removes the redundant call to FormatError(). It also makes
SetException() a static function, since it is only used locally.

--
assignee: theller
components: ctypes
files: Python-redundant-FormatError-call.0.patch
keywords: patch
messages: 80641
nosy: eckhardt, theller
severity: normal
status: open
title: Avoid redundant call to FormatError()
type: resource usage
versions: Python 2.7
Added file: 
http://bugs.python.org/file12876/Python-redundant-FormatError-call.0.patch

___
Python tracker 

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



[issue5032] itertools.count step

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I've looked again at what it would take to update the C code and think
that the optimizations there make it difficult to add this feature
without adding a lot of code complexity and without slowing-down the
common case.  Also, I value the simplicity of the current API.

Suggest you use "range(start, sys.maxsize, step)" or just roll your own
generator (like Lambert's second version).

___
Python tracker 

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



[issue5079] time.ctime docs refer to "time tuple" for default

2009-01-27 Thread Tom Lynn

New submission from Tom Lynn :

The docs for time.ctime() (quoted below) seem to have been copied from 
time.asctime(). They refer to a time tuple and localtime(), where they 
should refer to seconds and time().

Current docs::

ctime(seconds) -> string

Convert a time in seconds since the Epoch to a string in local time.
This is equivalent to asctime(localtime(seconds)). When the time 
tuple is not present, current time as returned by localtime() is 
used.

--
messages: 80644
nosy: tlynn
severity: normal
status: open
title: time.ctime docs refer to "time tuple" for default

___
Python tracker 

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



[issue5079] time.ctime docs refer to "time tuple" for default

2009-01-27 Thread Tom Lynn

Changes by Tom Lynn :


--
components: +Library (Lib)
type:  -> feature request
versions: +Python 2.5, Python 3.0

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-27 Thread Mark Dickinson

Mark Dickinson  added the comment:

combinations_with_replacement addition looks good.  Thank you.

I wonder whether the second argument should be constrained to be an
integer? I find the following a little surprising:

>>> list(combinations_with_replacement(range(5), -0.3))
[()]

(same behaviour with combinations and permutations).  Should I open a
separate issue for this, or is it just not worth changing?

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Glad you like it.

Will meditate for a bit on the floating point input.  My first thought
is that it isn't worth going through the __index__ dance to preclude
inputs that look odd.

___
Python tracker 

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



[issue4673] Distutils should provide an uninstall command

2009-01-27 Thread Andy Buckley

Andy Buckley  added the comment:

If an uninstall registry is feasible, the it could be neat. The
suggested behaviour of unlinking known files based on the source
directory is not all that inconvenient: it's by no means perfect, but it
has its uses and is familiar to many, since it is how GNU autotools behaves.

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-27 Thread Mark Dickinson

Mark Dickinson  added the comment:

I only just noticed the DeprecationWarning that's already happening for
float inputs in 2.7.  (And float inputs already raise TypeError in 3.1.)
So I agree that it's probably not worth it.

___
Python tracker 

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



[issue5080] PyArg_Parse* should raise TypeError for float parsed with integer format

2009-01-27 Thread Mark Dickinson

New submission from Mark Dickinson :

Since Python 2.3, PyArg_ParseTuple and friends give a DeprecationWarning
for floating-point arguments where integers are expected.  From
http://www.python.org/download/releases/2.3/NEWS.txt:

- The PyArg_Parse functions now issue a DeprecationWarning if a float
  argument is provided when an integer is specified (this affects the 'b',
  'B', 'h', 'H', 'i', and 'l' codes).  Future versions of Python will
  raise a TypeError.

Can we turn that DeprecationWarning into a TypeError for 2.7?  (It's
already a TypeError in 3.x.) I'd like to see things like 'range(-0.3)'
and 'itertools.combinations(range(3), 5.1)' raise TypeError.

N.B. The relevant format codes in 2.7 include 'I' and 'n' in addition to
the six codes listed above.

--
messages: 80649
nosy: marketdickinson
severity: normal
status: open
title: PyArg_Parse* should raise TypeError for float parsed with integer format
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue5081] Unable to print Unicode characters in Python 3 on Windows

2009-01-27 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

While trying to port pyftpdlib to Python 3.x I noticed that Python 3.0
has a serious issue since unable to print certain unicode characters on
stdout:

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print('\u20ac')  # euro sign
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\python30\lib\io.py", line 1491, in write
b = encoder.encode(s)
  File "C:\python30\lib\encodings\cp850.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u20ac' in
position
0: character maps to 
>>>


Note that the same thing works on Python 2.6

Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print unicode('\u20ac')
\u20ac

This same thing is also discussed on python ml:
http://groups.google.it/group/comp.lang.python/browse_thread/thread/fb42765fe7476fc9/f560b4eaf2b0e3f4?hl=it&pli=1

--
components: None
messages: 80650
nosy: giampaolo.rodola
severity: normal
status: open
title: Unable to print Unicode characters in Python 3 on Windows
type: crash
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue5072] urllib.open sends full URL after GET command instead of local path

2009-01-27 Thread Olemis Lang

Olemis Lang  added the comment:

Actually I am using a proxy hosted in some other machine (i.e. not my 
PC ... sorry, I didnt mention :S ...) I «debugged» urllib and, when 
branching at this point (see below ;) in URLopener.open_http :

{{{
#!python

# urllib,py

def open_http(self, url, data=None):
"""Use HTTP protocol."""
import httplib
user_passwd = None
proxy_passwd= None
if isinstance(url, str): # Branching here !!
host, selector = splithost(url)
if host:
user_passwd, host = splituser(host)
host = unquote(host)
realhost = host
else:
host, selector = url


}}}

url variable is bound to the following binary tuple 

{{{
#!python

('172.18.2.7:3128', 'http://localhost:8000/trac-dev')
}}}

My IP is 172.18.2.99 ... so the `else` branch is the one being executed 

If you need further details ... dont hesitate and ask anything you 
want ;)

PD: What d'u mean when you said?

> Do you have an HTTP proxy? running at the *same* port? (!)

I dont understand this since *I already said* that *I accessed* my Trac 
environment using my web browser (Opera 9.63, I dont know whether this 
is relevant at all ... ), *I sent you* the lines outputted by tracd to 
stdout (or stderr ... I am not very sure right now ... ;) and *I told 
you* that, once I applied the path *I submitted*, everything was *back 
to normal* ...

I dont understand how could all this be possible if I were running 
tracd and an HTTP proxy in the *same* port, or even in case 
`http_proxy` envvar be set to the hostname + port where my Trac 
instance is listening for incoming connections ... 

Anyway ... CMIIW ...

I also checked that immediately before executing the following 
statements ...

{{{
#!python

# urllib,py

h = httplib.HTTP(host)
if data is not None:
h.putrequest('POST', selector)
h.putheader('Content-Type', 'application/x-www-form-
urlencoded')
h.putheader('Content-Length', '%d' % len(data))
else:
h.putrequest('GET', selector)

}}}

... `selector` is bound to 'http://localhost:8000/trac-dev' ... BTW the 
`else` clause *is the one executed* in this case, and this is 
consistent with tracd reports *I sent before* and is logical since 
`data` arg *is missing* in the code snippet I sent before.

___
Python tracker 

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



[issue1293741] doctest runner cannot handle non-ascii characters

2009-01-27 Thread Rodrigo Bernardo Pimentel

Changes by Rodrigo Bernardo Pimentel :


--
nosy: +rbp

___
Python tracker 

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



[issue3892] bsddb: test01_basic_replication fails on Windows sometimes

2009-01-27 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I've investigated more. I think this is timeout problem. According to 
following site,

http://www.oracle.com/technology/documentation/berkeley-
db/db/api_c/rep_timeout.html

timeout should be specified in microseconds. This means

self.dbenvMaster.rep_set_timeout(db.DB_REP_CONNECTION_RETRY,100123)

only waits 10msec. This is too small comparing to default timeout. 
Probably 10sec is appropriate here.

After I applied an attached patch "fix_timeout.py", I ran test several 
times and found no error.

# I changed time.time()+10 to time.time()+30 because my machine is too 
slow, so 10sec was not enough. :-[

--
keywords: +patch
Added file: http://bugs.python.org/file12877/fix_timeout.patch

___
Python tracker 

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



[issue5072] urllib.open sends full URL after GET command instead of local path

2009-01-27 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I suppose 172.18.2.7:3128 is the address:port of the your proxy, right?
In which case, urllib seems to do the right thing. When talking to an
HTTP proxy, requests are of the form "GET http://site.com/path";, rather
than "GET /path". It's up to the proxy to strip the host part of the URL
when forwarding the request to the target server.

(but I suppose tracd could also be more permissive and allow the "GET
http://site.com/path"; variant. It seems Apache does)

--
nosy: +pitrou

___
Python tracker 

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



[issue1397474] timeit execution enviroment

2009-01-27 Thread David W. Lambert

Changes by David W. Lambert :


--
nosy: +LambertDW

___
Python tracker 

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



[issue5072] urllib.open sends full URL after GET command instead of local path

2009-01-27 Thread Olemis Lang

Olemis Lang  added the comment:

> Quoting Antoine Pitrou ...

> I suppose 172.18.2.7:3128 is the address:port of the your proxy, 
right?

Yes ...

> In which case, urllib seems to do the right thing. When talking to an
HTTP proxy, requests are of the form "GET http://site.com/path";, rather
than "GET /path". It's up to the proxy to strip the host part of the URL
when forwarding the request to the target server.

This being said ... 

> (but I suppose tracd could also be more permissive and allow the "GET
http://site.com/path"; variant. It seems Apache does)

... It works with Apache (I am talking about trac once again ...) 
therefore I will report this issue to Trac devs instead ...

Thnx a lot ! Sorry if I caused you any trouble ...

___
Python tracker 

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



[issue1180] Option to ignore or substitute ~/.pydistutils.cfg

2009-01-27 Thread Akira Kitada

Akira Kitada  added the comment:

Any update?
Is this patch going to be included in 2.6.x/3.0.x in near future?

--
nosy: +tarek

___
Python tracker 

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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread Andrea Corbellini

New submission from Andrea Corbellini :

Most of the Python frameworks have some functions and classes that are
widely used. For example a 'log.debug' function will be used in almost
all modules. It is inconvenient to write 'import log' every time.

It would be useful to have a special place (a dict or a special module)
where you can declare attributes that can be used everywhere without
importing anything. Currently, the only way to do this is:

>>> import __builtin__
>>> __builtin__.debug = log.debug

However, I think that this shouldn't be the better solution. Using
something like '__framework__' would be really better, in my opinion.

--
components: Interpreter Core
messages: 80656
nosy: andrea-bs
severity: normal
status: open
title: Let frameworks to register attributes as builtins

___
Python tracker 

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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread Andrea Corbellini

Changes by Andrea Corbellini :


--
type:  -> feature request

___
Python tracker 

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



[issue4111] Add DTrace probes

2009-01-27 Thread John Levon

Changes by John Levon :


--
nosy: +movement

___
Python tracker 

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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread STINNER Victor

STINNER Victor  added the comment:

Please, don't do that! Why not using "from framework import debug"? 
Working example: "from logging import debug". I hate namespace 
polution and all global symbols.

--
nosy: +haypo

___
Python tracker 

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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread Andrea Corbellini

Andrea Corbellini  added the comment:

Well, writing every time 'from X import Y' looks to me uncomfortable.
But of course what I'm asking is not essential :-)

___
Python tracker 

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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Not being able to figure out where a name came from easily is worse than
having to type out the import statement.  This feature would negatively
impact readability of Python source significantly.

--
nosy: +exarkun

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-27 Thread James Cooper

James Cooper  added the comment:

Our company recently rediscovered this bug in 2.5.2.  After a couple
hours of debugging, we realized the error message was incorrect and
found the bug in the destinsrc function.

This may not be a show-stopping bug, but it's non-obvious, annoying,
unnecessary, and very easy to fix.  Any chance of getting this into a
release?

--
nosy: +jamescooper

___
Python tracker 

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



[issue2047] shutil.destinsrc returns wrong result when source path matches beginning of destination path

2009-01-27 Thread Raghuram Devarakonda

Raghuram Devarakonda  added the comment:

On Tue, Jan 27, 2009 at 12:35 PM, James Cooper  wrote:
> This may not be a show-stopping bug, but it's non-obvious, annoying,
> unnecessary, and very easy to fix.  Any chance of getting this into a
> release?

Considering that the issue is idle for such a long time, I am not sure
if any one will check this in. Your best bet may be to bring this up
on python-dev. As you say, the problem is obvious and the fix is
simple.

___
Python tracker 

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



[issue5075] bdist_wininst should not depend on the vc runtime?

2009-01-27 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> My apologies for not being more on top of this, but I couldn't find the
> answer in the developer FAQ.  This question applies to issue 4566 and
> will partially apply to issue 5076.  The patches are against the trunk -
> after checking in, what action should I take to ensure it is merged to
> 2.6 and 3.x?  I'm happy to manually merge and checkin to those branches
> if appropriate; if so, should I check it into branches/release30-maint
> as well as branches/py3k?

If you want to backport the changes yourself, you should run
svnmerge.py; not sure how well this works on Windows, though (it invokes
an svn binary). The merge flow would be

  trunk -> release26-maint
   \-> py3k -> release30-maint

It's important to use svnmerge only, so that the merge tracking
properties are right.

In 2.6, do "svnmerge.py merge -r", then "svn commit -F
svnmerge-". In 3k, do the same, although you might have
to recompile the stubs in-between in case there are merge
conflicts on the binary files. In 3.0, do the same, but you
need to "svn revert .", because there will be merge conflicts
on ".".

If you don't want to perform all these operations, let me know,
and I'll do them.

___
Python tracker 

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



[issue5076] bdist_wininst fails on py3k

2009-01-27 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Good question!  I'm not really aware of the complexities involved in
> merging between the various branches, but given the fairly trivial
> nature of the patch I figured there were potential advantages in both
> identical source and stubs.  I'm happy to work the patch into either
> #ifdef based (ie, identical source, different stubs), or "unconditional"
> (both source and stubs different) if you prefer - and if so, which of
> those 2 do you prefer?

It's still possible to merge changes reasonably even if the "target"
(i.e. py3k) differs slightly from the source. Therefore, I think the 3k
version should unconditionally only support python3x.dlls. IOW, let
the sources diverge (for sake of simplicity of each individual source).

___
Python tracker 

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



[issue1754] WindowsError messages are not properly encoded

2009-01-27 Thread Ulrich Eckhardt

Changes by Ulrich Eckhardt :


--
nosy: +eckhardt

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Correction to earlier statement.  It should have read:

Guido disallowed returning a len method on iterators.  He expected
bool(it) to be always be True.

___
Python tracker 

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



[issue5081] Unable to print Unicode characters in Python 3 on Windows

2009-01-27 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Your 2.6 example is incorrect. Try

py> print u'\u20ac'

If you want the 3.0 equivalent of your 2.6 code: it is

py> print(r'\u20ac')
\u20ac

Closing this as "works for me".

--
nosy: +loewis
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



[issue5082] Let frameworks to register attributes as builtins

2009-01-27 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

I agree that this shouldn't be added to Python. At a minimum, it is
clear that there is too much opposition to such a feature that the bug
tracker is an inappropriate medium to discuss it.

If you want to pursue this idea, discuss it on python-ideas, and, if
this shows sufficient interest in the feature, write a PEP.

--
nosy: +loewis
resolution:  -> 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



[issue1717] Get rid of more references to __cmp__

2009-01-27 Thread Mark Dickinson

Mark Dickinson  added the comment:

Stage 1 committed in r69025 (py3k) and r69026 (release30-maint).

___
Python tracker 

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



[issue874900] threading module can deadlock after fork

2009-01-27 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue5083] New resource ('gui') for regrtest

2009-01-27 Thread Guilherme Polo

New submission from Guilherme Polo :

I would like to add a 'gui' resource in regrtest, this would be nice for
the ttk module that I'm planning to do add very soon (after I solve
another issue about tests).

--
components: Tests
files: regrtest_gui_resource.diff
keywords: patch
messages: 80668
nosy: gpolo
severity: normal
status: open
title: New resource ('gui') for regrtest
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file12878/regrtest_gui_resource.diff

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12407/round_int_int.patch

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12412/round_int_int2.patch

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12414/round_int_int3.patch

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12415/round_int_int4.patch

___
Python tracker 

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



[issue3997] zipfile and winzip

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file11841/zip-64k.patch

___
Python tracker 

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



[issue3997] zipfile and winzip

2009-01-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file11850/zip-64k-2.patch

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-27 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I'll take on the two remaining tasks for this:

* add configure magic to detect when the compiler supports this so
  that it can default to --with-computed-gotos on modern systems.
* commit the back port to 2.7 trunk.

--
assignee:  -> gregory.p.smith
status: pending -> open
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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Jake McGuire

New submission from Jake McGuire :

Instance attribute names are normally interned - this is done in 
PyObject_SetAttr (among other places).  Unpickling (in pickle and 
cPickle) directly updates __dict__ on the instance object.  This 
bypasses the interning so you end up with many copies of the strings 
representing your attribute names, which wastes a lot of space, both in 
RAM and in pickles of sequences of objects created from pickles.  Note 
that the native python memcached client uses pickle to serialize 
objects.

>>> import pickle
>>> class C(object):
...   def __init__(self, x):
... self.long_attribute_name = x
...
>>> len(pickle.dumps([pickle.loads(pickle.dumps(C(None), 
pickle.HIGHEST_PROTOCOL)) for i in range(100)], 
pickle.HIGHEST_PROTOCOL))
3658
>>> len(pickle.dumps([C(None) for i in range(100)], 
pickle.HIGHEST_PROTOCOL))
1441
>>>

Interning the strings on unpickling makes the pickles smaller, and at 
least for cPickle actually makes unpickling sequences of many objects 
slightly faster.  I have included proposed patches to cPickle.c and 
pickle.py, and would appreciate any feedback.

--
components: Library (Lib)
files: cPickle.c.diff
keywords: patch
messages: 80670
nosy: jakemcguire
severity: normal
status: open
title: unpickling does not intern attribute names
type: resource usage
Added file: http://bugs.python.org/file12879/cPickle.c.diff

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Jake McGuire

Changes by Jake McGuire :


Added file: http://bugs.python.org/file12880/pickle.py.diff

___
Python tracker 

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



[issue4111] Add DTrace probes

2009-01-27 Thread Ted Leung

Ted Leung  added the comment:

I tried building this on my Mac and got this;

ar cr libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/ 
asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/ 
compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/ 
frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o  
Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/ 
graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/ 
modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o  
Python/pyarena.o Python/pyfpe.o Python/pymath.o Python/pystate.o  
Python/pythonrun.o Python/structmember.o Python/symtable.o Python/ 
sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o  
Python/pystrtod.o Python/formatter_unicode.o Python/formatter_string.o  
Python/dynload_shlib.o @DTRACEOBJS@  Python/mactoolboxglue.o Python/ 
thread.o
ar: @DTRACEOBJS@: No such file or directory
make: *** [libpython2.7.a] Error 1

my configure line was:

./configure --enable-framework --enable-toolbox-glue --with-threads -- 
enable-dtrace

On Jan 25, 2009, at 2:00 PM, Skip Montanaro wrote:

>
> Skip Montanaro  added the comment:
>
> Here's a patch against the current trunk (2.7) which compiles on my  
> Mac.  It
> adds a --with-dtrace configure option.  The code checks to see if  
> the -G
> option is understood by the dtrace command.  If so, dtrace support  
> is added
> Sun-style.  If not we do things Apple's way.
>
> The existing test cases pass on Apple except for one case in  
> test_sys which
> tries to confirm the size of a frame object.  I added an #ifdef  
> WITH_DTRACE
> around the extra slot but there is no way of telling from Python  
> code that
> this extra slot is there.  That would have to somehow be exposed to  
> the
> Python programmer so the test can be adjusted.  All tests pass when
> --with-dtrace is omitted.  I have not yet tried this on Solaris.  I  
> will try
> to get to it this week if someone doesn't beat me to it.
>
> There are as yet no new dtrace test cases so I can't confirm that  
> the added
> dtrace support actually works.  There are also no documentation  
> updates.
> Unlike most compile options this adds a significant new feature to the
> runtime environment so some documentation changes are probably  
> called for.
>
> Added file: http://bugs.python.org/file12861/dtrace.diff
>
> ___
> Python tracker 
> 
> ___

___
Python tracker 

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



[issue3997] zipfile and winzip

2009-01-27 Thread Brett Cannon

Brett Cannon  added the comment:

Amaury, did the buildbots verify this worked and thus this bug can be
closed?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Someone ought to ping Guido on this.  He may have some strong thoughts
on the signature (having it sometimes return ints and sometimes floats).
 But in this case, accuracy may be the more important consideration.

___
Python tracker 

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



[issue5085] distutils/test_sdist failure on windows

2009-01-27 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

test_sdist fails on windows with following message.

http://www.python.org/dev/buildbot/trunk.stable/x86%20XP-4%
20trunk/builds/1823/step-test/0

==
ERROR: test_make_distribution (distutils.tests.test_sdist.sdistTestCase)
--
Traceback (most recent call last):
  File "E:\cygwin\home\db3l\buildarea\trunk.bolen-
windows\build\lib\distutils\tests\test_sdist.py", line 119, in 
test_make_distribution
spawn('tar --help')
  File "E:\cygwin\home\db3l\buildarea\trunk.bolen-
windows\build\lib\distutils\spawn.py", line 37, in spawn
_spawn_nt(cmd, search_path, dry_run=dry_run)
  File "E:\cygwin\home\db3l\buildarea\trunk.bolen-
windows\build\lib\distutils\spawn.py", line 70, in _spawn_nt
cmd = _nt_quote_args(cmd)
  File "E:\cygwin\home\db3l\buildarea\trunk.bolen-
windows\build\lib\distutils\spawn.py", line 61, in _nt_quote_args
args[i] = '"%s"' % args[i]
TypeError: 'str' object does not support item assignment



This can be fixed if replace
  spawn('tar --help')
in Lib/distutils/tests/test_sdist.py with
  spawn(['tar', '--help'])
but, "tar --help" outputs very long message, it is not beautiful.

So I'll push attached patch. (This also checks gzip
which requres to run test)

--
components: Tests
files: test_sdist_on_win32.patch
keywords: patch
messages: 80674
nosy: ocean-city
severity: normal
status: open
title: distutils/test_sdist failure on windows
versions: Python 2.7
Added file: http://bugs.python.org/file12881/test_sdist_on_win32.patch

___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-27 Thread Mark Hammond

Changes by Mark Hammond :


___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

ack - I mis-clicked and accidentally removed message78811 and can't see
how to reinstate it.  The message isn't critical, but I'm sorry about that!

___
Python tracker 

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



[issue5077] 2to3 fixer for the removal of operator functions

2009-01-27 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Review:

The mappings should become static to the class or module.

The repeat2mul case doesn't handle prefixes.

--
nosy: +benjamin.peterson
versions: +Python 2.6, Python 2.7

___
Python tracker 

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



[issue5079] time.ctime docs refer to "time tuple" for default

2009-01-27 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

It's already fixed in 2.6, 2.7 and 3.0
I'm unsure of 2.5 status regarding documentation updates.

--
assignee:  -> georg.brandl
components: +Documentation -Library (Lib)
nosy: +gagenellina, georg.brandl
versions:  -Python 3.0

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

Either my browser got crazy, or you uploaded the same patch (.py) twice.

--
nosy: +gagenellina

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Jake McGuire

Changes by Jake McGuire :


Removed file: http://bugs.python.org/file12879/cPickle.c.diff

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Jake McGuire

Changes by Jake McGuire :


Added file: http://bugs.python.org/file12882/cPickle.c.diff

___
Python tracker 

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



[issue4111] Add DTrace probes

2009-01-27 Thread Skip Montanaro

Skip Montanaro  added the comment:

Ted> I tried building this on my Mac and got this;

Forgive me if I'm preaching to the choir here.

Did you run autoconf or autoreconf after applying the patch?  If not,
@DTRACEOBJS@ would not be a substitutable string.  It's fairly common (at
least in the Python community) to omit modified configure scripts from these
sorts of patches because the changes to generated configure scripts between
different versions of autoconf are so massive that they dwarf the actual
functional changes in the patch, often by a couple orders of magnitude.

Skip

___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

Checked in to the trunk as as r69038 and svnmerge'd:
* release26-maint as 69040
* py3k as 69041
* release30-maint as 69043

--
resolution: accepted -> 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



[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-27 Thread Zooko O'Whielacronx

Zooko O'Whielacronx  added the comment:

Tarek:

Yes, failure to build an extension module for any reason should
definitely cause "build" to fail by default.  However, many Python
packages seem to come with optional extension modules, typically for a
performance speed-up.  simplejson, zope.interface, and twisted all do
this (these are three packages that allmydata-tahoe depends on).  My own
pyutil package used to do this, but I eventually just removed the
optional C extension module in order to avoid this problem.  So, for
those it would be good if the package setup.py could specify that an
extension module is optional and that failure to build it for any reason
does not mean failure of the "build".

Note that twisted's setup.py already attempts to do this for certain of
its extension modules, and if I understand correctly it is able to
detect and handle failure to build if gcc fails, but not if gcc is absent.

___
Python tracker 

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



[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-27 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

As far as Twisted is concerned, the two cases Tarek mentioned aren't
really relevant.  In order for Zooko's use case to be handled ("install
Twisted on an OLPC"), what would be ideal is if there were a way to tell
distutils about an extension which is optional.  It doesn't matter if it
can be built or not.  Any failure is irrelevant.

This doesn't necessarily have to mean that errors pass silently.  The
build failure can still be reported.  The build could even fail by
default and distutils could gain a new option for switching the behavior
to succeeding if only optional extensions fail to build.  Or it could be
the other way around, with an option to make the build fail if any
optional extensions cannot be built (this approach favors people who
don't really know what a "build" is and just want something installed,
leaving the more advanced option to people who are able to figure out
that there are options that control build behavior).

--
nosy: +exarkun

___
Python tracker 

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



[issue5072] urllib.open sends full URL after GET command instead of local path

2009-01-27 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

> > Do you have an HTTP proxy? running at the *same* port?
> (!)
> 
> I dont understand this since *I already said* that *I
> accessed* my Trac 
> environment using my web browser (Opera 9.63, I dont know
> whether this 
> is relevant at all ... ), *I sent you* the lines outputted
> by tracd to 
> stdout (or stderr ... I am not very sure right now ... ;)
> and *I told 
> you* that, once I applied the path *I submitted*,
> everything was *back 
> to normal* ...

If you had configured a proxy at localhost:8000, and *also* a Trac instance at 
that port, and Trac had "won the race" for the port, then you would observe 
exactly the symthoms you describe. That is, urllib talking to 8000 as it were a 
proxy, and the Trac instance actually there getting confused.

Your patch, as you surely understand now, is not correct; in fact, the code is 
OK as it is. urllib builds the request in that specific way *because* he thinks 
there is a proxy. If the proxy is buggy, misconfigured, or inexistent, it's not 
the library's fault :)

-- 
Gabriel Genellina
> 
> I dont understand how could all this be possible if I were
> running 
> tracd and an HTTP proxy in the *same* port, or even in case
> 
> `http_proxy` envvar be set to the hostname + port where my
> Trac 
> instance is listening for incoming connections ... 
> 
> Anyway ... CMIIW ...
> 
> I also checked that immediately before executing the
> following 
> statements ...
> 
> {{{
> #!python
> 
> # urllib,py
> 
> h = httplib.HTTP(host)
> if data is not None:
> h.putrequest('POST', selector)
> h.putheader('Content-Type',
> 'application/x-www-form-
> urlencoded')
> h.putheader('Content-Length',
> '%d' % len(data))
> else:
> h.putrequest('GET', selector)
> 
> }}}
> 
> ... `selector` is bound to
> 'http://localhost:8000/trac-dev' ... BTW the 
> `else` clause *is the one executed* in this case, and this
> is 
> consistent with tracd reports *I sent before* and is
> logical since 
> `data` arg *is missing* in the code snippet I sent before.
> 
> ___
> Python tracker 
> 
> ___

  Yahoo! Cocina
Recetas prácticas y comida saludable
http://ar.mujer.yahoo.com/cocina/

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Guido, do you have any thoughts on this?

Basically, it's a choice between giving round() a weird signature
(sometimes returning floats and sometimes int/longs) versus having
accurate roundings of integers (which become unrepresentable when
divided by powers of 10.0).

--
assignee:  -> gvanrossum
nosy: +gvanrossum

___
Python tracker 

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



[issue5086] set_daemon does not exist in Thread

2009-01-27 Thread Michael Newman

New submission from Michael Newman :

This is related to:
http://bugs.python.org/issue3628
http://bugs.python.org/issue4808

I found in the example at the bottom of:
http://docs.python.org/3.0/library/queue.html
"t.set_daemon(True)"
won't work.

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import Thread
>>> t = Thread()
>>> dir(t)
['_Thread__exc_info', '_Thread__initialized', '__class__',
'__delattr__', '__dic
t__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__gt__',
 '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__',
'__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__
', '__subclasshook__', '__weakref__', '_args', '_block', '_bootstrap',
'_bootstr
ap_inner', '_daemonic', '_delete', '_ident', '_initialized', '_kwargs',
'_name',
 '_note', '_set_daemon', '_started', '_stderr', '_stop', '_stopped',
'_target',
'_verbose', 'daemon', 'getName', 'ident', 'isAlive', 'isDaemon',
'is_alive', 'jo
in', 'name', 'run', 'setDaemon', 'setName', 'start']
>>> t.set_daemon(True)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'Thread' object has no attribute 'set_daemon'
>>> t.daemon
False
# This appears to be the proper method, unless "set_daemon" gets added
in (or setDaemon is used, but that appears to be depreciated syntax):
>>> t.daemon = True
>>> t.daemon
True

Please see the attached "queue_join.py" for my own working example. It
would be helpful to include the line:
>>> from threading import Thread
in the official example.

--
assignee: georg.brandl
components: Documentation
files: queue_join.py
messages: 80685
nosy: georg.brandl, mnewman
severity: normal
status: open
title: set_daemon does not exist in Thread
versions: Python 3.0
Added file: http://bugs.python.org/file12883/queue_join.py

___
Python tracker 

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



[issue5087] set_daemon does not exist in Thread

2009-01-27 Thread Michael Newman

New submission from Michael Newman :

This is related to:
http://bugs.python.org/issue3628
http://bugs.python.org/issue4808

I found in the example at the bottom of:
http://docs.python.org/3.0/library/queue.html
"t.set_daemon(True)"
won't work.

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import Thread
>>> t = Thread()
>>> dir(t)
['_Thread__exc_info', '_Thread__initialized', '__class__',
'__delattr__', '__dic
t__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__gt__',
 '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__',
'__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__
', '__subclasshook__', '__weakref__', '_args', '_block', '_bootstrap',
'_bootstr
ap_inner', '_daemonic', '_delete', '_ident', '_initialized', '_kwargs',
'_name',
 '_note', '_set_daemon', '_started', '_stderr', '_stop', '_stopped',
'_target',
'_verbose', 'daemon', 'getName', 'ident', 'isAlive', 'isDaemon',
'is_alive', 'jo
in', 'name', 'run', 'setDaemon', 'setName', 'start']
>>> t.set_daemon(True)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'Thread' object has no attribute 'set_daemon'
>>> t.daemon
False
# This appears to be the proper method, unless "set_daemon" gets added
in (or setDaemon is used, but that appears to be depreciated syntax):
>>> t.daemon = True
>>> t.daemon
True

Please see the attached "queue_join.py" for my own working example. It
would be helpful to include the line:
>>> from threading import Thread
in the official example.

--
assignee: georg.brandl
components: Documentation
files: queue_join.py
messages: 80686
nosy: georg.brandl, mnewman
severity: normal
status: open
title: set_daemon does not exist in Thread
versions: Python 3.0
Added file: http://bugs.python.org/file12884/queue_join.py

___
Python tracker 

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



[issue5075] bdist_wininst should not depend on the vc runtime?

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

Thanks for the merging advice!

The patch to the build system is indeed trivial - unfortunately it also
failed to work correctly due to install.c using freopen, a CRT function,
to redirect the output.  Interestingly, this probably means that if
someone attempted to use python 2.6 to create a pure-python .exe
installer, they would fail to see any output when installed to earlier
Python versions (and vice-versa...)

I've worked up a patch for install.c which uses the win32 API to achieve
the same result using SetStdHandle() etc.  This technique requires the
handles to be redirected before the Python DLL is loaded, so I took the
opportunity to refactor things a little - we now have 2 locations that
perform the redirection instead of 3 but I didn't see huge benefit in
trying to knock that down to 1.

The patch is against the trunk but should also be applied to 2.6 and the
3.x branches.  I've tested the new code-paths using a 32bit trunk build
only but it should work the same everywhere.

--
keywords: +needs review, patch
Added file: http://bugs.python.org/file12885/bug-5075.patch

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

The patch for cPickle doesn't do the same thing as the pickle one. In
the cPickle one, you are only interning slot attributes, which, I
believe, is not what you intended. :-)

--
assignee:  -> alexandre.vassalotti
nosy: +alexandre.vassalotti

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Jake McGuire

Jake McGuire  added the comment:

Are you sure?  I may not have enough context in my diff, which I  
should have done against an anonymous svn checkout, but it looks like  
the slot attributes get set several lines after my diff.  "while  
(PyDict_Next(slotstate, ...))" as opposed to the "while  
(PyDict_Next(state, ...))" in my change...

-jake

On Jan 27, 2009, at 6:54 PM, Alexandre Vassalotti wrote:

>
> Alexandre Vassalotti  added the comment:
>
> The patch for cPickle doesn't do the same thing as the pickle one. In
> the cPickle one, you are only interning slot attributes, which, I
> believe, is not what you intended. :-)
>
> --
> assignee:  -> alexandre.vassalotti
> nosy: +alexandre.vassalotti
>
> ___
> Python tracker 
> 
> ___

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Oh, you are right. I was looking at py3k's version of pickle, which uses
PyDict_Update instead of a while loop; that is why I got confused.

___
Python tracker 

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



[issue4111] Add DTrace probes

2009-01-27 Thread Ted Leung

Ted Leung  added the comment:

I didn't run auto(re)conf.  After I did that, all was well.  However,  
the ustack provider doesn't appear to be working correctly.   I tried  
running the py_profile.d from the DTrace toolkit, and it doesn't show  
any stack traces, and when the script starts up it says

cc1: warning: /dev/fd/5 is shorter than expected

The basic function entry/exit probes appear to be working.

John +nosy'ed himself, so perhaps he'll have some insight?

On Jan 27, 2009, at 3:39 PM, Skip Montanaro wrote:

>
> Skip Montanaro  added the comment:
>
> Ted> I tried building this on my Mac and got this;
>
> Forgive me if I'm preaching to the choir here.
>
> Did you run autoconf or autoreconf after applying the patch?  If not,
> @DTRACEOBJS@ would not be a substitutable string.  It's fairly  
> common (at
> least in the Python community) to omit modified configure scripts  
> from these
> sorts of patches because the changes to generated configure scripts  
> between
> different versions of autoconf are so massive that they dwarf the  
> actual
> functional changes in the patch, often by a couple orders of  
> magnitude.
>
> Skip
>
> ___
> Python tracker 
> 
> ___

___
Python tracker 

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



[issue5076] bdist_wininst fails on py3k

2009-01-27 Thread Mark Hammond

Mark Hammond  added the comment:

Attaching an updated patch against the py3k branch which makes no
attempt to work on py2k.

Added file: http://bugs.python.org/file12886/wininst_py3k.patch

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread Guido van Rossum

Guido van Rossum  added the comment:

I think it's fine if it returns an int iff the first arg is an int.  In
other languages this would be overloaded as follows:

round(int)int
round(float)float
round(int, int)int
round(float, int)float

--
assignee: gvanrossum -> 

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread David W. Lambert

David W. Lambert  added the comment:

I'd prefer round(x,positive_integer) return float.  Returning int is a 
bit of a lie, except that the decimal module is available to avoid this 
sort of lie.

For non-positive integer roundings I'd like an integer return.

In my opinion, we'd benefit from this definition of round:


import numbers

def round(a,p=0,base=10):
'''
>>> round(147,-1,5)
145.0
>>> round(143,-1,5)
145.0
>>> round(142,-1,5)
140.0
>>> round(12.345,1,2)
12.5
>>> round(12.345,2,2)
12.25
>>> round(12.345,-2,2)
12
>>> round(12.345,-3,2)
16
'''
# consider using sign transfer for negative a

if base < 1:
raise ValueError('base too confusing')

require_integral_output = (
(p < 1) and
isinstance(base, numbers.Integral) and
isinstance(p, numbers.Integral))

b = base**p
result = int(a*b+0.5)/b
if require_integral_output:
result = int(0.5+result)
return result

--
nosy: +LambertDW

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread Guido van Rossum

Guido van Rossum  added the comment:

Well, that would leave a function whose return *type* depends on the
*value* of one of the arguments, which I find very ugly.

I don't know why you think rounding an int to X (X>0) digits after the
decimal point should return a float -- it's not like the int has any
digits behind the point, so nothing is gained. Why would it be a lie?

___
Python tracker 

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



[issue5086] set_daemon does not exist in Thread

2009-01-27 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> set_daemon does not exist in Thread

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread David W. Lambert

David W. Lambert  added the comment:

The value of one of the arguments controls how many digits there are.

Certainly if you rounded $10 to the nearest cents you'd expect $10.00.
Thus round(10,2) should be 10.00.  Without using decimal module, the 
best we can do is produce  10.0.

I'd apply a similar argument to convince you that the return value 
should be integral for negative "number of digits".

Hark!  This is python.  We can take this correct and beautiful approach.  
We are not constrainded by function signatures of c++ or FORTRAN90.

___
Python tracker 

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



[issue4707] round(25, 1) should return an integer, not a float

2009-01-27 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm sorry, but I don't see a significant difference between $10 and
$10.00.  If you want to display a certain number of digits, use "%.2f" %
x.  And trust me, I'm not doing this for Fortran's sake.

___
Python tracker 

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



[issue5023] Segfault in datetime.time.strftime("%z")

2009-01-27 Thread Neal Norwitz

Neal Norwitz  added the comment:

Can you debug this problem any further?  What is the C call stack?  Does
the problem occur if you build in debug mode (./configure
--with-pydebug)?  Does the problem occur with a different compiler (if
you have access to another one on the same box)?

--
nosy: +nnorwitz

___
Python tracker 

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