Re: [Python-Dev] [Preview] Comments and change proposals on documentation

2010-11-26 Thread Facundo Batista
On Wed, Nov 24, 2010 at 5:24 PM, Georg Brandl  wrote:

> at , you can look at a version of the 3.2
> docs that has the upcoming commenting feature.  JavaScript is mandatory.

This is awesome!! Thanks for this work, remember to buy you a beer next PyCon!


> Credits go to Jacob Mason, whose GSOC project is responsible for almost all
> of what you see there.  [1]

Ok, two beers.

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removal of Win32 ANSI API

2010-11-26 Thread Hirokazu Yamamoto

On 2010/11/14 9:06, Victor Stinner wrote:

Yes, but how do you check if the input argument is a bytes or a str object
with your PyArg_Parse converter? You should use "O" format and manually
convert it to unicode, and then convert the result back to bytes (if the input
was bytes). It don't think that it makes the code shorter.

The code is currently working. The question is if we have to drop the ANSI API
now, later or never. It looks like the decision moves to "later" (deprecate in
3.2, remove in 3.3). I still think that drop now doesn't really hurt.

Victor


Humble thoughts...
Is it possible a conversion from bytes (ANSI) to unicode fails on
windows? If not, is it allowed to convert to unicode with
PyUnicode_FSDecoder if function doesn't return str? For example, 
os.stat() takes str as arguments but doesn't return str.


# I noticed win_readlink() in Modules/posixmodule.c already unicode
# only. Maybe not so much problem? ;-)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removal of Win32 ANSI API

2010-11-26 Thread Hirokazu Yamamoto

On 2010/11/12 1:18, Ulrich Eckhardt wrote:

# I recently did it for winsound.PlaySound with MvL's approval


Interesting, is there a ticket associate with this? Also, was that on Python 3
or 2? Which commits?


Sorry for late posting. Rev 86300 and Issue 6317.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Summary of Python tracker Issues

2010-11-26 Thread Python tracker

ACTIVITY SUMMARY (2010-11-19 - 2010-11-26)
Python tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open2533 (-16)
  closed 19792 (+98)
  total  22325 (+82)

Open issues with patches: 1083 


Issues opened (66)
==

#1178: IDLE - add "paste code" functionality
http://bugs.python.org/issue1178  reopened by ned.deily

#3709: BaseHTTPRequestHandler innefficient when sending HTTP header
http://bugs.python.org/issue3709  reopened by r.david.murray

#5150: IDLE to support reindent.py
http://bugs.python.org/issue5150  reopened by rhettinger

#8879: Implement os.link on Windows
http://bugs.python.org/issue8879  reopened by amaury.forgeotdarc

#9769: PyUnicode_FromFormatV() doesn't handle non-ascii text correctl
http://bugs.python.org/issue9769  reopened by belopolsky

#10220: Make generator state easier to introspect
http://bugs.python.org/issue10220  reopened by ncoghlan

#10268: Add --enable-loadable-sqlite-extensions option to `configure`
http://bugs.python.org/issue10268  reopened by ned.deily

#10441: some stdlib modules need to be updated to handle SSL certifica
http://bugs.python.org/issue10441  reopened by pitrou

#10453: Add -h/--help option to compileall
http://bugs.python.org/issue10453  reopened by eric.araujo

#10464: netrc module not parsing passwords containing #s.
http://bugs.python.org/issue10464  opened by the_isz

#10466: locale.py resetlocale throws exception on Windows (getdefaultl
http://bugs.python.org/issue10466  opened by skoczian

#10469: test_socket fails using Visual Studio 2010
http://bugs.python.org/issue10469  opened by Kotan

#10475: hardcoded compilers for LDSHARED/LDCXXSHARED on NetBSD
http://bugs.python.org/issue10475  opened by njoly

#10478: Ctrl-C locks up the interpreter
http://bugs.python.org/issue10478  opened by isandler

#10479: cgitb.py should assume a binary stream for output
http://bugs.python.org/issue10479  opened by v+python

#10480: cgi.py should document the need for binary stdin/stdout
http://bugs.python.org/issue10480  opened by v+python

#10481: subprocess PIPEs are byte streams
http://bugs.python.org/issue10481  opened by v+python

#10482: subprocess and deadlock avoidance
http://bugs.python.org/issue10482  opened by v+python

#10483: http.server - what is executable on Windows
http://bugs.python.org/issue10483  opened by v+python

