473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

python -U problem for 2.4.3c1 on Windows 2000 (was Does -U optionreally exist?)

I did observe the problem when using the -U
option on Windows 2000. Seems like some infinite
recursion in cp1250.py -- see below.

I did not try it with earlier versions of Python.

Can this be reproduced on your computer?

Thanks for your time and experience,
pepr

P.S. Thanks, Martin, for the hint.

Martin v. Löwis wrote
Petr Prikryl wrote:
Martin v. Löwis wrote
As for dropping the u prefix on string literals:
Just try the -U option of the interpreter some time,
which makes all string literals Unicode. If you manage
to get the standard library working this way, you
won't need a per-file decision anymore: just start
your program with 'python -U'.
I have failed to find the -U option in Python 2.4.2.

[...] $ python2.4 -U
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
type("") <type 'unicode'> ^D [...]

On Windows machine

C:\>python -U
'import site' failed; use -v for traceback
Python 2.4.3c1 (#68, Mar 23 2006, 10:19:27) [MSC v.1310 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information. type('') <type 'unicode'> ^Z
See the 'import site' failure. I do use the sitecustomize.py
(C:\Python24\Lib\site-packages\sitecustomize.py). It contains
-------------------------------------
import sys
sys.setdefaultencoding('cp1250')
-------------------------------------

I did remove the sitecustomize.pyc before the command.
When trying the python -U -v 2>xxx.log, I get the
following (shortened):

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# C:\Python24\lib\site.pyc matches C:\Python24\lib\site.py
import site # precompiled from C:\Python24\lib\site.pyc
# C:\Python24\lib\os.pyc matches C:\Python24\lib\os.py
import os # precompiled from C:\Python24\lib\os.pyc
import nt # builtin
# C:\Python24\lib\ntpath.pyc matches C:\Python24\lib\ntpath.py
import ntpath # precompiled from C:\Python24\lib\ntpath.pyc
# C:\Python24\lib\stat.pyc matches C:\Python24\lib\stat.py
import stat # precompiled from C:\Python24\lib\stat.pyc
# C:\Python24\lib\UserDict.pyc matches C:\Python24\lib\UserDict.py
import UserDict # precompiled from C:\Python24\lib\UserDict.pyc
# C:\Python24\lib\copy_reg.pyc matches C:\Python24\lib\copy_reg.py
import copy_reg # precompiled from C:\Python24\lib\copy_reg.pyc
# C:\Python24\lib\types.pyc matches C:\Python24\lib\types.py
import types # precompiled from C:\Python24\lib\types.pyc
# C:\Python24\lib\locale.pyc matches C:\Python24\lib\locale.py
import locale # precompiled from C:\Python24\lib\locale.pyc
import _locale # builtin
# C:\Python24\lib\codecs.pyc matches C:\Python24\lib\codecs.py
import codecs # precompiled from C:\Python24\lib\codecs.pyc
import _codecs # builtin
import encodings # directory C:\Python24\lib\encodings
# C:\Python24\lib\encodings\__init__.pyc matches C:\Python24\lib\encodings\__init__.py
import encodings # precompiled from C:\Python24\lib\encodings\__init__.pyc
# C:\Python24\lib\encodings\aliases.pyc matches C:\Python24\lib\encodings\aliases.py
import encodings.aliases # precompiled from C:\Python24\lib\encodings\aliases.pyc
# C:\Python24\lib\encodings\cp1250.pyc matches C:\Python24\lib\encodings\cp1250.py
import encodings.cp1250 # precompiled from C:\Python24\lib\encodings\cp1250.pyc
import sitecustomize # from C:\Python24\lib\site-packages\sitecustomize.py
# wrote C:\Python24\lib\site-packages\sitecustomize.pyc
'import site' failed; traceback:
Traceback (most recent call last):
File "C:\Python24\lib\site.py", line 397, in ?
main()
File "C:\Python24\lib\site.py", line 394, in main
if hasattr(sys, "setdefaultencoding"):
File "C:\Python24\lib\encodings\cp1250.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
File "C:\Python24\lib\encodings\cp1250.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
File "C:\Python24\lib\encodings\cp1250.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
[...snip...]
File "C:\Python24\lib\encodings\cp1250.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
File "C:\Python24\lib\encodings\cp1250.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
RuntimeError: maximum recursion depth exceeded
# C:\Python24\lib\warnings.pyc matches C:\Python24\lib\warnings.py
import warnings # precompiled from C:\Python24\lib\warnings.pyc
# C:\Python24\lib\linecache.pyc matches C:\Python24\lib\linecache.py
import linecache # precompiled from C:\Python24\lib\linecache.pyc
Python 2.4.3c1 (#68, Mar 23 2006, 10:19:27) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] locale
# cleanup[1] encodings
# cleanup[1] nt
# cleanup[1] zipimport
# cleanup[1] warnings
# cleanup[1] _codecs
# cleanup[1] types
# cleanup[1] _locale
# cleanup[1] sitecustomize
# cleanup[1] signal
# cleanup[1] linecache
# cleanup[1] encodings.aliases
# cleanup[1] exceptions
# cleanup[1] encodings.cp1250
# cleanup[1] codecs
# cleanup[2] copy_reg
# cleanup[2] ntpath
# cleanup[2] UserDict
# cleanup[2] stat
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 7 unfreed ints in 1 out of 8 blocks
# cleanup floats

(the end)
--
Petr Prikryl (prikrylp at skil dot cz)
Mar 27 '06 #1
1 1547
Petr Prikryl wrote:
I did observe the problem when using the -U
option on Windows 2000. Seems like some infinite
recursion in cp1250.py -- see below.

I did not try it with earlier versions of Python.

Can this be reproduced on your computer?


I can't try right now. However, I can readily
believe that Python easily crashes when invoked
with -U, and I can also believe that it only happens
on some systems.

If you care, please research the cause, and submit a
bug fix. Just submitting the bug report likely won't
react in action (atleast not from me).

Regards,
Martin
Mar 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Will | last post by:
I just discovered Python and looked briefly at one of the tutorials for beginners... It looks a lot like the old Command line Basic... I'm sure it does much more but... 1 - Can you create...
3
by: Mike Moum | last post by:
Hi, I'm a civil engineer who also doubles as chief programmer for technical applications at my company. Most of our software is written in Visual Basic because our VP in charge of I.T. likes to...
3
by: Steven Fox | last post by:
============================================================ About DB2 Administration Tools Environment ============================================================ DB2 administration tools level:...
19
by: Mark C. | last post by:
The company I work for has been running Access 2000 on a Windows NT server with Opportunistic Locking turned off on the server without issue for almost a year. We have just switched to a Windows...
3
by: James Mills | last post by:
On Thu, Oct 9, 2008 at 2:26 PM, Warren DeLano <warren@delsci.comwrote: Yes it does :) I second this. It's far better to use Data Structures rather than Programming Constructs
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.