[issue5416] str.replace does strange things when given a negative count

2009-03-04 Thread David Majnemer

New submission from David Majnemer :

str.replace("", "", "asdf", -1) returns "asdf", I believe this is not
correct and strictly speaking not up to the documentation posted. I am
of the opinion that it should function like str.replace("", "", "asdf",
0) which returns ""

--
components: Interpreter Core
messages: 83119
nosy: dmajnemer
severity: normal
status: open
title: str.replace does strange things when given a negative count
versions: Python 2.5

___
Python tracker 

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



[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-04 Thread Retro

Retro  added the comment:

A strange thing now happened. Now the Python 2.6.1 interpreter has an
icon in the Add/Remove Programs list. I completely removed Python 2.6.1
and reinstalled it with the command

msiexec /i python-2.6.1.msi /l*v python26.log

and it now has an icon in the Add/Remove Programs list. Please see the
attached screenshot.

My Windows Vista is Business Edition, Service Pack 1. I got it by buying
my laptop and then upgraded it to the Service Pack 1 version and I have
the very latest updates installed on it, too. I don't know what do you
mean by specific version. I hope I answered your question.

Added file: http://bugs.python.org/file13240/arpvista_surprise.jpg

___
Python tracker 

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



[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-04 Thread Retro

Retro  added the comment:

And now I'm attaching the installing log of Python 2.6.1 for you. I hope
you have enough information to work on the solution. If you need more
information, just ask.

Added file: http://bugs.python.org/file13241/python26.rar

___
Python tracker 

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



[issue5416] str.replace does strange things when given a negative count

2009-03-04 Thread Daniel Diniz

Daniel Diniz  added the comment:

Confirmed in trunk and py3k. Changing to RFE, set it to behavior if you
disagree.

Python 2.4 does return "" for str.replace("", "", "asdf", -1), the
change happened in rev46226, with the effbot adding this snippet (by
Andrew Dalke?):

  if (maxcount < 0) {
 maxcount = PY_SSIZE_T_MAX;
  } else if (maxcount == 0 || PyString_GET_SIZE(self) == 0) {
   /* nothing to do; return the original string */
   return return_self(self);
  }


I'm not sure the current behavior can be considered better than what
David proposes, but I also wonder whether it matters at all.

--
nosy: +ajaksu2
stage:  -> test needed
type:  -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue5416] str.replace does strange things when given a negative count

2009-03-04 Thread Senthil

Senthil  added the comment:

And also look at the help on string.replace which sets -1 as the
default value for maxsplit optional argument and which again defaults
to replace-all.
Clearly, maxsplit= -1 is not equal to maxsplit = 0.

replace(s, old, new, maxsplit=-1)
replace (str, old, new[, maxsplit]) -> string

Return a copy of string str with all occurrences of substring
old replaced by new. If the optional argument maxsplit is
given, only the first maxsplit occurrences are replaced.

- Daniel, thanks for digging this out from Py2.4, unless we get an
rationale behind this change, my only though on this issue was -
document the maxsplit argument  saying that -1 defaults to replace
all.

--
nosy: +orsenthil

___
Python tracker 

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



[issue993580] inspect.findsource does not call linecache.checkcache

2009-03-04 Thread Daniel Diniz

Daniel Diniz  added the comment:

Issue 1218234 has a patch.

--
dependencies: +inspect.getsource doesn't update when a module is reloaded
nosy: +ajaksu2

___
Python tracker 

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



[issue1201569] allow running multiple instances of IDLE

2009-03-04 Thread Daniel Diniz

Changes by Daniel Diniz :


--
stage:  -> test needed
type:  -> feature request
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue1207589] Right Click Context Menu

2009-03-04 Thread Daniel Diniz

Changes by Daniel Diniz :


--
stage:  -> test needed
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue1244208] expat binding for XML_ParserReset (Bug #1208730)

2009-03-04 Thread Daniel Diniz

Changes by Daniel Diniz :


--
dependencies: +expat binding for XML_ParserReset
stage:  -> test needed
type:  -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue1194222] parsedate and Y2K

2009-03-04 Thread Daniel Diniz

Daniel Diniz  added the comment:

Confirmed in trunk and py3k.