#10484: http.server.is_cgi fails to handle CGI URLs containing PATH_IN
http://bugs.python.org/issue10484  opened by v+python

#10485: http.server fails when query string contains addition '?' char
http://bugs.python.org/issue10485  opened by v+python

#10486: http.server doesn't set all CGI environment variables
http://bugs.python.org/issue10486  opened by v+python

#10487: http.server - doesn't process Status: header from CGI scripts
http://bugs.python.org/issue10487  opened by v+python

#10492: test_doctest fails with iso-8859-15 locale
http://bugs.python.org/issue10492  opened by pitrou

#10494: Demo/comparisons/regextest.py needs some usage information.
http://bugs.python.org/issue10494  opened by ramiroluz

#10495: Demo/comparisons/sortingtest.py needs some usage information.
http://bugs.python.org/issue10495  opened by ramiroluz

#10496: "import site failed" when Python can't find home directory
http://bugs.python.org/issue10496  opened by bbi5291

#10497: Incorrect use of gettext in argparse
http://bugs.python.org/issue10497  opened by eric.araujo

#10498: calendar.LocaleHTMLCalendar.formatyearpage() results in traceb
http://bugs.python.org/issue10498  opened by r.david.murray

#10499: Modular interpolation in configparser
http://bugs.python.org/issue10499  opened by lukasz.langa

#10500: Palevo.DZ worm msix86 installer 3.x installer
http://bugs.python.org/issue10500  opened by VilIgnoble

#10502: Add unittestguirunner to Tools/
http://bugs.python.org/issue10502  opened by michael.foord

#10503: os.getuid() documentation should be clear on what kind of uid 
http://bugs.python.org/issue10503  opened by giampaolo.rodola

#10504: Trivial mingw compile fixes
http://bugs.python.org/issue10504  opened by jonny

#10507: Check well-formedness of reST markup within "make patchcheck"
http://bugs.python.org/issue10507  opened by dmalcolm

#10509: PyTokenizer_FindEncoding can lead to a segfault if bad charact
http://bugs.python.org/issue10509  opened by Trundle

#10510: distutils upload/register should use CRLF in HTTP requests
http://bugs.python.org/issue10510  opened by Brian.Jones

#10512: regrtest ResourceWarning - unclosed sockets and files
http://bugs.python.org/issue10512  opened by nvawda

#10513: sqlite3.InterfaceError after commit
http://bugs.python.org/issue10513  opened by [email protected]

#10514: configure does not create accurate Makefile
http://bugs.python.org/issue10514  opened by daelious

#10515: csv sniffer does not recognize quotes at the end of line
http://bugs.py

[Python-Dev] PyPy 1.4 released

2010-11-26 Thread Maciej Fijalkowski
===
PyPy 1.4: Ouroboros in practice
===

We're pleased to announce the 1.4 release of PyPy. This is a major breakthrough
in our long journey, as PyPy 1.4 is the first PyPy release that can translate
itself faster than CPython.  Starting today, we are using PyPy more for
our every-day development.  So may you :) You can download it here:

http://pypy.org/download.html

What is PyPy


PyPy is a very compliant Python interpreter, almost a drop-in replacement
for CPython. It's fast (`pypy 1.4 and cpython 2.6`_ comparison)

Among its new features, this release includes numerous performance improvements
(which made fast self-hosting possible), a 64-bit JIT backend, as well
as serious stabilization. As of now, we can consider the 32-bit and 64-bit
linux versions of PyPy stable enough to run `in production`_.

Numerous speed achievements are described on `our blog`_. Normalized speed
charts comparing `pypy 1.4 and pypy 1.3`_ as well as `pypy 1.4 and cpython 2.6`_
are available on benchmark website. For the impatient: yes, we got a lot faster!

More highlights
===

* PyPy's built-in Just-in-Time compiler is fully transparent and
  automatically generated; it now also has very reasonable memory
  requirements.  The total memory used by a very complex and
  long-running process (translating PyPy itself) is within 1.5x to
  at most 2x the memory needed by CPython, for a speed-up of 2x.

* More compact instances.  All instances are as compact as if
  they had ``__slots__``.  This can give programs a big gain in
  memory.  (In the example of translation above, we already have
  carefully placed ``__slots__``, so there is no extra win.)

* `Virtualenv support`_: now PyPy is fully compatible with
virtualenv_: note that
  to use it, you need a recent version of virtualenv (>= 1.5).

* Faster (and JITted) regular expressions - huge boost in speeding up
  the `re` module.

* Other speed improvements, like JITted calls to functions like map().

.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _`Virtualenv support`:
http://morepypy.blogspot.com/2010/08/using-virtualenv-with-pypy.html
.. _`in production`:
http://morepypy.blogspot.com/2010/11/running-large-radio-telescope-software.html
.. _`our blog`: http://morepypy.blogspot.com
.. _`pypy 1.4 and pypy 1.3`:
http://speed.pypy.org/comparison/?exe=1%2B41,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=1%2B41&chart=normal+bars
.. _`pypy 1.4 and cpython 2.6`:
http://speed.pypy.org/comparison/?exe=2%2B35,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=2%2B35&chart=normal+bars

Cheers,

Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski,
Amaury Forgeot d'Arc, Armin Rigo and the PyPy team
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PyPy 1.4 released

2010-11-26 Thread Reid Kleckner
Congratulations!  Excellent work.

Reid

On Fri, Nov 26, 2010 at 1:23 PM, Maciej Fijalkowski  wrote:
> ===
> PyPy 1.4: Ouroboros in practice
> ===
>
> We're pleased to announce the 1.4 release of PyPy. This is a major 
> breakthrough
> in our long journey, as PyPy 1.4 is the first PyPy release that can translate
> itself faster than CPython.  Starting today, we are using PyPy more for
> our every-day development.  So may you :) You can download it here:
>
>    http://pypy.org/download.html
>
> What is PyPy
> 
>
> PyPy is a very compliant Python interpreter, almost a drop-in replacement
> for CPython. It's fast (`pypy 1.4 and cpython 2.6`_ comparison)
>
> Among its new features, this release includes numerous performance 
> improvements
> (which made fast self-hosting possible), a 64-bit JIT backend, as well
> as serious stabilization. As of now, we can consider the 32-bit and 64-bit
> linux versions of PyPy stable enough to run `in production`_.
>
> Numerous speed achievements are described on `our blog`_. Normalized speed
> charts comparing `pypy 1.4 and pypy 1.3`_ as well as `pypy 1.4 and cpython 
> 2.6`_
> are available on benchmark website. For the impatient: yes, we got a lot 
> faster!
>
> More highlights
> ===
>
> * PyPy's built-in Just-in-Time compiler is fully transparent and
>  automatically generated; it now also has very reasonable memory
>  requirements.  The total memory used by a very complex and
>  long-running process (translating PyPy itself) is within 1.5x to
>  at most 2x the memory needed by CPython, for a speed-up of 2x.
>
> * More compact instances.  All instances are as compact as if
>  they had ``__slots__``.  This can give programs a big gain in
>  memory.  (In the example of translation above, we already have
>  carefully placed ``__slots__``, so there is no extra win.)
>
> * `Virtualenv support`_: now PyPy is fully compatible with
> virtualenv_: note that
>  to use it, you need a recent version of virtualenv (>= 1.5).
>
> * Faster (and JITted) regular expressions - huge boost in speeding up
>  the `re` module.
>
> * Other speed improvements, like JITted calls to functions like map().
>
> .. _virtualenv: http://pypi.python.org/pypi/virtualenv
> .. _`Virtualenv support`:
> http://morepypy.blogspot.com/2010/08/using-virtualenv-with-pypy.html
> .. _`in production`:
> http://morepypy.blogspot.com/2010/11/running-large-radio-telescope-software.html
> .. _`our blog`: http://morepypy.blogspot.com
> .. _`pypy 1.4 and pypy 1.3`:
> http://speed.pypy.org/comparison/?exe=1%2B41,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=1%2B41&chart=normal+bars
> .. _`pypy 1.4 and cpython 2.6`:
> http://speed.pypy.org/comparison/?exe=2%2B35,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=2%2B35&chart=normal+bars
>
> Cheers,
>
> Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski,
> Amaury Forgeot d'Arc, Armin Rigo and the PyPy team
> ___
> Python-Dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-dev/reid.kleckner%40gmail.com
>
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86817 - python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

2010-11-26 Thread Brian Curtin
On Fri, Nov 26, 2010 at 12:44, hirokazu.yamamoto  wrote:

> Author: hirokazu.yamamoto
> Date: Fri Nov 26 19:44:28 2010
> New Revision: 86817
>
> Log:
> Now can reproduce the error on AMD64 Windows Server 2008
> even where os.symlink is not supported.
>
>
> Modified:
>   python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>
> Modified: python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>
> ==
> --- python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>  (original)
> +++ python/branches/py3k-stat-on-windows/Lib/test/test_shutil.pyFri
> Nov 26 19:44:28 2010
> @@ -271,24 +271,32 @@
> shutil.rmtree(src_dir)
> shutil.rmtree(os.path.dirname(dst_dir))
>
> [email protected]_unless_symlink
> [email protected](hasattr(os, 'link'), 'requires os.link')
> def test_dont_copy_file_onto_link_to_itself(self):
> # bug 851123.
> os.mkdir(TESTFN)
> src = os.path.join(TESTFN, 'cheese')
> dst = os.path.join(TESTFN, 'shop')
> try:
> -f = open(src, 'w')
> -f.write('cheddar')
> -f.close()
> -
> -if hasattr(os, "link"):
> -os.link(src, dst)
> -self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
> -with open(src, 'r') as f:
> -self.assertEqual(f.read(), 'cheddar')
> -os.remove(dst)
> +with open(src, 'w') as f:
> +f.write('cheddar')
> +os.link(src, dst)
> +self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
> +with open(src, 'r') as f:
> +self.assertEqual(f.read(), 'cheddar')
> +os.remove(dst)
> +finally:
> +shutil.rmtree(TESTFN, ignore_errors=True)
>
> [email protected]_unless_symlink
> +def test_dont_copy_file_onto_symlink_to_itself(self):
> +# bug 851123.
> +os.mkdir(TESTFN)
> +src = os.path.join(TESTFN, 'cheese')
> +dst = os.path.join(TESTFN, 'shop')
> +try:
> +with open(src, 'w') as f:
> +f.write('cheddar')
> # Using `src` here would mean we end up with a symlink pointing
> # to TESTFN/TESTFN/cheese, while it should point at
> # TESTFN/cheese.
> @@ -298,10 +306,7 @@
> self.assertEqual(f.read(), 'cheddar')
> os.remove(dst)
> finally:
> -try:
> -shutil.rmtree(TESTFN)
> -except OSError:
> -pass
> +shutil.rmtree(TESTFN, ignore_errors=True)
>
> @support.skip_unless_symlink
> def test_rmtree_on_symlink(self):


You might be working on something slightly different, but I have an issue
created for the failure of that test: http://bugs.python.org/issue10540

It slipped past me because I was only running the test suite as a regular
user without the required symlink privilege, so the test was skipped. That
Server 2008 build slave runs the test suite as administrator, so it was
running that test and going into the os.link block, which it didn't do until
r86733.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86817 - python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

2010-11-26 Thread Hirokazu Yamamoto

On 2010/11/27 3:52, Brian Curtin wrote:

On Fri, Nov 26, 2010 at 12:44, hirokazu.yamamoto
wrote:



Author: hirokazu.yamamoto
Date: Fri Nov 26 19:44:28 2010
New Revision: 86817

Log:
Now can reproduce the error on AMD64 Windows Server 2008
even where os.symlink is not supported.


Modified:
   python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

Modified: python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

==
--- python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
  (original)
+++ python/branches/py3k-stat-on-windows/Lib/test/test_shutil.pyFri
Nov 26 19:44:28 2010
@@ -271,24 +271,32 @@
 shutil.rmtree(src_dir)
 shutil.rmtree(os.path.dirname(dst_dir))

[email protected]_unless_symlink
[email protected](hasattr(os, 'link'), 'requires os.link')
 def test_dont_copy_file_onto_link_to_itself(self):
 # bug 851123.
 os.mkdir(TESTFN)
 src = os.path.join(TESTFN, 'cheese')
 dst = os.path.join(TESTFN, 'shop')
 try:
-f = open(src, 'w')
-f.write('cheddar')
-f.close()
-
-if hasattr(os, "link"):
-os.link(src, dst)
-self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
-with open(src, 'r') as f:
-self.assertEqual(f.read(), 'cheddar')
-os.remove(dst)
+with open(src, 'w') as f:
+f.write('cheddar')
+os.link(src, dst)
+self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
+with open(src, 'r') as f:
+self.assertEqual(f.read(), 'cheddar')
+os.remove(dst)
+finally:
+shutil.rmtree(TESTFN, ignore_errors=True)

