[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-28 Thread Tim Golden

Tim Golden added the comment:

Fixed. Thanks for the report.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d5a9a1ba47ee by Tim Golden in branch 'default':
Issue14255 Don't flatten case of tempdir
http://hg.python.org/cpython/rev/d5a9a1ba47ee

--
nosy: +python-dev

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-25 Thread Tim Golden

Changes by Tim Golden m...@timgolden.me.uk:


Removed file: http://bugs.python.org/file32338/issue14255.2.diff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-25 Thread Tim Golden

Tim Golden added the comment:

New patch, tested on Windows  Linux

--
Added file: http://bugs.python.org/file32362/issue14255.3.diff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Tim Golden

Tim Golden added the comment:

normpath doesn't really buy anything here as abspath already has the same 
effect (plus more). Patch attach removes normcase|path leaving only abspath.

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Tim Golden

Tim Golden added the comment:

If no-one objects, I'll commit in a day or two.

--
Added file: http://bugs.python.org/file32328/issue14255.diff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Could you perhaps add a test?

--
components:  -IO, Windows
stage: needs patch - patch review
versions: +Python 3.4 -Python 3.2

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Tim Golden

Changes by Tim Golden m...@timgolden.me.uk:


Removed file: http://bugs.python.org/file32328/issue14255.diff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Tim Golden

Tim Golden added the comment:

Added, including a slightly surprising change needed to test_zipimport_support 
(which arguably should have been there from the start for robustness).

--
assignee:  - tim.golden
Added file: http://bugs.python.org/file32338/issue14255.2.diff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-10-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The test fails under Linux here:

==
FAIL: test_case_sensitive (test.test_tempfile.TestGetTempDir)
--
Traceback (most recent call last):
  File /home/antoine/cpython/default/Lib/test/test_tempfile.py, line 490, in 
test_case_sensitive
self.assertEqual(tempfile.gettempdir(), case_sensitive_tempdir)
AssertionError: '/tmp' != 'C:\\Temp'
- /tmp
+ C:\Temp

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-01-18 Thread Takayuki SHIMIZUKAWA

Takayuki SHIMIZUKAWA added the comment:

 I think that moving to 'normpath' instead of 'normcase'

Official manual says 'abspath' include 'normpath' functionality.
I think it is need JUST remove '_os.path.normcase' calling.

But, I do not understand the circumstances which use 'normcase'.

--
nosy: +shimizukawa

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-10-20 Thread Jeff McNeil

Jeff McNeil added the comment:

Yeah clearly the wrong behavior on Winders.

I think that moving to 'normpath' instead of 'normcase' is likely the right 
thing to do. Patch is attached, so if someone with commit powers could review 
real quick I'll address whatever needs to be addressed.

IMHO, the 'normcase' calls are of questionable benefit since the posix call is 
simply an identity and as this bug details, it isn't necessarily the right 
behavior on Win.

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-10-18 Thread James Teh

James Teh added the comment:

This issue is much nastier than it seems when dealing with character sets that 
contain multi-byte characters in Python 2.7 on Windows. For example, on a 
Japanese system:
1. The ANSI code page is cp932 and Python 2.7 will return the TEMP environment 
variable as a str with this encoding.
2. If a user has a username containing the character \u5c71, this will be 
encoded as \x8eR, so the TEMP environment variable will include this character.
3. When normcase is called, \x8eR is converted to \x8er.
4. Because \x8eR is a multi-byte character, \x8er is an unrelated character; 
case insensitivity for R doesn't apply.
5. The result is that the correct temp directory is skipped. In fact, on most 
systems, IOError is raised because none of the other candidate directories are 
valid either.

--
nosy: +jteh

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Here's a tiny patch that just changes normcase-normpath.  This fixes the 
casing issue at the 'gettempdir' level, though it doesn't address the 
'normcase' function itself.

Note that *both* macpath.py and ntpath.py use s.lower, which obviously won't 
fly on case-sensitive mounts. If someone more experienced than I has a 
suggestion on how to handle that -- or whether its worthwhile to even touch -- 
I'll gladly implement.

--
keywords: +patch
Added file: http://bugs.python.org/file24861/tempfile_normpath.patch

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread 勇刚 罗

勇刚 罗 luoyongg...@gmail.com added the comment:

It's possible to getting actual file name under Windows.
http://stackoverflow.com/questions/74451/getting-actual-file-name-with-proper-casing-on-windows

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

It doesn't seem to me that the right approach on either platform is to simply 
downcase.  Maybe just deprecate the call altogether as its not doing anything 
normpath isn't if the s.lower call is removed?

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-14 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

There's not much sense in having normcase() if it never does anything :)

But in this case, I don't really see why tempfile needs to use normcase().

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-14 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

+1 for fixing.

--
nosy: +pitrou
priority: normal - low
stage: test needed - needs patch

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-14 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

The normcase call isn't exactly a no-op in ntpath.py as it also swaps / for \\. 
 Removing the .lower() seems to simply make it a watered down version of 
normpath.

There are a couple of options I guess.  We could simply keep the altsep, or 
update _get_default_tempdir to use normpath?  

I'd be happy to do it once everyone agrees =)

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-14 Thread 勇刚 罗

勇刚 罗 luoyongg...@gmail.com added the comment:

+1
 _get_default_tempdir to use normpath

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

The actual implementation calls os.path.normcase from 
tempfile._get_default_tempdir. In this scenario here, that resolves to the 
ntpath module  triggers a lowercase conversion.

On the other hand, the posixpath module is simply an identity function.

Now, it *is* possible to force a Windows file system to run in a case-sensitive 
configuration. Since ntpath.py forces lower case, this could actually cause 
breakage in that situation, however rare.

In my opinion, changing the ntpath.normcase function to retain case probably 
yields more correct behavior.

--
nosy: +mcjeff

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +brian.curtin, georg.brandl, ncoghlan, tim.golden
stage:  - test needed
type:  - behavior
versions:  -Python 2.6, Python 3.1, Python 3.4

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-11 Thread 勇刚 罗

New submission from 勇刚 罗 luoyongg...@gmail.com:

 print tempfile.gettempdir()
c:\users\dreamkxd\appdata\local\temp

And the real path is
C:\Users\dreamkxd\AppData\Local\Temp.

--
messages: 155424
nosy: 勇刚.罗
priority: normal
severity: normal
status: open
title: tempfile.gettempdir() didn't return the path with correct case.

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-11 Thread 勇刚 罗

Changes by 勇刚 罗 luoyongg...@gmail.com:


--
components: +IO, Library (Lib), Windows
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

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