--
keywords: +easy, patch
nosy: +ajaksu2
stage:  -> test needed
type:  -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-03-04 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I released that the attached patch had some indentation issues.
The one in attachment fixes them.

Added file: http://bugs.python.org/file13242/ftplib.patch

___
Python tracker 

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



[issue5416] str.replace does strange things when given a negative count

2009-03-04 Thread David W. Lambert

David W. Lambert  added the comment:

I completely agree that this is a documentation issue.

Also, or perhaps for foolish completeness, in

http://docs.python.org/3.0/library/stdtypes.html

we would point out that the following group of string methods also work
for bytes and bytearrays.  Of these, only str type has format method.

"String Methods

String objects support the methods listed below. Note that none of these
methods take keyword arguments.

In addition, Python’s strings support the sequence type methods
described in the Sequence Types — str, bytes, bytearray, list, tuple,
range section. To output formatted strings, see the String Formatting
section. Also, see the re module for string functions based on regular
expressions."

--
nosy: +LambertDW

___
Python tracker 

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



[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-03-04 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I realized that the attached patch had some indentation issues.
The one in attachment fixes them.

___
Python tracker 

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



[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-03-04 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Removed file: http://bugs.python.org/file13156/ftplib.patch

___
Python tracker 

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



[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-04 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

I'm closing this as "works for me". The error is not reproducible.

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



[issue4192] Subprocess error with I/O redirection to Pipes

2009-03-04 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Probably this happens because receiever.py doesn't wait for flooder.py
termination, and pipe end is closed when recieiver.py terminates.

Does this code work for you?

p = subprocess.Popen("python
flooder.py",stdin=subprocess.PIPE,stdout=subprocess.PIPE)
p.wait()

--
nosy: +ocean-city

___
Python tracker 

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



[issue1201569] allow running multiple instances of IDLE

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
nosy:  -ronaldoussoren

___
Python tracker 

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



[issue4192] Subprocess error with I/O redirection to Pipes

2009-03-04 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

This happens because when flooder.py terminates, its stdout will be
closed, but another pipe end in receirver.py process is already closed, so

Python\sysmodule.c(1098): _check_and_flush (FILE *stream)

In this function, fflush() fails. The reason why error message is not
helpful is probably this close function is called in interpreter
termination process, other modules/objects to do so are already destroyed.

Maybe this error message can be improved in some way, but I'm not sure.

___
Python tracker 

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



[issue5224] OS X installer: "Update Shell Profile" script is not updated

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

This is now also fixed for the trunk and 2.6

--
status: open -> closed

___
Python tracker 

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



[issue5226] OS X installer: Welcome and Readme files are out-of-date

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Fixed for the trunk and 2.6 as well.

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



[issue5417] Reference to missing(?) function in Extending & Embedding Document

2009-03-04 Thread Ruth Aydt

New submission from Ruth Aydt :

Section 1.6 "Calling Python Functions from C" in the Extending and
Embedding Python, 2.6.1 guide talks about "PyEval_CallObject".  But, I
can't find it anywhere else in the 2.6 doc set.   

I did see in PEP 3100 that the function is to be removed in 3.0.  I
suspect section 1.6 in doc needs to be updated to use a different
function in the example & text.

--
assignee: georg.brandl
components: Documentation
messages: 83134
nosy: aydt, georg.brandl
severity: normal
status: open
title: Reference to missing(?) function in Extending & Embedding Document
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



[issue4565] Rewrite the IO stack in C

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

And the io-c branch has been merged in r70152.

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



[issue3618] possible deadlock in python IO implementation

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Since io-c has been merging, I'm lowering priority.

--
priority: critical -> low
title: possible deadlock in IO library (Lib/io.py) -> possible deadlock in 
python IO implementation

___
Python tracker 

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



[issue4565] Rewrite the IO stack in C

2009-03-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
dependencies:  -possible deadlock in python IO implementation

___
Python tracker 

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



[issue4263] BufferedWriter non-blocking overage

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This has been fixed in io-c branch. (r70152)

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



[issue4996] io.TextIOWrapper calls buffer.read1()

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This has been fixed in io-c branch merge. (r70152)

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



[issue3883] Bottom buttons of IDLE Preferences Pane on Mac not wide enough for their text.

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Fixed for the trunk and 2.6 as well.

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



[issue5194] OS X IDLE.app and bin/idle: missing/extra menu options

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I've applied a cleaned up version of patch-nad0014-trunk-26.txt to the 
trunk and 2.6 branch. This completely fixes this issue.

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



[issue4862] utf-16 BOM is not skipped after seek(0)

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This has been fixed by the io-c branch merge.

--
nosy: +benjamin.peterson
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



[issue5266] StringIO.read(n) does not enforce requested size in newline mode

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This is fixed by the io-c branch merge. (r70152)

--
nosy: +benjamin.peterson
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



[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This is fixed by the io-c branch merge. (r70152)

--
nosy: +benjamin.peterson
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



[issue5264] StringIO failure when reading a chunk of text without newlines

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This is fixed by the io-c branch merge. (r70152)

--
nosy: +benjamin.peterson
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



[issue881824] Add ResolveFinderAliases to macostools module

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I'm closing this issue as rejected because the macostools module is 
deprecated. We'll therefore not apply any more feature enhancements.

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



[issue5117] os.path.relpath problem with root directory

2009-03-04 Thread Jim Blandy

Jim Blandy  added the comment:

In case the behavior requested here is controversial, here's an example
of where it would be nice to have relpath(x, '/') return a path for x
that is relative to the root directory:

The 'oprofile' system profiler for Linux profiles everything running on
the system at once.  Its profile count database takes the form of a
directory tree of counter files that mirrors the whole filesystem:
/var/lib/oprofile/samples/current/{root}/bin/ls holds the samples for
/bin/ls, and so on.  Also, the 'opannotate' command annotates source
trees with profile counts: if /bin/ls were built from /src/ls.c, then
'opannotate -o ~/ann-tree' would put a count-annotated copy of ls's
source '~/ann-tree/src/ls.c'.

At the moment, I wish I could simply say:

src=path to source file
real_src = os.path.realpath(src)
rel_real_src = os.path.relpath(real_src, '/')
annotated_source = os.path.join(annotation_dir, rel_real_src)

but this bug gets in the way.

--
nosy: +jimb

___
Python tracker 

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



[issue5408] test_osx_env failing

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Ned: IMHO your patch is not correct. test_osx_env tests behaviour that's 
only valid for a framework build, and should therefore only run when 
testing a framework build.

The easiest way to accomplish that is to change the test in 
test_osx_env.main to:

   if sys.platform == 'darwin' and 
sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'):

(with an "from distutils import sysconfig" statement just above the 
test).

I will commit this fix when I've actually tested it.

___
Python tracker 

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



[issue2740] Cmd module doesn't support readline completion on OSX Leopard

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I intend to close this as won't fix. The issue is caused by Apple's build 
of Python, the generic Python.org build won't even compile when using 
libedit.

___
Python tracker 

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



[issue4834] Trouble configuring with icc on Mac OS X 10.5

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Skip: could you please explain which bit of Xcode you didn't install? 
The compile should work regardless of installing 10.3 SDK support.

The code you mention in your report sets MACOSX_DEPLOYMENT_TARGET to 
10.3 on 10.3 systems or later, unless you explictly set it to another 
version yourself. This matches the default compiler settings on at least 
10.4 systems. I just noticed that the default on 10.5 systems to compile 
for the current OS release.

The intention of the code is to allow the resulting binaries to run on 
as many platforms as possible.

Note that you can easily work around this issue by explicitly setting 
MACOSX_DEPLOYMENT_TARGET to 10.5.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue5154] OSX broken poll testing doesn't work

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue5269] OS X Installer: add options to specify universal build type and deployment target

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I'm +1 on this feature, I haven't looked at the patch yet.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue5269] OS X Installer: add options to specify universal build type and deployment target

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
assignee:  -> ronaldoussoren

___
Python tracker 

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



[issue734115] Packaging without disturbing an existing installation

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

AFAIK this patch is no longer necessary, at least no on OSX. The current 
binary installer is already build using a separate DESTDIR without having 
to patch Makefiles.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue763708] Failures in test_macostools for --enable-unicode=ucs4

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

IMHO fixing this is not worth the trouble, we should just document that 
the Carbon extensions aren't supported in a UCS4 build (or even explictly 
detect a UCS4 build in setup.py and not compile the Carbon extensions).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Usage of PyObjC in the build-script should be avoided, as should eating 
exceptions like you propose. The rationale for not silencing exceptions is 
that the build script is supposed to enable reproducable builds.

I'll probably add a small Cocoa ObjC program to the BuildScript directory 
that uses the API's you mention.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
assignee:  -> ronaldoussoren

___
Python tracker 

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



[issue900502] bundlebuilder: some way to add non-py files in packages

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I intend to close this issue as it is an enhancement proposal for a 
deprecated module.

Py2app (the modern replacement for bundlebuilder) also doesn't support 
this scenario, although it should be fairly easy to add such support to 
that codebase.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue1113328] OSATerminology still semi-broken

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Fixed in the trunk in revision r70178. 

hhas: it is save to backport this to python 2.6?

--
assignee: jackjansen -> ronaldoussoren
nosy: +ronaldoussoren
resolution:  -> accepted

___
Python tracker 

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



[issue5154] OSX broken poll testing doesn't work

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

poll(3) doesn't work for all types of filedescriptors on OSX.

Specifically:

  BUGS
 The poll() system call currently does not support devices.


(That's from the manpage of poll). This is why Apple doesn't expose 
select.poll in their build of Python.

I haven't used select.poll myself and therefore don't know if the issues 
with the poll system call are serious enough to warrant hiding 
select.poll on OSX.

___
Python tracker 

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



[issue763708] Failures in test_macostools for --enable-unicode=ucs4

2009-03-04 Thread Brett Cannon

Brett Cannon  added the comment:

The code solution is probably the most useful since people are more
likely to just compile Python without reading some text file that will
mention UCS4 builds will not create the Carbon extensions.

___
Python tracker 

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



[issue5408] test_osx_env failing

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Committed my fix as r70179 (3.x) and r70180 (30-maint).

Benjamin: can you confirm this actually fixes the issue with a non-
framework build, I don't know if I'll be able to test that before the 
first 3.1a release.

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

___
Python tracker 

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



[issue4165] Failure building 64-bit Python on Leopard

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
status: pending -> closed

___
Python tracker 

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



[issue5198] Strange DeprecationWarning behaviour in module struct

2009-03-04 Thread Ilya Sandler

Ilya Sandler  added the comment:

Here is another case, which I think is even worse.

Range checks are done inconsistently as well:

.../trunk> ./python -c 'import struct; struct.pack("B", 257)

'Traceback (most recent call last):
  File "", line 1, in 
struct.error: ubyte format requires 0 <= number <= 255

.../trunk> ./python -c 'import struct; struct.pack(">B", 257)' 
sys:1: DeprecationWarning: 'B' format requires 0 <= number <= 255

--
nosy: +isandler

___
Python tracker 

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



[issue5408] test_osx_env failing

2009-03-04 Thread Ned Deily

Ned Deily  added the comment:

I don't have strong feelings about it one way or the other.  As far as I 
can tell from the code and testing and the documented behavior, the effect 
on sys.executable is independent of whether it is a framework build or 
not.  But I'm fine with narrowing the scope of the test.

___
Python tracker 

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



[issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

2009-03-04 Thread Ronald Oussoren

Changes by Ronald Oussoren :


___
Python tracker 

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



[issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

The attached patch shows what I intent do commit after testing. This adds 
a small ObjC command-line tool that sets the icon.  I still have to build 
the installer to check if the patch actually works.

--
resolution:  -> accepted
Added file: http://bugs.python.org/file13243/patch-seticon.txt

___
Python tracker 

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



[issue5408] test_osx_env failing

2009-03-04 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

The effect on sys.executable is always present, the test is only valid for 
a framework build because that's the only build that can find sys.prefix 
without looking at sys.executable.  Setting PYTHONEXECUTABLE with a non-
framework build is only valid if the value of the variable point's to a 
python executable in the right location within the installation tree.

___
Python tracker 

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



[issue5408] test_osx_env failing

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thumbs up here! Thanks.

___
Python tracker 

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



[issue5154] OSX broken poll testing doesn't work

2009-03-04 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



[issue5408] test_osx_env failing

2009-03-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
status: pending -> closed

___
Python tracker 

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



[issue5381] json need object_pairs_hook

2009-03-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

After enhancing namedtuple and ConfigParser, I found a simpler approach
that doesn't involve extending the API.  The simple way is to use
ordered dictionaries directly.  

With a small tweak to OD's repr, it is fully substitutable for a dict
without changing any client code or doctests (the OD loses its own
eval/repr order-preserving roundtrip but what json already gives now).

See attached patch.

Added file: http://bugs.python.org/file13244/json_ordered.diff

___
Python tracker 

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



[issue5381] json need object_pairs_hook

2009-03-04 Thread Bob Ippolito

Bob Ippolito  added the comment:

Unfortunately this is a patch for the old json lib... the new one has a C 
API and an entirely different method of parsing documents (for performance 
reasons).

___
Python tracker 

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



[issue5381] json need object_pairs_hook

2009-03-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

When do you expect the new C version to go in?  I'm looking forward to it.

___
Python tracker 

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



[issue4862] utf-16 BOM is not skipped after seek(0)

2009-03-04 Thread STINNER Victor

STINNER Victor  added the comment:

> This has been fixed by the io-c branch merge.

Can you at least include the patch to test_io.py from amaury's patch?

And why not fixing the Python version of the io module (i'm not sure 
of the new name: _pyio?) since we have a working patch?

___
Python tracker 

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



[issue4996] io.TextIOWrapper calls buffer.read1()

2009-03-04 Thread STINNER Victor

STINNER Victor  added the comment:

> This has been fixed in io-c branch merge. r70152

Amazing, io-c is faster but also fixes many bugs!

___
Python tracker 

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



[issue3618] possible deadlock in python IO implementation

2009-03-04 Thread STINNER Victor

STINNER Victor  added the comment:

> Since io-c has been merging, I'm lowering priority.

Why not fixing this issue? The issue is rare (only occurs when using profiling 
with a callback writting to stdout) and you closed the issue #4862 which is 
more common (read an UTF-16 file).

___
Python tracker 

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



[issue5381] json need object_pairs_hook

2009-03-04 Thread Bob Ippolito

Bob Ippolito  added the comment:

Whenever someone applies the patch for http://bugs.python.org/issue4136 -- 
I don't know when that will happen.

___
Python tracker 

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



[issue3618] possible deadlock in python IO implementation

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/3/4 STINNER Victor :
>
> STINNER Victor  added the comment:
>
>> Since io-c has been merging, I'm lowering priority.
>
> Why not fixing this issue? The issue is rare (only occurs when using profiling
> with a callback writting to stdout) and you closed the issue #4862 which is
> more common (read an UTF-16 file).

See msg82934.

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-03-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Martin, is this patch good-to-go?

___
Python tracker 

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



[issue4862] utf-16 BOM is not skipped after seek(0)

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Ah, I forgot this wasn't applied to the Python implementation. Fixed in
r70184.

___
Python tracker 

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



[issue5418] urllib.response.addinfourl does not support __exit__

2009-03-04 Thread Mitchell Model

New submission from Mitchell Model :

response = urllib.request.open(someURL)
page = response.read()

close() be called on response after the read(), right?  Experimentation 
shows that I can repeatedly read from response until I close it, getting 
back empty bytes objects.

Thinking that anything with a close() should support the with statement, 
I tried putting  the code inside one but got
AttributeError: 'addinfourl' object has no attribute '__exit__'
so I can see that it doesn't support with. It seems like it should.

--
components: Library (Lib)
messages: 83174
nosy: MLModel
severity: normal
status: open
title: urllib.response.addinfourl does not support __exit__
type: behavior
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



[issue3618] possible deadlock in python IO implementation

2009-03-04 Thread STINNER Victor

STINNER Victor  added the comment:

Ooops, I wanted to write: "Why not *closing* this issue?", sorry.

___
Python tracker 

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



[issue4862] utf-16 BOM is not skipped after seek(0)

2009-03-04 Thread STINNER Victor

STINNER Victor  added the comment:

@benjamin: ok, great.

___
Python tracker 

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



[issue3618] possible deadlock in python IO implementation

2009-03-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I suppose we might as well. If anyone wants to fix the Python
implementation later, they can go ahead and reopen this.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

2009-03-04 Thread Bill Janssen

Bill Janssen  added the comment:

Looks good.  The contrast is stark.

___
Python tracker 

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



[issue5419] urllib.request.open(someURL).read() returns a bytes object so writing it requires binary mode

2009-03-04 Thread Mitchell Model

New submission from Mitchell Model :

There needs to be something somewhere in the documentation that makes 
the simple point that data coming in from the web is bytes not strings, 
which is a big change from Python 2, and that it needs to be manipulated 
as such, including writing in binary mode.

I am not sure what documentation should be changed, but I do think 
something is missing, because I just ran around in circles on this one 
for quite some time. Perhaps the Unicode HOWTO needs more information; 
possibly urllib.request does; maybe a combination of things have to be 
added to several documentation files. Here's what happened:

I wanted to read from a web page, make some string replacements, and 
save to a file, so I wrote code that boils down to something like:

with open('url.html', 'w') as fil:
fil.write(urllib.request.open(aURL).read()).replace(str1, str2)

The first thing that happened was an error telling me that I can't write 
bytes to a text stream, so I realized that read() was returning a bytes 
object, which makes sense.

So I converted it to a string, but that put a b' at the beginning of the 
file and a ' at the end! Bad.

Instead of str(thebytes) I did the proper thing: thebytes.decode(), and 
wrote that to the file.

But then I found that Non-ASCII characters created problems -- they were 
saved in the file as \xNN\xNN or even three \x's, then displayed as 
garbage when the page was opened in a browser. 

So I tried decoding using different codecs but couldn't find one that 
worked for the é and the emdash that were in the response.

Finally I realized that the whole thing was a delusion: obviously 
urlopen responses have to return bytes objects, and adding 'b' to the 
'w' when opening the output file fixed everything. (I also had to change 
my replacement strings to bytes.)

I went back to the relevant documentation multiple times, including 
after I figured everything out, and I can't convince myself that it 
makes the connection anywhere between bytes coming in, manipulating the 
bytes as bytes, and writing out in binary. Yes, in retrospect this all 
makes sense and perhaps even should have been obvious, but I am quite 
sure I won't be the only experienced Python 2 programmer to trip over 
this when making the transition to Python 3.

I apologize in advance if the requested documentation exists and I 
didn't find it, in which case I would appreciate a pointer to where it 
is lies.

--
assignee: georg.brandl
components: Documentation
messages: 83179
nosy: MLModel, georg.brandl
severity: normal
status: open
title: urllib.request.open(someURL).read() returns a  bytes object so writing 
it requires binary mode
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



[issue5420] Queue deprecation warning patch

2009-03-04 Thread Tennessee Leeuwenburg

New submission from Tennessee Leeuwenburg :

A very tiny patch which places a DeprecationWarning inside Queue.empty
and Queue.full

--
components: Library (Lib)
files: queue_patch.txt
messages: 83180
nosy: tleeuwenb...@gmail.com
severity: normal
status: open
title: Queue deprecation warning patch
type: feature request
versions: Python 3.1
Added file: http://bugs.python.org/file13245/queue_patch.txt

___
Python tracker 

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



[issue5420] Queue deprecation warning patch

2009-03-04 Thread Tennessee Leeuwenburg

Tennessee Leeuwenburg  added the comment:

Add comment to NEWS as documented...

Added file: http://bugs.python.org/file13246/NEWS_patch.txt

___
Python tracker 

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



[issue5420] Queue deprecation warning patch

2009-03-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Can you make a single patch for Lib/queue.py and Misc/NEWS and remove
any uses of emtpy/full in the standard library including multiprocessing.

Also, for deprecations, it's always nice to have the message suggest an
alternative, something like:  "The empty() method is deprecated and
scheduled to be removed in Py3.2.  Instead, use qsize() or catch a
queue.Empty exception."

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue5420] Queue deprecation warning patch

2009-03-04 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Unit tests are a great thing as well.  Also, the deprecation warnings
you've added are the really annoying kind.  They refer to users to the
source of the deprecated methods themselves!  A vastly preferable use of
the warnings system is to refer users to the *callers* of the deprecated
methods.  Try passing different values for the stacklevel parameter of
the warnings.warn function until you get a warning that is more helpful.

--
nosy: +exarkun

___
Python tracker 

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



[issue5381] json needs object_pairs_hook

2009-03-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
title: json need object_pairs_hook -> json needs object_pairs_hook

___
Python tracker 

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



[issue5420] Queue deprecation warning patch

2009-03-04 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