[email protected]_unless_symlink
+def test_dont_copy_file_onto_symlink_to_itself(self):
+# bug 851123.
+os.mkdir(TESTFN)
+src = os.path.join(TESTFN, 'cheese')
+dst = os.path.join(TESTFN, 'shop')
+try:
+with open(src, 'w') as f:
+f.write('cheddar')
 # Using `src` here would mean we end up with a symlink pointing
 # to TESTFN/TESTFN/cheese, while it should point at
 # TESTFN/cheese.
@@ -298,10 +306,7 @@
 self.assertEqual(f.read(), 'cheddar')
 os.remove(dst)
 finally:
-try:
-shutil.rmtree(TESTFN)
-except OSError:
-pass
+shutil.rmtree(TESTFN, ignore_errors=True)

 @support.skip_unless_symlink
 def test_rmtree_on_symlink(self):



You might be working on something slightly different, but I have an issue
created for the failure of that test: http://bugs.python.org/issue10540

It slipped past me because I was only running the test suite as a regular
user without the required symlink privilege, so the test was skipped. That
Server 2008 build slave runs the test suite as administrator, so it was
running that test and going into the os.link block, which it didn't do until
r86733.


I'm not sure, but why does os.path.samefile return False for hard link
on windows? MSDN says,

> A hard link is the file system representation of a file by which more 
> than one path references a single file in the same volume.

(http://msdn.microsoft.com/en-us/library/aa365006%28VS.85%29.aspx)

I know st_ino on windows is a bit different from POSIX, so, just I'm not 
sure. ;-)




___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86817 - python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

2010-11-26 Thread Brian Curtin
On Fri, Nov 26, 2010 at 13:45, Hirokazu Yamamoto  wrote:

> On 2010/11/27 3:52, Brian Curtin wrote:
>
>> On Fri, Nov 26, 2010 at 12:44, hirokazu.yamamoto<
>> [email protected]
>>
>>> wrote:
>>>
>>
>>  Author: hirokazu.yamamoto
>>> Date: Fri Nov 26 19:44:28 2010
>>> New Revision: 86817
>>>
>>> Log:
>>> Now can reproduce the error on AMD64 Windows Server 2008
>>> even where os.symlink is not supported.
>>>
>>>
>>> Modified:
>>>   python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>>>
>>> Modified: python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>>>
>>>
>>> ==
>>> --- python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>>>  (original)
>>> +++ python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py
>>>  Fri
>>> Nov 26 19:44:28 2010
>>> @@ -271,24 +271,32 @@
>>> shutil.rmtree(src_dir)
>>> shutil.rmtree(os.path.dirname(dst_dir))
>>>
>>> [email protected]_unless_symlink
>>> [email protected](hasattr(os, 'link'), 'requires os.link')
>>> def test_dont_copy_file_onto_link_to_itself(self):
>>> # bug 851123.
>>> os.mkdir(TESTFN)
>>> src = os.path.join(TESTFN, 'cheese')
>>> dst = os.path.join(TESTFN, 'shop')
>>> try:
>>> -f = open(src, 'w')
>>> -f.write('cheddar')
>>> -f.close()
>>> -
>>> -if hasattr(os, "link"):
>>> -os.link(src, dst)
>>> -self.assertRaises(shutil.Error, shutil.copyfile, src,
>>> dst)
>>> -with open(src, 'r') as f:
>>> -self.assertEqual(f.read(), 'cheddar')
>>> -os.remove(dst)
>>> +with open(src, 'w') as f:
>>> +f.write('cheddar')
>>> +os.link(src, dst)
>>> +self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
>>> +with open(src, 'r') as f:
>>> +self.assertEqual(f.read(), 'cheddar')
>>> +os.remove(dst)
>>> +finally:
>>> +shutil.rmtree(TESTFN, ignore_errors=True)
>>>
>>> [email protected]_unless_symlink
>>> +def test_dont_copy_file_onto_symlink_to_itself(self):
>>> +# bug 851123.
>>> +os.mkdir(TESTFN)
>>> +src = os.path.join(TESTFN, 'cheese')
>>> +dst = os.path.join(TESTFN, 'shop')
>>> +try:
>>> +with open(src, 'w') as f:
>>> +f.write('cheddar')
>>> # Using `src` here would mean we end up with a symlink
>>> pointing
>>> # to TESTFN/TESTFN/cheese, while it should point at
>>> # TESTFN/cheese.
>>> @@ -298,10 +306,7 @@
>>> self.assertEqual(f.read(), 'cheddar')
>>> os.remove(dst)
>>> finally:
>>> -try:
>>> -shutil.rmtree(TESTFN)
>>> -except OSError:
>>> -pass
>>> +shutil.rmtree(TESTFN, ignore_errors=True)
>>>
>>> @support.skip_unless_symlink
>>> def test_rmtree_on_symlink(self):
>>>
>>
>>
>> You might be working on something slightly different, but I have an issue
>> created for the failure of that test: http://bugs.python.org/issue10540
>>
>> It slipped past me because I was only running the test suite as a regular
>> user without the required symlink privilege, so the test was skipped. That
>> Server 2008 build slave runs the test suite as administrator, so it was
>> running that test and going into the os.link block, which it didn't do
>> until
>> r86733.
>>
>
> I'm not sure, but why does os.path.samefile return False for hard link
> on windows? MSDN says,
>
> > A hard link is the file system representation of a file by which more >
> than one path references a single file in the same volume.
> (http://msdn.microsoft.com/en-us/library/aa365006%28VS.85%29.aspx)
>
> I know st_ino on windows is a bit different from POSIX, so, just I'm not
> sure. ;-)


