Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c7eaa6fb
Commit
c7eaa6fb
authored
Aug 31, 2009
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LP #418454: workaround for non-working FTP server under Python 2.6
parent
e84355fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
doc/CHANGES.rst
doc/CHANGES.rst
+2
-0
src/ZServer/FTPServer.py
src/ZServer/FTPServer.py
+19
-4
No files found.
doc/CHANGES.rst
View file @
c7eaa6fb
...
...
@@ -78,6 +78,8 @@ Features Added
Bugs Fixed
++++++++++
- LP #418454: FTP server did not work with Python 2.6.X
- Fixed issue with sending text containing ':' from MailHost.
- MailHost will now ensure the headers it sets are 7bit.
...
...
src/ZServer/FTPServer.py
View file @
c7eaa6fb
...
...
@@ -64,6 +64,7 @@ FTP Authorization
"""
import
sys
from
PubCore
import
handle
from
medusa.ftp_server
import
ftp_channel
,
ftp_server
,
recv_channel
import
asyncore
,
asynchat
...
...
@@ -81,6 +82,8 @@ import marshal
import
stat
import
time
py26_or_later
=
sys
.
version_info
>=
(
2
,
6
)
class
zope_ftp_channel
(
ftp_channel
):
"Passes its commands to Zope, not a filesystem"
...
...
@@ -105,13 +108,25 @@ class zope_ftp_channel(ftp_channel):
return
path
# Overriden async_chat methods
def
push
(
self
,
producer
,
send
=
1
):
def
push
(
self
,
data
,
send
=
1
):
# this is thread-safe when send is false
# note, that strings are not wrapped in
# producers by default
self
.
producer_fifo
.
push
(
producer
)
if
send
:
self
.
initiate_send
()
# LP #418454
if
py26_or_later
:
# Python 2.6 or later
sabs
=
self
.
ac_out_buffer_size
if
len
(
data
)
>
sabs
:
for
i
in
xrange
(
0
,
len
(
data
),
sabs
):
self
.
producer_fifo
.
append
(
data
[
i
:
i
+
sabs
])
else
:
self
.
producer_fifo
.
append
(
data
)
else
:
# pre-Python 2.6
self
.
producer_fifo
.
push
(
data
)
if
send
:
self
.
initiate_send
()
push_with_producer
=
push
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment