Issue 1:
Checklist

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None (I've looked, don't see any, probably to odd corner case)

Possible Duplicates

None

Environment & Settings

Celery version: celery==4.3.0

celery report Output:

Sorry, I don't have a celery project setup. The error is when using send_task (the worker and the queuer of the tasks doesn't share any code base)

Steps to Reproduce

Required Dependencies

Minimal Python Version: Unknown (I'm on 3.6.3)

Minimal Celery Version: N/A or Unknown

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

alembic==1.1.0
amqp==2.5.1
billiard==3.6.1.0
blinker==1.4
cachetools==3.1.1
celery==4.3.0
certifi==2019.9.11
chardet==3.0.4
Click==7.0
debtcollector==1.22.0
Flask==1.0.2
Flask-Classful==0.13.1
Flask-JSON==0.3.0
Flask-Migrate==2.0.1
Flask-Script==2.0.6
Flask-SQLAlchemy==2.4.0
gcloud==0.18.3
google-api-core==1.14.2
google-api-python-client==1.7.9
google-auth==1.6.3
google-auth-httplib2==0.0.3
google-cloud-core==1.0.3
google-cloud-datastore==1.8.0
google-cloud-pubsub==1.0.0
google-cloud-storage==1.16.1
google-resumable-media==0.4.0
googleapis-common-protos==1.6.0
grpc-google-iam-v1==0.12.3
grpcio==1.9.1
gunicorn==19.6.0
httplib2==0.13.1
idna==2.8
importlib-metadata==0.22
itsdangerous==1.1.0
Jinja2==2.10.1
kombu==4.6.4
Mako==1.1.0
MarkupSafe==1.1.1
monotonic==1.5
more-itertools==7.2.0
oauth2client==4.0.0
pbr==5.4.3
protobuf==3.6.1
psycopg2==2.7.3.2
psycopg2-binary==2.8.3
pyasn1==0.4.7
pyasn1-modules==0.2.6
python-dateutil==2.8.0
python-editor==1.0.4
pytz==2019.2
PyYAML==3.12
ratelimitingfilter==0.5.dev1
raven==6.10.0
requests==2.22.0
rsa==4.0
six==1.11.0
SQLAlchemy==1.3.8
statsd==3.3.0
tenacity==3.4.0
uritemplate==3.0.0
urllib3==1.25.3
vine==1.3.0
Werkzeug==0.15.6
wrapt==1.11.2
zipp==0.6.0

Other Dependencies

N/A

Minimally Reproducible Test Case

1. Setup an exchange with a blank routing key in Rabbitmq

celeryapp.send_task("task, ["data"],exchange="your_exchange",routing_key='',connection=conn)

Expected Behavior

I would expect a message sent with an exchange and a blank (but not None) routing key to be sent using the exchange and the blank routing key.

Actual Behavior

Background:

Due to legacy reasons I'm not capable of changing the routing structure in RabbitMQ.

Using a blank routing key, the message is sent to the default queue. The issue originates from amqp.py:

if (not exchange or not routing_key) and exchange_type == 'direct':
exchange, routing_key = '', qname

Using not discards the blank routing key.

I am not too well versed on advanced routing, but if you want to I can try to create a pull request changing it to:

if (not exchange or routing_key is None) and exchange_type == 'direct':
exchange, routing_key = '', qname

As a quirky short term work around, you can do:

celeryapp.send_task(
"task",
["data"],
exchange="your_exchange",
routing_key='',
exchange_type='anything_but_direct_here',
connection=conn
)

Which won't trigger the offending if-bransch.

I'm mostly creating this ticket so future Googlers can find it if they have the same problem. If you would accept a PR let me know.

Issue 2:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Hey there! I've read all the checkboxes etc. but it's such an obvious bug, that I feel they are not necessary. I hope that this unconformity won't let you just ignore the actual issue:

Steps to Reproduce

Minimally Reproducible Test Case

Run celery on Windows, no matter which python.

Expected Behavior

It should start

Actual Behavior

File ".venv\lib\site-packages\celery\platforms.py", line 9, in <module>
import grp
ModuleNotFoundError: No module named 'grp'

The module grp is only available on linux, thus this does not work on widnwos and also not make sense as a global import. It's also imported below by try_import.

Possible fix

This line should simply be removed, because below there is a try_import for this as well. Also in the check_privileges, the non-existence of grp should be checked. Unfortunately due to my companies restrictions I cannot submit a MR.

Git blame shows @namloc2001 and @thedrow for this line which is still on master.

Thanks!