The samefile thing, I don't know either. GetFinalPathNameByHandle does not
appear to work with hard links, at least how it's being used right now. It
has no problem with symlinks. We briefly chatted about this on the os.link
feature issue, but I never found a way around it.

I'll look into it this weekend.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86817 - python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

2010-11-26 Thread Hirokazu Yamamoto

On 2010/11/27 5:02, Brian Curtin wrote:

We briefly chatted about this on the os.link
feature issue, but I never found a way around it.


How about implementing os.path.samefile in
Modules/posixmodule.c like this?

http://bugs.python.org/file19262/py3k_fix_kill_python_for_short_path.patch

# I hope this works.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86817 - python/branches/py3k-stat-on-windows/Lib/test/test_shutil.py

2010-11-26 Thread Brian Curtin
On Fri, Nov 26, 2010 at 14:18, Hirokazu Yamamoto  wrote:

> On 2010/11/27 5:02, Brian Curtin wrote:
>
>> We briefly chatted about this on the os.link
>> feature issue, but I never found a way around it.
>>
>
> How about implementing os.path.samefile in
> Modules/posixmodule.c like this?
>
> http://bugs.python.org/file19262/py3k_fix_kill_python_for_short_path.patch
>
> # I hope this works.
>

That's almost identical to what the current os.path.sameopenfile is.

Lib/ntpath.py opens both files, then compares them via _getfileinformation.
That function is implemented to take in a file descriptor, call
GetFileInformationByHandle with it, then returns a tuple
of dwVolumeSerialNumber, nFileIndexHigh, and nFileIndexLow.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removal of Win32 ANSI API

2010-11-26 Thread Martin v. Löwis
> Is it possible a conversion from bytes (ANSI) to unicode fails on
> windows?

It should fail sometimes, right? Not for windows-1252, but certainly
for shift-jis (you know better than me). It seems that whether
MultiByteToWideChar will fail depends on whether MB_ERR_INVALID_CHARS
is given or not. I don't know what it will do if this flag is not
given - my guess it fills in REPLACEMENT CHARACTER.

> If not, is it allowed to convert to unicode with
> PyUnicode_FSDecoder if function doesn't return str? For example,
> os.stat() takes str as arguments but doesn't return str.

This I don't understand. os.stat doesn't return text at all -
so what do you want to convert?

> # I noticed win_readlink() in Modules/posixmodule.c already unicode
> # only. Maybe not so much problem? ;-)

Well, readlink is new on Windows, and symlinks are not widespread.
So there is no backwards compatibility concern here.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-26 Thread Nick Coghlan
On Thu, Nov 25, 2010 at 5:25 AM, Terry Reedy  wrote:
> I know now that I could always edit with IDLE's editor, but it is a lot
> easier to right click and select edit than it is to run thru the directory
> tree in an open dialog.

If you want a decent free text editor on Windows, the open source
Notepad++ does a very nice job. It also adds an "Edit with Notepad++"
to the explorer context menu :)

> And of course, since the pseudo-BOM addition is
> undocumented within notepad itself, and probably other editors, it is easy
> to not know.

As far as the implicit BOM addition itself goes, reindent.py and
reindent-rst.py could probably be updated to check for it, but the
miscellaneous files (like ACKS) are likely to continue to need manual
checks.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com