[issue11638] pysetup un sdist crashes with weird trace if version is unicode by accident

2011-10-05 Thread Jens Diemer

Changes by Jens Diemer :


--
nosy: +jens

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



[issue11638] pysetup un sdist crashes with weird trace if version is unicode by accident

2011-10-05 Thread Jens Diemer

Jens Diemer  added the comment:

I have the same problem, using distutils (and not distutils2):


Traceback (most recent call last):
  File "./setup.py", line 60, in 
test_suite="creole.tests.run_all_tests",
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File 
"/home/jens/python2creole_env/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/sdist.py",
 line 147, in run
  File "/usr/lib/python2.7/distutils/command/sdist.py", line 448, in 
make_distribution
owner=self.owner, group=self.group)
  File "/usr/lib/python2.7/distutils/cmd.py", line 392, in make_archive
owner=owner, group=group)
  File "/usr/lib/python2.7/distutils/archive_util.py", line 237, in make_archive
filename = func(base_name, base_dir, **kwargs)
  File "/usr/lib/python2.7/distutils/archive_util.py", line 101, in make_tarball
tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
  File "/usr/lib/python2.7/tarfile.py", line 1687, in open
_Stream(name, filemode, comptype, fileobj, bufsize),
  File "/usr/lib/python2.7/tarfile.py", line 431, in __init__
self._init_write_gz()
  File "/usr/lib/python2.7/tarfile.py", line 459, in _init_write_gz
self.__write(self.name + NUL)
  File "/usr/lib/python2.7/tarfile.py", line 475, in __write
self.buf += s
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal 
not in range(128)


The Problem seems that tarfile._Stream() can't handle 'name' as unicode. With 
this changes, it works:

class _Stream:
...
def __init__(self, name, mode, comptype, fileobj, bufsize):
...
self.name = str(name) or ""
+

Don't know it this is related to the usage of: from __future__ import 
unicode_literals ?

--
components: +Distutils

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



[issue3332] DocTest and dict sort.

2008-07-10 Thread Jens Diemer

New submission from Jens Diemer <[EMAIL PROTECTED]>:

The doctest doesn't work good, if a function returns a dict.

Here a simple example:

def test(d):
"""
This works:
>>> test({"A":1, "B":2, "C":3})
{'A': 1, 'C': 3, 'B': 2}
   
This failed, because of different dict sort:
>>> test({"A":1, "B":2, "C":3})
{'A': 1, 'B': 2, 'C': 3}
   
The Error messages:

Failed example:
test({"A":1, "B":2, "C":3})
Expected:
{'A': 1, 'B': 2, 'C': 3}
Got:
{'A': 1, 'C': 3, 'B': 2}
"""
return d


The problem is IMHO that doctest.py [1] OutputChecker.check_output()
does compare the repr() of the dict and not the real dict as data.

One solution: Use eval() to convert the string repr. of the dict into
the real dict:

...
#--
try:
if eval(got) == eval(want):
return True
except:
pass #*pfeif* kein schoener stil, aber pragmatisch
#-
# We didn't find any match; return false.
return False

German discuss can be found here:
http://www.python-forum.de/topic-15321.html

[1] http://svn.python.org/view/python/trunk/Lib/doctest.py?view=markup

--
components: Extension Modules
messages: 69501
nosy: jedie
severity: normal
status: open
title: DocTest and dict sort.
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3332>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42253] xml.dom.minidom.rst missed informations

2020-11-03 Thread Jens Diemer


New submission from Jens Diemer :

The standalone arguments was added in Python 3.9. This information is missed in 
the docu.

--
messages: 380277
nosy: jedie2
priority: normal
pull_requests: 22042
severity: normal
status: open
title: xml.dom.minidom.rst missed informations
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42253>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24086] Configparser interpolation is unexpected

2015-06-10 Thread Jens Diemer

Jens Diemer added the comment:

IMHO i ran into the same bug, try to "./setup.py upload" with my new password 
in ~/.pypirc:

configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', 
found: "%foobar"

This is a limitation of the configparser... But what's about to validate this 
on the "set PyPi password view" ?

So that's impossible to set a PyPi password which can't be parsed by 
configparser ?

--
nosy: +jens

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



[issue21417] Compression level for zipfile

2015-06-24 Thread Jens Diemer

Changes by Jens Diemer :


--
nosy: +jens

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



[issue19894] zipfile ignores deflate level settings in zipinfo object

2015-06-24 Thread Jens Diemer

Jens Diemer added the comment:

IMHO it should be possible to set compression level not only for DEFLATE.
And it should be similar with the tarfile API.

Seems that http://bugs.python.org/issue21417 will cover this.

--
nosy: +jens

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



[issue21417] Compression level for zipfile

2015-06-24 Thread Jens Diemer

Jens Diemer added the comment:

btw. hacked work-a-round is:

zlib.Z_DEFAULT_COMPRESSION = 9

--

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



[issue18199] Windows: support path longer than 260 bytes using "\\?\" prefix

2016-02-05 Thread Jens Diemer

Jens Diemer added the comment:

I also with this problems.

I have made a test script.

There is a problem with os.chdir(): It doesn't work with \\?\ notation.
And there is also a problem, if you use 

```
import os
import pathlib
import tempfile

with tempfile.TemporaryDirectory(prefix="path_test_") as path:
new_path = pathlib.Path(path, "A"*255, "B"*255)
extended_path = "?\\%s" % new_path
os.makedirs(extended_path)
print(len(extended_path), extended_path)
```
os.makedirs() will work, but the cleanup will failed.
Output is:
```
567 
\\?\C:\Users\jens\AppData\Local\Temp\path_test_8fe6utdz\AAA\BBB
Traceback (most recent call last):
  File "D:\test2.py", line 18, in 
print(len(extended_path), extended_path)
  File "C:\Program Files (x86)\Python35-32\lib\tempfile.py", line 807, in 
__exit__
self.cleanup()
  File "C:\Program Files (x86)\Python35-32\lib\tempfile.py", line 811, in 
cleanup
_shutil.rmtree(self.name)
  File "C:\Program Files (x86)\Python35-32\lib\shutil.py", line 488, in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\Program Files (x86)\Python35-32\lib\shutil.py", line 383, in 
_rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Program Files (x86)\Python35-32\lib\shutil.py", line 381, in 
_rmtree_unsafe
os.unlink(fullname)
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht 
finden: 
'C:\\Users\\jens\\AppData\\Local\\Temp\\path_test_8fe6utdz\\AAA'
```

--
nosy: +jens
Added file: http://bugs.python.org/file41820/test.py

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



[issue18199] Windows: support path longer than 260 bytes using "\\?\" prefix

2016-02-10 Thread Jens Diemer

Jens Diemer added the comment:

I have made https://github.com/jedie/pathlib_revised to address this, see: 
https://github.com/jedie/pathlib_revised#windows-max_path

The idea is to add a property (I call it 'extended_path') and this will add the 
\\?\ prefix on all absolute path under windows. Under non-Windows the property 
will return ".path"
And i patch methods like 'chmod', 'unlink', 'rename' etc. to use the 
'extended_path' property and i add more methods like 'link', 'listdir', 
'copyfile' etc.

The source code is here: 
https://github.com/jedie/pathlib_revised/blob/master/pathlib_revised/pathlib.py

This is another thing: Why are not all filesystem access methods implemented in 
pathlib?!?
e.g.: There is Path.unlink() but no Path.link()
There is Path.rmdir() but no Path.chdir()
and many more.

And the last thing is: Why is pathlib so bad designed? It's ugly to extend it. 
But this address: https://bugs.python.org/issue24132

--

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