New submission from progval :
Hi,
I found two related bugs when calling tarfile.TarFile.next() on an empty tar
file, both when trying to seek when it should not:
import io
import tarfile
# Create a tarball with no member:
fd = io.BytesIO()
with tarfile.open(fileobj=fd, mode="w&qu
ProgVal added the comment:
@r.david.murray I don't think it's a bug either, but a possible enhancement.
@serhiy.storchaka We could simply do this: if isinstance(url, bytes): url =
os.fsdecode(url)
--
___
Python tracker
<http://bu
New submission from ProgVal:
The documentation for mimetypes.guess_type says that it “guesses the type of a
file based on its filename or URL”.
However, this function only accepts a string object, and not a bytes object:
>>> import os
>>> import mimetypes
>>> mime
New submission from ProgVal:
The function os.path.commonprefix computes the longest prefix of strings (any
iterable, actually), regardless of their meaning as paths.
I do not see any reason to use this function for paths, and keeping it in the
os.path module makes it prone to be confused with
ProgVal added the comment:
Indeed, thanks.
I should have done that when I migrated from compiler.parse.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
ProgVal added the comment:
(Oops, submitted too soon.)
I understand the rational of this change, so I am not sure if this is actually
a bug.
However, if someone wants to parse a simple expression that may be a string,
they need to add a special handling in case it's a string interpreted
New submission from ProgVal:
Since commit cb41b2766de646435743b6af7dd152751b54e73f (Python 3.7a0), string
literals are not parsed the same way.
ast.parse("'test'").body used to be a list with one item containing 'test'; but
now it is an empty list:
Python 3.5.2
ProgVal added the comment:
> On Linux 3.16? 4.7? What is difference between 3.16 and 4.7?
On 4.8 (which has the same issue as 4.7).
The difference is that on 4.7, the rlimit has to be set incredibly high for the
child process not to hit the limit.
> Again, I doubt Python's memory
ProgVal added the comment:
first command:
(0, 0)
0.14user 0.01system 0:00.94elapsed 16%CPU (0avgtext+0avgdata 18484maxresident)k
560inputs+0outputs (0major+2702minor)pagefaults 0swaps
second command:
(6663744, 6732519)
0.18user 0.01system 0:00.96elapsed 20%CPU (0avgtext+0avgdata
New submission from ProgVal:
Hi,
Here is a fixer to remove "import exceptions" from Python 2 code and replace
"exceptions.X" with "X".
Valentin
--
components: 2to3 (2.x to 3.x conversion tool)
files: fix_import_exceptions.py
messages: 282787
nosy: Val
ProgVal added the comment:
Sorry. That's the result of |||get_traced_memory|on Python 3.5 and Linux
4.7.
--
___
Python tracker
<http://bugs.python.org/is
ProgVal added the comment:
(4350362, 4376669)
--
___
Python tracker
<http://bugs.python.org/issue28663>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by ProgVal :
--
versions: +Python 3.6, Python 3.7
___
Python tracker
<http://bugs.python.org/issue28663>
___
___
Python-bugs-list mailing list
Unsub
New submission from ProgVal:
Hi,
I use `resource.setrlimit(resource.RLIMIT_DATA, ...)` to limit the memory usage
of a child process.
I noticed that on recent Linux versions, my processes are much more likely to
raise MemoryError or behave inconsistently (which I believe is caused by a
New submission from ProgVal:
Hello,
The following code:
import sys
import multiprocessing
sys.stdout.close()
def foo():
pass
p = multiprocessing.Process(target=foo)
p.start()
Crashes with:
Traceback (most recent call last):
File "foo.py", line 10, in
p.start()
File
ProgVal added the comment:
I know, that's why I did not ask to change the code. Only the doc to make that
behavior more explicit.
--
___
Python tracker
<http://bugs.python.org/is
ProgVal added the comment:
The directory could be created
--
___
Python tracker
<http://bugs.python.org/issue27023>
___
___
Python-bugs-list mailing list
Unsub
New submission from ProgVal:
Documentation of tempfile.gettempdir()
<https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir> does not
mention it only supports existing directories.
This led to this question on Stackoverflow:
http://stackoverflow.com/q/37229398/
New submission from ProgVal:
In Python/errors.c, PyErr_Restore is defined this way:
void
PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
In Python/ceval.c, in the END_FINALLY case, it is called like this:
PyErr_Restore(status, exc, tb);
I believe “exc” should be renamed
ProgVal added the comment:
Even if xmlrpc.client imported them in its namespace?
--
___
Python tracker
<http://bugs.python.org/issue26640>
___
___
Python-bug
New submission from ProgVal:
from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode
Shouldn't these class/functions be moved to a new module, with a name like
xmlrpc.common?
--
components: Library (Lib)
messages: 262428
nosy: Valentin.Lorentz
priority: normal
sev
New submission from ProgVal:
The doc of xmlrpc.server and xmlrpc.client both warn about XML vulnerabilities.
However, both say “The xmlrpc.client module is not secure”, whereas the page
for xml.server should say xmlrpc.server.
--
assignee: docs@python
components: Documentation
New submission from ProgVal:
socket.sendall() returns None if it succeeded
<https://docs.python.org/3/library/socket.html#socket.socket.sendall>
SSLSocket.sendall() is said to have the same behavior as socket.sendall(),
besides not allowing flags
<https://docs.python.org/3/library
ProgVal added the comment:
The relevant piece of code:
https://github.com/ProgVal/Limnoria/blob/master/plugins/Web/plugin.py#L85
commands.process is defined here:
https://github.com/ProgVal/Limnoria/blob/master/src/commands.py#L76
callbacks.CommandProcess is defined at
https://github.com
New submission from ProgVal:
In a project, I have a package with a module named Socket.py, and the
__init__.py imports the "socket" module (from the standard Python lib).
However, when fix_import went over it _on Windows_, it converted "import
socket" to "from . import
New submission from ProgVal:
In Python 3.3 (I did not test with 3.4), sys.modules cannot be reassigned
without breaking the import mechanism; while it works with Python <= 3.2.
Here is how to reproduce the bug:
progval@Andromede:/tmp$ mkdir test_imports
progval@Andromede:/tmp$ echo &q
New submission from ProgVal:
In Python 3.3, multiprocessing.Process.join() is not blocking with floats lower
than 1.0 (not included). It works as expected (ie. blocking for the specified
timeout) in Python 2.6->3.2
As you can see in this example, calling join() with 0.99 returns immediat
ProgVal added the comment:
Oh, excuse me, it's because of my code!
class MyRequestHandler(SocketServer.TCPServer):
--
resolution: -> invalid
___
Python tracker
<http://bugs.python.org
ProgVal added the comment:
This seems odd to me: this line:
self.RequestHandlerClass(request, client_address, self)
calls TCPServer's constructor:
def __init__(self, server_address, RequestHandlerClass,
bind_and_activate
ProgVal added the comment:
The problem happens on Python 2.7 too.
Additionaly, here is the traceback, if I don't edit the library:
Exception happened during processing of request from ('127.0.0.1', 50378)
Traceback (most recent call last):
File "/usr/lib/python2.7/Socket
New submission from ProgVal :
Hello,
I have issues with a script I'm programming (TypeError at every client
connection), so I edited BaseServer's __init__():
def __init__(self, server_address, RequestHandlerClass):
"""Constructor. May be extended, do no
ProgVal added the comment:
This code :
import urllib2
print urllib2.urlopen('http://plugins.supybot-fr.tk/GoodFrench.tar').read(500)
Prints :
data/75500017517511466030066011677 5ustar progvalprogval
If the problem comes from networking libraries, I really don&
ProgVal added the comment:
Same result on all tested versions (2.5 -> 2.7) :
--
import urllib2
import tarfile
tarfile.open(fileobj=open('/home/progval/Downloads/GoodFrench.tar'), mode='r:')
# Works
tarfile.open(fileobj=urllib2.
ProgVal added the comment:
I also have the bug with Python 2.7.1rc1 (from Debian 'Experimental' repo)
--
nosy: +ProgVal
versions: +Python 2.6 -Python 3.1, Python 3.2
___
Python tracker
<http://bugs.python.o
ProgVal added the comment:
Here is the new traceback:
Traceback (most recent call last):
...
File "/home/progval/workspace/Supybot/Supybot-plugins/Packages/plugin.py",
line 123, in extractData
file = tarfile.open(fileobj=file_, mode='r:')
File "/usr/lib/python2
ProgVal added the comment:
Thanks for your answer.
Sorry, no change...
--
components: +Library (Lib)
versions: +Python 2.6
___
Python tracker
<http://bugs.python.org/issue10
New submission from ProgVal :
Hello,
I had this traceback:
Traceback (most recent call last):
...
File "/home/progval/workspace/Supybot/Supybot-plugins/Packages/plugin.py",
line 123, in extractData
file = tarfile.open(fileobj=file_)
File "/usr/lib/python2.6/tarfile.py&
37 matches
Mail list logo