FAQ
Hi,

I realize that this has been discussed before. And you might think the
solution is os.environ["PYTHONCASEOK"] = "hotdog" but try this one.
There is dialog.py sitting in pythonwin/.../mfc directory and Dialog.py
in lib-tk directory. If I have both directory in my Pythonpath, I cannot
call the one sitting at the second directory with out encountering the
dreaded "Case Mismatch" error.
I feel that "Case Mismatch" should only occur after all directories has
been searched to find the 'right' case import. Not after finding the
first non-matching one. Is there a way to set environ to do what I want?
If not, can anyone tell me how to get around this prob or tell me if
what I am proposing makes sense or not?

--
*****************************************************************************
S. Hoon Yoon (Quant) Merrill Lynch Equity Trading,
yelled at yahoo.com hoon at bigfoot.com(w)
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages." Mauldin
*****************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcard.vcf
Type: text/x-vcard
Size: 193 bytes
Desc: Card for Hoon Yoon
Url : http://mail.python.org/pipermail/python-list/attachments/19990714/7187485e/attachment.vcf

Search Discussions

  • Guido van Rossum at Jul 15, 1999 at 10:52 pm

    Hoon Yoon <hyoon at bigfoot.com> writes:

    I realize that this has been discussed before. And you might think the
    solution is os.environ["PYTHONCASEOK"] = "hotdog" but try this one.
    There is dialog.py sitting in pythonwin/.../mfc directory and Dialog.py
    in lib-tk directory. If I have both directory in my Pythonpath, I cannot
    call the one sitting at the second directory with out encountering the
    dreaded "Case Mismatch" error.
    I feel that "Case Mismatch" should only occur after all directories has
    been searched to find the 'right' case import. Not after finding the
    first non-matching one. Is there a way to set environ to do what I want?
    If not, can anyone tell me how to get around this prob or tell me if
    what I am proposing makes sense or not?
    This is intentional -- it prevents people from *relying* on the case
    matching to make their program work. (The case sensitivity is there
    to make your program fail if you typed "import String" when you meant
    "import string".)

    Two workarounds: (1) make a copy of the second one with a different
    name, and use that; (2) rearrange your sys.path so that the one you
    want to use comes first. Neither might work if you have some library
    module that uses one and some other library module that uses the other...

    --Guido van Rossum (home page: http://www.python.org/~guido/)
  • Hoon Yoon at Jul 16, 1999 at 2:07 pm
    Guido,

    The problem here is that both Dialog and dialog comes with pretty
    standard Python distribution for tk and mfc. I had similar prb with COM
    and callDll some time ago.
    If I use the first solution, then I am kinda lost because I don't know
    what those standard distribution call each other when and where.
    If I use the second way, then I cannot use either portion of tk (and
    Dialog.py in Tk is pretty important) or mfc (I am not sure how dialog.py
    is important, but..).
    My current thought is that I use sys.path with insert to control the
    precedence during run time, but it's not an amicable situation.
    Best solution is I guess standard packages to avoid name confusion
    like this. Or what I proposed earlier about searching through the whole
    PYTHONPATH before rasing case mismatch err.
    Thanks for the reply,

    Hoon,

    Guido van Rossum wrote:
    Hoon Yoon <hyoon at bigfoot.com> writes:
    I realize that this has been discussed before. And you might think the
    solution is os.environ["PYTHONCASEOK"] = "hotdog" but try this one.
    There is dialog.py sitting in pythonwin/.../mfc directory and Dialog.py
    in lib-tk directory. If I have both directory in my Pythonpath, I cannot
    call the one sitting at the second directory with out encountering the
    dreaded "Case Mismatch" error.
    I feel that "Case Mismatch" should only occur after all directories has
    been searched to find the 'right' case import. Not after finding the
    first non-matching one. Is there a way to set environ to do what I want?
    If not, can anyone tell me how to get around this prob or tell me if
    what I am proposing makes sense or not?
    This is intentional -- it prevents people from *relying* on the case
    matching to make their program work. (The case sensitivity is there
    to make your program fail if you typed "import String" when you meant
    "import string".)

    Two workarounds: (1) make a copy of the second one with a different
    name, and use that; (2) rearrange your sys.path so that the one you
    want to use comes first. Neither might work if you have some library
    module that uses one and some other library module that uses the other...

    --Guido van Rossum (home page: http://www.python.org/~guido/)
    --
    *****************************************************************************
    S. Hoon Yoon (Quant) Merrill Lynch Equity Trading,
    yelled at yahoo.com hoon at bigfoot.com(w)
    "Miracle is always only few standard deviations away, but so is
    catastrophe."
    * Expressed opinions are often my own, but NOT my employer's.
    "I feel like a fugitive from the law of averages." Mauldin
    *****************************************************************************
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: vcard.vcf
    Type: text/x-vcard
    Size: 193 bytes
    Desc: Card for Hoon Yoon
    Url : http://mail.python.org/pipermail/python-list/attachments/19990716/367f92af/attachment.vcf
  • Fredrik Lundh at Jul 16, 1999 at 3:45 pm

    Hoon Yoon wrote:
    If I use the second way, then I cannot use either portion of tk (and
    Dialog.py in Tk is pretty important)
    afaik, it's obsolete. new code should use
    tkMessageDialog or tkFileDialog instead. see:

    http://www.pythonware.com/library/tkinter/introduction/standard-dialogs.htm

    if you have old code that relies on Dialog.py,
    copy the file to the application directory, and
    remove it from lib-tk...

    </F>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 14, '99 at 5:39p
activeJul 16, '99 at 3:45p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase